diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 9859174a2e35..5b44517ec511 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -23,7 +23,7 @@ runs: fi - name: Setup Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }} bun-download-url: ${{ steps.bun-url.outputs.url }} @@ -33,8 +33,9 @@ runs: shell: bash run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT" - - name: Cache Bun dependencies - uses: actions/cache@v4 + - name: Restore Bun dependencies + id: bun-cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ steps.cache.outputs.dir }} key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} @@ -56,3 +57,10 @@ runs: bun install ${{ inputs.install-flags }} fi shell: bash + + - name: Save Bun dependencies + if: steps.bun-cache.outputs.cache-hit != 'true' && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: ${{ steps.cache.outputs.dir }} + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} diff --git a/.github/actions/setup-git-committer/action.yml b/.github/actions/setup-git-committer/action.yml index 87d2f5d0d44a..65c974c6ab48 100644 --- a/.github/actions/setup-git-committer/action.yml +++ b/.github/actions/setup-git-committer/action.yml @@ -19,7 +19,7 @@ runs: steps: - name: Create app token id: apptoken - uses: actions/create-github-app-token@v2 + uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2 with: app-id: ${{ inputs.opencode-app-id }} private-key: ${{ inputs.opencode-app-secret }} diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index a7106667b116..e93d5fbdb260 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -13,7 +13,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 diff --git a/.github/workflows/close-issues.yml b/.github/workflows/close-issues.yml index 04b6ae7ac80f..b8a2e3f575d8 100644 --- a/.github/workflows/close-issues.yml +++ b/.github/workflows/close-issues.yml @@ -12,9 +12,9 @@ jobs: contents: read issues: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: oven-sh/setup-bun@v2 + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml new file mode 100644 index 000000000000..a1e603a88104 --- /dev/null +++ b/.github/workflows/close-prs.yml @@ -0,0 +1,50 @@ +name: close-prs + +on: + schedule: + - cron: "0 22 * * *" # Daily at 10:00 PM UTC + workflow_dispatch: + inputs: + dry-run: + description: "Log matching PRs without closing them" + type: boolean + default: true + max-close: + description: "Maximum matching PRs to close" + type: string + required: false + default: "50" + +jobs: + close: + runs-on: ubuntu-latest + timeout-minutes: 240 + permissions: + contents: read + issues: write + pull-requests: write + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + with: + bun-version: latest + + - name: Close old PRs without enough positive reactions + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + max_close="${{ inputs['max-close'] }}" + if [ -z "$max_close" ]; then + max_close="50" + fi + + args=("--threshold" "2" "--age-months" "1" "--sleep-ms" "20000" "--max-close" "$max_close") + + if [ "${{ github.event_name }}" = "schedule" ]; then + args+=("--execute") + elif [ "${{ inputs['dry-run'] }}" = "false" ]; then + args+=("--execute") + fi + + bun script/github/close-prs.ts "${args[@]}" diff --git a/.github/workflows/close-stale-prs.yml b/.github/workflows/close-stale-prs.yml deleted file mode 100644 index e0e571b46911..000000000000 --- a/.github/workflows/close-stale-prs.yml +++ /dev/null @@ -1,235 +0,0 @@ -name: close-stale-prs - -on: - workflow_dispatch: - inputs: - dryRun: - description: "Log actions without closing PRs" - type: boolean - default: false - schedule: - - cron: "0 6 * * *" - -permissions: - contents: read - issues: write - pull-requests: write - -jobs: - close-stale-prs: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Close inactive PRs - uses: actions/github-script@v8 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const DAYS_INACTIVE = 60 - const MAX_RETRIES = 3 - - // Adaptive delay: fast for small batches, slower for large to respect - // GitHub's 80 content-generating requests/minute limit - const SMALL_BATCH_THRESHOLD = 10 - const SMALL_BATCH_DELAY_MS = 1000 // 1s for daily operations (≤10 PRs) - const LARGE_BATCH_DELAY_MS = 2000 // 2s for backlog (>10 PRs) = ~30 ops/min, well under 80 limit - - const startTime = Date.now() - const cutoff = new Date(Date.now() - DAYS_INACTIVE * 24 * 60 * 60 * 1000) - const { owner, repo } = context.repo - const dryRun = context.payload.inputs?.dryRun === "true" - - core.info(`Dry run mode: ${dryRun}`) - core.info(`Cutoff date: ${cutoff.toISOString()}`) - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)) - } - - async function withRetry(fn, description = 'API call') { - let lastError - for (let attempt = 0; attempt < MAX_RETRIES; attempt++) { - try { - const result = await fn() - return result - } catch (error) { - lastError = error - const isRateLimited = error.status === 403 && - (error.message?.includes('rate limit') || error.message?.includes('secondary')) - - if (!isRateLimited) { - throw error - } - - // Parse retry-after header, default to 60 seconds - const retryAfter = error.response?.headers?.['retry-after'] - ? parseInt(error.response.headers['retry-after']) - : 60 - - // Exponential backoff: retryAfter * 2^attempt - const backoffMs = retryAfter * 1000 * Math.pow(2, attempt) - - core.warning(`${description}: Rate limited (attempt ${attempt + 1}/${MAX_RETRIES}). Waiting ${backoffMs / 1000}s before retry...`) - - await sleep(backoffMs) - } - } - core.error(`${description}: Max retries (${MAX_RETRIES}) exceeded`) - throw lastError - } - - const query = ` - query($owner: String!, $repo: String!, $cursor: String) { - repository(owner: $owner, name: $repo) { - pullRequests(first: 100, states: OPEN, after: $cursor) { - pageInfo { - hasNextPage - endCursor - } - nodes { - number - title - author { - login - } - createdAt - commits(last: 1) { - nodes { - commit { - committedDate - } - } - } - comments(last: 1) { - nodes { - createdAt - } - } - reviews(last: 1) { - nodes { - createdAt - } - } - } - } - } - } - ` - - const allPrs = [] - let cursor = null - let hasNextPage = true - let pageCount = 0 - - while (hasNextPage) { - pageCount++ - core.info(`Fetching page ${pageCount} of open PRs...`) - - const result = await withRetry( - () => github.graphql(query, { owner, repo, cursor }), - `GraphQL page ${pageCount}` - ) - - allPrs.push(...result.repository.pullRequests.nodes) - hasNextPage = result.repository.pullRequests.pageInfo.hasNextPage - cursor = result.repository.pullRequests.pageInfo.endCursor - - core.info(`Page ${pageCount}: fetched ${result.repository.pullRequests.nodes.length} PRs (total: ${allPrs.length})`) - - // Delay between pagination requests (use small batch delay for reads) - if (hasNextPage) { - await sleep(SMALL_BATCH_DELAY_MS) - } - } - - core.info(`Found ${allPrs.length} open pull requests`) - - const stalePrs = allPrs.filter((pr) => { - const dates = [ - new Date(pr.createdAt), - pr.commits.nodes[0] ? new Date(pr.commits.nodes[0].commit.committedDate) : null, - pr.comments.nodes[0] ? new Date(pr.comments.nodes[0].createdAt) : null, - pr.reviews.nodes[0] ? new Date(pr.reviews.nodes[0].createdAt) : null, - ].filter((d) => d !== null) - - const lastActivity = dates.sort((a, b) => b.getTime() - a.getTime())[0] - - if (!lastActivity || lastActivity > cutoff) { - core.info(`PR #${pr.number} is fresh (last activity: ${lastActivity?.toISOString() || "unknown"})`) - return false - } - - core.info(`PR #${pr.number} is STALE (last activity: ${lastActivity.toISOString()})`) - return true - }) - - if (!stalePrs.length) { - core.info("No stale pull requests found.") - return - } - - core.info(`Found ${stalePrs.length} stale pull requests`) - - // ============================================ - // Close stale PRs - // ============================================ - const requestDelayMs = stalePrs.length > SMALL_BATCH_THRESHOLD - ? LARGE_BATCH_DELAY_MS - : SMALL_BATCH_DELAY_MS - - core.info(`Using ${requestDelayMs}ms delay between operations (${stalePrs.length > SMALL_BATCH_THRESHOLD ? 'large' : 'small'} batch mode)`) - - let closedCount = 0 - let skippedCount = 0 - - for (const pr of stalePrs) { - const issue_number = pr.number - const closeComment = `Closing this pull request because it has had no updates for more than ${DAYS_INACTIVE} days. If you plan to continue working on it, feel free to reopen or open a new PR.` - - if (dryRun) { - core.info(`[dry-run] Would close PR #${issue_number} from ${pr.author?.login || 'unknown'}: ${pr.title}`) - continue - } - - try { - // Add comment - await withRetry( - () => github.rest.issues.createComment({ - owner, - repo, - issue_number, - body: closeComment, - }), - `Comment on PR #${issue_number}` - ) - - // Close PR - await withRetry( - () => github.rest.pulls.update({ - owner, - repo, - pull_number: issue_number, - state: "closed", - }), - `Close PR #${issue_number}` - ) - - closedCount++ - core.info(`Closed PR #${issue_number} from ${pr.author?.login || 'unknown'}: ${pr.title}`) - - // Delay before processing next PR - await sleep(requestDelayMs) - } catch (error) { - skippedCount++ - core.error(`Failed to close PR #${issue_number}: ${error.message}`) - } - } - - const elapsed = Math.round((Date.now() - startTime) / 1000) - core.info(`\n========== Summary ==========`) - core.info(`Total open PRs found: ${allPrs.length}`) - core.info(`Stale PRs identified: ${stalePrs.length}`) - core.info(`PRs closed: ${closedCount}`) - core.info(`PRs skipped (errors): ${skippedCount}`) - core.info(`Elapsed time: ${elapsed}s`) - core.info(`=============================`) diff --git a/.github/workflows/compliance-close.yml b/.github/workflows/compliance-close.yml index c3bcf9f686f4..14e68701e57d 100644 --- a/.github/workflows/compliance-close.yml +++ b/.github/workflows/compliance-close.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Close non-compliant issues and PRs after 2 hours - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const { data: items } = await github.rest.issues.listForRepo({ diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index c7df066d41c6..15bf0783160e 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -21,18 +21,18 @@ jobs: REGISTRY: ghcr.io/${{ github.repository_owner }} TAG: "24.04" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: ./.github/actions/setup-bun - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - name: Login to GHCR - uses: docker/login-action@v3 + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: registry: ghcr.io username: ${{ github.repository_owner }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index abd8bafdd675..7b4f53a98ee0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,11 +13,11 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: ./.github/actions/setup-bun - - uses: actions/setup-node@v4 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "24" diff --git a/.github/workflows/docs-locale-sync.yml b/.github/workflows/docs-locale-sync.yml index 9689eee6d212..5f921e8bb717 100644 --- a/.github/workflows/docs-locale-sync.yml +++ b/.github/workflows/docs-locale-sync.yml @@ -16,7 +16,7 @@ jobs: contents: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: persist-credentials: false fetch-depth: 0 diff --git a/.github/workflows/docs-update.yml b/.github/workflows/docs-update.yml index 900ad2b0c586..4767dec53999 100644 --- a/.github/workflows/docs-update.yml +++ b/.github/workflows/docs-update.yml @@ -18,7 +18,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 # Fetch full history to access commits @@ -43,7 +43,7 @@ jobs: - name: Run opencode if: steps.commits.outputs.has_commits == 'true' - uses: sst/opencode/github@latest + uses: sst/opencode/github@2c14fc5586fe0b88e5c04732d2e846769cc35671 # latest env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} with: diff --git a/.github/workflows/duplicate-issues.yml b/.github/workflows/duplicate-issues.yml index 6c1943fe7b8a..4648a2d0c3d3 100644 --- a/.github/workflows/duplicate-issues.yml +++ b/.github/workflows/duplicate-issues.yml @@ -13,7 +13,7 @@ jobs: issues: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 @@ -125,7 +125,7 @@ jobs: issues: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 706ab2989e15..324cfec02001 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -13,7 +13,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Bun uses: ./.github/actions/setup-bun diff --git a/.github/workflows/nix-eval.yml b/.github/workflows/nix-eval.yml index c76b2c972973..75332695a1ad 100644 --- a/.github/workflows/nix-eval.yml +++ b/.github/workflows/nix-eval.yml @@ -20,10 +20,10 @@ jobs: timeout-minutes: 15 steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup Nix - uses: nixbuild/nix-quick-install-action@v34 + uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34 - name: Evaluate flake outputs (all systems) run: | diff --git a/.github/workflows/nix-hashes.yml b/.github/workflows/nix-hashes.yml index 6b5b3929adcb..085f8895c293 100644 --- a/.github/workflows/nix-hashes.yml +++ b/.github/workflows/nix-hashes.yml @@ -41,10 +41,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup Nix - uses: nixbuild/nix-quick-install-action@v34 + uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34 - name: Compute node_modules hash id: hash @@ -72,7 +72,7 @@ jobs: echo "Computed hash for ${SYSTEM}: $HASH" - name: Upload hash - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: hash-${{ matrix.system }} path: hash.txt @@ -85,7 +85,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: persist-credentials: false fetch-depth: 0 @@ -102,7 +102,7 @@ jobs: git pull --rebase --autostash origin "$GITHUB_REF_NAME" - name: Download hash artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: hashes pattern: hash-* diff --git a/.github/workflows/notify-discord.yml b/.github/workflows/notify-discord.yml index b1d8053603a9..0b2b1cde051b 100644 --- a/.github/workflows/notify-discord.yml +++ b/.github/workflows/notify-discord.yml @@ -9,6 +9,6 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - name: Send nicely-formatted embed to Discord - uses: SethCohen/github-releases-to-discord@v1 + uses: SethCohen/github-releases-to-discord@24d166886aee4646d448c8a389ff9e1ebcab3682 # v1.20.0 with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 76e75fcaefb9..3469c21917f8 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -21,12 +21,12 @@ jobs: issues: read steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: ./.github/actions/setup-bun - name: Run opencode - uses: anomalyco/opencode/github@latest + uses: anomalyco/opencode/github@2c14fc5586fe0b88e5c04732d2e846769cc35671 # latest env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} OPENCODE_PERMISSION: '{"bash": "deny"}' diff --git a/.github/workflows/pr-management.yml b/.github/workflows/pr-management.yml index 35bd7ae36f2d..b6aa4e589d89 100644 --- a/.github/workflows/pr-management.yml +++ b/.github/workflows/pr-management.yml @@ -12,7 +12,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 @@ -78,7 +78,7 @@ jobs: issues: write steps: - name: Add Contributor Label - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | const isPR = !!context.payload.pull_request; diff --git a/.github/workflows/pr-standards.yml b/.github/workflows/pr-standards.yml index 1edbd5d061dc..06838089d354 100644 --- a/.github/workflows/pr-standards.yml +++ b/.github/workflows/pr-standards.yml @@ -12,7 +12,7 @@ jobs: pull-requests: write steps: - name: Check PR standards - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const pr = context.payload.pull_request; @@ -159,7 +159,7 @@ jobs: pull-requests: write steps: - name: Check PR template compliance - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const pr = context.payload.pull_request; diff --git a/.github/workflows/publish-github-action.yml b/.github/workflows/publish-github-action.yml index d2789373a34a..e5ca91b5618a 100644 --- a/.github/workflows/publish-github-action.yml +++ b/.github/workflows/publish-github-action.yml @@ -16,7 +16,7 @@ jobs: publish: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-depth: 0 diff --git a/.github/workflows/publish-vscode.yml b/.github/workflows/publish-vscode.yml index f49a10578072..00c7e260482e 100644 --- a/.github/workflows/publish-vscode.yml +++ b/.github/workflows/publish-vscode.yml @@ -15,7 +15,7 @@ jobs: publish: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-depth: 0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5f7ee96b90d1..5f8bac973adc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2404 if: github.repository == 'anomalyco/opencode' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-depth: 0 @@ -72,7 +72,7 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2404 if: github.repository == 'anomalyco/opencode' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-tags: true @@ -95,14 +95,14 @@ jobs: GH_REPO: ${{ needs.version.outputs.repo }} GH_TOKEN: ${{ steps.committer.outputs.token }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: opencode-cli path: | packages/opencode/dist/opencode-darwin* packages/opencode/dist/opencode-linux* - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: opencode-cli-windows path: packages/opencode/dist/opencode-windows* @@ -123,9 +123,9 @@ jobs: AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }} AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: opencode-cli-windows path: packages/opencode/dist @@ -138,13 +138,13 @@ jobs: opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} - name: Azure login - uses: azure/login@v2 + uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0 with: client-id: ${{ env.AZURE_CLIENT_ID }} tenant-id: ${{ env.AZURE_TENANT_ID }} subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} - - uses: azure/artifact-signing-action@v1 + - uses: azure/artifact-signing-action@b443cf8ea4124818d2ea9f043cba29fc3ec47b16 # v1.2.0 with: endpoint: ${{ env.AZURE_TRUSTED_SIGNING_ENDPOINT }} signing-account-name: ${{ env.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }} @@ -201,7 +201,7 @@ jobs: --clobber ` --repo "${{ needs.version.outputs.repo }}" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: opencode-cli-signed-windows path: | @@ -244,14 +244,14 @@ jobs: - host: "blacksmith-4vcpu-ubuntu-2404" target: x86_64-unknown-linux-gnu platform_flag: --linux - - host: "blacksmith-4vcpu-ubuntu-2404" + - host: "blacksmith-4vcpu-ubuntu-2404-arm" target: aarch64-unknown-linux-gnu - platform_flag: --linux + platform_flag: --linux --arm64 runs-on: ${{ matrix.settings.host }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - - uses: apple-actions/import-codesign-certs@v2 + - uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0 if: runner.os == 'macOS' with: keychain: build @@ -268,19 +268,19 @@ jobs: - name: Azure login if: runner.os == 'Windows' - uses: azure/login@v2 + uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0 with: client-id: ${{ env.AZURE_CLIENT_ID }} tenant-id: ${{ env.AZURE_TENANT_ID }} subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} - - uses: actions/setup-node@v4 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "24" - name: Cache apt packages if: contains(matrix.settings.host, 'ubuntu') - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ~/apt-cache key: ${{ runner.os }}-${{ matrix.settings.target }}-apt-electron-${{ hashFiles('.github/workflows/publish.yml') }} @@ -388,12 +388,12 @@ jobs: } } - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: opencode-desktop-${{ matrix.settings.target }} path: packages/desktop/dist/* - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: needs.version.outputs.release with: name: latest-yml-${{ matrix.settings.target }} @@ -408,44 +408,44 @@ jobs: if: always() && !failure() && !cancelled() runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: ./.github/actions/setup-bun - name: Login to GitHub Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "24" registry-url: "https://registry.npmjs.org" - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: opencode-cli path: packages/opencode/dist - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: opencode-cli-windows path: packages/opencode/dist - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: opencode-cli-signed-windows path: packages/opencode/dist - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 if: needs.version.outputs.release with: pattern: latest-yml-* @@ -459,7 +459,7 @@ jobs: opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} - name: Cache apt packages (AUR) - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: /var/cache/apt/archives key: ${{ runner.os }}-apt-aur-${{ hashFiles('.github/workflows/publish.yml') }} diff --git a/.github/workflows/release-github-action.yml b/.github/workflows/release-github-action.yml index 3f5caa55c8dc..4a1d7218bb2c 100644 --- a/.github/workflows/release-github-action.yml +++ b/.github/workflows/release-github-action.yml @@ -16,7 +16,7 @@ jobs: release: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 2bd1f0c4a002..00a4fba8ca13 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -25,7 +25,7 @@ jobs: fi - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index 824733901d6b..bc97cfcd7188 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Bun uses: ./.github/actions/setup-bun diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 6d143a8a22f4..1e652104d690 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -29,7 +29,7 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Bun uses: ./.github/actions/setup-bun diff --git a/.github/workflows/sync-zed-extension.yml b/.github/workflows/sync-zed-extension.yml index f14487cde974..6e4b44083c1a 100644 --- a/.github/workflows/sync-zed-extension.yml +++ b/.github/workflows/sync-zed-extension.yml @@ -10,7 +10,7 @@ jobs: name: Release Zed Extension runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f226d3483a71..4a65b9927738 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,12 +37,12 @@ jobs: shell: bash steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "24" @@ -55,7 +55,7 @@ jobs: git config --global user.name "opencode" - name: Cache Turbo - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: node_modules/.cache/turbo key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-${{ github.sha }} @@ -75,7 +75,7 @@ jobs: - name: Publish unit reports if: always() - uses: mikepenz/action-junit-report@v6 + uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0 with: report_paths: packages/*/.artifacts/unit/junit.xml check_name: "unit results (${{ matrix.settings.name }})" @@ -85,7 +85,7 @@ jobs: - name: Upload unit artifacts if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: unit-${{ matrix.settings.name }}-${{ github.run_attempt }} include-hidden-files: true @@ -111,12 +111,12 @@ jobs: shell: bash steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "24" @@ -131,7 +131,7 @@ jobs: - name: Cache Playwright browsers id: playwright-cache - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ github.workspace }}/.playwright-browsers key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium @@ -155,7 +155,7 @@ jobs: - name: Upload Playwright artifacts if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }} if-no-files-found: ignore diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 99e7b5b34fe3..27852a12ce4d 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -12,7 +12,7 @@ jobs: issues: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index b247d24b40db..fc9a52797c1d 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -12,7 +12,7 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Bun uses: ./.github/actions/setup-bun diff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsonc index dab531d337eb..0ae2fbe26bc4 100644 --- a/.opencode/opencode.jsonc +++ b/.opencode/opencode.jsonc @@ -1,11 +1,7 @@ { "$schema": "https://opencode.ai/config.json", "provider": {}, - "permission": { - "edit": { - "packages/opencode/migration/*": "ask", - }, - }, + "permission": {}, "mcp": {}, "tools": { "github-triage": false, diff --git a/.opencode/skills/improve-codebase-architecture/DEEPENING.md b/.opencode/skills/improve-codebase-architecture/DEEPENING.md new file mode 100644 index 000000000000..c52fdfd99f35 --- /dev/null +++ b/.opencode/skills/improve-codebase-architecture/DEEPENING.md @@ -0,0 +1,37 @@ +# Deepening + +How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [LANGUAGE.md](LANGUAGE.md) — **module**, **interface**, **seam**, **adapter**. + +## Dependency categories + +When assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam. + +### 1. In-process + +Pure computation, in-memory state, no I/O. Always deepenable — merge the modules and test through the new interface directly. No adapter needed. + +### 2. Local-substitutable + +Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface. + +### 3. Remote but owned (Ports & Adapters) + +Your own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter. + +Recommendation shape: _"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."_ + +### 4. True external (Mock) + +Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter. + +## Seam discipline + +- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection. +- **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them. + +## Testing strategy: replace, don't layer + +- Old unit tests on shallow modules become waste once tests at the deepened module's interface exist — delete them. +- Write new tests at the deepened module's interface. The **interface is the test surface**. +- Tests assert on observable outcomes through the interface, not internal state. +- Tests should survive internal refactors — they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface. diff --git a/.opencode/skills/improve-codebase-architecture/INTERFACE-DESIGN.md b/.opencode/skills/improve-codebase-architecture/INTERFACE-DESIGN.md new file mode 100644 index 000000000000..3197723a0d04 --- /dev/null +++ b/.opencode/skills/improve-codebase-architecture/INTERFACE-DESIGN.md @@ -0,0 +1,44 @@ +# Interface Design + +When the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on "Design It Twice" (Ousterhout) — your first idea is unlikely to be the best. + +Uses the vocabulary in [LANGUAGE.md](LANGUAGE.md) — **module**, **interface**, **seam**, **adapter**, **leverage**. + +## Process + +### 1. Frame the problem space + +Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate: + +- The constraints any new interface would need to satisfy +- The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md)) +- A rough illustrative code sketch to ground the constraints — not a proposal, just a way to make the constraints concrete + +Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel. + +### 2. Spawn sub-agents + +Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module. + +Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint: + +- Agent 1: "Minimize the interface — aim for 1–3 entry points max. Maximise leverage per entry point." +- Agent 2: "Maximise flexibility — support many use cases and extension." +- Agent 3: "Optimise for the most common caller — make the default case trivial." +- Agent 4 (if applicable): "Design around ports & adapters for cross-seam dependencies." + +Include both [LANGUAGE.md](LANGUAGE.md) vocabulary and CONTEXT.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language. + +Each sub-agent outputs: + +1. Interface (types, methods, params — plus invariants, ordering, error modes) +2. Usage example showing how callers use it +3. What the implementation hides behind the seam +4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md)) +5. Trade-offs — where leverage is high, where it's thin + +### 3. Present and compare + +Present designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**. + +After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not a menu. diff --git a/.opencode/skills/improve-codebase-architecture/LANGUAGE.md b/.opencode/skills/improve-codebase-architecture/LANGUAGE.md new file mode 100644 index 000000000000..dd9b60fea072 --- /dev/null +++ b/.opencode/skills/improve-codebase-architecture/LANGUAGE.md @@ -0,0 +1,53 @@ +# Language + +Shared vocabulary for every suggestion this skill makes. Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point. + +## Terms + +**Module** +Anything with an interface and an implementation. Deliberately scale-agnostic — applies equally to a function, class, package, or tier-spanning slice. +_Avoid_: unit, component, service. + +**Interface** +Everything a caller must know to use the module correctly. Includes the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. +_Avoid_: API, signature (too narrow — those refer only to the type-level surface). + +**Implementation** +What's inside a module — its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for "adapter" when the seam is the topic; "implementation" otherwise. + +**Depth** +Leverage at the interface — the amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface. A module is **shallow** when the interface is nearly as complex as the implementation. + +**Seam** _(from Michael Feathers)_ +A place where you can alter behaviour without editing in that place. The _location_ at which a module's interface lives. Choosing where to put the seam is its own design decision, distinct from what goes behind it. +_Avoid_: boundary (overloaded with DDD's bounded context). + +**Adapter** +A concrete thing that satisfies an interface at a seam. Describes _role_ (what slot it fills), not substance (what's inside). + +**Leverage** +What callers get from depth. More capability per unit of interface they have to learn. One implementation pays back across N call sites and M tests. + +**Locality** +What maintainers get from depth. Change, bugs, knowledge, and verification concentrate at one place rather than spreading across callers. Fix once, fixed everywhere. + +## Principles + +- **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface. +- **The deletion test.** Imagine deleting the module. If complexity vanishes, the module wasn't hiding anything (it was a pass-through). If complexity reappears across N callers, the module was earning its keep. +- **The interface is the test surface.** Callers and tests cross the same seam. If you want to test _past_ the interface, the module is probably the wrong shape. +- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it. + +## Relationships + +- A **Module** has exactly one **Interface** (the surface it presents to callers and tests). +- **Depth** is a property of a **Module**, measured against its **Interface**. +- A **Seam** is where a **Module**'s **Interface** lives. +- An **Adapter** sits at a **Seam** and satisfies the **Interface**. +- **Depth** produces **Leverage** for callers and **Locality** for maintainers. + +## Rejected framings + +- **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead. +- **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know. +- **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**. diff --git a/.opencode/skills/improve-codebase-architecture/SKILL.md b/.opencode/skills/improve-codebase-architecture/SKILL.md new file mode 100644 index 000000000000..05984a609682 --- /dev/null +++ b/.opencode/skills/improve-codebase-architecture/SKILL.md @@ -0,0 +1,71 @@ +--- +name: improve-codebase-architecture +description: Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable. +--- + +# Improve Codebase Architecture + +Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability. + +## Glossary + +Use these terms exactly in every suggestion. Consistent language is the point — don't drift into "component," "service," "API," or "boundary." Full definitions in [LANGUAGE.md](LANGUAGE.md). + +- **Module** — anything with an interface and an implementation (function, class, package, slice). +- **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature. +- **Implementation** — the code inside. +- **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation. +- **Seam** — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not "boundary.") +- **Adapter** — a concrete thing satisfying an interface at a seam. +- **Leverage** — what callers get from depth. +- **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place. + +Key principles (see [LANGUAGE.md](LANGUAGE.md) for the full list): + +- **Deletion test**: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep. +- **The interface is the test surface.** +- **One adapter = hypothetical seam. Two adapters = real seam.** + +This skill is _informed_ by the project's domain model. The domain language gives names to good seams; ADRs record decisions the skill should not re-litigate. + +## Process + +### 1. Explore + +Read the project's domain glossary and any ADRs in the area you're touching first. + +Then use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction: + +- Where does understanding one concept require bouncing between many small modules? +- Where are modules **shallow** — interface nearly as complex as the implementation? +- Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)? +- Where do tightly-coupled modules leak across their seams? +- Which parts of the codebase are untested, or hard to test through their current interface? + +Apply the **deletion test** to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want. + +### 2. Present candidates + +Present a numbered list of deepening opportunities. For each candidate: + +- **Files** — which files/modules are involved +- **Problem** — why the current architecture is causing friction +- **Solution** — plain English description of what would change +- **Benefits** — explained in terms of locality and leverage, and also in how tests would improve + +**Use CONTEXT.md vocabulary for the domain, and [LANGUAGE.md](LANGUAGE.md) vocabulary for the architecture.** If `CONTEXT.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service." + +**ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly (e.g. _"contradicts ADR-0007 — but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids. + +Do NOT propose interfaces yet. Ask the user: "Which of these would you like to explore?" + +### 3. Grilling loop + +Once the user picks a candidate, drop into a grilling conversation. Walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive. + +Side effects happen inline as decisions crystallize: + +- **Naming a deepened module after a concept not in `CONTEXT.md`?** Add the term to `CONTEXT.md` — same discipline as `/grill-with-docs` (see [CONTEXT-FORMAT.md](../grill-with-docs/CONTEXT-FORMAT.md)). Create the file lazily if it doesn't exist. +- **Sharpening a fuzzy term during the conversation?** Update `CONTEXT.md` right there. +- **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing — skip ephemeral reasons ("not worth it right now") and self-evident ones. See [ADR-FORMAT.md](../grill-with-docs/ADR-FORMAT.md). +- **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md). diff --git a/AGENTS.md b/AGENTS.md index 7913ddabd28e..0b1998ec5012 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -73,6 +73,29 @@ function foo() { } ``` +### Complex Logic + +When a function has several validation branches or supporting details, make the main function read as the happy path and move supporting details into small helpers below it. + +```ts +// Good +export function loadThing(input: unknown) { + const config = requireConfig(input) + const metadata = readMetadata(input) + return createThing({ config, metadata }) +} + +function requireConfig(input: unknown) { + ... +} +``` + +- Keep helpers close to the code they support, below the main export when that improves readability. +- Do not over-abstract simple expressions into many single-use helpers; extract only when it names a real concept like `requireConfig` or `readMetadata`. +- Do not return `Effect` from helpers unless they actually perform effectful work. Synchronous parsing, validation, and option building should stay synchronous. +- Prefer Effect schema helpers such as `Schema.UnknownFromJsonString` and `Schema.decodeUnknownOption` over manual `JSON.parse` wrapped in `Effect.try` when parsing untrusted JSON strings. +- Add comments for non-obvious constraints and surprising behavior, not for obvious assignments or control flow. + ### Schema Definitions (Drizzle) Use snake_case for field names so column names don't need to be redefined as strings. diff --git a/bun.lock b/bun.lock index 4268e5fb7d46..8fa8d02544a5 100644 --- a/bun.lock +++ b/bun.lock @@ -29,7 +29,7 @@ }, "packages/app": { "name": "@opencode-ai/app", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/core": "workspace:*", @@ -65,7 +65,6 @@ "solid-list": "catalog:", "tailwindcss": "catalog:", "virtua": "catalog:", - "zod": "catalog:", }, "devDependencies": { "@happy-dom/global-registrator": "20.0.11", @@ -85,7 +84,7 @@ }, "packages/console/app": { "name": "@opencode-ai/console-app", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", @@ -120,7 +119,7 @@ }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -147,7 +146,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@ai-sdk/anthropic": "3.0.64", "@ai-sdk/openai": "3.0.48", @@ -169,7 +168,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -193,26 +192,53 @@ }, "packages/core": { "name": "@opencode-ai/core", - "version": "1.14.48", + "version": "1.15.0", "bin": { "opencode": "./bin/opencode", }, "dependencies": { + "@ai-sdk/alibaba": "1.0.17", + "@ai-sdk/amazon-bedrock": "4.0.96", + "@ai-sdk/anthropic": "3.0.71", + "@ai-sdk/azure": "3.0.49", + "@ai-sdk/cerebras": "2.0.41", + "@ai-sdk/cohere": "3.0.27", + "@ai-sdk/deepinfra": "2.0.41", + "@ai-sdk/gateway": "3.0.104", + "@ai-sdk/google": "3.0.63", + "@ai-sdk/google-vertex": "4.0.112", + "@ai-sdk/groq": "3.0.31", + "@ai-sdk/mistral": "3.0.27", + "@ai-sdk/openai": "3.0.53", + "@ai-sdk/openai-compatible": "2.0.41", + "@ai-sdk/perplexity": "3.0.26", + "@ai-sdk/provider": "3.0.8", + "@ai-sdk/provider-utils": "4.0.23", + "@ai-sdk/togetherai": "2.0.41", + "@ai-sdk/vercel": "2.0.39", + "@ai-sdk/xai": "3.0.82", + "@aws-sdk/credential-providers": "3.993.0", "@effect/opentelemetry": "catalog:", "@effect/platform-node": "catalog:", "@npmcli/arborist": "9.4.0", "@npmcli/config": "10.8.1", + "@openrouter/ai-sdk-provider": "2.8.1", "@opentelemetry/api": "1.9.0", "@opentelemetry/context-async-hooks": "2.6.1", "@opentelemetry/exporter-trace-otlp-http": "0.214.0", "@opentelemetry/sdk-trace-base": "2.6.1", + "ai-gateway-provider": "3.1.2", "cross-spawn": "catalog:", "effect": "catalog:", + "gitlab-ai-provider": "6.6.0", "glob": "13.0.5", + "google-auth-library": "10.5.0", + "immer": "11.1.4", "mime-types": "3.0.2", "minimatch": "10.2.5", "npm-package-arg": "13.0.2", "semver": "^7.6.3", + "venice-ai-sdk-provider": "2.0.1", "xdg-basedir": "5.1.0", "zod": "catalog:", }, @@ -227,7 +253,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "drizzle-orm": "catalog:", "effect": "catalog:", @@ -281,7 +307,7 @@ }, "packages/enterprise": { "name": "@opencode-ai/enterprise", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@opencode-ai/core": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -311,7 +337,7 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "catalog:", @@ -327,7 +353,7 @@ }, "packages/http-recorder": { "name": "@opencode-ai/http-recorder", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@effect/platform-node": "catalog:", "effect": "catalog:", @@ -340,7 +366,7 @@ }, "packages/llm": { "name": "@opencode-ai/llm", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@smithy/eventstream-codec": "4.2.14", "@smithy/util-utf8": "4.2.2", @@ -358,7 +384,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "1.14.48", + "version": "1.15.0", "bin": { "opencode": "./bin/opencode", }, @@ -382,7 +408,6 @@ "@ai-sdk/openai-compatible": "2.0.41", "@ai-sdk/perplexity": "3.0.26", "@ai-sdk/provider": "3.0.8", - "@ai-sdk/provider-utils": "4.0.23", "@ai-sdk/togetherai": "2.0.41", "@ai-sdk/vercel": "2.0.39", "@ai-sdk/xai": "3.0.82", @@ -399,6 +424,7 @@ "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/ui": "workspace:*", "@openrouter/ai-sdk-provider": "2.8.1", "@opentelemetry/api": "1.9.0", "@opentelemetry/context-async-hooks": "2.6.1", @@ -420,7 +446,6 @@ "bonjour-service": "1.3.0", "bun-pty": "0.4.8", "chokidar": "4.0.3", - "cli-sound": "1.1.3", "clipboardy": "4.0.0", "cross-spawn": "catalog:", "decimal.js": "10.5.0", @@ -432,6 +457,7 @@ "glob": "13.0.5", "google-auth-library": "10.5.0", "gray-matter": "4.0.3", + "htmlparser2": "8.0.2", "ignore": "7.0.5", "immer": "11.1.4", "jsonc-parser": "3.3.1", @@ -494,7 +520,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@opencode-ai/sdk": "workspace:*", "effect": "catalog:", @@ -510,9 +536,9 @@ "typescript": "catalog:", }, "peerDependencies": { - "@opentui/core": ">=0.2.6", - "@opentui/keymap": ">=0.2.6", - "@opentui/solid": ">=0.2.6", + "@opentui/core": ">=0.2.10", + "@opentui/keymap": ">=0.2.10", + "@opentui/solid": ">=0.2.10", }, "optionalPeers": [ "@opentui/core", @@ -532,7 +558,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "cross-spawn": "catalog:", }, @@ -547,7 +573,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -582,7 +608,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/core": "workspace:*", @@ -631,7 +657,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", @@ -679,6 +705,9 @@ "@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch", }, "overrides": { + "@opentui/core": "catalog:", + "@opentui/keymap": "catalog:", + "@opentui/solid": "catalog:", "@types/bun": "catalog:", "@types/node": "catalog:", }, @@ -692,9 +721,9 @@ "@npmcli/arborist": "9.4.0", "@octokit/rest": "22.0.0", "@openauthjs/openauth": "0.0.0-20250322224806", - "@opentui/core": "0.2.6", - "@opentui/keymap": "0.2.6", - "@opentui/solid": "0.2.6", + "@opentui/core": "0.2.10", + "@opentui/keymap": "0.2.10", + "@opentui/solid": "0.2.10", "@pierre/diffs": "1.1.0-beta.18", "@playwright/test": "1.59.1", "@sentry/solid": "10.36.0", @@ -1073,8 +1102,6 @@ "@develar/schema-utils": ["@develar/schema-utils@2.6.5", "", { "dependencies": { "ajv": "^6.12.0", "ajv-keywords": "^3.4.1" } }, "sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig=="], - "@dimforge/rapier2d-simd-compat": ["@dimforge/rapier2d-simd-compat@0.17.3", "", {}, "sha512-bijvwWz6NHsNj5e5i1vtd3dU2pDhthSaTUZSh14DUGGKJfw8eMnlWZsxwHBxB/a3AXVNDjL9abuHw1k9FGR+jg=="], - "@dot/log": ["@dot/log@0.1.5", "", { "dependencies": { "chalk": "^4.1.2", "loglevelnext": "^6.0.0", "p-defer": "^3.0.0" } }, "sha512-ECraEVJWv2f2mWK93lYiefUkphStVlKD6yKDzisuoEmxuLKrxO9iGetHK2DoEAkj7sxjE886n0OUVVCUx0YPNg=="], "@drizzle-team/brocli": ["@drizzle-team/brocli@0.11.0", "", {}, "sha512-hD3pekGiPg0WPCCGAZmusBBJsDqGUR66Y452YgQsZOnkdQ7ViEPKuyP4huUGEZQefp8g34RRodXYmJ2TbCH+tg=="], @@ -1291,62 +1318,6 @@ "@isaacs/string-locale-compare": ["@isaacs/string-locale-compare@1.1.0", "", {}, "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ=="], - "@jimp/core": ["@jimp/core@1.6.0", "", { "dependencies": { "@jimp/file-ops": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "await-to-js": "^3.0.0", "exif-parser": "^0.1.12", "file-type": "^16.0.0", "mime": "3" } }, "sha512-EQQlKU3s9QfdJqiSrZWNTxBs3rKXgO2W+GxNXDtwchF3a4IqxDheFX1ti+Env9hdJXDiYLp2jTRjlxhPthsk8w=="], - - "@jimp/diff": ["@jimp/diff@1.6.0", "", { "dependencies": { "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "pixelmatch": "^5.3.0" } }, "sha512-+yUAQ5gvRC5D1WHYxjBHZI7JBRusGGSLf8AmPRPCenTzh4PA+wZ1xv2+cYqQwTfQHU5tXYOhA0xDytfHUf1Zyw=="], - - "@jimp/file-ops": ["@jimp/file-ops@1.6.0", "", {}, "sha512-Dx/bVDmgnRe1AlniRpCKrGRm5YvGmUwbDzt+MAkgmLGf+jvBT75hmMEZ003n9HQI/aPnm/YKnXjg/hOpzNCpHQ=="], - - "@jimp/js-bmp": ["@jimp/js-bmp@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "bmp-ts": "^1.0.9" } }, "sha512-FU6Q5PC/e3yzLyBDXupR3SnL3htU7S3KEs4e6rjDP6gNEOXRFsWs6YD3hXuXd50jd8ummy+q2WSwuGkr8wi+Gw=="], - - "@jimp/js-gif": ["@jimp/js-gif@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "gifwrap": "^0.10.1", "omggif": "^1.0.10" } }, "sha512-N9CZPHOrJTsAUoWkWZstLPpwT5AwJ0wge+47+ix3++SdSL/H2QzyMqxbcDYNFe4MoI5MIhATfb0/dl/wmX221g=="], - - "@jimp/js-jpeg": ["@jimp/js-jpeg@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "jpeg-js": "^0.4.4" } }, "sha512-6vgFDqeusblf5Pok6B2DUiMXplH8RhIKAryj1yn+007SIAQ0khM1Uptxmpku/0MfbClx2r7pnJv9gWpAEJdMVA=="], - - "@jimp/js-png": ["@jimp/js-png@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "pngjs": "^7.0.0" } }, "sha512-AbQHScy3hDDgMRNfG0tPjL88AV6qKAILGReIa3ATpW5QFjBKpisvUaOqhzJ7Reic1oawx3Riyv152gaPfqsBVg=="], - - "@jimp/js-tiff": ["@jimp/js-tiff@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "utif2": "^4.1.0" } }, "sha512-zhReR8/7KO+adijj3h0ZQUOiun3mXUv79zYEAKvE0O+rP7EhgtKvWJOZfRzdZSNv0Pu1rKtgM72qgtwe2tFvyw=="], - - "@jimp/plugin-blit": ["@jimp/plugin-blit@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-M+uRWl1csi7qilnSK8uxK4RJMSuVeBiO1AY0+7APnfUbQNZm6hCe0CCFv1Iyw1D/Dhb8ph8fQgm5mwM0eSxgVA=="], - - "@jimp/plugin-blur": ["@jimp/plugin-blur@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/utils": "1.6.0" } }, "sha512-zrM7iic1OTwUCb0g/rN5y+UnmdEsT3IfuCXCJJNs8SZzP0MkZ1eTvuwK9ZidCuMo4+J3xkzCidRwYXB5CyGZTw=="], - - "@jimp/plugin-circle": ["@jimp/plugin-circle@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" } }, "sha512-xt1Gp+LtdMKAXfDp3HNaG30SPZW6AQ7dtAtTnoRKorRi+5yCJjKqXRgkewS5bvj8DEh87Ko1ydJfzqS3P2tdWw=="], - - "@jimp/plugin-color": ["@jimp/plugin-color@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "tinycolor2": "^1.6.0", "zod": "^3.23.8" } }, "sha512-J5q8IVCpkBsxIXM+45XOXTrsyfblyMZg3a9eAo0P7VPH4+CrvyNQwaYatbAIamSIN1YzxmO3DkIZXzRjFSz1SA=="], - - "@jimp/plugin-contain": ["@jimp/plugin-contain@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-blit": "1.6.0", "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-oN/n+Vdq/Qg9bB4yOBOxtY9IPAtEfES8J1n9Ddx+XhGBYT1/QTU/JYkGaAkIGoPnyYvmLEDqMz2SGihqlpqfzQ=="], - - "@jimp/plugin-cover": ["@jimp/plugin-cover@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-crop": "1.6.0", "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", "zod": "^3.23.8" } }, "sha512-Iow0h6yqSC269YUJ8HC3Q/MpCi2V55sMlbkkTTx4zPvd8mWZlC0ykrNDeAy9IJegrQ7v5E99rJwmQu25lygKLA=="], - - "@jimp/plugin-crop": ["@jimp/plugin-crop@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-KqZkEhvs+21USdySCUDI+GFa393eDIzbi1smBqkUPTE+pRwSWMAf01D5OC3ZWB+xZsNla93BDS9iCkLHA8wang=="], - - "@jimp/plugin-displace": ["@jimp/plugin-displace@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-4Y10X9qwr5F+Bo5ME356XSACEF55485j5nGdiyJ9hYzjQP9nGgxNJaZ4SAOqpd+k5sFaIeD7SQ0Occ26uIng5Q=="], - - "@jimp/plugin-dither": ["@jimp/plugin-dither@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0" } }, "sha512-600d1RxY0pKwgyU0tgMahLNKsqEcxGdbgXadCiVCoGd6V6glyCvkNrnnwC0n5aJ56Htkj88PToSdF88tNVZEEQ=="], - - "@jimp/plugin-fisheye": ["@jimp/plugin-fisheye@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-E5QHKWSCBFtpgZarlmN3Q6+rTQxjirFqo44ohoTjzYVrDI6B6beXNnPIThJgPr0Y9GwfzgyarKvQuQuqCnnfbA=="], - - "@jimp/plugin-flip": ["@jimp/plugin-flip@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" } }, "sha512-/+rJVDuBIVOgwoyVkBjUFHtP+wmW0r+r5OQ2GpatQofToPVbJw1DdYWXlwviSx7hvixTWLKVgRWQ5Dw862emDg=="], - - "@jimp/plugin-hash": ["@jimp/plugin-hash@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/js-bmp": "1.6.0", "@jimp/js-jpeg": "1.6.0", "@jimp/js-png": "1.6.0", "@jimp/js-tiff": "1.6.0", "@jimp/plugin-color": "1.6.0", "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "any-base": "^1.1.0" } }, "sha512-wWzl0kTpDJgYVbZdajTf+4NBSKvmI3bRI8q6EH9CVeIHps9VWVsUvEyb7rpbcwVLWYuzDtP2R0lTT6WeBNQH9Q=="], - - "@jimp/plugin-mask": ["@jimp/plugin-mask@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" } }, "sha512-Cwy7ExSJMZszvkad8NV8o/Z92X2kFUFM8mcDAhNVxU0Q6tA0op2UKRJY51eoK8r6eds/qak3FQkXakvNabdLnA=="], - - "@jimp/plugin-print": ["@jimp/plugin-print@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/js-jpeg": "1.6.0", "@jimp/js-png": "1.6.0", "@jimp/plugin-blit": "1.6.0", "@jimp/types": "1.6.0", "parse-bmfont-ascii": "^1.0.6", "parse-bmfont-binary": "^1.0.6", "parse-bmfont-xml": "^1.1.6", "simple-xml-to-json": "^1.2.2", "zod": "^3.23.8" } }, "sha512-zarTIJi8fjoGMSI/M3Xh5yY9T65p03XJmPsuNet19K/Q7mwRU6EV2pfj+28++2PV2NJ+htDF5uecAlnGyxFN2A=="], - - "@jimp/plugin-quantize": ["@jimp/plugin-quantize@1.6.0", "", { "dependencies": { "image-q": "^4.0.0", "zod": "^3.23.8" } }, "sha512-EmzZ/s9StYQwbpG6rUGBCisc3f64JIhSH+ncTJd+iFGtGo0YvSeMdAd+zqgiHpfZoOL54dNavZNjF4otK+mvlg=="], - - "@jimp/plugin-resize": ["@jimp/plugin-resize@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", "zod": "^3.23.8" } }, "sha512-uSUD1mqXN9i1SGSz5ov3keRZ7S9L32/mAQG08wUwZiEi5FpbV0K8A8l1zkazAIZi9IJzLlTauRNU41Mi8IF9fA=="], - - "@jimp/plugin-rotate": ["@jimp/plugin-rotate@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-crop": "1.6.0", "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-JagdjBLnUZGSG4xjCLkIpQOZZ3Mjbg8aGCCi4G69qR+OjNpOeGI7N2EQlfK/WE8BEHOW5vdjSyglNqcYbQBWRw=="], - - "@jimp/plugin-threshold": ["@jimp/plugin-threshold@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-color": "1.6.0", "@jimp/plugin-hash": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", "zod": "^3.23.8" } }, "sha512-M59m5dzLoHOVWdM41O8z9SyySzcDn43xHseOH0HavjsfQsT56GGCC4QzU1banJidbUrePhzoEdS42uFE8Fei8w=="], - - "@jimp/types": ["@jimp/types@1.6.0", "", { "dependencies": { "zod": "^3.23.8" } }, "sha512-7UfRsiKo5GZTAATxm2qQ7jqmUXP0DxTArztllTcYdyw6Xi5oT4RaoXynVtCD4UyLK5gJgkZJcwonoijrhYFKfg=="], - - "@jimp/utils": ["@jimp/utils@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "tinycolor2": "^1.6.0" } }, "sha512-gqFTGEosKbOkYF/WFj26jMHOI5OH2jeP1MmC/zbK6BF6VJBf8rIC5898dPfSzZEbSA0wbbV5slbntWVc5PKLFA=="], - "@joshwooding/vite-plugin-react-docgen-typescript": ["@joshwooding/vite-plugin-react-docgen-typescript@0.7.0", "", { "dependencies": { "glob": "^13.0.1", "react-docgen-typescript": "^2.2.2" }, "peerDependencies": { "typescript": ">= 4.3.x", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["typescript"] }, "sha512-qvsTEwEFefhdirGOPnu9Wp6ChfIwy2dBCRuETU3uE+4cC+PFoxMSiiEhxk4lOluA34eARHA0OxqsEUYDqRMgeQ=="], "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], @@ -1619,23 +1590,23 @@ "@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.40.0", "", {}, "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw=="], - "@opentui/core": ["@opentui/core@0.2.6", "", { "dependencies": { "bun-ffi-structs": "0.2.2", "diff": "9.0.0", "marked": "17.0.1", "string-width": "7.2.0", "strip-ansi": "7.1.2", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@opentui/core-darwin-arm64": "0.2.6", "@opentui/core-darwin-x64": "0.2.6", "@opentui/core-linux-arm64": "0.2.6", "@opentui/core-linux-x64": "0.2.6", "@opentui/core-win32-arm64": "0.2.6", "@opentui/core-win32-x64": "0.2.6" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-dBpMaWVM7wtW2/2TlGPrkPjg6gOL3MVU/5XXk+U1LDJB8L4q4NeYWVdzfAVNcEvgmuuCy/cVqdY2D4ei+e7MMg=="], + "@opentui/core": ["@opentui/core@0.2.10", "", { "dependencies": { "bun-ffi-structs": "0.2.2", "diff": "9.0.0", "marked": "17.0.1", "string-width": "7.2.0", "strip-ansi": "7.1.2", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@opentui/core-darwin-arm64": "0.2.10", "@opentui/core-darwin-x64": "0.2.10", "@opentui/core-linux-arm64": "0.2.10", "@opentui/core-linux-x64": "0.2.10", "@opentui/core-win32-arm64": "0.2.10", "@opentui/core-win32-x64": "0.2.10" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-oviCtx0jYjc7F8X2b8+0IkQLg6WH47Nwl6CFeZo5dU0k6OpSbTbi07ZleObaiECAp+S1YLhAtVdgzHU7hBZlaw=="], - "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.2.6", "", { "os": "darwin", "cpu": "arm64" }, "sha512-hR5nsxNj+059utzenTCF0kealUlibON6fLuebFUCGM/5kJnqa+shIh0XbUDFm0+F47vqVUgZufBdUuieQZIbvQ=="], + "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.2.10", "", { "os": "darwin", "cpu": "arm64" }, "sha512-+lbDDj42Og+UtTZEwlHhGXichmOlkxSqn0J+Jqjat5/Tt5oZykj1NZjFIQ7ZSz4Miz7EmZwgYKE2CyOmmm9MoQ=="], - "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.2.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-pJ/bH4WC/mbBaakM1YdH6TVo67jhy0KPd61bCz97w0I/PJGr8fmNKvhmMt/AwyFgOQi3FYZiEKLMpGdvUcSsrQ=="], + "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.2.10", "", { "os": "darwin", "cpu": "x64" }, "sha512-5iAoA0aqMWWAQ93nh8Bb0ipwt9h+tvEFc88+YO9St43uUJ+XrXcmMj3T8wtl6dSu/SN0UoDWNaUMHUmtykiPtg=="], - "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.2.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-9Pnd3kOxig8ii+/IqYheOPEgferylsQA0L6tKBnHQ9jRlCJOcu0Rv65Jepueh212vevdV9DzPURJnhejG06J6g=="], + "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.2.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-EnrkxgH5K76Oi/Br1UHPZblXG5P60snmtySfnxuVaeECNZrbTkV6BV/A0WoBeWshJweGbx1D+eTF+sEEjQCi8w=="], - "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.2.6", "", { "os": "linux", "cpu": "x64" }, "sha512-458Mx9tBzEPzfft8cSt5ZaIpEepoxBXBOL6AUVmDTKWaZ3uouraPcEKraGAyvOTDQp2XDI3R8c/2GdaR77FaUQ=="], + "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.2.10", "", { "os": "linux", "cpu": "x64" }, "sha512-fI+r3kCPqIxsWwPVGpKUQy4zHK8y+jkDRCwa3UbaUy48RQ44jMuf2RhVhmi4xmCvSc8UPJBbYsw1tLuh9kmXjg=="], - "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.2.6", "", { "os": "win32", "cpu": "arm64" }, "sha512-BDUrdrT1RCcVnQoHJmUut4y811jDBAEtc6GJFB4Gs265Be8SrTjVCus6p2fSQ7j9sZQ1OcjO+5+4NkheSZICDQ=="], + "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.2.10", "", { "os": "win32", "cpu": "arm64" }, "sha512-8F4z2hIRgkVWcr6CMVeJ9N4+1rmURPt2Pq2GBPko8ch6rxHR+a//KD1MfphyuLTHBS1tJ4vfZSWSoiaESImtrA=="], - "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.2.6", "", { "os": "win32", "cpu": "x64" }, "sha512-SUYAzRJ9TSoD2Qt8kn6FJz6dbTrFEPVig5mScB4zFGgGQO/Bbod2/Q31vLS/IQrX+FDb67WaErD+kuMCnMPPLA=="], + "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.2.10", "", { "os": "win32", "cpu": "x64" }, "sha512-Ki+qNBlIFW5K2wcG/RHrlPp7yEQKXeiNX3mlje25iwX62Ac5w391HBpOmUjbPoq20McPyDRnhbLfbXQSPtickg=="], - "@opentui/keymap": ["@opentui/keymap@0.2.6", "", { "dependencies": { "@opentui/core": "0.2.6" }, "peerDependencies": { "@opentui/react": "0.2.6", "@opentui/solid": "0.2.6", "react": ">=19.2.0", "solid-js": "1.9.12" }, "optionalPeers": ["@opentui/react", "@opentui/solid", "react", "solid-js"] }, "sha512-+6OYuedrFCKVo4ryGFNwws++2VOmPcXU3PwpY0mP47gYQY2nvQ+etWIs2Y7r5eMIqUfxVCldkKsrzcEcA4tb/A=="], + "@opentui/keymap": ["@opentui/keymap@0.2.10", "", { "dependencies": { "@opentui/core": "0.2.10" }, "peerDependencies": { "@opentui/react": "0.2.10", "@opentui/solid": "0.2.10", "react": ">=19.2.0", "solid-js": "1.9.12" }, "optionalPeers": ["@opentui/react", "@opentui/solid", "react", "solid-js"] }, "sha512-80fU3Lr/98sNIpVYd8PApAeQw8A8D9BemyOGi6jGvTQCl0rxKgvaVBviDRGKxl1INTVjZy9By8UPncc2KJOuWQ=="], - "@opentui/solid": ["@opentui/solid@0.2.6", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.2.6", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.12", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.12" } }, "sha512-2y225WlOGi/fCaajkxBmLyVW8Cr+OmhowHdvrYcz5w2kBD15sKbJLIYu1G9DxceirT1uIyasGy2TGzRRcVkTDg=="], + "@opentui/solid": ["@opentui/solid@0.2.10", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.2.10", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.12", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.12" } }, "sha512-+4/MB90yIQiPwg8Y4wY092yva9BvRTsJeeeEO3e2H7P8k8zxYk4G9bzuhqYLxA9mTVQ+zVDlrmFoPQhT7vpIRw=="], "@oslojs/asn1": ["@oslojs/asn1@1.0.0", "", { "dependencies": { "@oslojs/binary": "1.0.0" } }, "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA=="], @@ -2287,8 +2258,6 @@ "@thisbeyond/solid-dnd": ["@thisbeyond/solid-dnd@0.7.5", "", { "peerDependencies": { "solid-js": "^1.5" } }, "sha512-DfI5ff+yYGpK9M21LhYwIPlbP2msKxN2ARwuu6GF8tT1GgNVDTI8VCQvH4TJFoVApP9d44izmAcTh/iTCH2UUw=="], - "@tokenizer/token": ["@tokenizer/token@0.3.0", "", {}, "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="], - "@tsconfig/bun": ["@tsconfig/bun@1.0.9", "", {}, "sha512-4M0/Ivfwcpz325z6CwSifOBZYji3DFOEpY6zEUt0+Xi2qRhzwvmqQN9XAHJh3OVvRJuAqVTLU2abdCplvp6mwQ=="], "@tsconfig/node22": ["@tsconfig/node22@22.0.2", "", {}, "sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA=="], @@ -2553,8 +2522,6 @@ "ansis": ["ansis@4.2.0", "", {}, "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig=="], - "any-base": ["any-base@1.1.0", "", {}, "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg=="], - "any-promise": ["any-promise@1.3.0", "", {}, "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="], "anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="], @@ -2623,8 +2590,6 @@ "avvio": ["avvio@9.2.0", "", { "dependencies": { "@fastify/error": "^4.0.0", "fastq": "^1.17.1" } }, "sha512-2t/sy01ArdHHE0vRH5Hsay+RtCZt3dLPji7W7/MMOCEgze5b7SNDC4j5H6FnVgPkI1MTNFGzHdHrVXDDl7QSSQ=="], - "await-to-js": ["await-to-js@3.0.0", "", {}, "sha512-zJAaP9zxTcvTHRlejau3ZOY4V7SRpiByf3/dxx2uyKxxor19tpmpV2QRsTKikckwhaPmr2dVpxxMr7jOCYVp5g=="], - "aws-sdk": ["aws-sdk@2.1692.0", "", { "dependencies": { "buffer": "4.9.2", "events": "1.1.1", "ieee754": "1.1.13", "jmespath": "0.16.0", "querystring": "0.2.0", "sax": "1.2.1", "url": "0.10.3", "util": "^0.12.4", "uuid": "8.0.0", "xml2js": "0.6.2" } }, "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw=="], "aws-ssl-profiles": ["aws-ssl-profiles@1.1.2", "", {}, "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g=="], @@ -2689,8 +2654,6 @@ "blob-to-buffer": ["blob-to-buffer@1.2.9", "", {}, "sha512-BF033y5fN6OCofD3vgHmNtwZWRcq9NLyyxyILx9hfMy1sXYy4ojFl765hJ2lP0YaN2fuxPaLO2Vzzoxy0FLFFA=="], - "bmp-ts": ["bmp-ts@1.0.9", "", {}, "sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw=="], - "body-parser": ["body-parser@1.20.4", "", { "dependencies": { "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "~1.2.0", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "on-finished": "~2.4.1", "qs": "~6.14.0", "raw-body": "~2.5.3", "type-is": "~1.6.18", "unpipe": "~1.0.0" } }, "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA=="], "bonjour-service": ["bonjour-service@1.3.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "multicast-dns": "^7.2.5" } }, "sha512-3YuAUiSkWykd+2Azjgyxei8OWf8thdn8AITIog2M4UICzoqfjlqr64WIjEXZllf/W6vK1goqleSR6brGomxQqA=="], @@ -2733,16 +2696,6 @@ "bun-types": ["bun-types@1.3.12", "", { "dependencies": { "@types/node": "*" } }, "sha512-HqOLj5PoFajAQciOMRiIZGNoKxDJSr6qigAttOX40vJuSp6DN/CxWp9s3C1Xwm4oH7ybueITwiaOcWXoYVoRkA=="], - "bun-webgpu": ["bun-webgpu@0.1.5", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.5", "bun-webgpu-darwin-x64": "^0.1.5", "bun-webgpu-linux-x64": "^0.1.5", "bun-webgpu-win32-x64": "^0.1.5" } }, "sha512-91/K6S5whZKX7CWAm9AylhyKrLGRz6BUiiPiM/kXadSnD4rffljCD/q9cNFftm5YXhx4MvLqw33yEilxogJvwA=="], - - "bun-webgpu-darwin-arm64": ["bun-webgpu-darwin-arm64@0.1.6", "", { "os": "darwin", "cpu": "arm64" }, "sha512-lIsDkPzJzPl6yrB5CUOINJFPnTRv6fF/Q8J1mAr43ogSp86WZEg9XZKaT6f3EUJ+9ETogGoMnoj1q0AwHUTbAQ=="], - - "bun-webgpu-darwin-x64": ["bun-webgpu-darwin-x64@0.1.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-uEddf5U7GvKIkM/BV18rUKtYHL6d0KeqBjNHwfqDH9QgEo9KVSKvJXS5I/sMefk5V5pIYE+8tQhtrREevhocng=="], - - "bun-webgpu-linux-x64": ["bun-webgpu-linux-x64@0.1.6", "", { "os": "linux", "cpu": "x64" }, "sha512-Y/f15j9r8ba0xUz+3lATtS74OE+PPzQXO7Do/1eCluJcuOlfa77kMjvBK/ShWnem3Y9xqi59pebTPOGRB+CaJA=="], - - "bun-webgpu-win32-x64": ["bun-webgpu-win32-x64@0.1.6", "", { "os": "win32", "cpu": "x64" }, "sha512-MHSFAKqizISb+C5NfDrFe3g0Al5Njnu0j/A+oO2Q+bIWX+fUYjBSowiYE1ZXJx65KuryuB+tiM7Qh6cQbVvkEg=="], - "bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="], "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="], @@ -2813,8 +2766,6 @@ "cli-cursor": ["cli-cursor@3.1.0", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="], - "cli-sound": ["cli-sound@1.1.3", "", { "dependencies": { "find-exec": "^1.0.3" }, "bin": { "cli-sound": "dist/esm/cli.js" } }, "sha512-dpdF3KS3wjo1fobKG5iU9KyKqzQWAqueymHzZ9epus/dZ40487gAvS6aXFeBul+GiQAQYUTAtUWgQvw6Jftbyg=="], - "cli-spinners": ["cli-spinners@3.4.0", "", {}, "sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw=="], "cli-truncate": ["cli-truncate@4.0.0", "", { "dependencies": { "slice-ansi": "^5.0.0", "string-width": "^7.0.0" } }, "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA=="], @@ -3165,8 +3116,6 @@ "execa": ["execa@8.0.1", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" } }, "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg=="], - "exif-parser": ["exif-parser@0.1.12", "", {}, "sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw=="], - "exit-hook": ["exit-hook@2.2.1", "", {}, "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw=="], "expect-type": ["expect-type@1.3.0", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="], @@ -3229,8 +3178,6 @@ "fetch-blob": ["fetch-blob@3.2.0", "", { "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" } }, "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ=="], - "file-type": ["file-type@16.5.4", "", { "dependencies": { "readable-web-to-node-stream": "^3.0.0", "strtok3": "^6.2.4", "token-types": "^4.1.1" } }, "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw=="], - "filelist": ["filelist@1.0.6", "", { "dependencies": { "minimatch": "^5.0.1" } }, "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA=="], "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], @@ -3239,8 +3186,6 @@ "find-babel-config": ["find-babel-config@2.1.2", "", { "dependencies": { "json5": "^2.2.3" } }, "sha512-ZfZp1rQyp4gyuxqt1ZqjFGVeVBvmpURMqdIWXbPRfB97Bf6BzdK/xSIbylEINzQ0kB5tlDQfn9HkNXXWsqTqLg=="], - "find-exec": ["find-exec@1.0.3", "", { "dependencies": { "shell-quote": "^1.8.1" } }, "sha512-gnG38zW90mS8hm5smNcrBnakPEt+cGJoiMkJwCU0IYnEb0H2NQk0NIljhNW+48oniCriFek/PH6QXbwsJo/qug=="], - "find-my-way": ["find-my-way@9.5.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-querystring": "^1.0.0", "safe-regex2": "^5.0.0" } }, "sha512-VW2RfnmscZO5KgBY5XVyKREMW5nMZcxDy+buTOsL+zIPnBlbKm+00sgzoQzq1EVh4aALZLfKdwv6atBGcjvjrQ=="], "find-my-way-ts": ["find-my-way-ts@0.1.6", "", {}, "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA=="], @@ -3323,8 +3268,6 @@ "ghostty-web": ["ghostty-web@github:anomalyco/ghostty-web#20bd361", {}, "anomalyco-ghostty-web-20bd361", "sha512-dW0nwaiBBcun9y5WJSvm3HxDLe5o9V0xLCndQvWonRVubU8CS1PHxZpLffyPt1YujPWC13ez03aWxcuKBPYYGQ=="], - "gifwrap": ["gifwrap@0.10.1", "", { "dependencies": { "image-q": "^4.0.0", "omggif": "^1.0.10" } }, "sha512-2760b1vpJHNmLzZ/ubTtNnEx5WApN/PYWJvXvgS+tL1egTTthayFYIQQNi136FLEDcN/IyEY2EcGpIITD6eYUw=="], - "giget": ["giget@2.0.0", "", { "dependencies": { "citty": "^0.1.6", "consola": "^3.4.0", "defu": "^6.1.4", "node-fetch-native": "^1.6.6", "nypm": "^0.6.0", "pathe": "^2.0.3" }, "bin": { "giget": "dist/cli.mjs" } }, "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA=="], "github-slugger": ["github-slugger@2.0.0", "", {}, "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw=="], @@ -3477,8 +3420,6 @@ "ignore-walk": ["ignore-walk@8.0.0", "", { "dependencies": { "minimatch": "^10.0.3" } }, "sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A=="], - "image-q": ["image-q@4.0.0", "", { "dependencies": { "@types/node": "16.9.1" } }, "sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw=="], - "immer": ["immer@11.1.4", "", {}, "sha512-XREFCPo6ksxVzP4E0ekD5aMdf8WMwmdNaz6vuvxgI40UaEiu6q3p8X52aU6GdyvLY3XXX/8R7JOTXStz/nBbRw=="], "import-local": ["import-local@3.2.0", "", { "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" }, "bin": { "import-local-fixture": "fixtures/cli.js" } }, "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA=="], @@ -3621,16 +3562,12 @@ "jake": ["jake@10.9.4", "", { "dependencies": { "async": "^3.2.6", "filelist": "^1.0.4", "picocolors": "^1.1.1" }, "bin": { "jake": "bin/cli.js" } }, "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA=="], - "jimp": ["jimp@1.6.0", "", { "dependencies": { "@jimp/core": "1.6.0", "@jimp/diff": "1.6.0", "@jimp/js-bmp": "1.6.0", "@jimp/js-gif": "1.6.0", "@jimp/js-jpeg": "1.6.0", "@jimp/js-png": "1.6.0", "@jimp/js-tiff": "1.6.0", "@jimp/plugin-blit": "1.6.0", "@jimp/plugin-blur": "1.6.0", "@jimp/plugin-circle": "1.6.0", "@jimp/plugin-color": "1.6.0", "@jimp/plugin-contain": "1.6.0", "@jimp/plugin-cover": "1.6.0", "@jimp/plugin-crop": "1.6.0", "@jimp/plugin-displace": "1.6.0", "@jimp/plugin-dither": "1.6.0", "@jimp/plugin-fisheye": "1.6.0", "@jimp/plugin-flip": "1.6.0", "@jimp/plugin-hash": "1.6.0", "@jimp/plugin-mask": "1.6.0", "@jimp/plugin-print": "1.6.0", "@jimp/plugin-quantize": "1.6.0", "@jimp/plugin-resize": "1.6.0", "@jimp/plugin-rotate": "1.6.0", "@jimp/plugin-threshold": "1.6.0", "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0" } }, "sha512-YcwCHw1kiqEeI5xRpDlPPBGL2EOpBKLwO4yIBJcXWHPj5PnA5urGq0jbyhM5KoNpypQ6VboSoxc9D8HyfvngSg=="], - "jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="], "jmespath": ["jmespath@0.16.0", "", {}, "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw=="], "jose": ["jose@6.0.11", "", {}, "sha512-QxG7EaliDARm1O1S8BGakqncGT9s25bKL1WSf6/oa17Tkqwi8D2ZNglqCF+DsYF88/rV66Q/Q2mFAy697E1DUg=="], - "jpeg-js": ["jpeg-js@0.4.4", "", {}, "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg=="], - "js-base64": ["js-base64@3.7.7", "", {}, "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="], "js-beautify": ["js-beautify@1.15.4", "", { "dependencies": { "config-chain": "^1.1.13", "editorconfig": "^1.0.4", "glob": "^10.4.2", "js-cookie": "^3.0.5", "nopt": "^7.2.1" }, "bin": { "css-beautify": "js/bin/css-beautify.js", "html-beautify": "js/bin/html-beautify.js", "js-beautify": "js/bin/js-beautify.js" } }, "sha512-9/KXeZUKKJwqCXUdBxFJ3vPh467OCckSBmYDwSK/EtV090K+iMJ7zx2S3HLVDIWFQdqMIsZWbnaGiba18aWhaA=="], @@ -4091,8 +4028,6 @@ "oidc-token-hash": ["oidc-token-hash@5.2.0", "", {}, "sha512-6gj2m8cJZ+iSW8bm0FXdGF0YhIQbKrfP4yWTNzxc31U6MOjfEmB1rHvlYvxI1B7t7BCi1F2vYTT6YhtQRG4hxw=="], - "omggif": ["omggif@1.0.10", "", {}, "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw=="], - "on-exit-leak-free": ["on-exit-leak-free@2.1.2", "", {}, "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA=="], "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="], @@ -4167,12 +4102,6 @@ "param-case": ["param-case@3.0.4", "", { "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" } }, "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A=="], - "parse-bmfont-ascii": ["parse-bmfont-ascii@1.0.6", "", {}, "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA=="], - - "parse-bmfont-binary": ["parse-bmfont-binary@1.0.6", "", {}, "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA=="], - - "parse-bmfont-xml": ["parse-bmfont-xml@1.1.6", "", { "dependencies": { "xml-parse-from-string": "^1.0.0", "xml2js": "^0.5.0" } }, "sha512-0cEliVMZEhrFDwMh4SxIyVJpqYoOWDJ9P895tFuS+XuNzI5UBmBk5U5O4KuJdTnZpSBI4LFA2+ZiJaiwfSwlMA=="], - "parse-conflict-json": ["parse-conflict-json@5.0.1", "", { "dependencies": { "json-parse-even-better-errors": "^5.0.0", "just-diff": "^6.0.0", "just-diff-apply": "^5.2.0" } }, "sha512-ZHEmNKMq1wyJXNwLxyHnluPfRAFSIliBvbK/UiOceROt4Xh9Pz0fq49NytIaeaCUf5VR86hwQ/34FCcNU5/LKQ=="], "parse-entities": ["parse-entities@4.0.2", "", { "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", "is-alphanumerical": "^2.0.0", "is-decimal": "^2.0.0", "is-hexadecimal": "^2.0.0" } }, "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw=="], @@ -4217,8 +4146,6 @@ "peberminta": ["peberminta@0.9.0", "", {}, "sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ=="], - "peek-readable": ["peek-readable@4.1.0", "", {}, "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg=="], - "pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="], "perfect-debounce": ["perfect-debounce@2.1.0", "", {}, "sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g=="], @@ -4239,8 +4166,6 @@ "pirates": ["pirates@4.0.7", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="], - "pixelmatch": ["pixelmatch@5.3.0", "", { "dependencies": { "pngjs": "^6.0.0" }, "bin": { "pixelmatch": "bin/pixelmatch" } }, "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q=="], - "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], "pkg-dir": ["pkg-dir@4.2.0", "", { "dependencies": { "find-up": "^4.0.0" } }, "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ=="], @@ -4249,16 +4174,12 @@ "pkg-up": ["pkg-up@3.1.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="], - "planck": ["planck@1.5.0", "", { "peerDependencies": { "stage-js": "^1.0.0-alpha.12" } }, "sha512-dlvqJE+FscZgrGUXJ5ybd0o5bvZ5XXyZNbm08xGsXp9WjXeAyWSFT6n9s/1PQcUBo4546fDXA5RMA4wbDyZw6g=="], - "playwright": ["playwright@1.59.1", "", { "dependencies": { "playwright-core": "1.59.1" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw=="], "playwright-core": ["playwright-core@1.59.1", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg=="], "plist": ["plist@3.1.0", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ=="], - "pngjs": ["pngjs@7.0.0", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="], - "poe-oauth": ["poe-oauth@0.0.6", "", {}, "sha512-dI8xrVl7RSFh0B+cb4GGuCjIfGtDT9VpbpVkP0UKcunpXF0eFw+6GencoJ7k+E02ZYqopBQApMVWGq70/GP69w=="], "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="], @@ -4383,8 +4304,6 @@ "readable-stream": ["readable-stream@4.7.0", "", { "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", "events": "^3.3.0", "process": "^0.11.10", "string_decoder": "^1.3.0" } }, "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg=="], - "readable-web-to-node-stream": ["readable-web-to-node-stream@3.0.4", "", { "dependencies": { "readable-stream": "^4.7.0" } }, "sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw=="], - "readdir-glob": ["readdir-glob@1.1.3", "", { "dependencies": { "minimatch": "^5.1.0" } }, "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA=="], "readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], @@ -4569,8 +4488,6 @@ "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], - "shell-quote": ["shell-quote@1.8.3", "", {}, "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw=="], - "shiki": ["shiki@3.20.0", "", { "dependencies": { "@shikijs/core": "3.20.0", "@shikijs/engine-javascript": "3.20.0", "@shikijs/engine-oniguruma": "3.20.0", "@shikijs/langs": "3.20.0", "@shikijs/themes": "3.20.0", "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-kgCOlsnyWb+p0WU+01RjkCH+eBVsjL1jOwUYWv0YDWkM2/A46+LDKVs5yZCUXjJG6bj4ndFoAg5iLIIue6dulg=="], "shikiji": ["shikiji@0.6.13", "", { "dependencies": { "hast-util-to-html": "^9.0.0" } }, "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA=="], @@ -4593,8 +4510,6 @@ "simple-update-notifier": ["simple-update-notifier@2.0.0", "", { "dependencies": { "semver": "^7.5.3" } }, "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w=="], - "simple-xml-to-json": ["simple-xml-to-json@1.2.7", "", {}, "sha512-mz9VXphOxQWX3eQ/uXCtm6upltoN0DLx8Zb5T4TFC4FHB7S9FDPGre8CfLWqPWQQH/GrQYd2AXhhVM5LDpYx6Q=="], - "sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="], "sitemap": ["sitemap@9.0.1", "", { "dependencies": { "@types/node": "^24.9.2", "@types/sax": "^1.2.1", "arg": "^5.0.0", "sax": "^1.4.1" }, "bin": { "sitemap": "dist/esm/cli.js" } }, "sha512-S6hzjGJSG3d6if0YoF5kTyeRJvia6FSTBroE5fQ0bu1QNxyJqhhinfUsXi9fH3MgtXODWvwo2BDyQSnhPQ88uQ=="], @@ -4681,8 +4596,6 @@ "stackframe": ["stackframe@1.3.4", "", {}, "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="], - "stage-js": ["stage-js@1.0.2", "", {}, "sha512-EWTRBYlg7Qv9wGUao99/PfRe3KaiQqWmgSvTOXvaWnu1Jk/q/vV8yJVu6bi/3EqDZeMVnCPAjheba6OFc5k1GQ=="], - "standard-as-callback": ["standard-as-callback@2.1.0", "", {}, "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A=="], "stat-mode": ["stat-mode@1.0.0", "", {}, "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg=="], @@ -4731,8 +4644,6 @@ "strnum": ["strnum@1.1.2", "", {}, "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA=="], - "strtok3": ["strtok3@6.3.0", "", { "dependencies": { "@tokenizer/token": "^0.3.0", "peek-readable": "^4.1.0" } }, "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw=="], - "stubborn-fs": ["stubborn-fs@2.0.0", "", { "dependencies": { "stubborn-utils": "^1.0.1" } }, "sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA=="], "stubborn-utils": ["stubborn-utils@1.0.2", "", {}, "sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg=="], @@ -4785,8 +4696,6 @@ "thread-stream": ["thread-stream@4.0.0", "", { "dependencies": { "real-require": "^0.2.0" } }, "sha512-4iMVL6HAINXWf1ZKZjIPcz5wYaOdPhtO8ATvZ+Xqp3BTdaqtAwQkNmKORqcIo5YkQqGXq5cwfswDwMqqQNrpJA=="], - "three": ["three@0.177.0", "", {}, "sha512-EiXv5/qWAaGI+Vz2A+JfavwYCMdGjxVsrn3oBwllUoqYeaBO75J63ZfyaQKoiLrqNHoTlUc6PFgMXnS0kI45zg=="], - "thunky": ["thunky@1.1.0", "", {}, "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA=="], "tiny-async-pool": ["tiny-async-pool@1.3.0", "", { "dependencies": { "semver": "^5.5.0" } }, "sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA=="], @@ -4799,8 +4708,6 @@ "tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="], - "tinycolor2": ["tinycolor2@1.6.0", "", {}, "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw=="], - "tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="], "tinyglobby": ["tinyglobby@0.2.16", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg=="], @@ -4821,8 +4728,6 @@ "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], - "token-types": ["token-types@4.2.1", "", { "dependencies": { "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } }, "sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ=="], - "toml": ["toml@4.1.1", "", {}, "sha512-EBJnVBr3dTXdA89WVFoAIPUqkBjxPMwRqsfuo1r240tKFHXv3zgca4+NJib/h6TyvGF7vOawz0jGuryJCdNHrw=="], "toolbeam-docs-theme": ["toolbeam-docs-theme@0.4.8", "", { "peerDependencies": { "@astrojs/starlight": "^0.34.3", "astro": "^5.7.13" } }, "sha512-b+5ynEFp4Woe5a22hzNQm42lD23t13ZMihVxHbzjA50zdcM9aOSJTIjdJ0PDSd4/50HbBXcpHiQsz6rM4N88ww=="], @@ -4975,8 +4880,6 @@ "utf8-byte-length": ["utf8-byte-length@1.0.5", "", {}, "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA=="], - "utif2": ["utif2@4.1.0", "", { "dependencies": { "pako": "^1.0.11" } }, "sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w=="], - "util": ["util@0.12.5", "", { "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", "which-typed-array": "^1.1.2" } }, "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA=="], "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], @@ -5105,8 +5008,6 @@ "xdg-basedir": ["xdg-basedir@5.1.0", "", {}, "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ=="], - "xml-parse-from-string": ["xml-parse-from-string@1.0.1", "", {}, "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g=="], - "xml2js": ["xml2js@0.6.2", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA=="], "xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], @@ -5459,46 +5360,10 @@ "@gitlab/opencode-gitlab-auth/open": ["open@10.2.0", "", { "dependencies": { "default-browser": "^5.2.1", "define-lazy-prop": "^3.0.0", "is-inside-container": "^1.0.0", "wsl-utils": "^0.1.0" } }, "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA=="], - "@happy-dom/global-registrator/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@hey-api/openapi-ts/open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="], "@hey-api/openapi-ts/semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], - "@jimp/core/mime": ["mime@3.0.0", "", { "bin": { "mime": "cli.js" } }, "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A=="], - - "@jimp/plugin-blit/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-circle/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-color/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-contain/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-cover/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-crop/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-displace/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-fisheye/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-flip/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-mask/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-print/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-quantize/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-resize/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-rotate/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/plugin-threshold/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "@jimp/types/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - "@jsx-email/cli/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], "@jsx-email/cli/esbuild": ["esbuild@0.19.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.19.12", "@esbuild/android-arm": "0.19.12", "@esbuild/android-arm64": "0.19.12", "@esbuild/android-x64": "0.19.12", "@esbuild/darwin-arm64": "0.19.12", "@esbuild/darwin-x64": "0.19.12", "@esbuild/freebsd-arm64": "0.19.12", "@esbuild/freebsd-x64": "0.19.12", "@esbuild/linux-arm": "0.19.12", "@esbuild/linux-arm64": "0.19.12", "@esbuild/linux-ia32": "0.19.12", "@esbuild/linux-loong64": "0.19.12", "@esbuild/linux-mips64el": "0.19.12", "@esbuild/linux-ppc64": "0.19.12", "@esbuild/linux-riscv64": "0.19.12", "@esbuild/linux-s390x": "0.19.12", "@esbuild/linux-x64": "0.19.12", "@esbuild/netbsd-x64": "0.19.12", "@esbuild/openbsd-x64": "0.19.12", "@esbuild/sunos-x64": "0.19.12", "@esbuild/win32-arm64": "0.19.12", "@esbuild/win32-ia32": "0.19.12", "@esbuild/win32-x64": "0.19.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg=="], @@ -5585,6 +5450,12 @@ "@openauthjs/openauth/jose": ["jose@5.9.6", "", {}, "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ=="], + "@opencode-ai/core/@ai-sdk/anthropic": ["@ai-sdk/anthropic@3.0.71", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-bUWOzrzR0gJKJO/PLGMR4uH2dqEgqGhrsCV+sSpk4KtOEnUQlfjZI/F7BFlqSvVpFbjdgYRRLysAeEZpJ6S1lg=="], + + "@opencode-ai/core/@ai-sdk/openai": ["@ai-sdk/openai@3.0.53", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Wld+Rbc05KaUn08uBt06eEuwcgalcIFtIl32Yp+GxuZXUQwOb6YeAuq+C6da4ch6BurFoqEaLemJVwjBb7x+PQ=="], + + "@opencode-ai/core/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@2.0.41", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-kNAGINk71AlOXx10Dq/PXw4t/9XjdK8uxfpVElRwtSFMdeSiLVt58p9TPx4/FJD+hxZuVhvxYj9r42osxWq79g=="], + "@opencode-ai/desktop/@actions/artifact": ["@actions/artifact@4.0.0", "", { "dependencies": { "@actions/core": "^1.10.0", "@actions/github": "^6.0.1", "@actions/http-client": "^2.1.0", "@azure/core-http": "^3.0.5", "@azure/storage-blob": "^12.15.0", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@protobuf-ts/plugin": "^2.2.3-alpha.1", "archiver": "^7.0.1", "jwt-decode": "^3.1.2", "unzip-stream": "^0.3.1" } }, "sha512-HCc2jMJRAfviGFAh0FsOR/jNfWhirxl7W6z8zDtttt0GltwxBLdEIjLiweOPFl9WbyJRW1VWnPUSAixJqcWUMQ=="], "@opencode-ai/desktop/marked": ["marked@15.0.12", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA=="], @@ -5637,24 +5508,16 @@ "@slack/bolt/path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="], - "@slack/logger/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@slack/oauth/@slack/logger": ["@slack/logger@3.0.0", "", { "dependencies": { "@types/node": ">=12.0.0" } }, "sha512-DTuBFbqu4gGfajREEMrkq5jBhcnskinhr4+AnfJEk48zhVeEv3XnUKGIX98B74kxhYsIMfApGGySTn7V3b5yBA=="], - "@slack/oauth/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@slack/socket-mode/@slack/logger": ["@slack/logger@3.0.0", "", { "dependencies": { "@types/node": ">=12.0.0" } }, "sha512-DTuBFbqu4gGfajREEMrkq5jBhcnskinhr4+AnfJEk48zhVeEv3XnUKGIX98B74kxhYsIMfApGGySTn7V3b5yBA=="], - "@slack/socket-mode/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@slack/socket-mode/@types/ws": ["@types/ws@7.4.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww=="], "@slack/socket-mode/ws": ["ws@7.5.10", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ=="], "@slack/web-api/@slack/logger": ["@slack/logger@3.0.0", "", { "dependencies": { "@types/node": ">=12.0.0" } }, "sha512-DTuBFbqu4gGfajREEMrkq5jBhcnskinhr4+AnfJEk48zhVeEv3XnUKGIX98B74kxhYsIMfApGGySTn7V3b5yBA=="], - "@slack/web-api/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@slack/web-api/eventemitter3": ["eventemitter3@3.1.2", "", {}, "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q=="], "@slack/web-api/form-data": ["form-data@2.5.5", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.35", "safe-buffer": "^5.2.1" } }, "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A=="], @@ -5715,62 +5578,8 @@ "@testing-library/dom/dom-accessibility-api": ["dom-accessibility-api@0.5.16", "", {}, "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg=="], - "@types/body-parser/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/cacache/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/cacheable-request/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/connect/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/cross-spawn/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/express-serve-static-core/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/fontkit/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/fs-extra/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/is-stream/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/jsonwebtoken/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/keyv/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/mssql/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/node-fetch/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/npm-registry-fetch/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/npmcli__arborist/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/npmlog/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/pacote/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/plist/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@types/plist/xmlbuilder": ["xmlbuilder@15.1.1", "", {}, "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg=="], - "@types/readable-stream/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/responselike/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/sax/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/send/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/serve-static/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/ssri/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/tunnel/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/ws/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "@types/yauzl/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "@vitest/expect/@vitest/utils": ["@vitest/utils@3.2.4", "", { "dependencies": { "@vitest/pretty-format": "3.2.4", "loupe": "^3.1.4", "tinyrainbow": "^2.0.0" } }, "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA=="], "@vitest/expect/tinyrainbow": ["tinyrainbow@2.0.0", "", {}, "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw=="], @@ -5847,18 +5656,12 @@ "builder-util-runtime/sax": ["sax@1.6.0", "", {}, "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA=="], - "bun-types/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - - "bun-webgpu/@webgpu/types": ["@webgpu/types@0.1.69", "", {}, "sha512-RPmm6kgRbI8e98zSD3RVACvnuktIja5+yLgDAkTmxLr90BEwdTXRQWNLF3ETTTyH/8mKhznZuN5AveXYFEsMGQ=="], - "c12/chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="], "c12/dotenv": ["dotenv@17.4.2", "", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="], "clone-response/mimic-response": ["mimic-response@1.0.1", "", {}, "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="], - "cloudflare/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "compress-commons/is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], "condense-newlines/kind-of": ["kind-of@3.2.2", "", { "dependencies": { "is-buffer": "^1.1.5" } }, "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ=="], @@ -5893,8 +5696,6 @@ "effect/@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], - "electron/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "electron-builder/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], "electron-builder/yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="], @@ -5949,8 +5750,6 @@ "gray-matter/js-yaml": ["js-yaml@3.14.2", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg=="], - "happy-dom/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "happy-dom/ws": ["ws@8.20.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA=="], "html-minifier-terser/commander": ["commander@10.0.1", "", {}, "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug=="], @@ -5963,8 +5762,6 @@ "iconv-corefoundation/node-addon-api": ["node-addon-api@1.7.2", "", {}, "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg=="], - "image-q/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "js-beautify/glob": ["glob@10.5.0", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg=="], "js-beautify/nopt": ["nopt@7.2.1", "", { "dependencies": { "abbrev": "^2.0.0" }, "bin": { "nopt": "bin/nopt.js" } }, "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w=="], @@ -6037,9 +5834,9 @@ "openid-client/lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], - "opentui-spinner/@opentui/core": ["@opentui/core@0.1.105", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "marked": "17.0.1", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.105", "@opentui/core-darwin-x64": "0.1.105", "@opentui/core-linux-arm64": "0.1.105", "@opentui/core-linux-x64": "0.1.105", "@opentui/core-win32-arm64": "0.1.105", "@opentui/core-win32-x64": "0.1.105", "bun-webgpu": "0.1.5", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-vllSOOCW6VIThV/96GRLJ1IxIBuR+ci6FDvnPIAG4s7SJ/FW6zAkqDn1xrtBwwk/lM3QWjLqy8BZc+zwWvveJA=="], + "opentui-spinner/@opentui/core": ["@opentui/core@0.2.7", "", { "dependencies": { "bun-ffi-structs": "0.2.2", "diff": "9.0.0", "marked": "17.0.1", "string-width": "7.2.0", "strip-ansi": "7.1.2", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@opentui/core-darwin-arm64": "0.2.7", "@opentui/core-darwin-x64": "0.2.7", "@opentui/core-linux-arm64": "0.2.7", "@opentui/core-linux-x64": "0.2.7", "@opentui/core-win32-arm64": "0.2.7", "@opentui/core-win32-x64": "0.2.7" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-cnN6JcaGC7SeQzobBy/CHzqUAQFtypazuw1CjQBo7WwoOiLMGubt9W5FXeF0zIrSxH2Ed6NLWhPYRg7SD4629Q=="], - "opentui-spinner/@opentui/solid": ["@opentui/solid@0.1.105", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.105", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.10", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.11" } }, "sha512-uxnaMP802sCI487pv/Hk9xdFdIj9mkg3eNliAqbqR0Shmd4phcjKEZvPRpijjmI99j4s9nul71jzF3h1oz31Nw=="], + "opentui-spinner/@opentui/solid": ["@opentui/solid@0.2.7", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.2.7", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.12", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.12" } }, "sha512-nlkx9HvuWaHtc5A8eUEAPNi+5+37LZS3ln73WRmtT5xin8LnQf+yhwopqGgPSnLq1ODLwhkKRdr/9JCDr2j7Bg=="], "ora/bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="], @@ -6053,14 +5850,10 @@ "p-retry/retry": ["retry@0.13.1", "", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="], - "parse-bmfont-xml/xml2js": ["xml2js@0.5.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA=="], - "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], "parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], - "pixelmatch/pngjs": ["pngjs@6.0.0", "", {}, "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg=="], - "pkg-dir/find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="], "pkg-up/find-up": ["find-up@3.0.0", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="], @@ -6085,8 +5878,6 @@ "proper-lockfile/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], - "protobufjs/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "raw-body/iconv-lite": ["iconv-lite@0.4.24", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="], "readable-stream/buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="], @@ -6117,8 +5908,6 @@ "shiki/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], - "sitemap/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "sitemap/sax": ["sax@1.6.0", "", {}, "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA=="], "slice-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="], @@ -6141,20 +5930,14 @@ "strip-ansi-cjs/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], - "stripe/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "sucrase/commander": ["commander@4.1.1", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="], "tar/yallist": ["yallist@5.0.0", "", {}, "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw=="], - "tedious/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "terser/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], "tiny-async-pool/semver": ["semver@5.7.2", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="], - "token-types/ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], - "tree-sitter-bash/node-addon-api": ["node-addon-api@8.7.0", "", {}, "sha512-9MdFxmkKaOYVTV+XVRG8ArDwwQ77XIgIPyKASB1k3JPq3M8fGQQQE3YpMOrKm6g//Ktx8ivZr8xo1Qmtqub+GA=="], "tw-to-css/postcss": ["postcss@8.4.31", "", { "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ=="], @@ -6171,8 +5954,6 @@ "uri-js/punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], - "utif2/pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="], - "venice-ai-sdk-provider/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@2.0.41", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-kNAGINk71AlOXx10Dq/PXw4t/9XjdK8uxfpVElRwtSFMdeSiLVt58p9TPx4/FJD+hxZuVhvxYj9r42osxWq79g=="], "vite-plugin-icons-spritesheet/glob": ["glob@11.1.0", "", { "dependencies": { "foreground-child": "^3.3.1", "jackspeak": "^4.1.1", "minimatch": "^10.1.1", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw=="], @@ -6487,8 +6268,6 @@ "@gitlab/opencode-gitlab-auth/open/wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], - "@happy-dom/global-registrator/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "@jsx-email/cli/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.19.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA=="], "@jsx-email/cli/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.19.12", "", { "os": "android", "cpu": "arm" }, "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w=="], @@ -6683,14 +6462,6 @@ "@sentry/cli/which/isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], - "@slack/logger/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@slack/oauth/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@slack/socket-mode/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@slack/web-api/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "@slack/web-api/form-data/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], "@slack/web-api/p-queue/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], @@ -6717,60 +6488,6 @@ "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime/@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="], - "@types/body-parser/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/cacache/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/cacheable-request/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/connect/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/cross-spawn/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/express-serve-static-core/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/fontkit/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/fs-extra/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/is-stream/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/jsonwebtoken/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/keyv/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/mssql/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/node-fetch/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/npm-registry-fetch/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/npmcli__arborist/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/npmlog/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/pacote/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/plist/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/readable-stream/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/responselike/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/sax/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/send/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/serve-static/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/ssri/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/tunnel/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/ws/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@types/yauzl/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "@vitest/expect/@vitest/utils/@vitest/pretty-format": ["@vitest/pretty-format@3.2.4", "", { "dependencies": { "tinyrainbow": "^2.0.0" } }, "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA=="], "accepts/mime-types/mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], @@ -6819,12 +6536,8 @@ "body-parser/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], - "bun-types/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "c12/chokidar/readdirp": ["readdirp@5.0.0", "", {}, "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ=="], - "cloudflare/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "crc/buffer/ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], "cross-spawn/which/isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], @@ -6843,8 +6556,6 @@ "electron-winstaller/fs-extra/universalify": ["universalify@0.1.2", "", {}, "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="], - "electron/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "esbuild-plugin-copy/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], "express/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], @@ -6857,14 +6568,10 @@ "gray-matter/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="], - "happy-dom/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "iconv-corefoundation/cli-truncate/slice-ansi": ["slice-ansi@3.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" } }, "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ=="], "iconv-corefoundation/cli-truncate/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], - "image-q/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "js-beautify/glob/jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="], "js-beautify/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="], @@ -6883,8 +6590,6 @@ "motion/framer-motion/motion-utils": ["motion-utils@12.36.0", "", {}, "sha512-eHWisygbiwVvf6PZ1vhaHCLamvkSbPIeAYxWUuL3a2PD/TROgE7FvfHWTIH4vMl798QLfMw15nRqIaRDXTlYRg=="], - "mssql/tedious/@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="], - "mssql/tedious/iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], "opencode-gitlab-auth/open/wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], @@ -6903,24 +6608,22 @@ "opencontrol/@modelcontextprotocol/sdk/zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="], - "opentui-spinner/@opentui/core/@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.105", "", { "os": "darwin", "cpu": "arm64" }, "sha512-1pIL7aer9amwj8EpYoMNtvavKetIe+nX8uBRmYsMQb+KvJoUAZUqENfRW+qHE5WrsOyxx8/QoyXTHw15GG5iLQ=="], + "opentui-spinner/@opentui/core/@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.2.7", "", { "os": "darwin", "cpu": "arm64" }, "sha512-CAy6cL3byz2Xf6gFiJHBpcnsp/2ADEWLLOUokVypOyPLcy8GY3sPzlA4pkAjVGQMYQhDj+Y3+SXz4uTLt4AETg=="], - "opentui-spinner/@opentui/core/@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.105", "", { "os": "darwin", "cpu": "x64" }, "sha512-hLIRSWlK3gY2NRXJGWiTBiMYSmRDjOYFZF6WtUVXhY2SL3sp08dhmr/6dmAVH+3pKCsCipLEsrrcQX6SAihCTA=="], + "opentui-spinner/@opentui/core/@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.2.7", "", { "os": "darwin", "cpu": "x64" }, "sha512-K06h333rMkC9cyMJr/VvcRK3ik81Admd8ZsES5uf5YXWPdYhXGf75I1T8mKIThhUmoFLb8R5xqfuPmoocsjM7Q=="], - "opentui-spinner/@opentui/core/@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.105", "", { "os": "linux", "cpu": "arm64" }, "sha512-jlRKfPkozTZEkHEePuCWYcTIUtPm+ieInAwGVqGmjbvqjxdVv1/W/Dt6LEZ/9jpRiOPd+FjXAfLe6wa/XWHr+w=="], + "opentui-spinner/@opentui/core/@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.2.7", "", { "os": "linux", "cpu": "arm64" }, "sha512-iYWGTztbdG9yYSB5Alxuo0dWAmkWQR0+/paNWUyPOocjigmKgMmACDtHgYqa7sxkIcWgmXljt/f8rgXDG4wdMg=="], - "opentui-spinner/@opentui/core/@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.105", "", { "os": "linux", "cpu": "x64" }, "sha512-kfWS1WMg6qHShmxZX9s1tZc/8JcXw6uyy2UtyTbJdRFExtXGH37oKHi8QK8iPL2ExCx4z7zqVnVJfO3X/Wh7lA=="], + "opentui-spinner/@opentui/core/@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.2.7", "", { "os": "linux", "cpu": "x64" }, "sha512-tymBCfYbsDRfHQNXsolkFfaTEIDhemD4+1ZovUztQd7i+0Ggnu9WbPN1SNCiRz6PjrlaNeQzZE3Wl8FfVdw/cw=="], - "opentui-spinner/@opentui/core/@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.105", "", { "os": "win32", "cpu": "arm64" }, "sha512-UFx6A8OpBVbGWK6OAw4GqAqKZgIITJfSOd35pG9yDVKQouHN2OGc2HeeXrH2A4h42p40Xl6IfcqqfllkpC13Dg=="], + "opentui-spinner/@opentui/core/@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.2.7", "", { "os": "win32", "cpu": "arm64" }, "sha512-XLPJWdT8QOukrYDkpIng6+uNUlF66ByXcQlC3qA9JbrUTBetZhgXs8Q2jEjRfc+Ty3uh1iRSA6PgJGbbOK/f4Q=="], - "opentui-spinner/@opentui/core/@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.105", "", { "os": "win32", "cpu": "x64" }, "sha512-f9FqqUmxehwhF+cgyazm0YT0v0BYTTCPzd6eztqhl74N3x/kC+jOOz2rdJDC/tTBo1JVsF64KupOnhIs6/Cogg=="], + "opentui-spinner/@opentui/core/@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.2.7", "", { "os": "win32", "cpu": "x64" }, "sha512-CzVGEfqysVk8Hxcj0RDv/DtXIM6iZmbmr23kW7y8CJMPtmV1gmKI4D9abVjynWJnGbaSBnDi43mgZnGMgOdyEg=="], - "opentui-spinner/@opentui/core/bun-ffi-structs": ["bun-ffi-structs@0.1.2", "", { "peerDependencies": { "typescript": "^5" } }, "sha512-Lh1oQAYHDcnesJauieA4UNkWGXY9hYck7OA5IaRwE3Bp6K2F2pJSNYqq+hIy7P3uOvo3km3oxS8304g5gDMl/w=="], + "opentui-spinner/@opentui/core/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="], "opentui-spinner/@opentui/solid/@babel/core": ["@babel/core@7.28.0", "", { "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.0", "@babel/helper-compilation-targets": "^7.27.2", "@babel/helper-module-transforms": "^7.27.3", "@babel/helpers": "^7.27.6", "@babel/parser": "^7.28.0", "@babel/template": "^7.27.2", "@babel/traverse": "^7.28.0", "@babel/types": "^7.28.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ=="], - "opentui-spinner/@opentui/solid/babel-preset-solid": ["babel-preset-solid@1.9.10", "", { "dependencies": { "babel-plugin-jsx-dom-expressions": "^0.40.3" }, "peerDependencies": { "@babel/core": "^7.0.0", "solid-js": "^1.9.10" }, "optionalPeers": ["solid-js"] }, "sha512-HCelrgua/Y+kqO8RyL04JBWS/cVdrtUv/h45GntgQY+cJl4eBcKkCDV3TdMjtKx1nXwRaR9QXslM/Npm1dxdZQ=="], - "ora/bl/buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="], "ora/bl/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], @@ -6929,14 +6632,10 @@ "p-locate/p-limit/yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], - "parse-bmfont-xml/xml2js/sax": ["sax@1.6.0", "", {}, "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA=="], - "pkg-dir/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], "pkg-up/find-up/locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="], - "protobufjs/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "readable-stream/buffer/ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], "readdir-glob/minimatch/brace-expansion": ["brace-expansion@2.1.0", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w=="], @@ -6947,16 +6646,10 @@ "send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], - "sitemap/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "storybook/open/wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], "string-width-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], - "stripe/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "tedious/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "tw-to-css/tailwindcss/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], "tw-to-css/tailwindcss/glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], @@ -7259,8 +6952,6 @@ "js-beautify/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], - "mssql/tedious/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "opencontrol/@modelcontextprotocol/sdk/express/accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], "opencontrol/@modelcontextprotocol/sdk/express/body-parser": ["body-parser@2.2.2", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.1", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA=="], diff --git a/bunfig.toml b/bunfig.toml index 36a21d9332a3..47c4ac53965b 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,6 +1,8 @@ [install] exact = true +# Only install newly resolved package versions published at least 3 days ago. +minimumReleaseAge = 259200 +minimumReleaseAgeExcludes = ["@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-x64", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid"] [test] root = "./do-not-run-tests-from-root" - diff --git a/infra/console.ts b/infra/console.ts index ab6502a8f875..56befe6268cb 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -293,3 +293,13 @@ new sst.cloudflare.x.SolidStart("Console", { }, }, }) + +//////////////// +// HELPERS +//////////////// + +export const stat = new sst.cloudflare.Worker("Stat", { + handler: "packages/console/function/src/stat.ts", + link: [database], + url: true, +}) diff --git a/infra/monitoring.ts b/infra/monitoring.ts index c08d39f26202..240e6c97ee1f 100644 --- a/infra/monitoring.ts +++ b/infra/monitoring.ts @@ -111,6 +111,34 @@ const providerHttpErrorsQuery = (product: "go" | "zen") => { }).json } +const modelLowTpsQuery = (product: "go" | "zen") => { + const filters = [ + { column: "model", op: "exists" }, + { column: "event_type", op: "=", value: "completions" }, + { column: "user_agent", op: "contains", value: "opencode" }, + { column: "isGoTier", op: "=", value: product === "go" ? "true" : "false" }, + { column: "status", op: ">=", value: "200" }, + { column: "status", op: "<", value: "400" }, + { column: "tps.output", op: "exists" }, + ] + + return honeycomb.getQuerySpecificationOutput({ + breakdowns: ["model"], + calculations: [ + { op: "COUNT", name: "TOTAL", filterCombination: "AND", filters }, + { + op: "P50", + name: "TPS", + column: "tps.output", + filterCombination: "AND", + filters, + }, + ], + formulas: [{ name: "LOW_TPS", expression: "IF(GTE($TOTAL, 100), $TPS, 999)" }], + timeRange: 1800, + }).json +} + new honeycomb.Trigger("IncreasedModelHttpErrorsGo", { name: "Increased Model HTTP Errors [Go]", description, @@ -149,6 +177,44 @@ new honeycomb.Trigger("IncreasedModelHttpErrorsZen", { ], }) +new honeycomb.Trigger("LowModelTpsGo", { + name: "Low Model TPS [Go]", + description, + queryJson: modelLowTpsQuery("go"), + alertType: "on_change", + frequency: 600, + thresholds: [{ op: "<=", value: 10, exceededLimit: 1 }], + recipients: [ + { + id: webhookRecipient.id, + notificationDetails: [ + { + variables: [{ name: "type", value: "model_low_tps" }], + }, + ], + }, + ], +}) + +new honeycomb.Trigger("LowModelTpsZen", { + name: "Low Model TPS [Zen]", + description, + queryJson: modelLowTpsQuery("zen"), + alertType: "on_change", + frequency: 600, + thresholds: [{ op: "<=", value: 10, exceededLimit: 1 }], + recipients: [ + { + id: webhookRecipient.id, + notificationDetails: [ + { + variables: [{ name: "type", value: "model_low_tps" }], + }, + ], + }, + ], +}) + new honeycomb.Trigger("IncreasedProviderHttpErrorsGo", { name: "Increased Provider HTTP Errors [Go]", description, diff --git a/nix/hashes.json b/nix/hashes.json index 33003919af55..0e3f9c49a055 100644 --- a/nix/hashes.json +++ b/nix/hashes.json @@ -1,8 +1,8 @@ { "nodeModules": { - "x86_64-linux": "sha256-Q9r1S15YL9LQK7DRhuOpw3Fxi24BPovEM995GZJayKw=", - "aarch64-linux": "sha256-C0rRTLnxxuuEkCBc3JZbkR66TUVwpcPFif3BU9GRAuA=", - "aarch64-darwin": "sha256-1HvalOO/pOkRlYH8CZ93psapt90C+pYzui1JCadBE1Q=", - "x86_64-darwin": "sha256-RrndyLWfhWm4mZ88XytFF2NI+ly8la550Z5LBN/g5u4=" + "x86_64-linux": "sha256-Hw7sVV9rTm6qBMtdwfLIV2QvxvLQY5qrywXzuyYbhcs=", + "aarch64-linux": "sha256-++oXnY7YqrYt0Qv7ZISmoHliARM9qEP8FacqLxGZH1c=", + "aarch64-darwin": "sha256-kZVa0R1YbuvtTzpETqK6ddj4ISje5jBFHBdlynkhW7Q=", + "x86_64-darwin": "sha256-94eagNDa8GGJxF8BsMX2BF5Pa+QTl48lXL1+6HgEn0I=" } } diff --git a/package.json b/package.json index 6d82864d6d59..a3400fbfb9a2 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,9 @@ "@types/cross-spawn": "6.0.6", "@octokit/rest": "22.0.0", "@hono/zod-validator": "0.4.2", - "@opentui/core": "0.2.6", - "@opentui/keymap": "0.2.6", - "@opentui/solid": "0.2.6", + "@opentui/core": "0.2.10", + "@opentui/keymap": "0.2.10", + "@opentui/solid": "0.2.10", "ulid": "3.0.1", "@kobalte/core": "0.13.11", "@types/luxon": "3.7.1", @@ -128,6 +128,9 @@ "electron" ], "overrides": { + "@opentui/core": "catalog:", + "@opentui/keymap": "catalog:", + "@opentui/solid": "catalog:", "@types/bun": "catalog:", "@types/node": "catalog:" }, diff --git a/packages/app/package.json b/packages/app/package.json index 9eb4083725c6..5e033f263c3e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/app", - "version": "1.14.48", + "version": "1.15.0", "description": "", "type": "module", "exports": { @@ -73,7 +73,6 @@ "solid-js": "catalog:", "solid-list": "catalog:", "tailwindcss": "catalog:", - "virtua": "catalog:", - "zod": "catalog:" + "virtua": "catalog:" } } diff --git a/packages/app/src/components/dialog-select-file.tsx b/packages/app/src/components/dialog-select-file.tsx index 63a321e46a4f..ac3bc03e44ec 100644 --- a/packages/app/src/components/dialog-select-file.tsx +++ b/packages/app/src/components/dialog-select-file.tsx @@ -107,7 +107,8 @@ function createCommandEntries(props: { const allowed = createMemo(() => { if (props.filesOnly()) return [] return props.command.options.filter( - (option) => !option.disabled && !option.id.startsWith("suggested.") && option.id !== "file.open", + (option) => + !option.disabled && !option.hidden && !option.id.startsWith("suggested.") && option.id !== "file.open", ) }) diff --git a/packages/app/src/components/dialog-select-mcp.tsx b/packages/app/src/components/dialog-select-mcp.tsx index 576ec8fec4b7..5a28173ead80 100644 --- a/packages/app/src/components/dialog-select-mcp.tsx +++ b/packages/app/src/components/dialog-select-mcp.tsx @@ -6,12 +6,14 @@ import { Dialog } from "@opencode-ai/ui/dialog" import { List } from "@opencode-ai/ui/list" import { Switch } from "@opencode-ai/ui/switch" import { useLanguage } from "@/context/language" -import { mcpQueryKey } from "@/context/global-sync" +import { useQueryOptions } from "@/context/global-sync" +import { pathKey } from "@/utils/path-key" const statusLabels = { connected: "mcp.status.connected", failed: "mcp.status.failed", needs_auth: "mcp.status.needs_auth", + needs_client_registration: "mcp.status.needs_client_registration", disabled: "mcp.status.disabled", } as const @@ -20,6 +22,7 @@ export const DialogSelectMcp: Component = () => { const sdk = useSDK() const language = useLanguage() const queryClient = useQueryClient() + const queryOptions = useQueryOptions() const items = createMemo(() => Object.entries(sync.data.mcp ?? {}) @@ -29,10 +32,18 @@ export const DialogSelectMcp: Component = () => { const toggle = useMutation(() => ({ mutationFn: async (name: string) => { - if (sync.data.mcp[name]?.status === "connected") await sdk.client.mcp.disconnect({ name }) - else await sdk.client.mcp.connect({ name }) + const status = sync.data.mcp[name] + if (status?.status === "connected") { + await sdk.client.mcp.disconnect({ name }) + return + } + if (status?.status === "needs_auth") { + await sdk.client.mcp.auth.authenticate({ name }) + return + } + await sdk.client.mcp.connect({ name }) }, - onSuccess: () => queryClient.refetchQueries({ queryKey: mcpQueryKey(sync.directory) }), + onSuccess: () => queryClient.refetchQueries(queryOptions.mcp(pathKey(sync.directory))), })) const enabledCount = createMemo(() => items().filter((i) => i.status === "connected").length) @@ -65,7 +76,7 @@ export const DialogSelectMcp: Component = () => { } const error = () => { const s = mcpStatus() - return s?.status === "failed" ? s.error : undefined + if (s?.status === "failed" || s?.status === "needs_client_registration") return s.error } const enabled = () => status() === "connected" return ( @@ -76,9 +87,6 @@ export const DialogSelectMcp: Component = () => { {statusLabel()} - - {language.t("common.loading.ellipsis")} - {error()} diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 2417fa98e25a..1e1be28b5961 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -16,7 +16,6 @@ import { } from "@/context/prompt" import { useLayout } from "@/context/layout" import { useSDK } from "@/context/sdk" -import { useGlobalSDK } from "@/context/global-sdk" import { useSync } from "@/context/sync" import { useComments } from "@/context/comments" import { Button } from "@opencode-ai/ui/button" @@ -56,7 +55,8 @@ import { PromptDragOverlay } from "./prompt-input/drag-overlay" import { promptPlaceholder } from "./prompt-input/placeholder" import { ImagePreview } from "@opencode-ai/ui/image-preview" import { useQueries } from "@tanstack/solid-query" -import { loadAgentsQuery, loadProvidersQuery } from "@/context/global-sync/bootstrap" +import { useQueryOptions } from "@/context/global-sync" +import { pathKey } from "@/utils/path-key" interface PromptInputProps { class?: string @@ -103,7 +103,7 @@ const NON_EMPTY_TEXT = /[^\s\u200B]/ export const PromptInput: Component = (props) => { const sdk = useSDK() - const globalSDK = useGlobalSDK() + const queryOptions = useQueryOptions() const sync = useSync() const local = useLocal() @@ -240,13 +240,7 @@ export const PromptInput: Component = (props) => { return paths }) const info = createMemo(() => (params.id ? sync.session.get(params.id) : undefined)) - const status = createMemo( - () => - sync.data.session_status[params.id ?? ""] ?? { - type: "idle", - }, - ) - const working = createMemo(() => status()?.type !== "idle") + const working = createMemo(() => sync.data.session_working(params.id ?? "")) const imageAttachments = createMemo(() => prompt.current().filter((part): part is ImageAttachmentPart => part.type === "image"), ) @@ -1256,9 +1250,9 @@ export const PromptInput: Component = (props) => { const [agentsQuery, globalProvidersQuery, providersQuery] = useQueries(() => ({ queries: [ - loadAgentsQuery(sdk.directory, sdk.client), - loadProvidersQuery(null, globalSDK.client), - loadProvidersQuery(sdk.directory, sdk.client), + queryOptions.agents(pathKey(sdk.directory)), + queryOptions.providers(null), + queryOptions.providers(pathKey(sdk.directory)), ], })) diff --git a/packages/app/src/components/prompt-input/submit.test.ts b/packages/app/src/components/prompt-input/submit.test.ts index 83b6212dcc56..7e8d0eb40742 100644 --- a/packages/app/src/components/prompt-input/submit.test.ts +++ b/packages/app/src/components/prompt-input/submit.test.ts @@ -1,10 +1,12 @@ import { beforeAll, beforeEach, describe, expect, mock, test } from "bun:test" import type { Prompt } from "@/context/prompt" +import { Worktree } from "@/utils/worktree" let createPromptSubmit: typeof import("./submit").createPromptSubmit const createdClients: string[] = [] const createdSessions: string[] = [] +const createdSessionInputs: unknown[] = [] const enabledAutoAccept: Array<{ sessionID: string; directory: string }> = [] const optimistic: Array<{ directory?: string @@ -20,18 +22,26 @@ const storedSessions: Record> = {} const promoted: Array<{ directory: string; sessionID: string }> = [] const sentShell: string[] = [] const syncedDirectories: string[] = [] +const goalActions: Array<{ action: string; sessionID: string; objective?: string; status?: string }> = [] +const toasts: Array<{ title?: string; description?: string }> = [] +type GoalTestData = { id: string; sessionID: string; objective: string; status: string } +let goalGetData: GoalTestData | undefined +let goalUpdateData: GoalTestData | undefined let params: { id?: string } = {} let selected = "/repo/worktree-a" let variant: string | undefined -const promptValue: Prompt = [{ type: "text", content: "ls", start: 0, end: 2 }] +let promptValue: Prompt = [{ type: "text", content: "ls", start: 0, end: 2 }] + +const flush = () => new Promise((resolve) => setTimeout(resolve, 0)) const clientFor = (directory: string) => { createdClients.push(directory) return { session: { - create: async () => { + create: async (input?: unknown) => { + createdSessionInputs.push(input) createdSessions.push(directory) return { data: { @@ -48,6 +58,21 @@ const clientFor = (directory: string) => { promptAsync: async () => ({ data: undefined }), command: async () => ({ data: undefined }), abort: async () => ({ data: undefined }), + goal: { + get: async () => ({ data: goalGetData }), + create: async (input: { sessionID: string; objective: string }) => { + goalActions.push({ action: "create", ...input }) + return { data: undefined } + }, + update: async (input: { sessionID: string; objective?: string; status?: string }) => { + goalActions.push({ action: "update", ...input }) + return { data: goalUpdateData } + }, + clear: async (input: { sessionID: string }) => { + goalActions.push({ action: "clear", ...input }) + return { data: undefined } + }, + }, }, worktree: { create: async () => ({ data: { directory: `${directory}/new` } }), @@ -71,7 +96,10 @@ beforeAll(async () => { })) mock.module("@opencode-ai/ui/toast", () => ({ - showToast: () => 0, + showToast: (input: { title?: string; description?: string }) => { + toasts.push(input) + return 0 + }, })) mock.module("@opencode-ai/core/util/encode", () => ({ @@ -204,6 +232,7 @@ beforeAll(async () => { beforeEach(() => { createdClients.length = 0 createdSessions.length = 0 + createdSessionInputs.length = 0 enabledAutoAccept.length = 0 optimistic.length = 0 optimisticSeeded.length = 0 @@ -211,8 +240,13 @@ beforeEach(() => { params = {} sentShell.length = 0 syncedDirectories.length = 0 + goalActions.length = 0 + toasts.length = 0 + goalGetData = undefined + goalUpdateData = undefined selected = "/repo/worktree-a" variant = undefined + promptValue = [{ type: "text", content: "ls", start: 0, end: 2 }] for (const key of Object.keys(storedSessions)) delete storedSessions[key] }) @@ -342,4 +376,169 @@ describe("prompt submit worktree selection", () => { expect(storedSessions["/repo/worktree-a"]).toEqual([{ id: "session-1", title: "New session 1" }]) expect(optimisticSeeded).toEqual([true]) }) + + test("routes /goal through the native goal API instead of prompt submission", async () => { + params = { id: "session-1" } + promptValue = [{ type: "text", content: "/goal ship app parity\n", start: 0, end: 22 }] + + const submit = createPromptSubmit({ + info: () => ({ id: "session-1" }), + imageAttachments: () => [], + commentCount: () => 0, + autoAccept: () => false, + mode: () => "normal", + working: () => false, + editor: () => undefined, + queueScroll: () => undefined, + promptLength: (value) => value.reduce((sum, part) => sum + ("content" in part ? part.content.length : 0), 0), + addToHistory: () => undefined, + resetHistoryNavigation: () => undefined, + setMode: () => undefined, + setPopover: () => undefined, + onSubmit: () => undefined, + }) + + await submit.handleSubmit({ preventDefault: () => undefined } as unknown as Event) + await flush() + + expect(goalActions).toEqual([{ action: "create", sessionID: "session-1", objective: "ship app parity" }]) + expect(optimistic).toHaveLength(0) + }) + + test("rejects oversized /goal objectives before posting to the goal API", async () => { + params = { id: "session-1" } + const text = `/goal ${"x".repeat(4001)}` + promptValue = [{ type: "text", content: text, start: 0, end: text.length }] + + const submit = createPromptSubmit({ + info: () => ({ id: "session-1" }), + imageAttachments: () => [], + commentCount: () => 0, + autoAccept: () => false, + mode: () => "normal", + working: () => false, + editor: () => undefined, + queueScroll: () => undefined, + promptLength: (value) => value.reduce((sum, part) => sum + ("content" in part ? part.content.length : 0), 0), + addToHistory: () => undefined, + resetHistoryNavigation: () => undefined, + setMode: () => undefined, + setPopover: () => undefined, + onSubmit: () => undefined, + }) + + await submit.handleSubmit({ preventDefault: () => undefined } as unknown as Event) + await flush() + + expect(goalActions).toEqual([]) + expect(toasts.at(-1)?.title).toBe("Goal command failed") + expect(toasts.at(-1)?.description).toContain("Goal objective is too long (4001/4000 characters)") + expect(optimistic).toHaveLength(0) + }) + + test("waits for created worktrees before applying /goal", async () => { + promptValue = [{ type: "text", content: "/goal ship app parity", start: 0, end: 21 }] + + const submit = createPromptSubmit({ + info: () => undefined, + imageAttachments: () => [], + commentCount: () => 0, + autoAccept: () => false, + mode: () => "normal", + working: () => false, + editor: () => undefined, + queueScroll: () => undefined, + promptLength: (value) => value.reduce((sum, part) => sum + ("content" in part ? part.content.length : 0), 0), + addToHistory: () => undefined, + resetHistoryNavigation: () => undefined, + setMode: () => undefined, + setPopover: () => undefined, + newSessionWorktree: () => "create", + onNewSessionWorktreeReset: () => undefined, + onSubmit: () => undefined, + }) + + await submit.handleSubmit({ preventDefault: () => undefined } as unknown as Event) + await flush() + + expect(createdSessions).toEqual(["/repo/main/new"]) + expect(createdSessionInputs[0]).toMatchObject({ + agent: "agent", + model: { providerID: "provider", id: "model" }, + }) + expect(goalActions).toEqual([]) + + Worktree.ready("/repo/main/new") + await flush() + + expect(goalActions).toEqual([{ action: "create", sessionID: "session-1", objective: "ship app parity" }]) + expect(optimistic).toHaveLength(0) + }) + + test("applies /goal controls immediately while followups are queued", async () => { + params = { id: "session-1" } + promptValue = [{ type: "text", content: "/goal pause", start: 0, end: 11 }] + goalGetData = { id: "goal-1", sessionID: "session-1", objective: "ship app parity", status: "active" } + const queued: unknown[] = [] + + const submit = createPromptSubmit({ + info: () => ({ id: "session-1" }), + imageAttachments: () => [], + commentCount: () => 0, + autoAccept: () => false, + mode: () => "normal", + working: () => true, + editor: () => undefined, + queueScroll: () => undefined, + promptLength: (value) => value.reduce((sum, part) => sum + ("content" in part ? part.content.length : 0), 0), + addToHistory: () => undefined, + resetHistoryNavigation: () => undefined, + setMode: () => undefined, + setPopover: () => undefined, + shouldQueue: () => true, + onQueue: (draft) => queued.push(draft), + onSubmit: () => undefined, + }) + + await submit.handleSubmit({ preventDefault: () => undefined } as unknown as Event) + await flush() + + expect(goalActions).toEqual([{ action: "update", sessionID: "session-1", status: "paused" }]) + expect(queued).toHaveLength(0) + expect(optimistic).toHaveLength(0) + }) + + test("reports when /goal resume remains budget-limited", async () => { + params = { id: "session-1" } + promptValue = [{ type: "text", content: "/goal resume", start: 0, end: 12 }] + goalGetData = { id: "goal-1", sessionID: "session-1", objective: "ship app parity", status: "budget_limited" } + goalUpdateData = goalGetData + + const submit = createPromptSubmit({ + info: () => ({ id: "session-1" }), + imageAttachments: () => [], + commentCount: () => 0, + autoAccept: () => false, + mode: () => "normal", + working: () => false, + editor: () => undefined, + queueScroll: () => undefined, + promptLength: (value) => value.reduce((sum, part) => sum + ("content" in part ? part.content.length : 0), 0), + addToHistory: () => undefined, + resetHistoryNavigation: () => undefined, + setMode: () => undefined, + setPopover: () => undefined, + onSubmit: () => undefined, + }) + + await submit.handleSubmit({ preventDefault: () => undefined } as unknown as Event) + await flush() + + expect(goalActions).toEqual([{ action: "update", sessionID: "session-1", status: "active" }]) + expect(toasts.at(-1)).toMatchObject({ + title: "Goal still budget-limited", + description: "Increase or clear the token budget to resume continuation.", + }) + expect(optimistic).toHaveLength(0) + }) }) diff --git a/packages/app/src/components/prompt-input/submit.ts b/packages/app/src/components/prompt-input/submit.ts index 05f0a3ed2cb3..d730fddad6ee 100644 --- a/packages/app/src/components/prompt-input/submit.ts +++ b/packages/app/src/components/prompt-input/submit.ts @@ -1,4 +1,4 @@ -import type { Message, Session } from "@opencode-ai/sdk/v2/client" +import type { Message, Session, SessionGoal } from "@opencode-ai/sdk/v2/client" import { showToast } from "@opencode-ai/ui/toast" import { base64Encode } from "@opencode-ai/core/util/encode" import { Binary } from "@opencode-ai/core/util/binary" @@ -25,6 +25,7 @@ type PendingPrompt = { } const pending = new Map() +const GOAL_OBJECTIVE_MAX_LENGTH = 4000 export type FollowupDraft = { sessionID: string @@ -50,8 +51,79 @@ const draftText = (prompt: Prompt) => prompt.map((part) => ("content" in part ? const draftImages = (prompt: Prompt) => prompt.filter((part): part is ImageAttachmentPart => part.type === "image") +const goalDescription = (goal: SessionGoal) => + [ + goal.objective, + `Tokens: ${goal.tokens.used}${goal.tokens.budget === undefined ? "" : `/${goal.tokens.budget}`}`, + `Time: ${goal.time.used}s`, + "Commands: /goal edit, /goal pause, /goal resume, /goal clear", + ].join("\n") + +async function runGoal(input: { + client: ReturnType["client"] + sessionID: string + text: string + edit?: (value: string) => void +}) { + const text = input.text.trim() + const arg = text.slice("/goal".length).trim() + const control = !arg || arg === "pause" || arg === "resume" || arg === "clear" || arg === "edit" + if (!control && arg.length > GOAL_OBJECTIVE_MAX_LENGTH) { + throw new Error( + `Goal objective is too long (${arg.length}/${GOAL_OBJECTIVE_MAX_LENGTH} characters). Shorten the /goal objective and put extra details in a normal follow-up prompt.`, + ) + } + const current = await input.client.session.goal.get({ sessionID: input.sessionID }) + if (!arg) { + const goal = current.data + showToast({ + title: goal ? `Goal ${goal.status}` : "No goal set", + description: goal ? goalDescription(goal) : "Use /goal .", + }) + return true + } + if (arg === "pause") { + if (!current.data) throw new Error("No goal to pause.") + await input.client.session.goal.update({ sessionID: input.sessionID, status: "paused" }) + showToast({ title: "Goal paused" }) + return true + } + if (arg === "resume") { + if (!current.data) throw new Error("No goal to resume.") + const updated = await input.client.session.goal.update({ sessionID: input.sessionID, status: "active" }) + if (updated.data?.status === "budget_limited") { + showToast({ + title: "Goal still budget-limited", + description: "Increase or clear the token budget to resume continuation.", + }) + } else { + showToast({ title: "Goal resumed" }) + } + return true + } + if (arg === "clear") { + await input.client.session.goal.clear({ sessionID: input.sessionID }) + showToast({ title: "Goal cleared" }) + return true + } + if (arg === "edit") { + if (!current.data) throw new Error("No goal to edit. Use /goal .") + input.edit?.(`/goal ${current.data.objective}`) + return true + } + if (current.data) { + await input.client.session.goal.update({ sessionID: input.sessionID, objective: arg, status: "active" }) + showToast({ title: "Goal updated" }) + return true + } + await input.client.session.goal.create({ sessionID: input.sessionID, objective: arg }) + showToast({ title: "Goal set" }) + return true +} + export async function sendFollowupDraft(input: FollowupSendInput) { const text = draftText(input.draft.prompt) + const commandText = text.trim() const images = draftImages(input.draft.prompt) const [, setStore] = input.globalSync.child(input.draft.sessionDirectory) @@ -73,6 +145,11 @@ export async function sendFollowupDraft(input: FollowupSendInput) { const [head, ...tail] = text.split(" ") const cmd = head?.startsWith("/") ? head.slice(1) : undefined + if (commandText === "/goal" || commandText.startsWith("/goal ")) { + if (!(await wait())) return false + await runGoal({ client: input.client, sessionID: input.draft.sessionID, text: commandText }) + return true + } if (cmd && input.sync.data.command.find((item) => item.name === cmd)) { setBusy() try { @@ -363,7 +440,14 @@ export function createPromptSubmit(input: PromptSubmitInput) { let session = input.info() if (!session && isNewSession) { const created = await client.session - .create() + .create({ + agent: currentAgent.name, + model: { + providerID: currentModel.provider.id, + id: currentModel.id, + variant, + }, + }) .then((x) => x.data ?? undefined) .catch((err) => { showToast({ @@ -424,67 +508,6 @@ export function createPromptSubmit(input: PromptSubmitInput) { }) } - if (!isNewSession && mode === "normal" && input.shouldQueue?.()) { - input.onQueue?.(draft) - clearContext() - clearInput() - return - } - - input.onSubmit?.() - - if (mode === "shell") { - clearInput() - client.session - .shell({ - sessionID: session.id, - agent, - model, - command: text, - }) - .catch((err) => { - showToast({ - title: language.t("prompt.toast.shellSendFailed.title"), - description: errorMessage(err), - }) - restoreInput() - }) - return - } - - if (text.startsWith("/")) { - const [cmdName, ...args] = text.split(" ") - const commandName = cmdName.slice(1) - const customCommand = sync.data.command.find((c) => c.name === commandName) - if (customCommand) { - clearInput() - client.session - .command({ - sessionID: session.id, - command: commandName, - arguments: args.join(" "), - agent, - model: `${model.providerID}/${model.modelID}`, - variant, - parts: images.map((attachment) => ({ - id: Identifier.ascending("part"), - type: "file" as const, - mime: attachment.mime, - url: attachment.dataUrl, - filename: attachment.filename, - })), - }) - .catch((err) => { - showToast({ - title: language.t("prompt.toast.commandSendFailed.title"), - description: formatServerError(err, language.t, language.t("common.requestFailed")), - }) - restoreInput() - }) - return - } - } - const commentItems = context.filter((item) => item.type === "file" && !!item.comment?.trim()) const messageID = Identifier.ascending("message") @@ -496,10 +519,7 @@ export function createPromptSubmit(input: PromptSubmitInput) { }) } - removeCommentItems(commentItems) - clearInput() - - const waitForWorktree = async () => { + const waitForWorktree = async (options: { restoreCommentItems?: boolean } = {}) => { const worktree = WorktreeState.get(sessionDirectory) if (!worktree || worktree.status !== "pending") return true @@ -513,7 +533,7 @@ export function createPromptSubmit(input: PromptSubmitInput) { sync.set("session_status", session.id, { type: "idle" }) } removeOptimisticMessage() - restoreCommentItems(commentItems) + if (options.restoreCommentItems !== false) restoreCommentItems(commentItems) restoreInput() } @@ -554,6 +574,97 @@ export function createPromptSubmit(input: PromptSubmitInput) { return true } + if (mode === "normal" && text.startsWith("/")) { + const [cmdName] = text.split(" ") + const commandName = cmdName.slice(1) + if (commandName === "goal") { + input.onSubmit?.() + clearInput() + void (async () => { + if (!(await waitForWorktree({ restoreCommentItems: false }))) return + await runGoal({ + client, + sessionID: session.id, + text, + edit: (value) => prompt.set([{ type: "text", content: value, start: 0, end: value.length }], value.length), + }) + })().catch((err) => { + pending.delete(session.id) + showToast({ + variant: "error", + title: "Goal command failed", + description: formatServerError(err, language.t, language.t("common.requestFailed")), + }) + restoreInput() + }) + return + } + } + + if (!isNewSession && mode === "normal" && input.shouldQueue?.()) { + input.onQueue?.(draft) + clearContext() + clearInput() + return + } + + input.onSubmit?.() + + if (mode === "shell") { + clearInput() + client.session + .shell({ + sessionID: session.id, + agent, + model, + command: text, + }) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.shellSendFailed.title"), + description: errorMessage(err), + }) + restoreInput() + }) + return + } + + if (text.startsWith("/")) { + const [cmdName, ...args] = text.split(" ") + const commandName = cmdName.slice(1) + const customCommand = sync.data.command.find((c) => c.name === commandName) + if (customCommand) { + clearInput() + client.session + .command({ + sessionID: session.id, + command: commandName, + arguments: args.join(" "), + agent, + model: `${model.providerID}/${model.modelID}`, + variant, + parts: images.map((attachment) => ({ + id: Identifier.ascending("part"), + type: "file" as const, + mime: attachment.mime, + url: attachment.dataUrl, + filename: attachment.filename, + })), + }) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.commandSendFailed.title"), + description: formatServerError(err, language.t, language.t("common.requestFailed")), + }) + restoreInput() + }) + return + } + } + + removeCommentItems(commentItems) + clearInput() + void sendFollowupDraft({ client, sync, diff --git a/packages/app/src/components/session/session-header.tsx b/packages/app/src/components/session/session-header.tsx index 3d4f58deec44..e3ce6e9e5770 100644 --- a/packages/app/src/components/session/session-header.tsx +++ b/packages/app/src/components/session/session-header.tsx @@ -158,6 +158,7 @@ export function SessionHeader() { const tree = createMemo(() => !isDesktopBeta || settings.general.showFileTree()) const term = createMemo(() => !isDesktopBeta || settings.general.showTerminal()) const status = createMemo(() => !isDesktopBeta || settings.general.showStatus()) + const goal = createMemo(() => sync.data.session_goal[params.id ?? ""]) const [exists, setExists] = createStore>>({ finder: true, @@ -426,6 +427,13 @@ export function SessionHeader() {
+ + {(item) => ( +
+ goal {item().status} +
+ )} +
diff --git a/packages/app/src/components/settings-keybinds.tsx b/packages/app/src/components/settings-keybinds.tsx index 7d2dfaa6363a..149a0309b5ca 100644 --- a/packages/app/src/components/settings-keybinds.tsx +++ b/packages/app/src/components/settings-keybinds.tsx @@ -123,11 +123,13 @@ function listFor(command: CommandContext, map: KeybindMap, palette: string) { for (const opt of command.catalog) { if (opt.id.startsWith("suggested.")) continue + if (opt.hidden) continue out.set(opt.id, { title: opt.title, group: groupFor(opt.id) }) } for (const opt of command.options) { if (opt.id.startsWith("suggested.")) continue + if (opt.hidden) continue out.set(opt.id, { title: opt.title, group: groupFor(opt.id) }) } diff --git a/packages/app/src/components/status-popover-body.tsx b/packages/app/src/components/status-popover-body.tsx index bbac56278428..b38c98f141c2 100644 --- a/packages/app/src/components/status-popover-body.tsx +++ b/packages/app/src/components/status-popover-body.tsx @@ -15,7 +15,8 @@ import { useSDK } from "@/context/sdk" import { normalizeServerUrl, ServerConnection, useServer } from "@/context/server" import { useSync } from "@/context/sync" import { useCheckServerHealth, type ServerHealth } from "@/utils/server-health" -import { mcpQueryKey } from "@/context/global-sync" +import { useQueryOptions } from "@/context/global-sync" +import { pathKey } from "@/utils/path-key" const pollMs = 10_000 @@ -139,13 +140,22 @@ const useMcpToggleMutation = () => { const sdk = useSDK() const language = useLanguage() const queryClient = useQueryClient() + const queryOptions = useQueryOptions() return useMutation(() => ({ mutationFn: async (name: string) => { const status = sync.data.mcp[name] - await (status?.status === "connected" ? sdk.client.mcp.disconnect({ name }) : sdk.client.mcp.connect({ name })) + if (status?.status === "connected") { + await sdk.client.mcp.disconnect({ name }) + return + } + if (status?.status === "needs_auth") { + await sdk.client.mcp.auth.authenticate({ name }) + return + } + await sdk.client.mcp.connect({ name }) }, - onSuccess: () => queryClient.refetchQueries({ queryKey: mcpQueryKey(sync.directory) }), + onSuccess: () => queryClient.refetchQueries(queryOptions.mcp(pathKey(sync.directory))), onError: (err) => { showToast({ variant: "error", @@ -314,7 +324,7 @@ export function StatusPopoverBody(props: { shown: Accessor }) { return (
0.1, }} diff --git a/packages/app/src/pages/session/review-tab.tsx b/packages/app/src/pages/session/review-tab.tsx index 5719fce31840..92288c63b042 100644 --- a/packages/app/src/pages/session/review-tab.tsx +++ b/packages/app/src/pages/session/review-tab.tsx @@ -32,7 +32,7 @@ export interface SessionReviewTabProps { focusedComment?: { file: string; id: string } | null onFocusedCommentChange?: (focus: { file: string; id: string } | null) => void focusedFile?: string - onScrollRef?: (el: HTMLDivElement) => void + onScrollRef?: (el: HTMLDivElement | undefined) => void commentMentions?: { items: (query: string) => string[] | Promise } @@ -126,6 +126,7 @@ export function SessionReviewTab(props: SessionReviewTabProps) { onCleanup(() => { if (restoreFrame !== undefined) cancelAnimationFrame(restoreFrame) + props.onScrollRef?.(undefined) }) return ( diff --git a/packages/app/src/pages/session/session-side-panel.tsx b/packages/app/src/pages/session/session-side-panel.tsx index 66f5269bf9f5..9a745891a30c 100644 --- a/packages/app/src/pages/session/session-side-panel.tsx +++ b/packages/app/src/pages/session/session-side-panel.tsx @@ -221,239 +221,241 @@ export function SessionSidePanel(props: { }} style={{ width: panelWidth() }} > -
-
-
- - - - -
- { - const stop = createFileTabListSync({ el, contextOpen }) - onCleanup(stop) - }} - > - - -
-
{language.t("session.tab.review")}
- -
{props.reviewCount()}
-
-
-
-
- - - tabs().close("context")} - aria-label={language.t("common.closeTab")} - /> - - } - hideCloseButton - onMiddleClick={() => tabs().close("context")} - > -
- -
{language.t("session.tab.context")}
-
-
-
- - {(tab) => } - -
- - { - void import("@/components/dialog-select-file").then((x) => { - dialog.show(() => ) - }) - }} - aria-label={language.t("command.file.open")} - /> - -
-
-
- - - - {props.reviewPanel()} - - - - - -
-
- -
- {language.t("session.files.selectToOpen")} -
+ +
+
+
+ + + + +
+ { + const stop = createFileTabListSync({ el, contextOpen }) + onCleanup(stop) + }} + > + + +
+
{language.t("session.tab.review")}
+ +
{props.reviewCount()}
+
+
+
+
+ + + tabs().close("context")} + aria-label={language.t("common.closeTab")} + /> + + } + hideCloseButton + onMiddleClick={() => tabs().close("context")} + > +
+ +
{language.t("session.tab.context")}
+
+
+
+ + {(tab) => } + +
+ + { + void import("@/components/dialog-select-file").then((x) => { + dialog.show(() => ) + }) + }} + aria-label={language.t("command.file.open")} + /> +
-
+ +
+ + + + {props.reviewPanel()} + - - - - + +
- +
+ +
+ {language.t("session.files.selectToOpen")} +
+
-
- - - {(tab) => } - - - - - {(tab) => { - const path = file.pathFromTab(tab) - return ( -
- {(p) => } -
- ) - }} -
-
- + + + + +
+ +
+
+
+
+ + + {(tab) => } + + + + + {(tab) => { + const path = file.pathFromTab(tab) + return ( +
+ {(p) => } +
+ ) + }} +
+
+ +
-
- -
+
- - - - {props.reviewCount()}{" "} - {language.t( - props.reviewCount() === 1 ? "session.review.change.one" : "session.review.change.other", - )} - - - {language.t("session.files.all")} - - - - - - - {language.t("common.loading")} - {language.t("common.loading.ellipsis")} -
- } - > + + + + {props.reviewCount()}{" "} + {language.t( + props.reviewCount() === 1 ? "session.review.change.one" : "session.review.change.other", + )} + + + {language.t("session.files.all")} + + + + + + + {language.t("common.loading")} + {language.t("common.loading.ellipsis")} +
+ } + > + props.focusReviewDiff(node.path)} + /> +
+ + + + + + {empty(language.t("session.files.empty"))} + props.focusReviewDiff(node.path)} + onFileClick={(node) => openTab(file.tab(node.path))} /> - - - - - - - {empty(language.t("session.files.empty"))} - - openTab(file.tab(node.path))} - /> - - - - -
- -
props.size.start()}> - { - props.size.touch() - layout.fileTree.resize(width) - }} - /> + + + +
-
-
- -
+ +
props.size.start()}> + { + props.size.touch() + layout.fileTree.resize(width) + }} + /> +
+
+
+ +
+ ) diff --git a/packages/app/src/pages/session/use-session-commands.tsx b/packages/app/src/pages/session/use-session-commands.tsx index 922299bec198..2a17523b1206 100644 --- a/packages/app/src/pages/session/use-session-commands.tsx +++ b/packages/app/src/pages/session/use-session-commands.tsx @@ -75,8 +75,16 @@ export const useSessionCommands = (actions: SessionCommandContext) => { import.meta.env.VITE_OPENCODE_CHANNEL !== "beta" || settings.general.showFileTree() - const idle = { type: "idle" as const } - const status = () => sync.data.session_status[params.id ?? ""] ?? idle + const goal = () => sync.data.session_goal[params.id ?? ""] + const goalDescription = () => { + const current = goal() + if (!current) return "Use /goal ." + return [ + current.objective, + `Tokens: ${current.tokens.used}${current.tokens.budget === undefined ? "" : `/${current.tokens.budget}`}`, + `Time: ${current.time.used}s`, + ].join("\n") + } const messages = () => { const id = params.id if (!id) return [] @@ -290,7 +298,7 @@ export const useSessionCommands = (actions: SessionCommandContext) => { const sessionID = params.id if (!sessionID) return - if (status().type !== "idle") { + if (sync.data.session_working(params.id ?? "")) { await sdk.client.session.abort({ sessionID }).catch(() => {}) } @@ -381,6 +389,58 @@ export const useSessionCommands = (actions: SessionCommandContext) => { } const sessionCmds = () => [ + sessionCommand({ + id: "session.goal", + title: "Goal", + description: goal() ? `${goal()!.status}: ${goal()!.objective}` : "Show or set the session goal", + slash: "goal", + disabled: !params.id, + onSelect: () => + showToast({ + title: goal() ? `Goal ${goal()!.status}` : "No goal set", + description: goalDescription(), + }), + }), + sessionCommand({ + id: "session.goal.pause", + title: "Pause Goal", + description: "Pause active goal continuation", + disabled: !params.id || !goal() || goal()?.status === "paused", + onSelect: async () => { + if (!params.id) return + await sdk.client.session.goal.update({ sessionID: params.id, status: "paused" }) + showToast({ title: "Goal paused" }) + }, + }), + sessionCommand({ + id: "session.goal.resume", + title: "Resume Goal", + description: "Resume goal continuation", + disabled: !params.id || !goal() || goal()?.status === "active", + onSelect: async () => { + if (!params.id) return + const updated = await sdk.client.session.goal.update({ sessionID: params.id, status: "active" }) + if (updated.data?.status === "budget_limited") { + showToast({ + title: "Goal still budget-limited", + description: "Increase or clear the token budget to resume continuation.", + }) + } else { + showToast({ title: "Goal resumed" }) + } + }, + }), + sessionCommand({ + id: "session.goal.clear", + title: "Clear Goal", + description: "Clear the current session goal", + disabled: !params.id || !goal(), + onSelect: async () => { + if (!params.id) return + await sdk.client.session.goal.clear({ sessionID: params.id }) + showToast({ title: "Goal cleared" }) + }, + }), sessionCommand({ id: "session.new", title: language.t("command.session.new"), diff --git a/packages/app/src/utils/id.ts b/packages/app/src/utils/id.ts index fa27cf4c5f94..dba7a8d95135 100644 --- a/packages/app/src/utils/id.ts +++ b/packages/app/src/utils/id.ts @@ -1,5 +1,3 @@ -import z from "zod" - const prefixes = { session: "ses", message: "msg", @@ -15,10 +13,6 @@ let counter = 0 type Prefix = keyof typeof prefixes export namespace Identifier { - export function schema(prefix: Prefix) { - return z.string().startsWith(prefixes[prefix]) - } - export function ascending(prefix: Prefix, given?: string) { return generateID(prefix, false, given) } diff --git a/packages/app/src/utils/server-errors.test.ts b/packages/app/src/utils/server-errors.test.ts index 1f53bb8cf66c..84f7c07d6078 100644 --- a/packages/app/src/utils/server-errors.test.ts +++ b/packages/app/src/utils/server-errors.test.ts @@ -128,4 +128,17 @@ describe("formatServerError", () => { ["Modelo nao encontrado: x/y", "Voce quis dizer: x/y2, x/y3", "Revise provider/model no config"].join("\n"), ) }) + + test("unwraps SDK-wrapped errors from cause.body", () => { + const body = { + name: "ConfigInvalidError", + data: { + message: "Missing host", + }, + } satisfies ConfigInvalidError + + const wrapped = new Error("ConfigInvalidError", { cause: { body, status: 400 } }) + + expect(formatServerError(wrapped, language.t)).toBe("Arquivo de config em config invalido: Missing host") + }) }) diff --git a/packages/app/src/utils/server-errors.ts b/packages/app/src/utils/server-errors.ts index 2c3a8c54dbbe..8a8db1781159 100644 --- a/packages/app/src/utils/server-errors.ts +++ b/packages/app/src/utils/server-errors.ts @@ -26,14 +26,22 @@ function tr(translator: Translator | undefined, key: string, text: string, vars? } export function formatServerError(error: unknown, translate?: Translator, fallback?: string) { - if (isConfigInvalidErrorLike(error)) return parseReadableConfigInvalidError(error, translate) - if (isProviderModelNotFoundErrorLike(error)) return parseReadableProviderModelNotFoundError(error, translate) + const unwrapped = unwrapNamedError(error) + if (isConfigInvalidErrorLike(unwrapped)) return parseReadableConfigInvalidError(unwrapped, translate) + if (isProviderModelNotFoundErrorLike(unwrapped)) return parseReadableProviderModelNotFoundError(unwrapped, translate) if (error instanceof Error && error.message) return error.message if (typeof error === "string" && error) return error if (fallback) return fallback return tr(translate, "error.chain.unknown", "Unknown error") } +function unwrapNamedError(error: unknown): unknown { + if (error instanceof Error && error.cause && typeof error.cause === "object" && "body" in error.cause) { + return (error.cause as Record).body + } + return error +} + function isConfigInvalidErrorLike(error: unknown): error is ConfigInvalidError { if (typeof error !== "object" || error === null) return false const o = error as Record diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 7e736ca77520..fbba88bea4ac 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-app", - "version": "1.14.48", + "version": "1.15.0", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/console/app/src/config.ts b/packages/console/app/src/config.ts index 829da5751eb5..2cd039fef7ef 100644 --- a/packages/console/app/src/config.ts +++ b/packages/console/app/src/config.ts @@ -9,8 +9,8 @@ export const config = { github: { repoUrl: "https://github.com/anomalyco/opencode", starsFormatted: { - compact: "150K", - full: "150,000", + compact: "160K", + full: "160,000", }, }, @@ -22,8 +22,8 @@ export const config = { // Static stats (used on landing page) stats: { - contributors: "850", - commits: "11,000", - monthlyUsers: "6.5M", + contributors: "900", + commits: "13,000", + monthlyUsers: "7.5M", }, } as const diff --git a/packages/console/app/src/routes/honeycomb/webhook.ts b/packages/console/app/src/routes/honeycomb/webhook.ts index 367a93aeb023..05be68353572 100644 --- a/packages/console/app/src/routes/honeycomb/webhook.ts +++ b/packages/console/app/src/routes/honeycomb/webhook.ts @@ -12,13 +12,22 @@ const basePayload = z.object({ url: z.string(), }) -const groups = z.object({ group: z.object({ key: z.string(), value: z.string() }).array() }).array() +const groups = z + .object({ + result: z.union([z.number(), z.string()]).nullish(), + group: z.object({ key: z.string(), value: z.string() }).array(), + }) + .array() const honeycombWebhookPayload = z.discriminatedUnion("type", [ basePayload.extend({ type: z.literal("model_http_errors"), groups, }), + basePayload.extend({ + type: z.literal("model_low_tps"), + groups, + }), basePayload.extend({ type: z.literal("provider_http_errors"), groups, @@ -29,14 +38,25 @@ const honeycombWebhookPayload = z.discriminatedUnion("type", [ ]) const postDiscordMessage = async (payload: z.infer) => { - const group = - payload.type === "model_http_errors" ? "model" : payload.type === "provider_http_errors" ? "provider" : undefined - const names = payload.type === "custom" ? [] : payload.groups.flatMap((item) => item.group.map((g) => g.value)) + const names = + payload.type === "custom" + ? [] + : payload.groups.flatMap((item) => + item.group.map((g) => { + const result = item.result == null ? undefined : Number(item.result) + return `- ${g.value}${ + result !== undefined && Number.isFinite(result) + ? payload.type === "model_low_tps" + ? ` (${Math.round(result)} TPS)` + : ` (${Math.round(result * 100)}% errors)` + : "" + }` + }), + ) const content = [ `[**${payload.isTest ? "[TEST] " : ""}${payload.name ?? "Honeycomb alert"}**](${payload.url})`, - group && names.length > 0 ? `Affected ${group}s:` : undefined, - ...names.map((name) => `- ${name}`), + ...names, "", `<@&${DISCORD_ALERT_ROLE_ID}>`, ] diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index 2e46df0366aa..3af36ad77a6c 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -123,7 +123,7 @@ export async function handler( ? createIpRateLimiter(modelInfo.id, modelInfo.rateLimit, ip, input.request) : createKeyRateLimiter(modelInfo.id, modelInfo.rateLimit, zenApiKey, input.request) await rateLimiter?.check() - const stickyTracker = createStickyTracker(modelInfo.stickyProvider, sessionId) + const stickyTracker = createStickyTracker(modelInfo.id, modelInfo.stickyProvider, sessionId) const stickyProvider = await stickyTracker?.get() const authInfo = await authenticate(modelInfo, zenApiKey) const billingSource = validateBilling(authInfo, modelInfo) @@ -216,7 +216,7 @@ export async function handler( // ie. 400 error is usually provider error like malformed request res.status !== 400 && // ie. openai 404 error: Item with id 'msg_0ead8b004a3b165d0069436a6b6834819896da85b63b196a3f' not found. - res.status !== 404 && + !(modelInfo.id.startsWith("gpt-") && res.status === 404) && // ie. cannot change codex model providers mid-session modelInfo.stickyProvider !== "strict" && modelInfo.fallbackProvider && @@ -238,7 +238,7 @@ export async function handler( dataDumper?.provideRequest(reqBody) // Store sticky provider - await stickyTracker?.set(providerInfo.id) + if (res.status === 200) await stickyTracker?.set(providerInfo.id) // Temporarily change 404 to 400 status code b/c solid start automatically override 404 response const resStatus = res.status === 404 ? 400 : res.status @@ -299,7 +299,6 @@ export async function handler( let buffer = "" let responseLength = 0 let timestampFirstByte = 0 - let timestampLastByte = 0 function pump(): Promise { return ( @@ -321,6 +320,7 @@ export async function handler( await modelTpsLimiter?.track( providerInfo.id, providerInfo.model, + providerInfo.tpsGoal, timestampFirstByte, timestampLastByte, usageInfo, @@ -526,7 +526,7 @@ export async function handler( }) .filter((provider) => { if (!provider.tpsGoal) return true - const isLowTps = modelTpsLimits?.[`${provider.id}/${provider.model}`] ?? false + const isLowTps = modelTpsLimits?.[`${provider.id}/${provider.model}/${provider.tpsGoal}`] ?? false return !isLowTps }) .map((provider) => { diff --git a/packages/console/app/src/routes/zen/util/modelTpsLimiter.ts b/packages/console/app/src/routes/zen/util/modelTpsLimiter.ts index 428272eecd81..477d08ce6829 100644 --- a/packages/console/app/src/routes/zen/util/modelTpsLimiter.ts +++ b/packages/console/app/src/routes/zen/util/modelTpsLimiter.ts @@ -5,7 +5,7 @@ import { UsageInfo } from "./provider/provider" export function createModelTpsLimiter(providers: { id: string; model: string; tpsGoal?: number }[]) { const tpsGoals = Object.fromEntries( providers.flatMap((p) => { - return p.tpsGoal ? [[`${p.id}/${p.model}`, p.tpsGoal]] : [] + return p.tpsGoal ? [[`${p.id}/${p.model}/${p.tpsGoal}`, p.tpsGoal]] : [] }), ) const ids = Object.keys(tpsGoals) @@ -56,11 +56,17 @@ export function createModelTpsLimiter(providers: { id: string; model: string; tp }), ) }, - track: async (provider: string, model: string, tsFirstByte: number, tsLastByte: number, usageInfo: UsageInfo) => { - const id = `${provider}/${model}` - if (!ids.includes(id)) return - const tpsGoal = tpsGoals[id] + track: async ( + provider: string, + model: string, + tpsGoal: number | undefined, + tsFirstByte: number, + tsLastByte: number, + usageInfo: UsageInfo, + ) => { if (!tpsGoal) return + const id = `${provider}/${model}/${tpsGoal}` + if (!ids.includes(id)) return if (tsFirstByte <= 0 || tsLastByte <= 0) return const tokens = usageInfo.outputTokens if (tokens <= 10) return diff --git a/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts b/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts index 8029757c5b61..fae0cdf03c39 100644 --- a/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts +++ b/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts @@ -1,16 +1,42 @@ -import { Resource } from "@opencode-ai/console-resource" +import { Database, eq } from "@opencode-ai/console-core/drizzle/index.js" +import { ModelStickyProviderTable } from "@opencode-ai/console-core/schema/ip.sql.js" -export function createStickyTracker(stickyProvider: "strict" | "prefer" | undefined, session: string) { +export function createStickyTracker(modelId: string, stickyProvider: "strict" | "prefer" | undefined, session: string) { if (!stickyProvider) return if (!session) return - const key = `sticky:${session}` + const id = `${modelId}/${session}` + let _providerId: string | undefined return { get: async () => { - return await Resource.GatewayKv.get(key) + const data = await Database.use((tx) => + tx + .select({ + providerId: ModelStickyProviderTable.providerId, + }) + .from(ModelStickyProviderTable) + .where(eq(ModelStickyProviderTable.id, id)) + .limit(1), + ) + _providerId = data[0]?.providerId + return _providerId }, set: async (providerId: string) => { - await Resource.GatewayKv.put(key, providerId, { expirationTtl: 86400 }) + if (_providerId === providerId) return + + await Database.use((tx) => + tx + .insert(ModelStickyProviderTable) + .values({ + id, + providerId, + }) + .onDuplicateKeyUpdate({ + set: { + providerId, + }, + }), + ) }, } } diff --git a/packages/console/core/migrations/20260513163955_tearful_whistler/migration.sql b/packages/console/core/migrations/20260513163955_tearful_whistler/migration.sql new file mode 100644 index 000000000000..a2bcc164ca61 --- /dev/null +++ b/packages/console/core/migrations/20260513163955_tearful_whistler/migration.sql @@ -0,0 +1,7 @@ +CREATE TABLE `model_sticky_provider` ( + `id` varchar(255) PRIMARY KEY, + `time_created` timestamp(3) NOT NULL DEFAULT (now()), + `time_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), + `time_deleted` timestamp(3), + `provider_id` varchar(255) NOT NULL +); diff --git a/packages/console/core/migrations/20260513163955_tearful_whistler/snapshot.json b/packages/console/core/migrations/20260513163955_tearful_whistler/snapshot.json new file mode 100644 index 000000000000..b79173522885 --- /dev/null +++ b/packages/console/core/migrations/20260513163955_tearful_whistler/snapshot.json @@ -0,0 +1,2765 @@ +{ + "version": "6", + "dialect": "mysql", + "id": "1f04bd59-35b0-493b-9d55-cfa08207ba8e", + "prevIds": ["c742e0f2-5d89-4216-b843-059d00680f13"], + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "name": "coupon", + "entityType": "tables" + }, + { + "name": "lite", + "entityType": "tables" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "name": "key_rate_limit", + "entityType": "tables" + }, + { + "name": "model_sticky_provider", + "entityType": "tables" + }, + { + "name": "model_tpm_rate_limit", + "entityType": "tables" + }, + { + "name": "model_tps_rate_limit", + "entityType": "tables" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "account" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "auth" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "entityType": "columns", + "table": "billing" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "entityType": "columns", + "table": "billing" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "entityType": "columns", + "table": "billing" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "entityType": "columns", + "table": "billing" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_selected", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "lite_subscription_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "lite", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "coupon" + }, + { + "type": "enum('BUILDATHON','GOFREEMONTH','GO3MONTHS100','GO6MONTHS100','GO12MONTHS100')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "coupon" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_redeemed", + "entityType": "columns", + "table": "coupon" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "lite" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "lite" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "lite" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "entityType": "columns", + "table": "lite" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "weekly_usage", + "entityType": "columns", + "table": "lite" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_weekly_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "entityType": "columns", + "table": "payment" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "ip" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "entityType": "columns", + "table": "ip" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "entityType": "columns", + "table": "key_rate_limit" + }, + { + "type": "varchar(40)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "entityType": "columns", + "table": "key_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "entityType": "columns", + "table": "key_rate_limit" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "model_sticky_provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "model_sticky_provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "model_sticky_provider" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "model_sticky_provider" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider_id", + "entityType": "columns", + "table": "model_sticky_provider" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "model_tpm_rate_limit" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "entityType": "columns", + "table": "model_tpm_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "entityType": "columns", + "table": "model_tpm_rate_limit" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "model_tps_rate_limit" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "entityType": "columns", + "table": "model_tps_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "qualify", + "entityType": "columns", + "table": "model_tps_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "unqualify", + "entityType": "columns", + "table": "model_tps_rate_limit" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "provider" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "entityType": "columns", + "table": "user" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "entityType": "columns", + "table": "user" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "entityType": "columns", + "table": "user" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "entityType": "columns", + "table": "user" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "workspace" + }, + { + "columns": ["id"], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": ["id"], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": ["id"], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": ["email", "type"], + "name": "PRIMARY", + "table": "coupon", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "lite", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": ["ip", "interval"], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": ["ip"], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": ["key", "interval"], + "name": "PRIMARY", + "table": "key_rate_limit", + "entityType": "pks" + }, + { + "columns": ["id"], + "name": "PRIMARY", + "table": "model_sticky_provider", + "entityType": "pks" + }, + { + "columns": ["id", "interval"], + "name": "PRIMARY", + "table": "model_tpm_rate_limit", + "entityType": "pks" + }, + { + "columns": ["id", "interval"], + "name": "PRIMARY", + "table": "model_tps_rate_limit", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": ["workspace_id", "id"], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": ["id"], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "entityType": "indexes", + "table": "auth" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "entityType": "indexes", + "table": "auth" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "entityType": "indexes", + "table": "benchmark" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "entityType": "indexes", + "table": "billing" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "entityType": "indexes", + "table": "billing" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "entityType": "indexes", + "table": "lite" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "entityType": "indexes", + "table": "subscription" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "entityType": "indexes", + "table": "usage" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "entityType": "indexes", + "table": "key" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "entityType": "indexes", + "table": "model" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "entityType": "indexes", + "table": "provider" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "entityType": "indexes", + "table": "workspace" + } + ], + "renames": [] +} diff --git a/packages/console/core/package.json b/packages/console/core/package.json index 986103ece3ca..b58e595171e8 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "1.14.48", + "version": "1.15.0", "private": true, "type": "module", "license": "MIT", diff --git a/packages/console/core/src/schema/ip.sql.ts b/packages/console/core/src/schema/ip.sql.ts index 975dcfa186ca..a80fa474cae3 100644 --- a/packages/console/core/src/schema/ip.sql.ts +++ b/packages/console/core/src/schema/ip.sql.ts @@ -51,3 +51,13 @@ export const ModelTpsRateLimitTable = mysqlTable( }, (table) => [primaryKey({ columns: [table.id, table.interval] })], ) + +export const ModelStickyProviderTable = mysqlTable( + "model_sticky_provider", + { + id: varchar("id", { length: 255 }).notNull(), + ...timestamps, + providerId: varchar("provider_id", { length: 255 }).notNull(), + }, + (table) => [primaryKey({ columns: [table.id] })], +) diff --git a/packages/console/core/sst-env.d.ts b/packages/console/core/sst-env.d.ts index 9680a53aab1e..088db5be2c7e 100644 --- a/packages/console/core/sst-env.d.ts +++ b/packages/console/core/sst-env.d.ts @@ -298,6 +298,7 @@ declare module "sst" { "EnterpriseStorage": cloudflare.R2Bucket "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service + "Stat": cloudflare.Service "ZenData": cloudflare.R2Bucket "ZenDataNew": cloudflare.R2Bucket } diff --git a/packages/console/function/package.json b/packages/console/function/package.json index 5c1d1ba22349..faf72baae09e 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-function", - "version": "1.14.48", + "version": "1.15.0", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/function/src/stat.ts b/packages/console/function/src/stat.ts new file mode 100644 index 000000000000..957adf491a60 --- /dev/null +++ b/packages/console/function/src/stat.ts @@ -0,0 +1,43 @@ +import { and, Database, inArray } from "@opencode-ai/console-core/drizzle/index.js" +import { ModelTpsRateLimitTable } from "@opencode-ai/console-core/schema/ip.sql.js" + +type Result = Record + +export default { + async fetch(request: Request) { + if (request.method !== "POST") return new Response("Method Not Allowed", { status: 405 }) + + const body = (await request.json()) as { ids: string[] } + const ids = body.ids + if (ids.length === 0) return Response.json({} satisfies Result) + + const toInterval = (date: Date) => + parseInt( + date + .toISOString() + .replace(/[^0-9]/g, "") + .substring(0, 12), + ) + const now = Date.now() + const intervals = Array.from({ length: 30 }, (_, i) => toInterval(new Date(now - i * 60 * 1000))) + + const rows = await Database.use((tx) => + tx + .select() + .from(ModelTpsRateLimitTable) + .where(and(inArray(ModelTpsRateLimitTable.id, ids), inArray(ModelTpsRateLimitTable.interval, intervals))), + ) + + const rowsByKey = new Map(rows.map((row) => [`${row.id}:${row.interval}`, row])) + const result: Result = Object.fromEntries( + ids.map((id) => [ + id, + intervals.map((interval) => { + const row = rowsByKey.get(`${id}:${interval}`) + return { interval, qualify: row?.qualify ?? 0, unqualify: row?.unqualify ?? 0 } + }), + ]), + ) + return Response.json(result) + }, +} diff --git a/packages/console/function/sst-env.d.ts b/packages/console/function/sst-env.d.ts index 9680a53aab1e..088db5be2c7e 100644 --- a/packages/console/function/sst-env.d.ts +++ b/packages/console/function/sst-env.d.ts @@ -298,6 +298,7 @@ declare module "sst" { "EnterpriseStorage": cloudflare.R2Bucket "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service + "Stat": cloudflare.Service "ZenData": cloudflare.R2Bucket "ZenDataNew": cloudflare.R2Bucket } diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index 6c101f051e66..3ef49a1b90e6 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "1.14.48", + "version": "1.15.0", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/console/resource/sst-env.d.ts b/packages/console/resource/sst-env.d.ts index 9680a53aab1e..088db5be2c7e 100644 --- a/packages/console/resource/sst-env.d.ts +++ b/packages/console/resource/sst-env.d.ts @@ -298,6 +298,7 @@ declare module "sst" { "EnterpriseStorage": cloudflare.R2Bucket "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service + "Stat": cloudflare.Service "ZenData": cloudflare.R2Bucket "ZenDataNew": cloudflare.R2Bucket } diff --git a/packages/core/package.json b/packages/core/package.json index e2ffa31d8d73..7a7c0880b6a7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.14.48", + "version": "1.15.0", "name": "@opencode-ai/core", "type": "module", "license": "MIT", @@ -26,6 +26,27 @@ "@types/semver": "catalog:" }, "dependencies": { + "@ai-sdk/alibaba": "1.0.17", + "@ai-sdk/amazon-bedrock": "4.0.96", + "@ai-sdk/anthropic": "3.0.71", + "@ai-sdk/azure": "3.0.49", + "@ai-sdk/cerebras": "2.0.41", + "@ai-sdk/cohere": "3.0.27", + "@ai-sdk/deepinfra": "2.0.41", + "@ai-sdk/gateway": "3.0.104", + "@ai-sdk/google": "3.0.63", + "@ai-sdk/google-vertex": "4.0.112", + "@ai-sdk/groq": "3.0.31", + "@ai-sdk/mistral": "3.0.27", + "@ai-sdk/openai": "3.0.53", + "@ai-sdk/openai-compatible": "2.0.41", + "@ai-sdk/perplexity": "3.0.26", + "@ai-sdk/provider": "3.0.8", + "@ai-sdk/provider-utils": "4.0.23", + "@ai-sdk/togetherai": "2.0.41", + "@ai-sdk/vercel": "2.0.39", + "@ai-sdk/xai": "3.0.82", + "@aws-sdk/credential-providers": "3.993.0", "@effect/opentelemetry": "catalog:", "@effect/platform-node": "catalog:", "@npmcli/arborist": "9.4.0", @@ -34,13 +55,19 @@ "@opentelemetry/context-async-hooks": "2.6.1", "@opentelemetry/exporter-trace-otlp-http": "0.214.0", "@opentelemetry/sdk-trace-base": "2.6.1", - "effect": "catalog:", + "@openrouter/ai-sdk-provider": "2.8.1", + "ai-gateway-provider": "3.1.2", "cross-spawn": "catalog:", + "effect": "catalog:", + "gitlab-ai-provider": "6.6.0", "glob": "13.0.5", + "google-auth-library": "10.5.0", + "immer": "11.1.4", "mime-types": "3.0.2", "minimatch": "10.2.5", "npm-package-arg": "13.0.2", "semver": "^7.6.3", + "venice-ai-sdk-provider": "2.0.1", "xdg-basedir": "5.1.0", "zod": "catalog:" }, diff --git a/packages/core/src/aisdk.ts b/packages/core/src/aisdk.ts new file mode 100644 index 000000000000..5fa2294309c7 --- /dev/null +++ b/packages/core/src/aisdk.ts @@ -0,0 +1,172 @@ +export * as AISDK from "./aisdk" + +import type { LanguageModelV3 } from "@ai-sdk/provider" +import { Cause, Context, Effect, Layer, Schema } from "effect" +import { ModelV2 } from "./model" +import { PluginV2 } from "./plugin" +import { ProviderV2 } from "./provider" + +type SDK = any + +function wrapSSE(res: Response, ms: number, ctl: AbortController) { + if (typeof ms !== "number" || ms <= 0) return res + if (!res.body) return res + if (!res.headers.get("content-type")?.includes("text/event-stream")) return res + + const reader = res.body.getReader() + const body = new ReadableStream({ + async pull(ctrl) { + const part = await new Promise>>((resolve, reject) => { + const id = setTimeout(() => { + const err = new Error("SSE read timed out") + ctl.abort(err) + void reader.cancel(err) + reject(err) + }, ms) + + reader.read().then( + (part) => { + clearTimeout(id) + resolve(part) + }, + (err) => { + clearTimeout(id) + reject(err) + }, + ) + }) + + if (part.done) { + ctrl.close() + return + } + + ctrl.enqueue(part.value) + }, + async cancel(reason) { + ctl.abort(reason) + await reader.cancel(reason) + }, + }) + + return new Response(body, { + headers: new Headers(res.headers), + status: res.status, + statusText: res.statusText, + }) +} + +function prepareOptions(model: ModelV2.Info, pkg: string) { + const options: Record = { name: model.providerID, ...model.options.aisdk.provider } + if (model.endpoint.type === "aisdk" && model.endpoint.url) options.baseURL = model.endpoint.url + + const customFetch = options.fetch + const chunkTimeout = options.chunkTimeout + delete options.chunkTimeout + options.fetch = async (input: Parameters[0], init?: RequestInit) => { + const opts = { ...(init ?? {}) } + const signals = [ + opts.signal, + typeof chunkTimeout === "number" && chunkTimeout > 0 ? new AbortController() : undefined, + options.timeout !== undefined && options.timeout !== null && options.timeout !== false + ? AbortSignal.timeout(options.timeout) + : undefined, + ].filter((item): item is AbortSignal | AbortController => Boolean(item)) + const chunkAbortCtl = signals.find((item): item is AbortController => item instanceof AbortController) + const abortSignals = signals.map((item) => (item instanceof AbortController ? item.signal : item)) + if (abortSignals.length === 1) opts.signal = abortSignals[0] + if (abortSignals.length > 1) opts.signal = AbortSignal.any(abortSignals) + + if ((pkg === "@ai-sdk/openai" || pkg === "@ai-sdk/azure") && opts.body && opts.method === "POST") { + const body = JSON.parse(opts.body as string) + if (body.store !== true && Array.isArray(body.input)) { + for (const item of body.input) { + if ("id" in item) delete item.id + } + opts.body = JSON.stringify(body) + } + } + + const res = await (typeof customFetch === "function" ? customFetch : fetch)(input, { + ...opts, + timeout: false, + }) + if (!chunkAbortCtl || typeof chunkTimeout !== "number") return res + return wrapSSE(res, chunkTimeout, chunkAbortCtl) + } + + return options +} + +export class InitError extends Schema.TaggedErrorClass()("AISDK.InitError", { + providerID: ProviderV2.ID, + cause: Schema.Defect, +}) {} + +function initError(providerID: ProviderV2.ID) { + return Effect.catchCause((cause) => Effect.fail(new InitError({ providerID, cause: Cause.squash(cause) }))) +} + +export interface Interface { + readonly language: (model: ModelV2.Info) => Effect.Effect +} + +export class Service extends Context.Service()("@opencode/v2/AISDK") {} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const languages = new Map() + const sdks = new Map() + + return Service.of({ + language: Effect.fn("AISDK.language")(function* (model) { + const key = `${model.providerID}/${model.id}/${model.options.variant ?? "default"}` + const existing = languages.get(key) + if (existing) return existing + if (model.endpoint.type !== "aisdk") + return yield* new InitError({ + providerID: model.providerID, + cause: new Error(`Unsupported endpoint ${model.endpoint.type}`), + }) + + const options = prepareOptions(model, model.endpoint.package) + const sdkKey = JSON.stringify({ + providerID: model.providerID, + endpoint: model.endpoint, + options, + }) + const sdk = + sdks.get(sdkKey) ?? + (yield* plugin + .trigger("aisdk.sdk", { model, package: model.endpoint.package, options }, {}) + .pipe(initError(model.providerID))).sdk + if (!sdk) + return yield* new InitError({ + providerID: model.providerID, + cause: new Error("No AISDK provider plugin returned an SDK"), + }) + sdks.set(sdkKey, sdk) + const result = yield* plugin + .trigger( + "aisdk.language", + { + model, + sdk, + options, + }, + {}, + ) + .pipe(initError(model.providerID)) + const language = yield* Effect.sync(() => result.language ?? sdk.languageModel(model.apiID)).pipe( + initError(model.providerID), + ) + languages.set(key, language) + return language + }), + }) + }), +) + +export const defaultLayer = layer.pipe(Layer.provide(PluginV2.defaultLayer)) diff --git a/packages/opencode/src/v2/auth.ts b/packages/core/src/auth.ts similarity index 86% rename from packages/opencode/src/v2/auth.ts rename to packages/core/src/auth.ts index 0ac6223a66b3..843c9504b40e 100644 --- a/packages/opencode/src/v2/auth.ts +++ b/packages/core/src/auth.ts @@ -1,9 +1,9 @@ import path from "path" import { Effect, Layer, Option, Schema, Context, SynchronizedRef } from "effect" -import { Identifier } from "@opencode-ai/core/util/identifier" -import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema" -import { Global } from "@opencode-ai/core/global" -import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Identifier } from "./util/identifier" +import { NonNegativeInt, withStatics } from "./schema" +import { Global } from "./global" +import { AppFileSystem } from "./filesystem" export const OAUTH_DUMMY_KEY = "opencode-oauth-dummy-key" @@ -106,25 +106,43 @@ export const layer = Layer.effect( const fsys = yield* AppFileSystem.Service const global = yield* Global.Service const file = path.join(global.data, "auth-v2.json") + const legacyFile = path.join(global.data, "auth.json") + + const writeMigrated = Effect.fnUntraced(function* (raw: Record) { + const migrated = migrate(raw) + yield* fsys + .writeJson(file, migrated, 0o600) + .pipe(Effect.mapError((cause) => new AuthFileWriteError({ operation: "migrate", cause }))) + return migrated + }) + + const parseAuthContent = () => { + try { + return JSON.parse(process.env.OPENCODE_AUTH_CONTENT ?? "") + } catch {} + } const load: () => Effect.Effect = Effect.fnUntraced(function* () { if (process.env.OPENCODE_AUTH_CONTENT) { - try { - return JSON.parse(process.env.OPENCODE_AUTH_CONTENT) - } catch {} + const raw = parseAuthContent() + if (raw && typeof raw === "object") { + if ("version" in raw && raw.version === 2) return raw as Writable + return yield* writeMigrated(raw as Record) + } + return { version: 2, accounts: {}, active: {} } } - const raw = yield* fsys.readJson(file).pipe(Effect.orElseSucceed(() => null)) + const legacy = yield* fsys.readJson(legacyFile).pipe(Effect.orElseSucceed(() => null)) + if (legacy && typeof legacy === "object") return yield* writeMigrated(legacy as Record) - if (!raw || typeof raw !== "object") return { version: 2, accounts: {}, active: {} } + const raw = yield* fsys.readJson(file).pipe(Effect.orElseSucceed(() => null)) - if ("version" in raw && raw.version === 2) return raw as Writable + if (raw && typeof raw === "object") { + if ("version" in raw && raw.version === 2) return raw as Writable + return yield* writeMigrated(raw as Record) + } - const migrated = migrate(raw as Record) - yield* fsys - .writeJson(file, migrated, 0o600) - .pipe(Effect.mapError((cause) => new AuthFileWriteError({ operation: "migrate", cause }))) - return migrated + return { version: 2, accounts: {}, active: {} } }) const write = (data: Writable) => diff --git a/packages/core/src/catalog.ts b/packages/core/src/catalog.ts new file mode 100644 index 000000000000..d27f17bfb872 --- /dev/null +++ b/packages/core/src/catalog.ts @@ -0,0 +1,269 @@ +export * as Catalog from "./catalog" + +import { Context, Effect, HashMap, Layer, Option, Order, pipe, Schema, Array } from "effect" +import { produce, type Draft } from "immer" +import { ModelV2 } from "./model" +import { PluginV2 } from "./plugin" +import { ProviderV2 } from "./provider" +import { Location } from "./location" +import { EventV2 } from "./event" + +type ProviderRecord = { + provider: ProviderV2.Info + models: HashMap.HashMap +} + +export class ProviderNotFoundError extends Schema.TaggedErrorClass()( + "CatalogV2.ProviderNotFound", + { + providerID: ProviderV2.ID, + }, +) {} + +export class ModelNotFoundError extends Schema.TaggedErrorClass()("CatalogV2.ModelNotFound", { + providerID: ProviderV2.ID, + modelID: ModelV2.ID, +}) {} + +export const Event = { + ModelUpdated: EventV2.define({ + type: "catalog.model.updated", + schema: { + model: ModelV2.Info, + }, + }), +} + +export interface Interface { + readonly provider: { + readonly get: (providerID: ProviderV2.ID) => Effect.Effect + readonly update: (providerID: ProviderV2.ID, fn: (provider: Draft) => void) => Effect.Effect + readonly all: () => Effect.Effect + readonly available: () => Effect.Effect + } + readonly model: { + readonly get: ( + providerID: ProviderV2.ID, + modelID: ModelV2.ID, + ) => Effect.Effect + readonly update: ( + providerID: ProviderV2.ID, + modelID: ModelV2.ID, + fn: (model: Draft) => void, + ) => Effect.Effect + readonly all: () => Effect.Effect + readonly available: () => Effect.Effect + readonly default: () => Effect.Effect> + readonly setDefault: ( + providerID: ProviderV2.ID, + modelID: ModelV2.ID, + ) => Effect.Effect + readonly small: (providerID: ProviderV2.ID) => Effect.Effect> + } +} + +export class Service extends Context.Service()("@opencode/v2/Catalog") {} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + yield* Location.Service + let records = HashMap.empty() + let defaultModel: { providerID: ProviderV2.ID; modelID: ModelV2.ID } | undefined + const plugin = yield* PluginV2.Service + const events = yield* EventV2.Service + + const resolve = (model: ModelV2.Info) => { + const provider = Option.getOrThrow(HashMap.get(records, model.providerID)).provider + const endpoint = + model.endpoint.type === "unknown" + ? provider.endpoint + : model.endpoint.type === "aisdk" && provider.endpoint.type === "aisdk" && !model.endpoint.url + ? { ...model.endpoint, url: provider.endpoint.url } + : model.endpoint + const options = { + headers: { + ...provider.options.headers, + ...model.options.headers, + }, + body: { + ...provider.options.body, + ...model.options.body, + }, + aisdk: { + provider: { + ...provider.options.aisdk.provider, + ...model.options.aisdk.provider, + }, + request: model.options.aisdk.request, + }, + variant: model.options.variant, + } + return new ModelV2.Info({ + ...model, + endpoint, + options, + }) + } + + function* getRecord(providerID: ProviderV2.ID) { + const match = HashMap.get(records, providerID) + if (!match.valueOrUndefined) return yield* new ProviderNotFoundError({ providerID }) + return match.value + } + + const result: Interface = { + provider: { + get: Effect.fn("CatalogV2.provider.get")(function* (providerID) { + const record = yield* getRecord(providerID) + return record.provider + }), + + update: Effect.fnUntraced(function* (providerID, fn) { + const current = Option.getOrUndefined(HashMap.get(records, providerID)) + const provider = produce(current?.provider ?? ProviderV2.Info.empty(providerID), (draft) => { + fn(draft) + if (draft.endpoint.type === "aisdk" && typeof draft.options.aisdk.provider.baseURL === "string") { + draft.endpoint.url = draft.options.aisdk.provider.baseURL + delete draft.options.aisdk.provider.baseURL + } + }) + const updated = yield* plugin.trigger("provider.update", {}, { provider, cancel: false }) + records = HashMap.set(records, providerID, { + provider: updated.provider, + models: current?.models ?? HashMap.empty(), + }) + }), + + all: Effect.fn("CatalogV2.provider.all")(function* () { + return globalThis.Array.from(HashMap.values(records)).map((record) => record.provider) + }), + + available: Effect.fn("CatalogV2.provider.available")(function* () { + return globalThis.Array.from(HashMap.values(records)) + .map((record) => record.provider) + .filter((provider) => provider.enabled) + }), + }, + + model: { + get: Effect.fn("CatalogV2.model.get")(function* (providerID, modelID) { + const record = yield* getRecord(providerID) + const model = Option.getOrUndefined(HashMap.get(record.models, modelID)) + if (!model) return yield* new ModelNotFoundError({ providerID, modelID }) + return resolve(model) + }), + + update: Effect.fnUntraced(function* (providerID, modelID, fn) { + const record = yield* getRecord(providerID) + const model = produce( + HashMap.get(record.models, modelID).pipe(Option.getOrElse(() => ModelV2.Info.empty(providerID, modelID))), + (draft) => { + fn(draft) + if (draft.endpoint.type === "aisdk" && typeof draft.options.aisdk.provider.baseURL === "string") { + draft.endpoint.url = draft.options.aisdk.provider.baseURL + delete draft.options.aisdk.provider.baseURL + } + }, + ) + const updated = yield* plugin.trigger("model.update", {}, { model, cancel: false }) + if (updated.cancel) return + const next = new ModelV2.Info({ ...updated.model, id: modelID, providerID }) + records = HashMap.set(records, providerID, { + provider: record.provider, + models: HashMap.set(record.models, modelID, next), + }) + yield* events.publish(Event.ModelUpdated, { model: resolve(next) }) + return + }), + + all: Effect.fn("CatalogV2.model.all")(function* () { + return pipe( + records, + HashMap.toValues, + Array.flatMap((record) => HashMap.toValues(record.models)), + Array.map(resolve), + Array.sortWith((item) => item.time.released.epochMilliseconds, Order.flip(Order.Number)), + ) + }), + + available: Effect.fn("CatalogV2.model.available")(function* () { + return (yield* result.model.all()).filter((model) => { + const record = Option.getOrUndefined(HashMap.get(records, model.providerID)) + return record?.provider.enabled !== false && model.enabled + }) + }), + + default: Effect.fn("CatalogV2.model.default")(function* () { + if (defaultModel) { + const model = yield* result.model.get(defaultModel.providerID, defaultModel.modelID).pipe(Effect.option) + if (Option.isSome(model) && model.value.enabled) return model + } + + return pipe( + yield* result.model.available(), + Array.sortWith((item) => item.time.released.epochMilliseconds, Order.flip(Order.Number)), + Array.head, + ) + }), + + setDefault: Effect.fn("CatalogV2.model.setDefault")(function* (providerID, modelID) { + yield* result.model.get(providerID, modelID) + defaultModel = { providerID, modelID } + }), + + small: Effect.fn("CatalogV2.model.small")(function* (providerID) { + const record = Option.getOrUndefined(HashMap.get(records, providerID)) + if (!record) return Option.none() + + if (providerID === ProviderV2.ID.opencode) { + const gpt5Nano = Option.getOrUndefined(HashMap.get(record.models, ModelV2.ID.make("gpt-5-nano"))) + if (gpt5Nano?.enabled && gpt5Nano.status === "active") return Option.some(resolve(gpt5Nano)) + } + + const candidates = pipe( + HashMap.toValues(record.models), + Array.filter( + (model) => + model.providerID === providerID && + model.enabled && + model.status === "active" && + model.capabilities.input.some((item) => item.startsWith("text")) && + model.capabilities.output.some((item) => item.startsWith("text")), + ), + Array.map((model) => ({ + model, + cost: model.cost[0] ? model.cost[0].input + model.cost[0].output : 999, + age: (Date.now() - model.time.released.epochMilliseconds) / (1000 * 60 * 60 * 24 * 30), + small: SMALL_MODEL_RE.test(`${model.id} ${model.family ?? ""} ${model.name}`.toLowerCase()), + })), + Array.filter((item) => item.cost > 0 && item.age <= 18), + ) + + const pick = (items: typeof candidates) => { + const maxCost = Math.max(...items.map((item) => item.cost), 0.01) + const maxAge = Math.max(...items.map((item) => item.age), 0.01) + return pipe( + items, + Array.sortWith((item) => (item.cost / maxCost) * 0.8 + (item.age / maxAge) * 0.2, Order.Number), + Array.map((item) => resolve(item.model)), + Array.head, + ) + } + + return pipe( + candidates, + Array.filter((item) => item.small), + (items) => (items.length > 0 ? pick(items) : pick(candidates)), + ) + }), + }, + } + + return Service.of(result) + }), +) + +const SMALL_MODEL_RE = /\b(nano|flash|lite|mini|haiku|small|fast)\b/ + +export const defaultLayer = layer.pipe(Layer.provideMerge(EventV2.defaultLayer), Layer.provide(PluginV2.defaultLayer)) diff --git a/packages/core/src/effect-zod.ts b/packages/core/src/effect-zod.ts deleted file mode 100644 index 42d89ec7d537..000000000000 --- a/packages/core/src/effect-zod.ts +++ /dev/null @@ -1,370 +0,0 @@ -import { Effect, Option, Schema, SchemaAST } from "effect" -import z from "zod" - -/** - * Annotation key for providing a hand-crafted Zod schema that the walker - * should use instead of re-deriving from the AST. Attach it via - * `Schema.String.annotate({ [ZodOverride]: z.string().startsWith("per") })`. - */ -export const ZodOverride: unique symbol = Symbol.for("effect-zod/override") - -// AST nodes are immutable and frequently shared across schemas (e.g. a single -// Schema.Class embedded in multiple parents). Memoizing by node identity -// avoids rebuilding equivalent Zod subtrees and keeps derived children stable -// by reference across callers. -const walkCache = new WeakMap() - -// Shared empty ParseOptions for the rare callers that need one — avoids -// allocating a fresh object per parse inside refinements and transforms. -const EMPTY_PARSE_OPTIONS = {} as SchemaAST.ParseOptions - -export function zod(schema: S): z.ZodType> { - return walk(schema.ast) as z.ZodType> -} - -/** - * Derive a Zod value from an Effect Schema (or a Schema-backed export with a - * `.zod` static) and narrow the result to `z.ZodObject` so `.shape`, - * `.omit`, `.extend`, and friends are accessible. - * - * The `zod()` walker returns `z.ZodType` because not every AST node decodes - * to an object; this helper keeps the "I started from a `Schema.Struct`" cast - * in one place instead of sprinkling `as unknown as z.ZodObject` across - * call sites. - * - * The return is intentionally loose — carrying Schema field types through the - * mapped `.omit()` / `.extend()` surface triggers brand-intersection - * explosions for branded primitives (`string & Brand<"SessionID">` extends - * `object` via the brand and gets walked into the prototype by `DeepPartial`, - * mapped-schema helpers, and zod's inference through `z.ZodType` - * wrappers also can't reconstruct `T` cleanly. Consumers that care about the - * post-`.omit()` shape should cast `c.req.valid(...)` to the expected type. - */ -export function zodObject(schema: S): z.ZodObject { - const derived: z.ZodTypeAny = "zod" in schema && isZodType(schema.zod) ? schema.zod : walk(schema.ast) - return derived as unknown as z.ZodObject -} - -function isZodType(value: unknown): value is z.ZodTypeAny { - return typeof value === "object" && value !== null && "_zod" in value -} - -/** - * Emit a JSON Schema for a tool/route parameter schema — derives the zod form - * via the walker so Effect Schema inputs flow through the same zod-openapi - * pipeline the LLM/SDK layer already depends on. `io: "input"` mirrors what - * `session/prompt.ts` has always passed to `ai`'s `jsonSchema()` helper. - */ -export function toJsonSchema(schema: S) { - return z.toJSONSchema(zod(schema), { io: "input" }) -} - -function walk(ast: SchemaAST.AST): z.ZodTypeAny { - const cached = walkCache.get(ast) - if (cached) return cached - const result = walkUncached(ast) - walkCache.set(ast, result) - return result -} - -function walkUncached(ast: SchemaAST.AST): z.ZodTypeAny { - const override = (ast.annotations as any)?.[ZodOverride] as z.ZodTypeAny | undefined - // `description` annotations layer on top of an override so callers can - // reuse a shared override schema (e.g. `SessionID`) and still add a - // per-field description on the outer wrapper. - const base = override ?? bodyWithChecks(ast) - const desc = SchemaAST.resolveDescription(ast) - const ref = SchemaAST.resolveIdentifier(ast) - const described = desc ? base.describe(desc) : base - return ref ? described.meta({ ref }) : described -} - -function bodyWithChecks(ast: SchemaAST.AST): z.ZodTypeAny { - // Schema.Class wraps its fields in a Declaration AST plus an encoding that - // constructs the class instance. For the Zod derivation we want the plain - // field shape (the decoded/consumer view), not the class instance — so - // Declarations fall through to body(), not encoded(). User-level - // Schema.decodeTo / Schema.transform attach encoding to non-Declaration - // nodes, where we do apply the transform. - // - // Schema.withDecodingDefault also attaches encoding, but we want `.default(v)` - // on the inner Zod rather than a transform wrapper — so optional ASTs whose - // encoding resolves a default from Option.none() route through body()/opt(). - const hasEncoding = ast.encoding?.length && (ast._tag !== "Declaration" || ast.typeParameters.length === 0) - const hasTransform = hasEncoding && !(SchemaAST.isOptional(ast) && extractDefault(ast) !== undefined) - const base = hasTransform ? encoded(ast) : body(ast) - return ast.checks?.length ? applyChecks(base, ast.checks, ast) : base -} - -// Walk the encoded side and apply each link's decode to produce the decoded -// shape. A node `Target` produced by `from.decodeTo(Target)` carries -// `Target.encoding = [Link(from, transformation)]`. Chained decodeTo calls -// nest the encoding via `Link.to` so walking it recursively threads all -// prior transforms — typical encoding.length is 1. -function encoded(ast: SchemaAST.AST): z.ZodTypeAny { - const encoding = ast.encoding! - return encoding.reduce( - (acc, link) => acc.transform((v) => decode(link.transformation, v)), - walk(encoding[0].to), - ) -} - -// Transformations built via pure `SchemaGetter.transform(fn)` (the common -// decodeTo case) resolve synchronously, so running with no services is safe. -// Effectful / middleware-based transforms will surface as Effect defects. -function decode(transformation: SchemaAST.Link["transformation"], value: unknown): unknown { - const exit = Effect.runSyncExit( - (transformation.decode as any).run(Option.some(value), EMPTY_PARSE_OPTIONS) as Effect.Effect< - Option.Option - >, - ) - if (exit._tag === "Failure") throw new Error(`effect-zod: transform failed: ${String(exit.cause)}`) - return Option.getOrElse(exit.value, () => value) -} - -// Flatten FilterGroups and any nested variants into a linear list of Filters. -// Well-known filters (Schema.isInt, isGreaterThan, isPattern, …) are -// translated into native Zod methods so their JSON Schema output includes -// the corresponding constraint (type: integer, exclusiveMinimum, pattern, …). -// Anything else falls back to a single .superRefine layer — runtime-only, -// emits no JSON Schema constraint. -function applyChecks(out: z.ZodTypeAny, checks: SchemaAST.Checks, ast: SchemaAST.AST): z.ZodTypeAny { - const filters: SchemaAST.Filter[] = [] - const collect = (c: SchemaAST.Check) => { - if (c._tag === "FilterGroup") c.checks.forEach(collect) - else filters.push(c) - } - checks.forEach(collect) - - const unhandled: SchemaAST.Filter[] = [] - const translated = filters.reduce((acc, filter) => { - const next = translateFilter(acc, filter) - if (next) return next - unhandled.push(filter) - return acc - }, out) - - if (unhandled.length === 0) return translated - - return translated.superRefine((value, ctx) => { - for (const filter of unhandled) { - const issue = filter.run(value, ast, EMPTY_PARSE_OPTIONS) - if (!issue) continue - const message = issueMessage(issue) ?? (filter.annotations as any)?.message ?? "Validation failed" - ctx.addIssue({ code: "custom", message }) - } - }) -} - -// Translate a well-known Effect Schema filter into a native Zod method call on -// `out`. Dispatch is keyed on `filter.annotations.meta._tag`, which every -// built-in check factory (isInt, isGreaterThan, isPattern, …) attaches at -// construction time. Returns `undefined` for unrecognised filters so the -// caller can fall back to the generic .superRefine path. -function translateFilter(out: z.ZodTypeAny, filter: SchemaAST.Filter): z.ZodTypeAny | undefined { - const meta = (filter.annotations as { meta?: Record } | undefined)?.meta - if (!meta || typeof meta._tag !== "string") return undefined - switch (meta._tag) { - case "isInt": - return call(out, "int") - case "isFinite": - return call(out, "finite") - case "isGreaterThan": - return call(out, "gt", meta.exclusiveMinimum) - case "isGreaterThanOrEqualTo": - return call(out, "gte", meta.minimum) - case "isLessThan": - return call(out, "lt", meta.exclusiveMaximum) - case "isLessThanOrEqualTo": - return call(out, "lte", meta.maximum) - case "isBetween": { - const lo = meta.exclusiveMinimum ? call(out, "gt", meta.minimum) : call(out, "gte", meta.minimum) - if (!lo) return undefined - return meta.exclusiveMaximum ? call(lo, "lt", meta.maximum) : call(lo, "lte", meta.maximum) - } - case "isMultipleOf": - return call(out, "multipleOf", meta.divisor) - case "isMinLength": - return call(out, "min", meta.minLength) - case "isMaxLength": - return call(out, "max", meta.maxLength) - case "isLengthBetween": { - const lo = call(out, "min", meta.minimum) - if (!lo) return undefined - return call(lo, "max", meta.maximum) - } - case "isPattern": - return call(out, "regex", meta.regExp) - case "isStartsWith": - return call(out, "startsWith", meta.startsWith) - case "isEndsWith": - return call(out, "endsWith", meta.endsWith) - case "isIncludes": - return call(out, "includes", meta.includes) - case "isUUID": - return call(out, "uuid") - case "isULID": - return call(out, "ulid") - case "isBase64": - return call(out, "base64") - case "isBase64Url": - return call(out, "base64url") - } - return undefined -} - -// Invoke a named Zod method on `target` if it exists, otherwise return -// undefined so the caller can fall back. Using this helper instead of a -// typed cast keeps `translateFilter` free of per-case narrowing noise. -function call(target: z.ZodTypeAny, method: string, ...args: unknown[]): z.ZodTypeAny | undefined { - const fn = (target as unknown as Record z.ZodTypeAny) | undefined>)[method] - return typeof fn === "function" ? fn.apply(target, args) : undefined -} - -function issueMessage(issue: any): string | undefined { - if (typeof issue?.annotations?.message === "string") return issue.annotations.message - if (typeof issue?.message === "string") return issue.message - return undefined -} - -function body(ast: SchemaAST.AST): z.ZodTypeAny { - if (SchemaAST.isOptional(ast)) return opt(ast) - - switch (ast._tag) { - case "String": - return z.string() - case "Number": - return z.number() - case "Boolean": - return z.boolean() - case "Null": - return z.null() - case "Undefined": - return z.undefined() - case "Any": - case "Unknown": - return z.unknown() - case "Never": - return z.never() - case "Literal": - return z.literal(ast.literal) - case "Union": - return union(ast) - case "Objects": - return object(ast) - case "Arrays": - return array(ast) - case "Declaration": - return decl(ast) - default: - return fail(ast) - } -} - -function opt(ast: SchemaAST.AST): z.ZodTypeAny { - if (ast._tag !== "Union") return fail(ast) - const items = ast.types.filter((item) => item._tag !== "Undefined") - const inner = - items.length === 1 - ? walk(items[0]) - : items.length > 1 - ? z.union(items.map(walk) as [z.ZodTypeAny, z.ZodTypeAny, ...Array]) - : z.undefined() - // Schema.withDecodingDefault attaches an encoding `Link` whose transformation - // decode Getter resolves `Option.none()` to `Option.some(default)`. Invoke - // it to extract the default and emit `.default(...)` instead of `.optional()`. - const fallback = extractDefault(ast) - if (fallback !== undefined) return inner.default(fallback.value) - return inner.optional() -} - -type DecodeLink = { - readonly transformation: { - readonly decode: { - readonly run: ( - input: Option.Option, - options: SchemaAST.ParseOptions, - ) => Effect.Effect, unknown> - } - } -} - -function extractDefault(ast: SchemaAST.AST): { value: unknown } | undefined { - const encoding = (ast as { encoding?: ReadonlyArray }).encoding - if (!encoding?.length) return undefined - // Walk the chain of encoding Links in order; the first Getter that produces - // a value from Option.none wins. withDecodingDefault always puts its - // defaulting Link adjacent to the optional Union. - for (const link of encoding) { - const probe = Effect.runSyncExit(link.transformation.decode.run(Option.none(), {})) - if (probe._tag !== "Success") continue - if (Option.isSome(probe.value)) return { value: probe.value.value } - } - return undefined -} - -function union(ast: SchemaAST.Union): z.ZodTypeAny { - // When every member is a string literal, emit z.enum() so that - // JSON Schema produces { "enum": [...] } instead of { "anyOf": [{ "const": ... }] }. - if (ast.types.length >= 2 && ast.types.every((t) => t._tag === "Literal" && typeof t.literal === "string")) { - return z.enum(ast.types.map((t) => (t as SchemaAST.Literal).literal as string) as [string, ...string[]]) - } - - const items = ast.types.map(walk) - if (items.length === 1) return items[0] - if (items.length < 2) return fail(ast) - - const discriminator = ast.annotations?.discriminator - if (typeof discriminator === "string") { - return z.discriminatedUnion(discriminator, items as [z.ZodObject, z.ZodObject, ...z.ZodObject[]]) - } - - return z.union(items as [z.ZodTypeAny, z.ZodTypeAny, ...Array]) -} - -function object(ast: SchemaAST.Objects): z.ZodTypeAny { - // Pure record: { [k: string]: V } - if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 1) { - const sig = ast.indexSignatures[0] - if (sig.parameter._tag !== "String") return fail(ast) - return z.record(z.string(), walk(sig.type)) - } - - // Pure object with known fields and no index signatures. - if (ast.indexSignatures.length === 0) { - return z.object(Object.fromEntries(ast.propertySignatures.map((sig) => [String(sig.name), walk(sig.type)]))) - } - - // Struct with a catchall (StructWithRest): known fields + index signature. - // Only supports a single string-keyed index signature; multi-signature or - // symbol/number keys fall through to fail. - if (ast.indexSignatures.length !== 1) return fail(ast) - const sig = ast.indexSignatures[0] - if (sig.parameter._tag !== "String") return fail(ast) - return z - .object(Object.fromEntries(ast.propertySignatures.map((p) => [String(p.name), walk(p.type)]))) - .catchall(walk(sig.type)) -} - -function array(ast: SchemaAST.Arrays): z.ZodTypeAny { - // Pure variadic arrays: { elements: [], rest: [item] } - if (ast.elements.length === 0) { - if (ast.rest.length !== 1) return fail(ast) - return z.array(walk(ast.rest[0])) - } - // Fixed-length tuples: { elements: [a, b, ...], rest: [] } - // Tuples with a variadic tail (...rest) are not yet supported. - if (ast.rest.length > 0) return fail(ast) - const items = ast.elements.map(walk) - return z.tuple(items as [z.ZodTypeAny, ...Array]) -} - -function decl(ast: SchemaAST.Declaration): z.ZodTypeAny { - if (ast.typeParameters.length !== 1) return fail(ast) - return walk(ast.typeParameters[0]) -} - -function fail(ast: SchemaAST.AST): never { - const ref = SchemaAST.resolveIdentifier(ast) - throw new Error(`unsupported effect schema: ${ref ?? ast._tag}`) -} diff --git a/packages/core/src/event.ts b/packages/core/src/event.ts new file mode 100644 index 000000000000..e01dc5b0d63b --- /dev/null +++ b/packages/core/src/event.ts @@ -0,0 +1,157 @@ +import { Context, Effect, Layer, Option, PubSub, Schema, Stream } from "effect" +import { Location } from "./location" +import { withStatics } from "./schema" +import { Identifier } from "./util/identifier" + +export const ID = Schema.String.pipe( + Schema.brand("Event.ID"), + withStatics((schema) => ({ create: () => schema.make("evt_" + Identifier.ascending()) })), +) +export type ID = typeof ID.Type + +export type Definition = { + readonly type: Type + readonly version?: number + readonly aggregate?: string + readonly data: DataSchema +} + +export type Data = Schema.Schema.Type + +export type Payload = { + readonly id: ID + readonly type: D["type"] + readonly data: Data + readonly version?: number + readonly location?: Location.Ref + readonly metadata?: Record +} + +export type Sync = (event: Payload) => Effect.Effect + +export const registry = new Map() + +export function define(input: { + readonly type: Type + readonly version?: number + readonly aggregate?: string + readonly schema: Fields +}): Schema.Schema>>> & Definition> { + const Data = Schema.Struct(input.schema) + const Payload = Schema.Struct({ + id: ID, + metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), + type: Schema.Literal(input.type), + version: Schema.optional(Schema.Number), + location: Schema.optional(Location.Ref), + data: Data, + }).annotate({ identifier: input.type }) + + const definition = Object.assign(Payload, { + type: input.type, + ...(input.version === undefined ? {} : { version: input.version }), + ...(input.aggregate === undefined ? {} : { aggregate: input.aggregate }), + data: Data, + }) + registry.set(input.type, definition) + return definition as Schema.Schema>>> & + Definition> +} + +export function definitions() { + return registry.values().toArray() +} + +export interface PublishOptions { + readonly id?: ID + readonly metadata?: Record +} + +export type Unsubscribe = Effect.Effect + +export interface Interface { + readonly publish: ( + definition: D, + data: Data, + options?: PublishOptions, + ) => Effect.Effect> + readonly publishEvent: (event: Payload) => Effect.Effect> + readonly subscribe: (definition: D) => Stream.Stream> + readonly all: () => Stream.Stream + readonly sync: (handler: Sync) => Effect.Effect +} + +export class Service extends Context.Service()("@opencode/Event") {} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const all = yield* PubSub.unbounded() + const typed = new Map>() + const syncHandlers = new Array() + + const getOrCreate = (definition: Definition) => + Effect.gen(function* () { + const existing = typed.get(definition.type) + if (existing) return existing + const pubsub = yield* PubSub.unbounded() + typed.set(definition.type, pubsub) + return pubsub + }) + + yield* Effect.addFinalizer(() => + Effect.gen(function* () { + yield* PubSub.shutdown(all) + yield* Effect.forEach(typed.values(), PubSub.shutdown, { discard: true }) + }), + ) + + function publishEvent(event: Payload) { + return Effect.gen(function* () { + for (const sync of syncHandlers) { + yield* sync(event as Payload) + } + const pubsub = typed.get(event.type) + if (pubsub) yield* PubSub.publish(pubsub, event as Payload) + yield* PubSub.publish(all, event as Payload) + return event + }) + } + + function publish(definition: D, data: Data, options?: PublishOptions) { + return Effect.gen(function* () { + const location = Option.getOrUndefined(yield* Effect.serviceOption(Location.Service)) + const event = { + id: options?.id ?? ID.create(), + ...(options?.metadata ? { metadata: options.metadata } : {}), + type: definition.type, + ...(definition.version === undefined ? {} : { version: definition.version }), + ...(location ? { location } : {}), + data, + } as Payload + return yield* publishEvent(event) + }) + } + + const subscribe = (definition: D): Stream.Stream> => + Stream.unwrap(getOrCreate(definition).pipe(Effect.map((pubsub) => Stream.fromPubSub(pubsub)))).pipe( + Stream.map((event) => event as Payload), + ) + + const streamAll = (): Stream.Stream => Stream.fromPubSub(all) + const sync = (handler: Sync): Effect.Effect => + Effect.sync(() => { + syncHandlers.push(handler) + return Effect.sync(() => { + const index = syncHandlers.indexOf(handler) + if (index >= 0) syncHandlers.splice(index, 1) + }) + }) + + return Service.of({ publish, publishEvent, subscribe, all: streamAll, sync }) + }), +) + +export const defaultLayer = layer + +export * as EventV2 from "./event" diff --git a/packages/core/src/flag/flag.ts b/packages/core/src/flag/flag.ts index f76d1aaf9d22..4b1d3d20aec5 100644 --- a/packages/core/src/flag/flag.ts +++ b/packages/core/src/flag/flag.ts @@ -5,29 +5,13 @@ function truthy(key: string) { return value === "true" || value === "1" } -function falsy(key: string) { - const value = process.env[key]?.toLowerCase() - return value === "false" || value === "0" -} - -function number(key: string) { - const value = process.env[key] - if (!value) return undefined - const parsed = Number(value) - return Number.isInteger(parsed) && parsed > 0 ? parsed : undefined -} - const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL") -const OPENCODE_DISABLE_CLAUDE_CODE = truthy("OPENCODE_DISABLE_CLAUDE_CODE") -const OPENCODE_DISABLE_CLAUDE_CODE_SKILLS = - OPENCODE_DISABLE_CLAUDE_CODE || truthy("OPENCODE_DISABLE_CLAUDE_CODE_SKILLS") const copy = process.env["OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"] export const Flag = { OTEL_EXPORTER_OTLP_ENDPOINT: process.env["OTEL_EXPORTER_OTLP_ENDPOINT"], OTEL_EXPORTER_OTLP_HEADERS: process.env["OTEL_EXPORTER_OTLP_HEADERS"], - OPENCODE_AUTO_SHARE: truthy("OPENCODE_AUTO_SHARE"), OPENCODE_AUTO_HEAP_SNAPSHOT: truthy("OPENCODE_AUTO_HEAP_SNAPSHOT"), OPENCODE_GIT_BASH_PATH: process.env["OPENCODE_GIT_BASH_PATH"], OPENCODE_CONFIG: process.env["OPENCODE_CONFIG"], @@ -38,53 +22,28 @@ export const Flag = { OPENCODE_DISABLE_TERMINAL_TITLE: truthy("OPENCODE_DISABLE_TERMINAL_TITLE"), OPENCODE_SHOW_TTFD: truthy("OPENCODE_SHOW_TTFD"), OPENCODE_PERMISSION: process.env["OPENCODE_PERMISSION"], - OPENCODE_DISABLE_DEFAULT_PLUGINS: truthy("OPENCODE_DISABLE_DEFAULT_PLUGINS"), - OPENCODE_DISABLE_LSP_DOWNLOAD: truthy("OPENCODE_DISABLE_LSP_DOWNLOAD"), - OPENCODE_ENABLE_EXPERIMENTAL_MODELS: truthy("OPENCODE_ENABLE_EXPERIMENTAL_MODELS"), OPENCODE_DISABLE_AUTOCOMPACT: truthy("OPENCODE_DISABLE_AUTOCOMPACT"), OPENCODE_DISABLE_MODELS_FETCH: truthy("OPENCODE_DISABLE_MODELS_FETCH"), OPENCODE_DISABLE_MOUSE: truthy("OPENCODE_DISABLE_MOUSE"), - OPENCODE_DISABLE_CLAUDE_CODE, - OPENCODE_DISABLE_CLAUDE_CODE_PROMPT: OPENCODE_DISABLE_CLAUDE_CODE || truthy("OPENCODE_DISABLE_CLAUDE_CODE_PROMPT"), - OPENCODE_DISABLE_CLAUDE_CODE_SKILLS, - OPENCODE_DISABLE_EXTERNAL_SKILLS: truthy("OPENCODE_DISABLE_EXTERNAL_SKILLS"), OPENCODE_FAKE_VCS: process.env["OPENCODE_FAKE_VCS"], OPENCODE_SERVER_PASSWORD: process.env["OPENCODE_SERVER_PASSWORD"], OPENCODE_SERVER_USERNAME: process.env["OPENCODE_SERVER_USERNAME"], - OPENCODE_ENABLE_QUESTION_TOOL: truthy("OPENCODE_ENABLE_QUESTION_TOOL"), // Experimental - OPENCODE_EXPERIMENTAL, OPENCODE_EXPERIMENTAL_FILEWATCHER: Config.boolean("OPENCODE_EXPERIMENTAL_FILEWATCHER").pipe( Config.withDefault(false), ), OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: Config.boolean("OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER").pipe( Config.withDefault(false), ), - OPENCODE_EXPERIMENTAL_ICON_DISCOVERY: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY"), OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT: copy === undefined ? process.platform === "win32" : truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"), - OPENCODE_ENABLE_EXA: truthy("OPENCODE_ENABLE_EXA") || OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EXA"), - OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: number("OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS"), - OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX: number("OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX"), - OPENCODE_EXPERIMENTAL_OXFMT: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_OXFMT"), - OPENCODE_EXPERIMENTAL_LSP_TY: truthy("OPENCODE_EXPERIMENTAL_LSP_TY"), - OPENCODE_EXPERIMENTAL_LSP_TOOL: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_LSP_TOOL"), - OPENCODE_EXPERIMENTAL_PLAN_MODE: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_PLAN_MODE"), - OPENCODE_EXPERIMENTAL_SCOUT: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_SCOUT"), - OPENCODE_EXPERIMENTAL_MARKDOWN: !falsy("OPENCODE_EXPERIMENTAL_MARKDOWN"), - OPENCODE_ENABLE_PARALLEL: truthy("OPENCODE_ENABLE_PARALLEL") || truthy("OPENCODE_EXPERIMENTAL_PARALLEL"), OPENCODE_MODELS_URL: process.env["OPENCODE_MODELS_URL"], OPENCODE_MODELS_PATH: process.env["OPENCODE_MODELS_PATH"], - OPENCODE_DISABLE_EMBEDDED_WEB_UI: truthy("OPENCODE_DISABLE_EMBEDDED_WEB_UI"), OPENCODE_DB: process.env["OPENCODE_DB"], - OPENCODE_DISABLE_CHANNEL_DB: truthy("OPENCODE_DISABLE_CHANNEL_DB"), - OPENCODE_SKIP_MIGRATIONS: truthy("OPENCODE_SKIP_MIGRATIONS"), - OPENCODE_STRICT_CONFIG_DEPS: truthy("OPENCODE_STRICT_CONFIG_DEPS"), OPENCODE_WORKSPACE_ID: process.env["OPENCODE_WORKSPACE_ID"], OPENCODE_EXPERIMENTAL_WORKSPACES: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_WORKSPACES"), - OPENCODE_EXPERIMENTAL_EVENT_SYSTEM: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EVENT_SYSTEM"), OPENCODE_EXPERIMENTAL_SESSION_SWITCHING: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_SESSION_SWITCHING"), // Evaluated at access time (not module load) because tests, the CLI, and diff --git a/packages/opencode/src/provider/sdk/copilot/README.md b/packages/core/src/github-copilot/README.md similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/README.md rename to packages/core/src/github-copilot/README.md diff --git a/packages/opencode/src/provider/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts b/packages/core/src/github-copilot/chat/convert-to-openai-compatible-chat-messages.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts rename to packages/core/src/github-copilot/chat/convert-to-openai-compatible-chat-messages.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/get-response-metadata.ts b/packages/core/src/github-copilot/chat/get-response-metadata.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/get-response-metadata.ts rename to packages/core/src/github-copilot/chat/get-response-metadata.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/map-openai-compatible-finish-reason.ts b/packages/core/src/github-copilot/chat/map-openai-compatible-finish-reason.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/map-openai-compatible-finish-reason.ts rename to packages/core/src/github-copilot/chat/map-openai-compatible-finish-reason.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-api-types.ts b/packages/core/src/github-copilot/chat/openai-compatible-api-types.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-api-types.ts rename to packages/core/src/github-copilot/chat/openai-compatible-api-types.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-language-model.ts b/packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-language-model.ts rename to packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-options.ts b/packages/core/src/github-copilot/chat/openai-compatible-chat-options.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-options.ts rename to packages/core/src/github-copilot/chat/openai-compatible-chat-options.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-metadata-extractor.ts b/packages/core/src/github-copilot/chat/openai-compatible-metadata-extractor.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-metadata-extractor.ts rename to packages/core/src/github-copilot/chat/openai-compatible-metadata-extractor.ts diff --git a/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-prepare-tools.ts b/packages/core/src/github-copilot/chat/openai-compatible-prepare-tools.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-prepare-tools.ts rename to packages/core/src/github-copilot/chat/openai-compatible-prepare-tools.ts diff --git a/packages/opencode/src/provider/sdk/copilot/copilot-provider.ts b/packages/core/src/github-copilot/copilot-provider.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/copilot-provider.ts rename to packages/core/src/github-copilot/copilot-provider.ts diff --git a/packages/opencode/src/provider/sdk/copilot/openai-compatible-error.ts b/packages/core/src/github-copilot/openai-compatible-error.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/openai-compatible-error.ts rename to packages/core/src/github-copilot/openai-compatible-error.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/convert-to-openai-responses-input.ts b/packages/core/src/github-copilot/responses/convert-to-openai-responses-input.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/convert-to-openai-responses-input.ts rename to packages/core/src/github-copilot/responses/convert-to-openai-responses-input.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/map-openai-responses-finish-reason.ts b/packages/core/src/github-copilot/responses/map-openai-responses-finish-reason.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/map-openai-responses-finish-reason.ts rename to packages/core/src/github-copilot/responses/map-openai-responses-finish-reason.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/openai-config.ts b/packages/core/src/github-copilot/responses/openai-config.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/openai-config.ts rename to packages/core/src/github-copilot/responses/openai-config.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/openai-error.ts b/packages/core/src/github-copilot/responses/openai-error.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/openai-error.ts rename to packages/core/src/github-copilot/responses/openai-error.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-api-types.ts b/packages/core/src/github-copilot/responses/openai-responses-api-types.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/openai-responses-api-types.ts rename to packages/core/src/github-copilot/responses/openai-responses-api-types.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-language-model.ts b/packages/core/src/github-copilot/responses/openai-responses-language-model.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/openai-responses-language-model.ts rename to packages/core/src/github-copilot/responses/openai-responses-language-model.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-prepare-tools.ts b/packages/core/src/github-copilot/responses/openai-responses-prepare-tools.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/openai-responses-prepare-tools.ts rename to packages/core/src/github-copilot/responses/openai-responses-prepare-tools.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-settings.ts b/packages/core/src/github-copilot/responses/openai-responses-settings.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/openai-responses-settings.ts rename to packages/core/src/github-copilot/responses/openai-responses-settings.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/tool/code-interpreter.ts b/packages/core/src/github-copilot/responses/tool/code-interpreter.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/tool/code-interpreter.ts rename to packages/core/src/github-copilot/responses/tool/code-interpreter.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/tool/file-search.ts b/packages/core/src/github-copilot/responses/tool/file-search.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/tool/file-search.ts rename to packages/core/src/github-copilot/responses/tool/file-search.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/tool/image-generation.ts b/packages/core/src/github-copilot/responses/tool/image-generation.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/tool/image-generation.ts rename to packages/core/src/github-copilot/responses/tool/image-generation.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/tool/local-shell.ts b/packages/core/src/github-copilot/responses/tool/local-shell.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/tool/local-shell.ts rename to packages/core/src/github-copilot/responses/tool/local-shell.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/tool/web-search-preview.ts b/packages/core/src/github-copilot/responses/tool/web-search-preview.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/tool/web-search-preview.ts rename to packages/core/src/github-copilot/responses/tool/web-search-preview.ts diff --git a/packages/opencode/src/provider/sdk/copilot/responses/tool/web-search.ts b/packages/core/src/github-copilot/responses/tool/web-search.ts similarity index 100% rename from packages/opencode/src/provider/sdk/copilot/responses/tool/web-search.ts rename to packages/core/src/github-copilot/responses/tool/web-search.ts diff --git a/packages/core/src/location-layer.ts b/packages/core/src/location-layer.ts new file mode 100644 index 000000000000..84dfb3dfae7f --- /dev/null +++ b/packages/core/src/location-layer.ts @@ -0,0 +1,12 @@ +import { Layer, LayerMap } from "effect" +import { Location } from "./location" +import { Catalog } from "./catalog" +import { PluginBoot } from "./plugin/boot" + +export class LocationServiceMap extends LayerMap.Service()("@opencode/example/LocationServiceMap", { + lookup: (ref: Location.Ref) => { + const location = Layer.succeed(Location.Service, Location.Service.of(ref)) + return Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer).pipe(Layer.provide(location)) + }, + idleTimeToLive: "5 minutes", +}) {} diff --git a/packages/core/src/location.ts b/packages/core/src/location.ts new file mode 100644 index 000000000000..00ff9cd3ea72 --- /dev/null +++ b/packages/core/src/location.ts @@ -0,0 +1,11 @@ +import { Context, Schema } from "effect" + +export * as Location from "./location" + +export const Ref = Schema.Struct({ + directory: Schema.String, + workspaceID: Schema.optional(Schema.String), +}).annotate({ identifier: "Location.Ref" }) +export type Ref = typeof Ref.Type + +export class Service extends Context.Service()("@opencode/Location") {} diff --git a/packages/core/src/model.ts b/packages/core/src/model.ts new file mode 100644 index 000000000000..77b8c60ebe77 --- /dev/null +++ b/packages/core/src/model.ts @@ -0,0 +1,116 @@ +import { DateTime, Schema } from "effect" +import { DateTimeUtcFromMillis } from "effect/Schema" +import { ProviderV2 } from "./provider" + +export const ID = Schema.String.pipe(Schema.brand("ModelV2.ID")) +export type ID = typeof ID.Type + +export const VariantID = Schema.String.pipe(Schema.brand("VariantID")) +export type VariantID = typeof VariantID.Type + +// Grouping of models, eg claude opus, claude sonnet +export const Family = Schema.String.pipe(Schema.brand("Family")) +export type Family = typeof Family.Type + +export const Capabilities = Schema.Struct({ + tools: Schema.Boolean, + // mime patterns, image, audio, video/*, text/* + input: Schema.String.pipe(Schema.Array), + output: Schema.String.pipe(Schema.Array), +}) +export type Capabilities = typeof Capabilities.Type + +export const Cost = Schema.Struct({ + tier: Schema.Struct({ + type: Schema.Literal("context"), + size: Schema.Int, + }).pipe(Schema.optional), + input: Schema.Finite, + output: Schema.Finite, + cache: Schema.Struct({ + read: Schema.Finite, + write: Schema.Finite, + }), +}) + +export const Ref = Schema.Struct({ + id: ID, + providerID: ProviderV2.ID, + variant: VariantID, +}) +export type Ref = typeof Ref.Type + +export class Info extends Schema.Class("ModelV2.Info")({ + id: ID, + apiID: ID, + providerID: ProviderV2.ID, + family: Family.pipe(Schema.optional), + name: Schema.String, + endpoint: ProviderV2.Endpoint, + capabilities: Capabilities, + options: Schema.Struct({ + ...ProviderV2.Options.fields, + variant: Schema.String.pipe(Schema.optional), + }), + variants: Schema.Struct({ + id: VariantID, + ...ProviderV2.Options.fields, + }).pipe(Schema.Array), + time: Schema.Struct({ + released: DateTimeUtcFromMillis, + }), + cost: Cost.pipe(Schema.Array), + status: Schema.Literals(["alpha", "beta", "deprecated", "active"]), + enabled: Schema.Boolean, + limit: Schema.Struct({ + context: Schema.Int, + input: Schema.Int.pipe(Schema.optional), + output: Schema.Int, + }), +}) { + static empty(providerID: ProviderV2.ID, modelID: ID) { + return new Info({ + id: modelID, + apiID: modelID, + providerID, + name: modelID, + endpoint: { + type: "unknown", + }, + capabilities: { + tools: false, + input: [], + output: [], + }, + options: { + headers: {}, + body: {}, + aisdk: { + provider: {}, + request: {}, + }, + }, + variants: [], + time: { + released: DateTime.makeUnsafe(0), + }, + cost: [], + status: "active", + enabled: true, + limit: { + context: 0, + output: 0, + }, + }) + } +} + +export function parse(input: string): { providerID: ProviderV2.ID; modelID: ID } { + const [providerID, ...modelID] = input.split("/") + return { + providerID: ProviderV2.ID.make(providerID), + modelID: ID.make(modelID.join("/")), + } +} + +export * as ModelV2 from "./model" diff --git a/packages/core/src/models-snapshot.d.ts b/packages/core/src/models-snapshot.d.ts new file mode 100644 index 000000000000..839eba6b7d51 --- /dev/null +++ b/packages/core/src/models-snapshot.d.ts @@ -0,0 +1,2 @@ +// Auto-generated by build.ts - do not edit +export declare const snapshot: Record diff --git a/packages/core/src/models-snapshot.js b/packages/core/src/models-snapshot.js new file mode 100644 index 000000000000..c582a75bdfd4 --- /dev/null +++ b/packages/core/src/models-snapshot.js @@ -0,0 +1,71726 @@ +// @ts-nocheck +// Auto-generated by build.ts - do not edit +export const snapshot = { + "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-235b-a22b": { + id: "qwen3-235b-a22b", + name: "Qwen3-235B-A22B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 2.86 }, + limit: { context: 128000, output: 16384 }, + }, + "grok-4.1": { + id: "grok-4.1", + name: "grok-4.1", + 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, + cost: { input: 2, output: 10 }, + limit: { context: 200000, output: 64000 }, + }, + "MiniMax-M2": { + id: "MiniMax-M2", + name: "MiniMax-M2", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-10-26", + last_updated: "2025-10-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.33, output: 1.32 }, + limit: { context: 1000000, output: 128000 }, + }, + "grok-4-1-fast-reasoning": { + id: "grok-4-1-fast-reasoning", + name: "grok-4-1-fast-reasoning", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-11-20", + last_updated: "2025-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, output: 30000 }, + }, + "gemini-2.5-flash-nothink": { + id: "gemini-2.5-flash-nothink", + name: "gemini-2.5-flash-nothink", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-06-24", + last_updated: "2025-06-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1000000, output: 65536 }, + }, + "grok-4.20-multi-agent-beta-0309": { + id: "grok-4.20-multi-agent-beta-0309", + name: "grok-4.20-multi-agent-beta-0309", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-16", + last_updated: "2026-03-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 2000000, output: 30000 }, + }, + "kimi-k2-0905-preview": { + id: "kimi-k2-0905-preview", + name: "kimi-k2-0905-preview", + 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: false, + cost: { input: 0.632, output: 2.53 }, + limit: { context: 262144, output: 262144 }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "claude-haiku-4-5", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-02-28", + release_date: "2025-10-16", + last_updated: "2025-10-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "claude-opus-4-5-20251101", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-25", + last_updated: "2025-11-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 200000, output: 64000 }, + }, + "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", + 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, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen3-235b-a22b-instruct-2507": { + id: "qwen3-235b-a22b-instruct-2507", + name: "qwen3-235b-a22b-instruct-2507", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.29, output: 1.143 }, + limit: { context: 128000, output: 65536 }, + }, + "glm-5v-turbo": { + id: "glm-5v-turbo", + name: "GLM-5V-Turbo", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-02", + modalities: { input: ["text", "image", "video", "audio", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.72, output: 3.2 }, + limit: { context: 200000, output: 131072 }, + }, + "mistral-large-2512": { + id: "mistral-large-2512", + name: "mistral-large-2512", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 3.3 }, + limit: { context: 128000, output: 262144 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "glm-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.286, output: 1.142 }, + limit: { context: 204800, output: 131072 }, + }, + "claude-3-5-haiku-20241022": { + id: "claude-3-5-haiku-20241022", + name: "claude-3-5-haiku-20241022", + 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, + cost: { input: 0.8, output: 4 }, + limit: { context: 200000, output: 8192 }, + }, + "doubao-seed-1-8-251215": { + id: "doubao-seed-1-8-251215", + name: "doubao-seed-1-8-251215", + 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, + cost: { input: 0.114, output: 0.286 }, + limit: { context: 224000, output: 64000 }, + }, + "chatgpt-4o-latest": { + id: "chatgpt-4o-latest", + name: "chatgpt-4o-latest", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-09", + release_date: "2024-08-08", + last_updated: "2024-08-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 15 }, + limit: { context: 128000, output: 16384 }, + }, + "glm-5": { + id: "glm-5", + name: "glm-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.6 }, + limit: { context: 204800, output: 131072 }, + }, + "deepseek-chat": { + id: "deepseek-chat", + name: "Deepseek-Chat", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2024-11-29", + last_updated: "2024-11-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 0.43 }, + limit: { context: 128000, output: 8192 }, + }, + "deepseek-v3.2-thinking": { + id: "deepseek-v3.2-thinking", + name: "DeepSeek-V3.2-Thinking", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.29, output: 0.43 }, + limit: { context: 128000, output: 128000 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "claude-sonnet-4-6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-18", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 1000000, output: 64000 }, + }, + "gpt-5-thinking": { + id: "gpt-5-thinking", + name: "gpt-5-thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-08", + last_updated: "2025-08-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "glm-4.7-flashx": { + id: "glm-4.7-flashx", + name: "glm-4.7-flashx", + family: "glm-flash", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-01-20", + last_updated: "2026-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.0715, output: 0.429 }, + limit: { context: 200000, output: 131072 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "gemini-3-flash-preview", + 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, + cost: { input: 0.5, output: 3 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen-plus": { + id: "qwen-plus", + name: "Qwen-Plus", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 1.2 }, + limit: { context: 1000000, output: 32768 }, + }, + "grok-4.20-beta-0309-non-reasoning": { + id: "grok-4.20-beta-0309-non-reasoning", + name: "grok-4.20-beta-0309-non-reasoning", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-16", + last_updated: "2026-03-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 2000000, output: 30000 }, + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "claude-opus-4-7", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2026-01-31", + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "gpt-5-mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2024-05-30", + release_date: "2025-08-08", + last_updated: "2025-08-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "gemini-3-pro-preview", + attachment: true, + reasoning: false, + 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, + cost: { input: 2, output: 12 }, + limit: { context: 1000000, output: 64000 }, + }, + "MiniMax-M2.7": { + id: "MiniMax-M2.7", + name: "MiniMax-M2.7", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-19", + last_updated: "2026-03-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen3-max-2025-09-23": { + id: "qwen3-max-2025-09-23", + name: "qwen3-max-2025-09-23", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.86, output: 3.43 }, + limit: { context: 258048, output: 65536 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "claude-sonnet-4-5-20250929", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07-31", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen-flash": { + id: "qwen-flash", + name: "Qwen-Flash", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.022, output: 0.22 }, + limit: { context: 1000000, output: 32768 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "gemini-2.5-pro", + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 1000000, output: 65536 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "grok-4-1-fast-non-reasoning", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-11-20", + last_updated: "2025-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, output: 30000 }, + }, + "claude-3-5-haiku-latest": { + id: "claude-3-5-haiku-latest", + name: "claude-3-5-haiku-latest", + 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, + cost: { input: 0.8, output: 4 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-opus-4-5-20251101-thinking": { + id: "claude-opus-4-5-20251101-thinking", + name: "claude-opus-4-5-20251101-thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-11-25", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 200000, output: 64000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "gpt-5.2", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2025-12-12", + last_updated: "2025-12-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "gpt-5.4-mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-03-19", + last_updated: "2026-03-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-3-pro-image-preview": { + id: "gemini-3-pro-image-preview", + name: "gemini-3-pro-image-preview", + 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"] }, + open_weights: false, + cost: { input: 2, output: 120 }, + limit: { context: 32768, output: 64000 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "glm-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-10", + last_updated: "2026-04-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.86, output: 3.5 }, + limit: { context: 200000, output: 131072 }, + }, + "qwen-max-latest": { + id: "qwen-max-latest", + name: "Qwen-Max-Latest", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2024-04-03", + last_updated: "2025-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.343, output: 1.372 }, + limit: { context: 131072, output: 8192 }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "gpt-5.4-nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-03-19", + last_updated: "2026-03-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.25 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-flash-image": { + id: "gemini-2.5-flash-image", + name: "gemini-2.5-flash-image", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-01", + release_date: "2025-10-08", + last_updated: "2025-10-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 30 }, + limit: { context: 32768, output: 32768 }, + }, + "glm-4.5": { + id: "glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.286, output: 1.142 }, + limit: { context: 131072, output: 98304 }, + }, + "gpt-5.4-mini-2026-03-17": { + id: "gpt-5.4-mini-2026-03-17", + name: "gpt-5.4-mini-2026-03-17", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-03-19", + last_updated: "2026-03-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "gemini-2.5-flash", + 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, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1000000, output: 65536 }, + }, + "gpt-5.2-chat-latest": { + id: "gpt-5.2-chat-latest", + name: "gpt-5.2-chat-latest", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2025-12-12", + last_updated: "2025-12-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 128000, output: 16384 }, + }, + "doubao-seed-1-6-vision-250815": { + id: "doubao-seed-1-6-vision-250815", + name: "doubao-seed-1-6-vision-250815", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.114, output: 1.143 }, + limit: { context: 256000, output: 32000 }, + }, + "gemini-3.1-flash-image-preview": { + id: "gemini-3.1-flash-image-preview", + name: "gemini-3.1-flash-image-preview", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-01", + release_date: "2026-02-27", + last_updated: "2026-02-27", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.5, output: 60 }, + limit: { context: 131072, output: 32768 }, + }, + "MiniMax-M2.7-highspeed": { + id: "MiniMax-M2.7-highspeed", + name: "MiniMax-M2.7-highspeed", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-19", + last_updated: "2026-03-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 4.8 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-4.5-x": { + id: "glm-4.5-x", + name: "glm-4.5-x", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.143, output: 2.29 }, + limit: { context: 128000, output: 16384 }, + }, + "MiniMax-M2.1": { + id: "MiniMax-M2.1", + name: "MiniMax-M2.1", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-19", + last_updated: "2025-12-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 1000000, output: 131072 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "gpt-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "kimi-k2-thinking-turbo": { + id: "kimi-k2-thinking-turbo", + name: "kimi-k2-thinking-turbo", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 1.265, output: 9.119 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek-reasoner": { + id: "deepseek-reasoner", + name: "Deepseek-Reasoner", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 0.43 }, + limit: { context: 128000, output: 128000 }, + }, + "grok-4-fast-reasoning": { + id: "grok-4-fast-reasoning", + name: "grok-4-fast-reasoning", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-09-23", + last_updated: "2025-09-23", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, output: 30000 }, + }, + "claude-opus-4-1-20250805-thinking": { + id: "claude-opus-4-1-20250805-thinking", + name: "claude-opus-4-1-20250805-thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-05-27", + last_updated: "2025-05-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75 }, + limit: { context: 200000, output: 32000 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "glm-4.5-air", + family: "glm-air", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1143, output: 0.286 }, + limit: { context: 131072, output: 98304 }, + }, + "gpt-5.4-pro": { + id: "gpt-5.4-pro", + name: "gpt-5.4-pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, cache_read: 0, cache_write: 0, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "glm-5-turbo": { + id: "glm-5-turbo", + name: "glm-5-turbo", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.72, output: 3.2 }, + limit: { context: 200000, output: 131072 }, + }, + "qwen3-30b-a3b": { + id: "qwen3-30b-a3b", + name: "Qwen3-30B-A3B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.11, output: 1.08 }, + limit: { context: 128000, output: 8192 }, + }, + "claude-opus-4-5": { + id: "claude-opus-4-5", + name: "claude-opus-4-5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-25", + last_updated: "2025-11-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 200000, output: 64000 }, + }, + "glm-4.5v": { + id: "glm-4.5v", + name: "GLM-4.5V", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-08-12", + last_updated: "2025-08-12", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 0.86 }, + limit: { context: 64000, output: 16384 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "glm-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.286, output: 1.142 }, + limit: { context: 204800, output: 131072 }, + }, + "claude-opus-4-6-thinking": { + id: "claude-opus-4-6-thinking", + name: "claude-opus-4-6-thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2026-02-06", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 1000000, output: 128000 }, + }, + "gemini-2.5-flash-preview-09-2025": { + id: "gemini-2.5-flash-preview-09-2025", + name: "gemini-2.5-flash-preview-09-2025", + 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, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1000000, output: 65536 }, + }, + "claude-sonnet-4-6-thinking": { + id: "claude-sonnet-4-6-thinking", + name: "claude-sonnet-4-6-thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2026-02-18", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 1000000, output: 64000 }, + }, + "glm-4.6v": { + id: "glm-4.6v", + name: "GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.145, output: 0.43 }, + limit: { context: 128000, output: 32768 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "claude-opus-4-1-20250805", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "gpt-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + cache_write: 0, + context_over_200k: { input: 5, output: 22.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-5.1-chat-latest": { + id: "gpt-5.1-chat-latest", + name: "gpt-5.1-chat-latest", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "claude-haiku-4-5-20251001", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-02-28", + release_date: "2025-10-16", + last_updated: "2025-10-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5 }, + limit: { context: 200000, output: 64000 }, + }, + "MiniMax-M1": { + id: "MiniMax-M1", + name: "MiniMax-M1", + 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, + cost: { input: 0.132, output: 1.254 }, + limit: { context: 1000000, output: 128000 }, + }, + "gpt-5.4-nano-2026-03-17": { + id: "gpt-5.4-nano-2026-03-17", + name: "gpt-5.4-nano-2026-03-17", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-03-19", + last_updated: "2026-03-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.25 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-sonnet-4-20250514": { + id: "claude-sonnet-4-20250514", + name: "claude-sonnet-4-20250514", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen3-coder-480b-a35b-instruct": { + id: "qwen3-coder-480b-a35b-instruct", + name: "qwen3-coder-480b-a35b-instruct", + 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, + cost: { input: 0.86, output: 3.43 }, + limit: { context: 262144, output: 65536 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "claude-opus-4-6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-06", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 1000000, output: 128000 }, + }, + "doubao-seed-code-preview-251028": { + id: "doubao-seed-code-preview-251028", + name: "doubao-seed-code-preview-251028", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-11-11", + last_updated: "2025-11-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.17, output: 1.14 }, + limit: { context: 256000, output: 32000 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "gpt-4.1-nano", + 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, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1047576, output: 32768 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "deepseek-v3.2", + 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: false, + cost: { input: 0.29, output: 0.43 }, + limit: { context: 128000, output: 8192 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "gpt-5-pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2024-09-30", + release_date: "2025-10-08", + last_updated: "2025-10-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 120 }, + limit: { context: 400000, input: 272000, output: 272000 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "gpt-4o", + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "claude-sonnet-4-5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07-31", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "gpt-5": { + id: "gpt-5", + name: "gpt-5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2024-09-30", + release_date: "2025-08-08", + last_updated: "2025-08-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "grok-4.20-beta-0309-reasoning": { + id: "grok-4.20-beta-0309-reasoning", + name: "grok-4.20-beta-0309-reasoning", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-16", + last_updated: "2026-03-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 2000000, output: 30000 }, + }, + "claude-opus-4-20250514": { + id: "claude-opus-4-20250514", + name: "claude-opus-4-20250514", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75 }, + limit: { context: 200000, output: 32000 }, + }, + "glm-for-coding": { + id: "glm-for-coding", + name: "glm-for-coding", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.086, output: 0.343 }, + limit: { context: 200000, output: 131072 }, + }, + "claude-sonnet-4-5-20250929-thinking": { + id: "claude-sonnet-4-5-20250929-thinking", + name: "claude-sonnet-4-5-20250929-thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "glm-4.5-airx": { + id: "glm-4.5-airx", + name: "glm-4.5-airx", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.572, output: 1.714 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "gpt-4.1", + 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, + cost: { input: 2, output: 8 }, + limit: { context: 1047576, output: 32768 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "kimi-k2-thinking", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.575, output: 2.3 }, + limit: { context: 262144, output: 262144 }, + }, + "gemini-2.0-flash-lite": { + id: "gemini-2.0-flash-lite", + name: "gemini-2.0-flash-lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-11", + release_date: "2025-06-16", + last_updated: "2025-06-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 2000000, output: 8192 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "gpt-4.1-mini", + 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, + cost: { input: 0.4, output: 1.6 }, + limit: { context: 1047576, output: 32768 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "grok-4-fast-non-reasoning", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-09-23", + last_updated: "2025-09-23", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, output: 30000 }, + }, + "doubao-seed-1-6-thinking-250715": { + id: "doubao-seed-1-6-thinking-250715", + name: "doubao-seed-1-6-thinking-250715", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-15", + last_updated: "2025-07-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.121, output: 1.21 }, + limit: { context: 256000, output: 16000 }, + }, + "ministral-14b-2512": { + id: "ministral-14b-2512", + name: "ministral-14b-2512", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.33, output: 0.33 }, + limit: { context: 128000, output: 128000 }, + }, + }, + }, + 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-235b-a22b": { + id: "qwen3-235b-a22b", + name: "Qwen3 235B-A22B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.8, reasoning: 8.4 }, + limit: { context: 131072, output: 16384 }, + }, + "qwen3.5-122b-a10b": { + id: "qwen3.5-122b-a10b", + name: "Qwen3.5 122B-A10B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-23", + last_updated: "2026-02-23", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 3.2 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3-coder-plus": { + id: "qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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, + cost: { input: 1, output: 5 }, + limit: { context: 1048576, output: 65536 }, + }, + "qwen3.6-27b": { + id: "qwen3.6-27b", + name: "Qwen3.6 27B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-22", + last_updated: "2026-04-22", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3.5-27b": { + id: "qwen3.5-27b", + name: "Qwen3.5 27B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-23", + last_updated: "2026-02-23", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.4 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen-vl-ocr": { + id: "qwen-vl-ocr", + name: "Qwen-VL OCR", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.72, output: 0.72 }, + limit: { context: 34096, output: 4096 }, + }, + "qwen-omni-turbo-realtime": { + id: "qwen-omni-turbo-realtime", + name: "Qwen-Omni Turbo Realtime", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.27, output: 1.07, input_audio: 4.44, output_audio: 8.89 }, + limit: { context: 32768, output: 2048 }, + }, + "qwen3-8b": { + id: "qwen3-8b", + name: "Qwen3 8B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.18, output: 0.7, reasoning: 2.1 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3.5-397b-a17b": { + id: "qwen3.5-397b-a17b", + name: "Qwen3.5 397B-A17B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-02-15", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 65536 }, + }, + "qwq-plus": { + id: "qwq-plus", + name: "QwQ Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen-vl-plus": { + id: "qwen-vl-plus", + name: "Qwen-VL Plus", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.21, output: 0.63 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-livetranslate-flash-realtime": { + id: "qwen3-livetranslate-flash-realtime", + name: "Qwen3-LiveTranslate Flash Realtime", + family: "qwen", + attachment: false, + 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, + cost: { input: 10, output: 10, input_audio: 10, output_audio: 38 }, + limit: { context: 53248, output: 4096 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.8, reasoning: 8.4 }, + limit: { context: 131072, output: 16384 }, + }, + "qwen-max": { + id: "qwen-max", + name: "Qwen Max", + 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, + cost: { input: 1.6, output: 6.4 }, + limit: { context: 32768, output: 8192 }, + }, + "qwen-plus": { + id: "qwen-plus", + name: "Qwen Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.4, output: 1.2, reasoning: 4 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen3.6-35b-a3b": { + id: "qwen3.6-35b-a3b", + name: "Qwen3.6 35B-A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.248, output: 1.485 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen-omni-turbo": { + id: "qwen-omni-turbo", + name: "Qwen-Omni Turbo", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.07, output: 0.27, input_audio: 4.44, output_audio: 8.89 }, + limit: { context: 32768, output: 2048 }, + }, + "qwen-flash": { + id: "qwen-flash", + name: "Qwen Flash", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen2-5-vl-7b-instruct": { + id: "qwen2-5-vl-7b-instruct", + name: "Qwen2.5-VL 7B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.05 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.276, output: 1.651, cache_read: 0.028, cache_write: 0.344 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen3-max": { + id: "qwen3-max", + name: "Qwen3 Max", + 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, + cost: { input: 1.2, output: 6 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3-omni-flash": { + id: "qwen3-omni-flash", + name: "Qwen3-Omni Flash", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.43, output: 1.66, input_audio: 3.81, output_audio: 15.11 }, + limit: { context: 65536, output: 16384 }, + }, + "qwen2-5-72b-instruct": { + id: "qwen2-5-72b-instruct", + name: "Qwen2.5 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 5.6 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-vl-235b-a22b": { + id: "qwen3-vl-235b-a22b", + name: "Qwen3-VL 235B-A22B", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.7, output: 2.8, reasoning: 8.4 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen3-asr-flash": { + id: "qwen3-asr-flash", + name: "Qwen3-ASR Flash", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.035, output: 0.035 }, + limit: { context: 53248, output: 4096 }, + }, + "qwen3-next-80b-a3b-thinking": { + id: "qwen3-next-80b-a3b-thinking", + name: "Qwen3-Next 80B-A3B (Thinking)", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09", + last_updated: "2025-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 6 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen-mt-plus": { + id: "qwen-mt-plus", + name: "Qwen-MT Plus", + 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, + cost: { input: 2.46, output: 7.37 }, + limit: { context: 16384, output: 8192 }, + }, + "qwen-vl-max": { + id: "qwen-vl-max", + name: "Qwen-VL Max", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.8, output: 3.2 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-coder-flash": { + id: "qwen3-coder-flash", + name: "Qwen3 Coder Flash", + 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, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen2-5-7b-instruct": { + id: "qwen2-5-7b-instruct", + name: "Qwen2.5 7B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.175, output: 0.7 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen2-5-14b-instruct": { + id: "qwen2-5-14b-instruct", + name: "Qwen2.5 14B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.4 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen2-5-32b-instruct": { + id: "qwen2-5-32b-instruct", + name: "Qwen2.5 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.8 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-next-80b-a3b-instruct": { + id: "qwen3-next-80b-a3b-instruct", + name: "Qwen3-Next 80B-A3B Instruct", + 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, + cost: { input: 0.5, output: 2 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen-plus-character-ja": { + id: "qwen-plus-character-ja", + name: "Qwen Plus Character (Japanese)", + 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, + cost: { input: 0.5, output: 1.4 }, + limit: { context: 8192, output: 512 }, + }, + "qwen3-omni-flash-realtime": { + id: "qwen3-omni-flash-realtime", + name: "Qwen3-Omni Flash Realtime", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.52, output: 1.99, input_audio: 4.57, output_audio: 18.13 }, + limit: { context: 65536, output: 16384 }, + }, + "qwen3-vl-30b-a3b": { + id: "qwen3-vl-30b-a3b", + name: "Qwen3-VL 30B-A3B", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.8, reasoning: 2.4 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen3-vl-plus": { + id: "qwen3-vl-plus", + name: "Qwen3-VL Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.6, reasoning: 4.8 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen3-coder-480b-a35b-instruct": { + id: "qwen3-coder-480b-a35b-instruct", + name: "Qwen3-Coder 480B-A35B Instruct", + 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, + cost: { input: 1.5, output: 7.5 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3-Coder 30B-A3B Instruct", + 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, + cost: { input: 0.45, output: 2.25 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen-turbo": { + id: "qwen-turbo", + name: "Qwen Turbo", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.2, reasoning: 0.5 }, + limit: { context: 1000000, output: 16384 }, + }, + "qwen-mt-turbo": { + id: "qwen-mt-turbo", + name: "Qwen-MT Turbo", + 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, + cost: { input: 0.16, output: 0.49 }, + limit: { context: 16384, output: 8192 }, + }, + "qwen3.6-max-preview": { + id: "qwen3.6-max-preview", + name: "Qwen3.6 Max Preview", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.3, output: 7.8, cache_read: 0.13, cache_write: 1.625 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen2-5-omni-7b": { + id: "qwen2-5-omni-7b", + name: "Qwen2.5-Omni 7B", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.1, output: 0.4, input_audio: 6.76 }, + limit: { context: 32768, output: 2048 }, + }, + "qwen3.5-plus": { + id: "qwen3.5-plus", + name: "Qwen3.5 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.4, output: 2.4, reasoning: 2.4 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen2-5-vl-72b-instruct": { + id: "qwen2-5-vl-72b-instruct", + name: "Qwen2.5-VL 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 2.8, output: 8.4 }, + limit: { context: 131072, output: 8192 }, + }, + "qvq-max": { + id: "qvq-max", + name: "QVQ Max", + family: "qvq", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.2, output: 4.8 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-14b": { + id: "qwen3-14b", + name: "Qwen3 14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.4, reasoning: 4.2 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3.5-35b-a3b": { + id: "qwen3.5-35b-a3b", + name: "Qwen3.5 35B-A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-23", + last_updated: "2026-02-23", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 2 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + 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: { + "qwen3-embedding-8b": { + id: "qwen3-embedding-8b", + name: "Qwen3 Embedding 8B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-25-11", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0 }, + limit: { context: 32768, output: 4096 }, + }, + "qwen3-235b-a22b-instruct-2507": { + id: "qwen3-235b-a22b-instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-01", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.75, output: 2.25 }, + limit: { context: 260000, output: 16384 }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-12-06", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.9, output: 0.9 }, + limit: { context: 100000, output: 16384 }, + }, + "qwen3.5-397b-a17b": { + id: "qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-03-17", + last_updated: "2026-03-17", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 256000, output: 16384 }, + }, + "devstral-2-123b-instruct-2512": { + id: "devstral-2-123b-instruct-2512", + name: "Devstral 2 123B Instruct (2512)", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-01-07", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2 }, + limit: { context: 256000, output: 16384 }, + }, + "deepseek-r1-distill-llama-70b": { + id: "deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.9, output: 0.9 }, + limit: { context: 32000, output: 8196 }, + }, + "pixtral-12b-2409": { + id: "pixtral-12b-2409", + name: "Pixtral 12B 2409", + family: "pixtral", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-09-25", + last_updated: "2026-03-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, output: 4096 }, + }, + "whisper-large-v3": { + id: "whisper-large-v3", + name: "Whisper Large v3", + family: "whisper", + attachment: false, + 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, + cost: { input: 0.003, output: 0 }, + limit: { context: 0, output: 8192 }, + }, + "voxtral-small-24b-2507": { + id: "voxtral-small-24b-2507", + name: "Voxtral Small 24B 2507", + family: "voxtral", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-01", + last_updated: "2026-03-17", + modalities: { input: ["text", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.35 }, + limit: { context: 32000, output: 16384 }, + }, + "gemma-3-27b-it": { + id: "gemma-3-27b-it", + name: "Gemma-3-27B-IT", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2026-03-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.5 }, + limit: { context: 40000, output: 8192 }, + }, + "bge-multilingual-gemma2": { + id: "bge-multilingual-gemma2", + name: "BGE Multilingual Gemma2", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-07-26", + last_updated: "2025-06-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0 }, + limit: { context: 8191, output: 3072 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3-Coder 30B-A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 128000, output: 32768 }, + }, + "mistral-small-3.2-24b-instruct-2506": { + id: "mistral-small-3.2-24b-instruct-2506", + name: "Mistral Small 3.2 24B Instruct (2506)", + family: "mistral-small", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-06-20", + last_updated: "2026-03-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.35 }, + limit: { context: 128000, output: 32768 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT-OSS 120B", + family: "gpt-oss", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-01-01", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 32768 }, + }, + "mistral-nemo-instruct-2407": { + id: "mistral-nemo-instruct-2407", + name: "Mistral Nemo Instruct 2407", + family: "mistral-nemo", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-25", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, output: 8192 }, + }, + "llama-3.1-8b-instruct": { + id: "llama-3.1-8b-instruct", + name: "Llama 3.1 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-01-01", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, output: 16384 }, + }, + }, + }, + "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: { + "glm-4-flash": { + id: "glm-4-flash", + name: "GLM-4 Flash", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-08-01", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.1003 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "Meta-Llama-3-1-8B-Instruct-FP8": { + id: "Meta-Llama-3-1-8B-Instruct-FP8", + name: "Llama 3.1 8B (decentralized)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.02, output: 0.03 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "claude-opus-4-thinking:32000": { + id: "claude-opus-4-thinking:32000", + name: "Claude 4 Opus Thinking (32K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "gemini-2.5-pro-preview-05-06": { + id: "gemini-2.5-pro-preview-05-06", + name: "Gemini 2.5 Pro Preview 0506", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-05-06", + last_updated: "2025-05-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "grok-3-mini-fast-beta": { + id: "grok-3-mini-fast-beta", + name: "Grok 3 Mini Fast Beta", + 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: false, + cost: { input: 0.6, output: 4 }, + limit: { context: 131072, input: 131072, output: 131072 }, + }, + "MiniMax-M2": { + id: "MiniMax-M2", + name: "MiniMax M2", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-10-25", + last_updated: "2025-10-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.17, output: 1.53 }, + limit: { context: 200000, input: 200000, output: 131072 }, + }, + "command-a-reasoning-08-2025": { + id: "command-a-reasoning-08-2025", + name: "Cohere Command A (08/2025)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-22", + last_updated: "2025-08-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, input: 256000, output: 8192 }, + }, + brave: { + id: "brave", + name: "Brave (Answers)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-03-02", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 5 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + "exa-research": { + id: "exa-research", + name: "Exa (Research)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-04", + last_updated: "2025-06-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 2.5 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + "Llama-3.3-70B-Nova": { + id: "Llama-3.3-70B-Nova", + name: "Llama 3.3 70B Nova", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "gemini-exp-1206": { + id: "gemini-exp-1206", + name: "Gemini 2.0 Pro 1206", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.258, output: 4.998 }, + limit: { context: 2097152, input: 2097152, output: 8192 }, + }, + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "Claude 4.5 Opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "auto-model-basic": { + id: "auto-model-basic", + name: "Auto model (Basic)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 1000000, input: 1000000, output: 1000000 }, + }, + "jamba-mini": { + id: "jamba-mini", + name: "Jamba Mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1989, output: 0.408 }, + limit: { context: 256000, input: 256000, output: 4096 }, + }, + "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)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "yi-large": { + id: "yi-large", + name: "Yi Large", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3.196, output: 3.196 }, + limit: { context: 32000, input: 32000, output: 4096 }, + }, + "auto-model-premium": { + id: "auto-model-premium", + name: "Auto model (Premium)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 1000000, input: 1000000, output: 1000000 }, + }, + "azure-gpt-4o": { + id: "azure-gpt-4o", + name: "Azure gpt-4o", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.499, output: 9.996 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "deepseek-v3-0324": { + id: "deepseek-v3-0324", + name: "DeepSeek Chat 0324", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "claude-3-5-haiku-20241022": { + id: "claude-3-5-haiku-20241022", + name: "Claude 3.5 Haiku", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4 }, + limit: { context: 200000, input: 200000, output: 8192 }, + }, + "doubao-seed-1-8-251215": { + id: "doubao-seed-1-8-251215", + name: "Doubao Seed 1.8", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-15", + last_updated: "2025-12-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.612, output: 6.12 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "doubao-seed-1-6-250615": { + id: "doubao-seed-1-6-250615", + name: "Doubao Seed 1.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-15", + last_updated: "2025-06-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.204, output: 0.51 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "ernie-x1.1-preview": { + id: "ernie-x1.1-preview", + name: "ERNIE X1.1", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-10", + last_updated: "2025-09-10", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 64000, input: 64000, output: 8192 }, + }, + "ernie-5.0-thinking-preview": { + id: "ernie-5.0-thinking-preview", + name: "Ernie 5.0 Thinking Preview", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 2 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "glm-4-air-0111": { + id: "glm-4-air-0111", + name: "GLM 4 Air 0111", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-11", + last_updated: "2025-01-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1394, output: 0.1394 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + fastgpt: { + id: "fastgpt", + name: "Web Answer", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-08-01", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 7.5, output: 7.5 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "doubao-seed-1-6-thinking-250615": { + id: "doubao-seed-1-6-thinking-250615", + name: "Doubao Seed 1.6 Thinking", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-15", + last_updated: "2025-06-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.204, output: 2.04 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "gemini-2.0-flash-001": { + id: "gemini-2.0-flash-001", + name: "Gemini 2.0 Flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.408 }, + limit: { context: 1000000, input: 1000000, output: 8192 }, + }, + "claude-opus-4-1-thinking:32000": { + id: "claude-opus-4-1-thinking:32000", + name: "Claude 4.1 Opus Thinking (32K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "Llama-3.3-70B-RAWMAW": { + id: "Llama-3.3-70B-RAWMAW", + name: "Llama 3.3 70B RAWMAW", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "GLM-4.5-Air-Derestricted-Steam": { + id: "GLM-4.5-Air-Derestricted-Steam", + name: "GLM 4.5 Air Derestricted Steam", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 220600, input: 220600, output: 65536 }, + }, + "claude-3-5-sonnet-20241022": { + id: "claude-3-5-sonnet-20241022", + name: "Claude 3.5 Sonnet", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 8192 }, + }, + "yi-medium-200k": { + id: "yi-medium-200k", + name: "Yi Medium 200k", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-03-01", + last_updated: "2024-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.499, output: 2.499 }, + limit: { context: 200000, input: 200000, output: 4096 }, + }, + "Gemma-3-27B-ArliAI-RPMax-v3": { + id: "Gemma-3-27B-ArliAI-RPMax-v3", + name: "Gemma 3 27B RPMax v3", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-03", + last_updated: "2025-07-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "phi-4-mini-instruct": { + id: "phi-4-mini-instruct", + name: "Phi 4 Mini", + 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: false, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "Llama-3.3+(3v3.3)-70B-TenyxChat-DaybreakStorywriter": { + id: "Llama-3.3+(3v3.3)-70B-TenyxChat-DaybreakStorywriter", + name: "Llama 3.3+ 70B TenyxChat DaybreakStorywriter", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "ernie-x1-32k": { + id: "ernie-x1-32k", + name: "Ernie X1 32k", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-08", + last_updated: "2025-05-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.33, output: 1.32 }, + limit: { context: 32000, input: 32000, output: 16384 }, + }, + "deepseek-chat": { + id: "deepseek-chat", + name: "DeepSeek V3/Deepseek Chat", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-02-27", + last_updated: "2025-02-27", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "glm-z1-air": { + id: "glm-z1-air", + name: "GLM Z1 Air", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.07 }, + limit: { context: 32000, input: 32000, output: 16384 }, + }, + "claude-3-7-sonnet-thinking:128000": { + id: "claude-3-7-sonnet-thinking:128000", + name: "Claude 3.7 Sonnet Thinking (128K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "glm-4-air": { + id: "glm-4-air", + name: "GLM-4 Air", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-06-05", + last_updated: "2024-06-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.2006 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "Llama-3.3-70B-MiraiFanfare": { + id: "Llama-3.3-70B-MiraiFanfare", + name: "Llama 3.3 70b Mirai Fanfare", + 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: false, + cost: { input: 0.493, output: 0.493 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "gemini-2.0-flash-thinking-exp-01-21": { + id: "gemini-2.0-flash-thinking-exp-01-21", + name: "Gemini 2.0 Flash Thinking 0121", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-01-21", + last_updated: "2025-01-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 1.003 }, + limit: { context: 1000000, input: 1000000, output: 8192 }, + }, + "Magistral-Small-2506": { + id: "Magistral-Small-2506", + name: "Magistral Small 2506", + 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: false, + cost: { input: 0.4, output: 1.4 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "doubao-1.5-pro-32k": { + id: "doubao-1.5-pro-32k", + name: "Doubao 1.5 Pro 32k", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-22", + last_updated: "2025-01-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1343, output: 0.3349 }, + limit: { context: 32000, input: 32000, output: 8192 }, + }, + "venice-uncensored:web": { + id: "venice-uncensored:web", + name: "Venice Uncensored Web", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-01", + last_updated: "2024-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 80000, input: 80000, output: 16384 }, + }, + "glm-4": { + id: "glm-4", + name: "GLM-4", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-01-16", + last_updated: "2024-01-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 14.994 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "qwen-max": { + id: "qwen-max", + name: "Qwen 2.5 Max", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-04-03", + last_updated: "2024-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5997, output: 6.392 }, + limit: { context: 32000, input: 32000, output: 8192 }, + }, + "qwen3-vl-235b-a22b-instruct-original": { + id: "qwen3-vl-235b-a22b-instruct-original", + name: "Qwen3 VL 235B A22B Instruct Original", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.2 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "jamba-large-1.6": { + id: "jamba-large-1.6", + name: "Jamba Large 1.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.989, output: 7.99 }, + limit: { context: 256000, input: 256000, output: 4096 }, + }, + "qwen-plus": { + id: "qwen-plus", + name: "Qwen Plus", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2024-01-25", + last_updated: "2024-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3995, output: 1.2002 }, + limit: { context: 995904, input: 995904, output: 32768 }, + }, + "qwen25-vl-72b-instruct": { + id: "qwen25-vl-72b-instruct", + name: "Qwen25 VL 72b", + 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: false, + cost: { input: 0.69989, output: 0.69989 }, + limit: { context: 32000, input: 32000, output: 32768 }, + }, + "claude-sonnet-4-thinking:64000": { + id: "claude-sonnet-4-thinking:64000", + name: "Claude 4 Sonnet Thinking (64K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "Gemini 3 Pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "Llama-3.3+(3.1v3.3)-70B-New-Dawn-v1.1": { + id: "Llama-3.3+(3.1v3.3)-70B-New-Dawn-v1.1", + name: "Llama 3.3+ 70B New Dawn v1.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "GLM-4.5-Air-Derestricted-Iceblink-ReExtract": { + id: "GLM-4.5-Air-Derestricted-Iceblink-ReExtract", + name: "GLM 4.5 Air Derestricted Iceblink ReExtract", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-12", + last_updated: "2025-12-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 131072, input: 131072, output: 98304 }, + }, + "universal-summarizer": { + id: "universal-summarizer", + name: "Universal Summarizer", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-05-01", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 30 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "claude-sonnet-4-thinking:32768": { + id: "claude-sonnet-4-thinking:32768", + name: "Claude 4 Sonnet Thinking (32K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "sarvan-medium": { + id: "sarvan-medium", + name: "Sarvam Medium", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "claude-3-7-sonnet-thinking:8192": { + id: "claude-3-7-sonnet-thinking:8192", + name: "Claude 3.7 Sonnet Thinking (8K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "gemini-2.5-flash-preview-05-20": { + id: "gemini-2.5-flash-preview-05-20", + name: "Gemini 2.5 Flash 0520", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 1048000, input: 1048000, output: 65536 }, + }, + "GLM-4.5-Air-Derestricted-Iceblink-v2-ReExtract": { + id: "GLM-4.5-Air-Derestricted-Iceblink-v2-ReExtract", + name: "GLM 4.5 Air Derestricted Iceblink v2 ReExtract", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-12", + last_updated: "2025-12-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 131072, input: 131072, output: 65536 }, + }, + "Llama-3.3-70B-Fallen-v1": { + id: "Llama-3.3-70B-Fallen-v1", + name: "Llama 3.3 70B Fallen v1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "qwen3-vl-235b-a22b-thinking": { + id: "qwen3-vl-235b-a22b-thinking", + name: "Qwen3 VL 235B A22B Thinking", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 6 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "claude-3-7-sonnet-thinking:32768": { + id: "claude-3-7-sonnet-thinking:32768", + name: "Claude 3.7 Sonnet Thinking (32K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-07-15", + last_updated: "2025-07-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "claude-3-7-sonnet-thinking:1024": { + id: "claude-3-7-sonnet-thinking:1024", + name: "Claude 3.7 Sonnet Thinking (1K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "Claude Sonnet 4.5", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "Llama-3.3-70B-Vulpecula-R1": { + id: "Llama-3.3-70B-Vulpecula-R1", + name: "Llama 3.3 70B Vulpecula R1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "claude-sonnet-4-thinking:8192": { + id: "claude-sonnet-4-thinking:8192", + name: "Claude 4 Sonnet Thinking (8K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "Llama-3.3-70B-Ignition-v0.1": { + id: "Llama-3.3-70B-Ignition-v0.1", + name: "Llama 3.3 70B Ignition v0.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "glm-4-plus-0111": { + id: "glm-4-plus-0111", + name: "GLM 4 Plus 0111", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 9.996 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "KAT-Coder-Air-V1": { + id: "KAT-Coder-Air-V1", + name: "KAT Coder Air V1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-10-28", + last_updated: "2025-10-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.2 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "deepseek-r1-sambanova": { + id: "deepseek-r1-sambanova", + name: "DeepSeek R1 Fast", + 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: false, + cost: { input: 4.998, output: 6.987 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "deepseek-r1": { + id: "deepseek-r1", + name: "DeepSeek R1", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.7 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "doubao-1-5-thinking-pro-250415": { + id: "doubao-1-5-thinking-pro-250415", + name: "Doubao 1.5 Thinking Pro", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-17", + last_updated: "2025-04-17", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.4 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "sonar-pro": { + id: "sonar-pro", + name: "Perplexity Pro", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 128000 }, + }, + "Gemma-3-27B-it-Abliterated": { + id: "Gemma-3-27B-it-Abliterated", + name: "Gemma 3 27B IT Abliterated", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-03", + last_updated: "2025-07-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.42, output: 0.42 }, + limit: { context: 32768, input: 32768, output: 96000 }, + }, + "deepseek-chat-cheaper": { + id: "deepseek-chat-cheaper", + name: "DeepSeek V3/Chat Cheaper", + 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: false, + cost: { input: 0.25, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "gemini-2.0-pro-exp-02-05": { + id: "gemini-2.0-pro-exp-02-05", + name: "Gemini 2.0 Pro 0205", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-05", + last_updated: "2025-02-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.989, output: 7.956 }, + limit: { context: 2097152, input: 2097152, output: 8192 }, + }, + "azure-gpt-4o-mini": { + id: "azure-gpt-4o-mini", + name: "Azure gpt-4o-mini", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1496, output: 0.595 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "Llama-3.3-70B-MS-Nevoria": { + id: "Llama-3.3-70B-MS-Nevoria", + name: "Llama 3.3 70B MS Nevoria", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "claude-opus-4-thinking": { + id: "claude-opus-4-thinking", + name: "Claude 4 Opus Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-07-15", + last_updated: "2025-07-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "Llama-3.3-70B-Sapphira-0.1": { + id: "Llama-3.3-70B-Sapphira-0.1", + name: "Llama 3.3 70B Sapphira 0.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "doubao-seed-code-preview-latest": { + id: "doubao-seed-code-preview-latest", + name: "Doubao Seed Code Preview", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "qwen-3.6-plus": { + id: "qwen-3.6-plus", + name: "Qwen 3.6 Plus", + family: "qwen3.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-04-02", + last_updated: "2026-04-02", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.45, output: 2.7 }, + limit: { context: 991800, output: 65536 }, + }, + "Llama-3.3-70B-ArliAI-RPMax-v1.4": { + id: "Llama-3.3-70B-ArliAI-RPMax-v1.4", + name: "Llama 3.3 70B RPMax v1.4", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "mistral-small-31-24b-instruct": { + id: "mistral-small-31-24b-instruct", + name: "Mistral Small 31 24b Instruct", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, input: 128000, output: 131072 }, + }, + "glm-4.1v-thinking-flashx": { + id: "glm-4.1v-thinking-flashx", + name: "GLM 4.1V Thinking FlashX", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 64000, input: 64000, output: 8192 }, + }, + "hunyuan-t1-latest": { + id: "hunyuan-t1-latest", + name: "Hunyuan T1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-22", + last_updated: "2025-03-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.17, output: 0.66 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "doubao-1-5-thinking-vision-pro-250428": { + id: "doubao-1-5-thinking-vision-pro-250428", + name: "Doubao 1.5 Thinking Vision Pro", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-15", + last_updated: "2025-05-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.55, output: 1.43 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "asi1-mini": { + id: "asi1-mini", + name: "ASI1 Mini", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 1 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "ernie-5.0-thinking-latest": { + id: "ernie-5.0-thinking-latest", + name: "Ernie 5.0 Thinking", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 2 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "Llama-3.3-70B-Incandescent-Malevolence": { + id: "Llama-3.3-70B-Incandescent-Malevolence", + name: "Llama 3.3 70B Incandescent Malevolence", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-Damascus-R1": { + id: "Llama-3.3-70B-Damascus-R1", + name: "Damascus R1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Gemma-3-27B-Nidum-Uncensored": { + id: "Gemma-3-27B-Nidum-Uncensored", + name: "Gemma 3 27B Nidum Uncensored", + 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: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 96000 }, + }, + "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", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "doubao-seed-2-0-pro-260215": { + id: "doubao-seed-2-0-pro-260215", + name: "Doubao Seed 2.0 Pro", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-14", + last_updated: "2026-02-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.782, output: 3.876 }, + limit: { context: 256000, input: 256000, output: 128000 }, + }, + "gemini-3-pro-image-preview": { + id: "gemini-3-pro-image-preview", + name: "Gemini 3 Pro Image", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "Gemma-3-27B-CardProjector-v4": { + id: "Gemma-3-27B-CardProjector-v4", + name: "Gemma 3 27B CardProjector v4", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "jamba-mini-1.7": { + id: "jamba-mini-1.7", + name: "Jamba Mini 1.7", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1989, output: 0.408 }, + limit: { context: 256000, input: 256000, output: 4096 }, + }, + "Llama-3.3-70B-Forgotten-Safeword-3.6": { + id: "Llama-3.3-70B-Forgotten-Safeword-3.6", + name: "Llama 3.3 70B Forgotten Safeword 3.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "doubao-1-5-thinking-pro-vision-250415": { + id: "doubao-1-5-thinking-pro-vision-250415", + name: "Doubao 1.5 Thinking Pro Vision", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.4 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "gemini-2.5-pro-preview-06-05": { + id: "gemini-2.5-pro-preview-06-05", + name: "Gemini 2.5 Pro Preview 0605", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "gemini-2.0-pro-reasoner": { + id: "gemini-2.0-pro-reasoner", + name: "Gemini 2.0 Pro Reasoner", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-05", + last_updated: "2025-02-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.292, output: 4.998 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "doubao-seed-2-0-lite-260215": { + id: "doubao-seed-2-0-lite-260215", + name: "Doubao Seed 2.0 Lite", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-14", + last_updated: "2026-02-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1462, output: 0.8738 }, + limit: { context: 256000, input: 256000, output: 32000 }, + }, + "gemini-2.5-flash-lite-preview-06-17": { + id: "gemini-2.5-flash-lite-preview-06-17", + name: "Gemini 2.5 Flash Lite Preview", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "sonar-deep-research": { + id: "sonar-deep-research", + name: "Perplexity Deep Research", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-25", + last_updated: "2025-02-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3.4, output: 13.6 }, + limit: { context: 60000, input: 60000, output: 128000 }, + }, + "Gemma-3-27B-it": { + id: "Gemma-3-27B-it", + name: "Gemma 3 27B IT", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-GeneticLemonade-Unleashed-v3": { + id: "Llama-3.3-70B-GeneticLemonade-Unleashed-v3", + name: "Llama 3.3 70B GeneticLemonade Unleashed v3", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Gemma-3-27B-Glitter": { + id: "Gemma-3-27B-Glitter", + name: "Gemma 3 27B Glitter", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.1": { + id: "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.1", + name: "Llama 3.3 70B Omega Directive Unslop v2.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "qwen3-30b-a3b-instruct-2507": { + id: "qwen3-30b-a3b-instruct-2507", + name: "Qwen3 30B A3B Instruct 2507", + 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: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "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", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + deepclaude: { + id: "deepclaude", + name: "DeepClaude", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-01", + last_updated: "2025-02-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "ernie-4.5-8k-preview": { + id: "ernie-4.5-8k-preview", + name: "Ernie 4.5 8k Preview", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.66, output: 2.6 }, + limit: { context: 8000, input: 8000, output: 16384 }, + }, + "doubao-seed-2-0-mini-260215": { + id: "doubao-seed-2-0-mini-260215", + name: "Doubao Seed 2.0 Mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-14", + last_updated: "2026-02-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0493, output: 0.4845 }, + limit: { context: 256000, input: 256000, output: 32000 }, + }, + "gemini-3-pro-preview-thinking": { + id: "gemini-3-pro-preview-thinking", + name: "Gemini 3 Pro Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "Llama-3.3-70B-GeneticLemonade-Opus": { + id: "Llama-3.3-70B-GeneticLemonade-Opus", + name: "Llama 3.3 70B GeneticLemonade Opus", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "v0-1.5-lg": { + id: "v0-1.5-lg", + name: "v0 1.5 LG", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-04", + last_updated: "2025-07-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "ernie-4.5-turbo-128k": { + id: "ernie-4.5-turbo-128k", + name: "Ernie 4.5 Turbo 128k", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-08", + last_updated: "2025-05-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.132, output: 0.55 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "KAT-Coder-Pro-V1": { + id: "KAT-Coder-Pro-V1", + name: "KAT Coder Pro V1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-10-28", + last_updated: "2025-10-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 6 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "claude-3-5-sonnet-20240620": { + id: "claude-3-5-sonnet-20240620", + name: "Claude 3.5 Sonnet Old", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2024-06-20", + last_updated: "2024-06-20", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 8192 }, + }, + "claude-opus-4-1-thinking:8192": { + id: "claude-opus-4-1-thinking:8192", + name: "Claude 4.1 Opus Thinking (8K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "gemini-2.0-flash-exp-image-generation": { + id: "gemini-2.0-flash-exp-image-generation", + name: "Gemini Text + Image", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 32767, input: 32767, output: 8192 }, + }, + "Llama-3.3-70B-Magnum-v4-SE": { + id: "Llama-3.3-70B-Magnum-v4-SE", + name: "Llama 3.3 70B Magnum v4 SE", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "glm-zero-preview": { + id: "glm-zero-preview", + name: "GLM Zero Preview", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.802, output: 1.802 }, + limit: { context: 8000, input: 8000, output: 4096 }, + }, + "study_gpt-chatgpt-4o-latest": { + id: "study_gpt-chatgpt-4o-latest", + name: "Study Mode", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 16384 }, + }, + "glm-4-airx": { + id: "glm-4-airx", + name: "GLM-4 AirX", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-06-05", + last_updated: "2024-06-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.006, output: 2.006 }, + limit: { context: 8000, input: 8000, output: 4096 }, + }, + "step-2-mini": { + id: "step-2-mini", + name: "Step-2 Mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-05", + last_updated: "2024-07-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.408 }, + limit: { context: 8000, input: 8000, output: 4096 }, + }, + "gemini-2.5-flash-preview-04-17:thinking": { + id: "gemini-2.5-flash-preview-04-17:thinking", + name: "Gemini 2.5 Flash Preview Thinking", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-04-17", + last_updated: "2025-04-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 3.5 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "Llama-3.3-70B-Mokume-Gane-R1": { + id: "Llama-3.3-70B-Mokume-Gane-R1", + name: "Llama 3.3 70B Mokume Gane R1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "deepseek-reasoner": { + id: "deepseek-reasoner", + name: "DeepSeek Reasoner", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.7 }, + limit: { context: 64000, input: 64000, output: 65536 }, + }, + "glm-z1-airx": { + id: "glm-z1-airx", + name: "GLM Z1 AirX", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 32000, input: 32000, output: 16384 }, + }, + "jamba-mini-1.6": { + id: "jamba-mini-1.6", + name: "Jamba Mini 1.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-01", + last_updated: "2025-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1989, output: 0.408 }, + limit: { context: 256000, input: 256000, output: 4096 }, + }, + "claude-opus-4-1-thinking": { + id: "claude-opus-4-1-thinking", + name: "Claude 4.1 Opus Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "grok-3-beta": { + id: "grok-3-beta", + name: "Grok 3 Beta", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 131072, input: 131072, output: 131072 }, + }, + "Llama-3.3-70B-Legion-V2.1": { + id: "Llama-3.3-70B-Legion-V2.1", + name: "Llama 3.3 70B Legion V2.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + sonar: { + id: "sonar", + name: "Perplexity Simple", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.003, output: 1.003 }, + limit: { context: 127000, input: 127000, output: 128000 }, + }, + "z-image-turbo": { + id: "z-image-turbo", + name: "Z Image Turbo", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-11-27", + last_updated: "2025-11-27", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "GLM-4.5-Air-Derestricted-Iceblink-v2": { + id: "GLM-4.5-Air-Derestricted-Iceblink-v2", + name: "GLM 4.5 Air Derestricted Iceblink v2", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 158600, input: 158600, output: 65536 }, + }, + "jamba-large": { + id: "jamba-large", + name: "Jamba Large", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.989, output: 7.99 }, + limit: { context: 256000, input: 256000, output: 4096 }, + }, + "claude-3-7-sonnet-reasoner": { + id: "claude-3-7-sonnet-reasoner", + name: "Claude 3.7 Sonnet Reasoner", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-29", + last_updated: "2025-03-29", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "ernie-4.5-turbo-vl-32k": { + id: "ernie-4.5-turbo-vl-32k", + name: "Ernie 4.5 Turbo VL 32k", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-08", + last_updated: "2025-05-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.495, output: 1.43 }, + limit: { context: 32000, input: 32000, output: 16384 }, + }, + "Mistral-Nemo-12B-Instruct-2407": { + id: "Mistral-Nemo-12B-Instruct-2407", + name: "Mistral Nemo 12B Instruct 2407", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.01, output: 0.01 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "doubao-seed-1-6-flash-250615": { + id: "doubao-seed-1-6-flash-250615", + name: "Doubao Seed 1.6 Flash", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-15", + last_updated: "2025-06-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0374, output: 0.374 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "qwq-32b": { + id: "qwq-32b", + name: "Qwen: QwQ 32B", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25599999, output: 0.30499999 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "Llama-3.3-70B-Strawberrylemonade-v1.2": { + id: "Llama-3.3-70B-Strawberrylemonade-v1.2", + name: "Llama 3.3 70B StrawberryLemonade v1.2", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "gemini-2.5-flash-preview-04-17": { + id: "gemini-2.5-flash-preview-04-17", + name: "Gemini 2.5 Flash Preview", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-04-17", + last_updated: "2025-04-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "ernie-x1-turbo-32k": { + id: "ernie-x1-turbo-32k", + name: "Ernie X1 Turbo 32k", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-08", + last_updated: "2025-05-08", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.165, output: 0.66 }, + limit: { context: 32000, input: 32000, output: 16384 }, + }, + "deepseek-math-v2": { + id: "deepseek-math-v2", + name: "DeepSeek Math V2", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-03", + last_updated: "2025-12-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "Llama-3.3-70B-Electranova-v1.0": { + id: "Llama-3.3-70B-Electranova-v1.0", + name: "Llama 3.3 70B Electranova v1.0", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-ArliAI-RPMax-v2": { + id: "Llama-3.3-70B-ArliAI-RPMax-v2", + name: "Llama 3.3 70B ArliAI RPMax v2", + 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: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "qwen-image": { + id: "qwen-image", + name: "Qwen Image", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "Llama-3.3-70B-Cu-Mai-R1": { + id: "Llama-3.3-70B-Cu-Mai-R1", + name: "Llama 3.3 70B Cu Mai R1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "GLM-4.5-Air-Derestricted-Iceblink": { + id: "GLM-4.5-Air-Derestricted-Iceblink", + name: "GLM 4.5 Air Derestricted Iceblink", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 131072, input: 131072, output: 98304 }, + }, + "Llama-3.3-70B-Bigger-Body": { + id: "Llama-3.3-70B-Bigger-Body", + name: "Llama 3.3 70B Bigger Body", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3+(3.1v3.3)-70B-Hanami-x1": { + id: "Llama-3.3+(3.1v3.3)-70B-Hanami-x1", + name: "Llama 3.3+ 70B Hanami x1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "hunyuan-turbos-20250226": { + id: "hunyuan-turbos-20250226", + name: "Hunyuan Turbo S", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-27", + last_updated: "2025-02-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.187, output: 0.374 }, + limit: { context: 24000, input: 24000, output: 8192 }, + }, + "gemini-2.5-flash-preview-09-2025": { + id: "gemini-2.5-flash-preview-09-2025", + name: "Gemini 2.5 Flash Preview (09/2025)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "GLM-4.6-Derestricted-v5": { + id: "GLM-4.6-Derestricted-v5", + name: "GLM 4.6 Derestricted v5", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.5 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "glm-4-plus": { + id: "glm-4-plus", + name: "GLM-4 Plus", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-08-01", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 7.497, output: 7.497 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "Gemma-3-27B-Big-Tiger-v3": { + id: "Gemma-3-27B-Big-Tiger-v3", + name: "Gemma 3 27B Big Tiger v3", + 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: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "brave-research": { + id: "brave-research", + name: "Brave (Research)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-03-02", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 5 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + hidream: { + id: "hidream", + name: "Hidream", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-01-01", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "qwen3-max-2026-01-23": { + id: "qwen3-max-2026-01-23", + name: "Qwen3 Max 2026-01-23", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-26", + last_updated: "2026-01-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2002, output: 6.001 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "Claude 4.1 Opus", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "Claude Haiku 4.5", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "MiniMax-M1": { + id: "MiniMax-M1", + name: "MiniMax M1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-16", + last_updated: "2025-06-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1394, output: 1.3328 }, + limit: { context: 1000000, input: 1000000, output: 131072 }, + }, + "gemini-2.5-flash-nothinking": { + id: "gemini-2.5-flash-nothinking", + name: "Gemini 2.5 Flash (No Thinking)", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "exa-research-pro": { + id: "exa-research-pro", + name: "Exa (Research Pro)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-04", + last_updated: "2025-06-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 2.5 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "grok-3-fast-beta": { + id: "grok-3-fast-beta", + name: "Grok 3 Fast Beta", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 131072, input: 131072, output: 131072 }, + }, + "claude-opus-4-5-20251101:thinking": { + id: "claude-opus-4-5-20251101:thinking", + name: "Claude 4.5 Opus Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "gemini-2.5-pro-exp-03-25": { + id: "gemini-2.5-pro-exp-03-25", + name: "Gemini 2.5 Pro Experimental 0325", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "claude-3-7-sonnet-thinking": { + id: "claude-3-7-sonnet-thinking", + name: "Claude 3.7 Sonnet Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 16000 }, + }, + "claude-opus-4-thinking:8192": { + id: "claude-opus-4-thinking:8192", + name: "Claude 4 Opus Thinking (8K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "claude-sonnet-4-thinking:1024": { + id: "claude-sonnet-4-thinking:1024", + name: "Claude 4 Sonnet Thinking (1K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "Llama-3.3-70B-Magnum-v4-SE-Cirrus-x1-SLERP": { + id: "Llama-3.3-70B-Magnum-v4-SE-Cirrus-x1-SLERP", + name: "Llama 3.3 70B Magnum v4 SE Cirrus x1 SLERP", + 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: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "step-r1-v-mini": { + id: "step-r1-v-mini", + name: "Step R1 V Mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-08", + last_updated: "2025-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 11 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "ernie-x1-32k-preview": { + id: "ernie-x1-32k-preview", + name: "Ernie X1 32k", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.33, output: 1.32 }, + limit: { context: 32000, input: 32000, output: 16384 }, + }, + "Llama-3.3-70B-StrawberryLemonade-v1.0": { + id: "Llama-3.3-70B-StrawberryLemonade-v1.0", + name: "Llama 3.3 70B StrawberryLemonade v1.0", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "KAT-Coder-Exp-72B-1010": { + id: "KAT-Coder-Exp-72B-1010", + name: "KAT Coder Exp 72B 1010", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-10-28", + last_updated: "2025-10-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.2 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "gemini-2.5-pro-preview-03-25": { + id: "gemini-2.5-pro-preview-03-25", + name: "Gemini 2.5 Pro Preview 0325", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "claude-opus-4-thinking:1024": { + id: "claude-opus-4-thinking:1024", + name: "Claude 4 Opus Thinking (1K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "claude-sonnet-4-20250514": { + id: "claude-sonnet-4-20250514", + name: "Claude 4 Sonnet", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "Llama-3.3-70B-Progenitor-V3.3": { + id: "Llama-3.3-70B-Progenitor-V3.3", + name: "Llama 3.3 70B Progenitor V3.3", + 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: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Qwen2.5-32B-EVA-v0.2": { + id: "Qwen2.5-32B-EVA-v0.2", + name: "Qwen 2.5 32b EVA", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-09-01", + last_updated: "2024-09-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.493, output: 0.493 }, + limit: { context: 24576, input: 24576, output: 8192 }, + }, + "brave-pro": { + id: "brave-pro", + name: "Brave (Pro)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-03-02", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 5 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + "step-2-16k-exp": { + id: "step-2-16k-exp", + name: "Step-2 16k Exp", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-05", + last_updated: "2024-07-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 7.004, output: 19.992 }, + limit: { context: 16000, input: 16000, output: 8192 }, + }, + "Llama-3.3-70B-Fallen-R1-v1": { + id: "Llama-3.3-70B-Fallen-R1-v1", + name: "Llama 3.3 70B Fallen R1 v1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "claude-sonnet-4-thinking": { + id: "claude-sonnet-4-thinking", + name: "Claude 4 Sonnet Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "doubao-1.5-pro-256k": { + id: "doubao-1.5-pro-256k", + name: "Doubao 1.5 Pro 256k", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.799, output: 1.445 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "claude-3-7-sonnet-20250219": { + id: "claude-3-7-sonnet-20250219", + name: "Claude 3.7 Sonnet", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 200000, input: 200000, output: 16000 }, + }, + "learnlm-1.5-pro-experimental": { + id: "learnlm-1.5-pro-experimental", + name: "Gemini LearnLM Experimental", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-14", + last_updated: "2024-05-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3.502, output: 10.506 }, + limit: { context: 32767, input: 32767, output: 8192 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3 Coder 30B A3B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + chroma: { + id: "chroma", + name: "Chroma", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-08-12", + last_updated: "2025-08-12", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "Llama-3.3-70B-Predatorial-Extasy": { + id: "Llama-3.3-70B-Predatorial-Extasy", + name: "Llama 3.3 70B Predatorial Extasy", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-Aurora-Borealis": { + id: "Llama-3.3-70B-Aurora-Borealis", + name: "Llama 3.3 70B Aurora Borealis", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-ArliAI-RPMax-v3": { + id: "Llama-3.3-70B-ArliAI-RPMax-v3", + name: "Llama 3.3 70B ArliAI RPMax v3", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "venice-uncensored": { + id: "venice-uncensored", + name: "Venice Uncensored", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "step-3": { + id: "step-3", + name: "Step-3", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-31", + last_updated: "2025-07-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2499, output: 0.6494 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.0": { + id: "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.0", + name: "Llama 3.3 70B Omega Directive Unslop v2.0", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "auto-model": { + id: "auto-model", + name: "Auto model", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 1000000, input: 1000000, output: 1000000 }, + }, + "claude-opus-4-1-thinking:32768": { + id: "claude-opus-4-1-thinking:32768", + name: "Claude 4.1 Opus Thinking (32K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "Llama-3.3-70B-Shakudo": { + id: "Llama-3.3-70B-Shakudo", + name: "Llama 3.3 70B Shakudo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Baichuan4-Air": { + id: "Baichuan4-Air", + name: "Baichuan 4 Air", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.157, output: 0.157 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "kimi-thinking-preview": { + id: "kimi-thinking-preview", + name: "Kimi Thinking Preview", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 31.46, output: 31.46 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "qwen-turbo": { + id: "qwen-turbo", + name: "Qwen Turbo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04998, output: 0.2006 }, + limit: { context: 1000000, input: 1000000, output: 8192 }, + }, + "Llama-3.3-70B-Mhnnn-x1": { + id: "Llama-3.3-70B-Mhnnn-x1", + name: "Llama 3.3 70B Mhnnn x1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "claude-opus-4-thinking:32768": { + id: "claude-opus-4-thinking:32768", + name: "Claude 4 Opus Thinking (32K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "Llama-3.3-70B-Argunaut-1-SFT": { + id: "Llama-3.3-70B-Argunaut-1-SFT", + name: "Llama 3.3 70B Argunaut 1 SFT", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "claude-opus-4-1-thinking:1024": { + id: "claude-opus-4-1-thinking:1024", + name: "Claude 4.1 Opus Thinking (1K)", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "phi-4-multimodal-instruct": { + id: "phi-4-multimodal-instruct", + name: "Phi 4 Multimodal", + 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: false, + cost: { input: 0.07, output: 0.11 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "doubao-seed-2-0-code-preview-260215": { + id: "doubao-seed-2-0-code-preview-260215", + name: "Doubao Seed 2.0 Code Preview", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-14", + last_updated: "2026-02-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.782, output: 3.893 }, + limit: { context: 256000, input: 256000, output: 128000 }, + }, + "deepseek-reasoner-cheaper": { + id: "deepseek-reasoner-cheaper", + name: "Deepseek R1 Cheaper", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.7 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "exa-answer": { + id: "exa-answer", + name: "Exa (Answer)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-04", + last_updated: "2025-06-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 2.5 }, + limit: { context: 4096, input: 4096, output: 4096 }, + }, + "v0-1.0-md": { + id: "v0-1.0-md", + name: "v0 1.0 MD", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-04", + last_updated: "2025-07-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "glm-4.1v-thinking-flash": { + id: "glm-4.1v-thinking-flash", + name: "GLM 4.1V Thinking Flash", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 64000, input: 64000, output: 8192 }, + }, + "azure-o1": { + id: "azure-o1", + name: "Azure o1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-17", + last_updated: "2024-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 59.993 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "GLM-4.5-Air-Derestricted": { + id: "GLM-4.5-Air-Derestricted", + name: "GLM 4.5 Air Derestricted", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 202600, input: 202600, output: 98304 }, + }, + "azure-o3-mini": { + id: "azure-o3-mini", + name: "Azure o3-mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.088, output: 4.3996 }, + limit: { context: 200000, input: 200000, output: 65536 }, + }, + "qwen3.6-max-preview": { + id: "qwen3.6-max-preview", + name: "Qwen3.6 Max Preview", + family: "qwen3.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-04-20", + last_updated: "2026-04-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.3, output: 7.8 }, + limit: { context: 245800, output: 65536 }, + }, + "Llama-3.3-70B-Sapphira-0.2": { + id: "Llama-3.3-70B-Sapphira-0.2", + name: "Llama 3.3 70B Sapphira 0.2", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-Anthrobomination": { + id: "Llama-3.3-70B-Anthrobomination", + name: "Llama 3.3 70B Anthrobomination", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "QwQ-32B-ArliAI-RpR-v1": { + id: "QwQ-32B-ArliAI-RpR-v1", + name: "QwQ 32b Arli V1", + 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: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "claude-opus-4-20250514": { + id: "claude-opus-4-20250514", + name: "Claude 4 Opus", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-05-14", + last_updated: "2025-05-14", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 14.994, output: 75.004 }, + limit: { context: 200000, input: 200000, output: 32000 }, + }, + "yi-lightning": { + id: "yi-lightning", + name: "Yi Lightning", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-10-16", + last_updated: "2024-10-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.2006 }, + limit: { context: 12000, input: 12000, output: 4096 }, + }, + "Llama-3.3-70B-Electra-R1": { + id: "Llama-3.3-70B-Electra-R1", + name: "Llama 3.3 70B Electra R1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-Forgotten-Abomination-v5.0": { + id: "Llama-3.3-70B-Forgotten-Abomination-v5.0", + name: "Llama 3.3 70B Forgotten Abomination v5.0", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Llama-3.3-70B-Cirrus-x1": { + id: "Llama-3.3-70B-Cirrus-x1", + name: "Llama 3.3 70B Cirrus x1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "grok-3-mini-beta": { + id: "grok-3-mini-beta", + name: "Grok 3 Mini Beta", + 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: false, + cost: { input: 0.3, output: 0.5 }, + limit: { context: 131072, input: 131072, output: 131072 }, + }, + "auto-model-standard": { + id: "auto-model-standard", + name: "Auto model (Standard)", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 1000000, input: 1000000, output: 1000000 }, + }, + "claude-sonnet-4-5-20250929-thinking": { + id: "claude-sonnet-4-5-20250929-thinking", + name: "Claude Sonnet 4.5 Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.994 }, + limit: { context: 1000000, input: 1000000, output: 64000 }, + }, + "v0-1.5-md": { + id: "v0-1.5-md", + name: "v0 1.5 MD", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-04", + last_updated: "2025-07-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, input: 200000, output: 64000 }, + }, + "kimi-k2-instruct-fast": { + id: "kimi-k2-instruct-fast", + name: "Kimi K2 0711 Fast", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-15", + last_updated: "2025-07-15", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 2 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "glm-4-long": { + id: "glm-4-long", + name: "GLM-4 Long", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-08-01", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.2006 }, + limit: { context: 1000000, input: 1000000, output: 4096 }, + }, + "jamba-large-1.7": { + id: "jamba-large-1.7", + name: "Jamba Large 1.7", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.989, output: 7.99 }, + limit: { context: 256000, input: 256000, output: 4096 }, + }, + "qvq-max": { + id: "qvq-max", + name: "Qwen: QvQ Max", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-28", + last_updated: "2025-03-28", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.4, output: 5.3 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "gemini-2.0-flash-thinking-exp-1219": { + id: "gemini-2.0-flash-thinking-exp-1219", + name: "Gemini 2.0 Flash Thinking 1219", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-19", + last_updated: "2024-12-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.408 }, + limit: { context: 32767, input: 32767, output: 8192 }, + }, + "gemini-2.0-flash-lite": { + id: "gemini-2.0-flash-lite", + name: "Gemini 2.0 Flash Lite", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0748, output: 0.306 }, + limit: { context: 1000000, input: 1000000, output: 8192 }, + }, + "azure-gpt-4-turbo": { + id: "azure-gpt-4-turbo", + name: "Azure gpt-4-turbo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-11-06", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 30.005 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "Baichuan-M2": { + id: "Baichuan-M2", + name: "Baichuan M2 32B Medical", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 15.73, output: 15.73 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "qwen-long": { + id: "qwen-long", + name: "Qwen Long 10M", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-25", + last_updated: "2025-01-25", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.408 }, + limit: { context: 10000000, input: 10000000, output: 8192 }, + }, + "sonar-reasoning-pro": { + id: "sonar-reasoning-pro", + name: "Perplexity Reasoning Pro", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.006, output: 7.9985 }, + limit: { context: 127000, input: 127000, output: 128000 }, + }, + "gemini-2.5-flash-preview-05-20:thinking": { + id: "gemini-2.5-flash-preview-05-20:thinking", + name: "Gemini 2.5 Flash 0520 Thinking", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 3.5 }, + limit: { context: 1048000, input: 1048000, output: 65536 }, + }, + "GLM-4.5-Air-Derestricted-Steam-ReExtract": { + id: "GLM-4.5-Air-Derestricted-Steam-ReExtract", + name: "GLM 4.5 Air Derestricted Steam ReExtract", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-12", + last_updated: "2025-12-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 131072, input: 131072, output: 65536 }, + }, + "Llama-3.3-70B-Dark-Ages-v0.1": { + id: "Llama-3.3-70B-Dark-Ages-v0.1", + name: "Llama 3.3 70B Dark Ages v0.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "Baichuan4-Turbo": { + id: "Baichuan4-Turbo", + name: "Baichuan 4 Turbo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.42, output: 2.42 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "doubao-1.5-vision-pro-32k": { + id: "doubao-1.5-vision-pro-32k", + name: "Doubao 1.5 Vision Pro 32k", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-22", + last_updated: "2025-01-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.459, output: 1.377 }, + limit: { context: 32000, input: 32000, output: 8192 }, + }, + "alibaba/qwen3.6-flash": { + id: "alibaba/qwen3.6-flash", + name: "Qwen3.6 Flash", + family: "qwen3.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.19, output: 1.16 }, + limit: { context: 991800, output: 65536 }, + }, + "inflection/inflection-3-pi": { + id: "inflection/inflection-3-pi", + name: "Inflection 3 Pi", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-10-11", + last_updated: "2024-10-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.499, output: 9.996 }, + limit: { context: 8000, input: 8000, output: 4096 }, + }, + "inflection/inflection-3-productivity": { + id: "inflection/inflection-3-productivity", + name: "Inflection 3 Productivity", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-10-11", + last_updated: "2024-10-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.499, output: 9.996 }, + limit: { context: 8000, input: 8000, output: 4096 }, + }, + "essentialai/rnj-1-instruct": { + id: "essentialai/rnj-1-instruct", + name: "RNJ-1 Instruct 8B", + family: "rnj", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-13", + last_updated: "2025-12-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "LLM360/K2-Think": { + id: "LLM360/K2-Think", + name: "K2-Think", + 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: false, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "TEE/kimi-k2.5": { + id: "TEE/kimi-k2.5", + name: "Kimi K2.5 TEE", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.9 }, + limit: { context: 128000, input: 128000, output: 65535 }, + }, + "TEE/glm-4.7": { + id: "TEE/glm-4.7", + name: "GLM 4.7 TEE", + family: "glm", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.85, output: 3.3 }, + limit: { context: 131000, input: 131000, output: 65535 }, + }, + "TEE/qwen3.5-397b-a17b": { + id: "TEE/qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B TEE", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-28", + last_updated: "2026-02-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 258048, input: 258048, output: 65536 }, + }, + "TEE/glm-5": { + id: "TEE/glm-5", + name: "GLM 5 TEE", + family: "glm", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 3.5 }, + limit: { context: 203000, input: 203000, output: 65535 }, + }, + "TEE/qwen2.5-vl-72b-instruct": { + id: "TEE/qwen2.5-vl-72b-instruct", + name: "Qwen2.5 VL 72B TEE", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-01", + last_updated: "2025-02-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "TEE/minimax-m2.1": { + id: "TEE/minimax-m2.1", + name: "MiniMax M2.1 TEE", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 200000, input: 200000, output: 131072 }, + }, + "TEE/qwen3-30b-a3b-instruct-2507": { + id: "TEE/qwen3-30b-a3b-instruct-2507", + name: "Qwen3 30B A3B Instruct 2507 TEE", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.44999999999999996 }, + limit: { context: 262000, input: 262000, output: 32768 }, + }, + "TEE/deepseek-v3.1": { + id: "TEE/deepseek-v3.1", + name: "DeepSeek V3.1 TEE", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 2.5 }, + limit: { context: 164000, input: 164000, output: 8192 }, + }, + "TEE/llama3-3-70b": { + id: "TEE/llama3-3-70b", + name: "Llama 3.3 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-03", + last_updated: "2025-07-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 2 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "TEE/glm-4.6": { + id: "TEE/glm-4.6", + name: "GLM 4.6 TEE", + family: "glm", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 2 }, + limit: { context: 203000, input: 203000, output: 65535 }, + }, + "TEE/kimi-k2.5-thinking": { + id: "TEE/kimi-k2.5-thinking", + name: "Kimi K2.5 Thinking TEE", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2026-01-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.9 }, + limit: { context: 128000, input: 128000, output: 65535 }, + }, + "TEE/gemma-3-27b-it": { + id: "TEE/gemma-3-27b-it", + name: "Gemma 3 27B TEE", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "TEE/deepseek-v3.2": { + id: "TEE/deepseek-v3.2", + name: "DeepSeek V3.2 TEE", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1 }, + limit: { context: 164000, input: 164000, output: 65536 }, + }, + "TEE/gpt-oss-20b": { + id: "TEE/gpt-oss-20b", + name: "GPT-OSS 20B TEE", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "TEE/qwen3-coder": { + id: "TEE/qwen3-coder", + name: "Qwen3 Coder 480B TEE", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-23", + last_updated: "2025-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 2 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "TEE/glm-4.7-flash": { + id: "TEE/glm-4.7-flash", + name: "GLM 4.7 Flash TEE", + family: "glm-flash", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.5 }, + limit: { context: 203000, input: 203000, output: 65535 }, + }, + "TEE/gpt-oss-120b": { + id: "TEE/gpt-oss-120b", + name: "GPT-OSS 120B TEE", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 2 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "TEE/deepseek-r1-0528": { + id: "TEE/deepseek-r1-0528", + name: "DeepSeek R1 0528 TEE", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-05-28", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 2 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "TEE/kimi-k2-thinking": { + id: "TEE/kimi-k2-thinking", + name: "Kimi K2 Thinking TEE", + family: "kimi-thinking", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 2 }, + limit: { context: 128000, input: 128000, output: 65535 }, + }, + "CrucibleLab/L3.3-70B-Loki-V2.0": { + id: "CrucibleLab/L3.3-70B-Loki-V2.0", + name: "L3.3 70B Loki v2.0", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-22", + last_updated: "2026-01-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "deepseek/deepseek-v3.2:thinking": { + id: "deepseek/deepseek-v3.2:thinking", + name: "DeepSeek V3.2 Thinking", + family: "deepseek", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27999999999999997, output: 0.42000000000000004 }, + limit: { context: 163000, input: 163000, output: 65536 }, + }, + "deepseek/deepseek-prover-v2-671b": { + id: "deepseek/deepseek-prover-v2-671b", + name: "DeepSeek Prover v2 671B", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-30", + last_updated: "2025-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 2.5 }, + limit: { context: 160000, input: 160000, output: 16384 }, + }, + "deepseek/deepseek-v3.2-speciale": { + id: "deepseek/deepseek-v3.2-speciale", + name: "DeepSeek V3.2 Speciale", + family: "deepseek", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27999999999999997, output: 0.42000000000000004 }, + limit: { context: 163000, input: 163000, output: 65536 }, + }, + "deepseek/deepseek-v3.2": { + id: "deepseek/deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27999999999999997, output: 0.42000000000000004 }, + limit: { context: 163000, input: 163000, output: 65536 }, + }, + "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond": { + id: "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond", + name: "MS3.2 24B Magnum Diamond", + 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: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 32768 }, + }, + "NeverSleep/Llama-3-Lumimaid-70B-v0.1": { + id: "NeverSleep/Llama-3-Lumimaid-70B-v0.1", + name: "Lumimaid 70b", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.006, output: 2.006 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "NeverSleep/Lumimaid-v0.2-70B": { + id: "NeverSleep/Lumimaid-v0.2-70B", + name: "Lumimaid v0.2", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 1.5 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "Steelskull/L3.3-Cu-Mai-R1-70b": { + id: "Steelskull/L3.3-Cu-Mai-R1-70b", + name: "Llama 3.3 70B Cu Mai", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "Steelskull/L3.3-Nevoria-R1-70b": { + id: "Steelskull/L3.3-Nevoria-R1-70b", + name: "Steelskull Nevoria R1 70b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "Steelskull/L3.3-MS-Evayale-70B": { + id: "Steelskull/L3.3-MS-Evayale-70B", + name: "Evayale 70b ", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "Steelskull/L3.3-Electra-R1-70b": { + id: "Steelskull/L3.3-Electra-R1-70b", + name: "Steelskull Electra R1 70b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.69989, output: 0.69989 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "Steelskull/L3.3-MS-Nevoria-70b": { + id: "Steelskull/L3.3-MS-Nevoria-70b", + name: "Steelskull Nevoria 70b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "Steelskull/L3.3-MS-Evalebis-70b": { + id: "Steelskull/L3.3-MS-Evalebis-70b", + name: "MS Evalebis 70b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "miromind-ai/mirothinker-v1.5-235b": { + id: "miromind-ai/mirothinker-v1.5-235b", + name: "MiroThinker v1.5 235B", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-07", + last_updated: "2026-01-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 32768, input: 32768, output: 4000 }, + }, + "pamanseau/OpenReasoning-Nemotron-32B": { + id: "pamanseau/OpenReasoning-Nemotron-32B", + name: "OpenReasoning Nemotron 32B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 32768, input: 32768, output: 65536 }, + }, + "arcee-ai/trinity-mini": { + id: "arcee-ai/trinity-mini", + name: "Trinity Mini", + family: "trinity-mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.045000000000000005, output: 0.15 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "arcee-ai/trinity-large": { + id: "arcee-ai/trinity-large", + name: "Trinity Large", + family: "trinity", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "cognitivecomputations/dolphin-2.9.2-qwen2-72b": { + id: "cognitivecomputations/dolphin-2.9.2-qwen2-72b", + name: "Dolphin 72b", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-27", + last_updated: "2025-02-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.306 }, + limit: { context: 8192, input: 8192, output: 4096 }, + }, + "deepcogito/cogito-v1-preview-qwen-32B": { + id: "deepcogito/cogito-v1-preview-qwen-32B", + name: "Cogito v1 Preview Qwen 32B", + family: "qwen", + 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: false, + cost: { input: 1.7999999999999998, output: 1.7999999999999998 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "deepcogito/cogito-v2.1-671b": { + id: "deepcogito/cogito-v2.1-671b", + name: "Cogito v2.1 671B MoE", + family: "cogito", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-19", + last_updated: "2025-11-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 1.25 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "Salesforce/Llama-xLAM-2-70b-fc-r": { + id: "Salesforce/Llama-xLAM-2-70b-fc-r", + name: "Llama-xLAM-2 70B fc-r", + 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: false, + cost: { input: 2.5, output: 2.5 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "NousResearch 2/hermes-4-405b:thinking": { + id: "NousResearch 2/hermes-4-405b:thinking", + name: "Hermes 4 Large (Thinking)", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "NousResearch 2/DeepHermes-3-Mistral-24B-Preview": { + id: "NousResearch 2/DeepHermes-3-Mistral-24B-Preview", + name: "DeepHermes-3 Mistral 24B (Preview)", + family: "nousresearch", + 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: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "NousResearch 2/Hermes-4-70B:thinking": { + id: "NousResearch 2/Hermes-4-70B:thinking", + name: "Hermes 4 (Thinking)", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-17", + last_updated: "2025-09-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.39949999999999997 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "NousResearch 2/hermes-4-405b": { + id: "NousResearch 2/hermes-4-405b", + name: "Hermes 4 Large", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "NousResearch 2/hermes-3-llama-3.1-70b": { + id: "NousResearch 2/hermes-3-llama-3.1-70b", + name: "Hermes 3 70B", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-07", + last_updated: "2026-01-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.408, output: 0.408 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "NousResearch 2/hermes-4-70b": { + id: "NousResearch 2/hermes-4-70b", + name: "Hermes 4 Medium", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-03", + last_updated: "2025-07-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.39949999999999997 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "soob3123/Veiled-Calla-12B": { + id: "soob3123/Veiled-Calla-12B", + name: "Veiled Calla 12B", + 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: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "soob3123/GrayLine-Qwen3-8B": { + id: "soob3123/GrayLine-Qwen3-8B", + name: "Grayline Qwen3 8B", + 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: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 16384, input: 16384, output: 32768 }, + }, + "soob3123/amoral-gemma3-27B-v2": { + id: "soob3123/amoral-gemma3-27B-v2", + name: "Amoral Gemma3 27B v2", + 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: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "nex-agi/deepseek-v3.1-nex-n1": { + id: "nex-agi/deepseek-v3.1-nex-n1", + name: "DeepSeek V3.1 Nex N1", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-10", + last_updated: "2025-12-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27999999999999997, output: 0.42000000000000004 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B": { + id: "Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B", + name: "Llama 3.05 Storybreaker Ministral 70b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B": { + id: "Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B", + name: "Nemotron Tenyxchat Storybreaker 70b", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "anthracite-org/magnum-v4-72b": { + id: "anthracite-org/magnum-v4-72b", + name: "Magnum v4 72B", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.006, output: 2.992 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "anthracite-org/magnum-v2-72b": { + id: "anthracite-org/magnum-v2-72b", + name: "Magnum V2 72B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.006, output: 2.992 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "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", + 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: false, + cost: { input: 0.5, output: 0.5 }, + limit: { context: 16384, input: 16384, output: 32768 }, + }, + "ReadyArt/The-Omega-Abomination-L-70B-v1.0": { + id: "ReadyArt/The-Omega-Abomination-L-70B-v1.0", + name: "The Omega Abomination V1", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 0.95 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "undi95/remm-slerp-l2-13b": { + id: "undi95/remm-slerp-l2-13b", + name: "ReMM SLERP 13B", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7989999999999999, output: 1.2069999999999999 }, + limit: { context: 6144, input: 6144, output: 4096 }, + }, + "MarinaraSpaghetti/NemoMix-Unleashed-12B": { + id: "MarinaraSpaghetti/NemoMix-Unleashed-12B", + name: "NemoMix 12B Unleashed", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "allenai/molmo-2-8b": { + id: "allenai/molmo-2-8b", + name: "Molmo 2 8B", + family: "allenai", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-14", + last_updated: "2026-02-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 36864, input: 36864, output: 36864 }, + }, + "allenai/olmo-3.1-32b-instruct": { + id: "allenai/olmo-3.1-32b-instruct", + name: "Olmo 3.1 32B Instruct", + family: "allenai", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-25", + last_updated: "2026-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "allenai/olmo-3.1-32b-think": { + id: "allenai/olmo-3.1-32b-think", + name: "Olmo 3.1 32B Think", + family: "allenai", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2026-01-25", + last_updated: "2026-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.5 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "allenai/olmo-3-32b-think": { + id: "allenai/olmo-3-32b-think", + name: "Olmo 3 32B Think", + family: "allenai", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.44999999999999996 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "stepfun-ai/step-3.5-flash:thinking": { + id: "stepfun-ai/step-3.5-flash:thinking", + name: "Step 3.5 Flash Thinking", + family: "step", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2026-02-02", + last_updated: "2026-02-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 256000, input: 256000, output: 256000 }, + }, + "stepfun-ai/step-3.5-flash": { + id: "stepfun-ai/step-3.5-flash", + name: "Step 3.5 Flash", + family: "step", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2026-02-02", + last_updated: "2026-02-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 256000, input: 256000, output: 256000 }, + }, + "zai-org/glm-4.7": { + id: "zai-org/glm-4.7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-01-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.8 }, + limit: { context: 200000, input: 200000, output: 128000 }, + }, + "zai-org/glm-5": { + id: "zai-org/glm-5", + name: "GLM 5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.55 }, + limit: { context: 200000, input: 200000, output: 128000 }, + }, + "zai-org/glm-5.1": { + id: "zai-org/glm-5.1", + name: "GLM 5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.55 }, + limit: { context: 200000, input: 200000, output: 131072 }, + }, + "zai-org/glm-5.1:thinking": { + id: "zai-org/glm-5.1:thinking", + name: "GLM 5.1 Thinking", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.55 }, + limit: { context: 200000, input: 200000, output: 131072 }, + }, + "zai-org/glm-5:thinking": { + id: "zai-org/glm-5:thinking", + name: "GLM 5 Thinking", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.55 }, + limit: { context: 200000, input: 200000, output: 128000 }, + }, + "zai-org/glm-4.7-flash": { + id: "zai-org/glm-4.7-flash", + name: "GLM 4.7 Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.4 }, + limit: { context: 200000, input: 200000, output: 128000 }, + }, + "featherless-ai/Qwerky-72B": { + id: "featherless-ai/Qwerky-72B", + name: "Qwerky 72B", + family: "qwerky", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-20", + last_updated: "2025-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 0.5 }, + limit: { context: 32000, input: 32000, output: 8192 }, + }, + "mlabonne/NeuralDaredevil-8B-abliterated": { + id: "mlabonne/NeuralDaredevil-8B-abliterated", + name: "Neural Daredevil 8B abliterated", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.44, output: 0.44 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + "raifle/sorcererlm-8x22b": { + id: "raifle/sorcererlm-8x22b", + name: "SorcererLM 8x22B", + family: "mixtral", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.505, output: 4.505 }, + limit: { context: 16000, input: 16000, output: 8192 }, + }, + "mistralai/mixtral-8x7b-instruct-v0.1": { + id: "mistralai/mixtral-8x7b-instruct-v0.1", + name: "Mixtral 8x7B", + family: "mixtral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-11", + last_updated: "2025-12-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.27 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "mistralai/mistral-saba": { + id: "mistralai/mistral-saba", + name: "Mistral Saba", + family: "mistral", + 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: false, + cost: { input: 0.1989, output: 0.595 }, + limit: { context: 32000, input: 32000, output: 32768 }, + }, + "mistralai/mistral-large-3-675b-instruct-2512": { + id: "mistralai/mistral-large-3-675b-instruct-2512", + name: "Mistral Large 3 675B", + family: "mistral-large", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3 }, + limit: { context: 262144, input: 262144, output: 256000 }, + }, + "mistralai/devstral-2-123b-instruct-2512": { + id: "mistralai/devstral-2-123b-instruct-2512", + name: "Devstral 2 123B", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-09", + last_updated: "2025-12-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.4 }, + limit: { context: 262144, input: 262144, output: 65536 }, + }, + "mistralai/codestral-2508": { + id: "mistralai/codestral-2508", + name: "Codestral 2508", + family: "codestral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.8999999999999999 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "mistralai/ministral-14b-instruct-2512": { + id: "mistralai/ministral-14b-instruct-2512", + name: "Ministral 3 14B", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 262144, input: 262144, output: 32768 }, + }, + "mistralai/mistral-tiny": { + id: "mistralai/mistral-tiny", + name: "Mistral Tiny", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-12-11", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25499999999999995, output: 0.25499999999999995 }, + limit: { context: 32000, input: 32000, output: 8192 }, + }, + "mistralai/ministral-8b-2512": { + id: "mistralai/ministral-8b-2512", + name: "Ministral 8B", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-04", + last_updated: "2025-12-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 262144, input: 262144, output: 32768 }, + }, + "mistralai/mixtral-8x22b-instruct-v0.1": { + id: "mistralai/mixtral-8x22b-instruct-v0.1", + name: "Mixtral 8x22B", + family: "mixtral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-11", + last_updated: "2025-12-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8999999999999999, output: 0.8999999999999999 }, + limit: { context: 65536, input: 65536, output: 32768 }, + }, + "mistralai/mistral-medium-3.1": { + id: "mistralai/mistral-medium-3.1", + name: "Mistral Medium 3.1", + family: "mistral-medium", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, input: 131072, output: 32768 }, + }, + "mistralai/ministral-3b-2512": { + id: "mistralai/ministral-3b-2512", + name: "Ministral 3B", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-04", + last_updated: "2025-12-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, input: 131072, output: 32768 }, + }, + "mistralai/Mistral-Nemo-Instruct-2407": { + id: "mistralai/Mistral-Nemo-Instruct-2407", + name: "Mistral Nemo", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.1207 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "mistralai/mistral-medium-3": { + id: "mistralai/mistral-medium-3", + name: "Mistral Medium 3", + family: "mistral-medium", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, input: 131072, output: 32768 }, + }, + "mistralai/mistral-7b-instruct": { + id: "mistralai/mistral-7b-instruct", + name: "Mistral 7B Instruct", + family: "mistral", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-27", + last_updated: "2024-05-27", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0544, output: 0.0544 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "mistralai/Devstral-Small-2505": { + id: "mistralai/Devstral-Small-2505", + name: "Mistral Devstral Small 2505", + 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: false, + cost: { input: 0.060000000000000005, output: 0.060000000000000005 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "mistralai/mistral-small-creative": { + id: "mistralai/mistral-small-creative", + name: "Mistral Small Creative", + family: "mistral-small", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "mistralai/mistral-large": { + id: "mistralai/mistral-large", + name: "Mistral Large 2411", + family: "mistral-large", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-02-26", + last_updated: "2024-02-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.006, output: 6.001 }, + limit: { context: 128000, input: 128000, output: 256000 }, + }, + "mistralai/ministral-14b-2512": { + id: "mistralai/ministral-14b-2512", + name: "Ministral 14B", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-04", + last_updated: "2025-12-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 262144, input: 262144, output: 32768 }, + }, + "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", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 0.5 }, + limit: { context: 32768, input: 32768, output: 4096 }, + }, + "shisa-ai/shisa-v2-llama3.3-70b": { + id: "shisa-ai/shisa-v2-llama3.3-70b", + name: "Shisa V2 Llama 3.3 70B", + 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: false, + cost: { input: 0.5, output: 0.5 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "meta-llama/llama-3.3-70b-instruct": { + id: "meta-llama/llama-3.3-70b-instruct", + name: "Llama 3.3 70b Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-02-27", + last_updated: "2025-02-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.23 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "meta-llama/llama-4-scout": { + id: "meta-llama/llama-4-scout", + name: "Llama 4 Scout", + family: "llama", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.085, output: 0.46 }, + limit: { context: 328000, input: 328000, output: 65536 }, + }, + "meta-llama/llama-4-maverick": { + id: "meta-llama/llama-4-maverick", + name: "Llama 4 Maverick", + family: "llama", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18000000000000002, output: 0.8 }, + limit: { context: 1048576, input: 1048576, output: 65536 }, + }, + "meta-llama/llama-3.2-90b-vision-instruct": { + id: "meta-llama/llama-3.2-90b-vision-instruct", + name: "Llama 3.2 Medium", + 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: false, + cost: { input: 0.9009999999999999, output: 0.9009999999999999 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "meta-llama/llama-3.2-3b-instruct": { + id: "meta-llama/llama-3.2-3b-instruct", + name: "Llama 3.2 3b Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-09-25", + last_updated: "2024-09-25", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0306, output: 0.0493 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "meta-llama/llama-3.1-8b-instruct": { + id: "meta-llama/llama-3.1-8b-instruct", + name: "Llama 3.1 8b Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0544, output: 0.0544 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "GalrionSoftworks/MN-LooseCannon-12B-v1": { + id: "GalrionSoftworks/MN-LooseCannon-12B-v1", + name: "MN-LooseCannon-12B-v1", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "baseten/Kimi-K2-Instruct-FP4": { + id: "baseten/Kimi-K2-Instruct-FP4", + name: "Kimi K2 0711 Instruct FP4", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-11", + last_updated: "2025-07-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 2 }, + limit: { context: 128000, input: 128000, output: 131072 }, + }, + "Gryphe/MythoMax-L2-13b": { + id: "Gryphe/MythoMax-L2-13b", + name: "MythoMax 13B", + 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: false, + cost: { input: 0.1003, output: 0.1003 }, + limit: { context: 4000, input: 4000, output: 4096 }, + }, + "x-ai/grok-4-fast:thinking": { + id: "x-ai/grok-4-fast:thinking", + name: "Grok 4 Fast Thinking", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, input: 2000000, output: 131072 }, + }, + "x-ai/grok-4-07-09": { + id: "x-ai/grok-4-07-09", + name: "Grok 4", + family: "grok", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 256000, input: 256000, output: 131072 }, + }, + "x-ai/grok-4-fast": { + id: "x-ai/grok-4-fast", + name: "Grok 4 Fast", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-20", + last_updated: "2025-09-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, input: 2000000, output: 131072 }, + }, + "x-ai/grok-code-fast-1": { + id: "x-ai/grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 256000, input: 256000, output: 131072 }, + }, + "x-ai/grok-4.1-fast": { + id: "x-ai/grok-4.1-fast", + name: "Grok 4.1 Fast", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-20", + last_updated: "2025-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, input: 2000000, output: 131072 }, + }, + "x-ai/grok-4.1-fast-reasoning": { + id: "x-ai/grok-4.1-fast-reasoning", + name: "Grok 4.1 Fast Reasoning", + family: "grok", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-20", + last_updated: "2025-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, input: 2000000, output: 131072 }, + }, + "tencent/Hunyuan-MT-7B": { + id: "tencent/Hunyuan-MT-7B", + name: "Hunyuan MT 7B", + family: "hunyuan", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-18", + last_updated: "2025-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 20 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + "microsoft/wizardlm-2-8x22b": { + id: "microsoft/wizardlm-2-8x22b", + name: "WizardLM-2 8x22B", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "microsoft/MAI-DS-R1-FP8": { + id: "microsoft/MAI-DS-R1-FP8", + name: "Microsoft DeepSeek R1", + family: "deepseek", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "cohere/command-r": { + id: "cohere/command-r", + name: "Cohere: Command R", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-03-11", + last_updated: "2024-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.476, output: 1.428 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "cohere/command-r-plus-08-2024": { + id: "cohere/command-r-plus-08-2024", + name: "Cohere: Command R+", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + release_date: "2024-08-30", + last_updated: "2024-08-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.856, output: 14.246 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "chutesai/Mistral-Small-3.2-24B-Instruct-2506": { + id: "chutesai/Mistral-Small-3.2-24B-Instruct-2506", + name: "Mistral Small 3.2 24b Instruct", + family: "chutesai", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.4 }, + limit: { context: 128000, input: 128000, output: 131072 }, + }, + "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": { + id: "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1", + name: "Nvidia Nemotron Ultra 253B", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-03", + last_updated: "2025-07-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 0.8 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "nvidia/nemotron-3-nano-30b-a3b": { + id: "nvidia/nemotron-3-nano-30b-a3b", + name: "Nvidia Nemotron 3 Nano 30B", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-15", + last_updated: "2025-12-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 256000, input: 256000, output: 262144 }, + }, + "nvidia/nvidia-nemotron-nano-9b-v2": { + id: "nvidia/nvidia-nemotron-nano-9b-v2", + name: "Nvidia Nemotron Nano 9B v2", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-18", + last_updated: "2025-08-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": { + id: "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF", + name: "Nvidia Nemotron 70b", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.357, output: 0.408 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "nvidia/Llama-3.3-Nemotron-Super-49B-v1": { + id: "nvidia/Llama-3.3-Nemotron-Super-49B-v1", + name: "Nvidia Nemotron Super 49B", + family: "nemotron", + 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: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5": { + id: "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5", + name: "Nvidia Nemotron Super 49B v1.5", + family: "nemotron", + 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: false, + cost: { input: 0.05, output: 0.25 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "TheDrummer 2/Anubis-70B-v1": { + id: "TheDrummer 2/Anubis-70B-v1", + name: "Anubis 70B v1", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.31, output: 0.31 }, + limit: { context: 65536, input: 65536, output: 16384 }, + }, + "TheDrummer 2/Cydonia-24B-v4.3": { + id: "TheDrummer 2/Cydonia-24B-v4.3", + name: "The Drummer Cydonia 24B v4.3", + family: "llama", + 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: false, + cost: { input: 0.1003, output: 0.1207 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "TheDrummer 2/Magidonia-24B-v4.3": { + id: "TheDrummer 2/Magidonia-24B-v4.3", + name: "The Drummer Magidonia 24B v4.3", + family: "llama", + 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: false, + cost: { input: 0.1003, output: 0.1207 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "TheDrummer 2/Cydonia-24B-v4": { + id: "TheDrummer 2/Cydonia-24B-v4", + name: "The Drummer Cydonia 24B v4", + family: "llama", + 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: false, + cost: { input: 0.2006, output: 0.2414 }, + limit: { context: 16384, input: 16384, output: 32768 }, + }, + "TheDrummer 2/Anubis-70B-v1.1": { + id: "TheDrummer 2/Anubis-70B-v1.1", + name: "Anubis 70B v1.1", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.31, output: 0.31 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "TheDrummer 2/Rocinante-12B-v1.1": { + id: "TheDrummer 2/Rocinante-12B-v1.1", + name: "Rocinante 12b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.408, output: 0.595 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "TheDrummer 2/Cydonia-24B-v4.1": { + id: "TheDrummer 2/Cydonia-24B-v4.1", + name: "The Drummer Cydonia 24B v4.1", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.1207 }, + limit: { context: 16384, input: 16384, output: 32768 }, + }, + "TheDrummer 2/UnslopNemo-12B-v4.1": { + id: "TheDrummer 2/UnslopNemo-12B-v4.1", + name: "UnslopNemo 12b v4", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "TheDrummer 2/Cydonia-24B-v2": { + id: "TheDrummer 2/Cydonia-24B-v2", + name: "The Drummer Cydonia 24B v2", + family: "llama", + 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: false, + cost: { input: 0.1003, output: 0.1207 }, + limit: { context: 16384, input: 16384, output: 32768 }, + }, + "TheDrummer 2/skyfall-36b-v2": { + id: "TheDrummer 2/skyfall-36b-v2", + name: "TheDrummer Skyfall 36B V2", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 64000, input: 64000, output: 32768 }, + }, + "deepseek-ai/DeepSeek-V3.1:thinking": { + id: "deepseek-ai/DeepSeek-V3.1:thinking", + name: "DeepSeek V3.1 Thinking", + family: "deepseek-thinking", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "deepseek-ai/DeepSeek-V3.1": { + id: "deepseek-ai/DeepSeek-V3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-07-26", + last_updated: "2025-07-26", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "deepseek-ai/DeepSeek-V3.1-Terminus:thinking": { + id: "deepseek-ai/DeepSeek-V3.1-Terminus:thinking", + name: "DeepSeek V3.1 Terminus (Thinking)", + family: "deepseek-thinking", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-22", + last_updated: "2025-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "deepseek-ai/deepseek-v3.2-exp-thinking": { + id: "deepseek-ai/deepseek-v3.2-exp-thinking", + name: "DeepSeek V3.2 Exp Thinking", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27999999999999997, output: 0.42000000000000004 }, + limit: { context: 163840, input: 163840, output: 65536 }, + }, + "deepseek-ai/deepseek-v3.2-exp": { + id: "deepseek-ai/deepseek-v3.2-exp", + name: "DeepSeek V3.2 Exp", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27999999999999997, output: 0.42000000000000004 }, + limit: { context: 163840, input: 163840, output: 65536 }, + }, + "deepseek-ai/DeepSeek-R1-0528": { + id: "deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek R1 0528", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-05-28", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.7 }, + limit: { context: 128000, input: 128000, output: 163840 }, + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + id: "deepseek-ai/DeepSeek-V3.1-Terminus", + name: "DeepSeek V3.1 Terminus", + 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: false, + cost: { input: 0.25, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "openai/gpt-5.1-codex-max": { + id: "openai/gpt-5.1-codex-max", + name: "GPT 5.1 Codex Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 20 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-5.2-chat": { + id: "openai/gpt-5.2-chat", + name: "GPT 5.2 Chat", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2026-01-01", + last_updated: "2026-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 400000, output: 16384 }, + }, + "openai/gpt-4o-mini-search-preview": { + id: "openai/gpt-4o-mini-search-preview", + name: "GPT-4o mini Search Preview", + family: "gpt-mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.088, output: 0.35 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/chatgpt-4o-latest": { + id: "openai/chatgpt-4o-latest", + name: "ChatGPT 4o", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 14.993999999999998 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "GPT 5.2 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-01-01", + last_updated: "2026-01-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 21, output: 168 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT 5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "GPT 5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.4 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-4-turbo": { + id: "openai/gpt-4-turbo", + name: "GPT-4 Turbo", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-11-06", + last_updated: "2024-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 30 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT 5.2", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-01-01", + last_updated: "2026-01-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/o3-mini-high": { + id: "openai/o3-mini-high", + name: "OpenAI o3-mini (High)", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.64, output: 2.588 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1496, output: 0.595 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/o4-mini-deep-research": { + id: "openai/o4-mini-deep-research", + name: "OpenAI o4-mini Deep Research", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-5.1-chat": { + id: "openai/gpt-5.1-chat", + name: "GPT 5.1 Chat", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "OpenAI o4-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT 5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "GPT 5.1 Codex Mini", + family: "gpt-codex-mini", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/o1-preview": { + id: "openai/o1-preview", + name: "OpenAI o1-preview", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 14.993999999999998, output: 59.993 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "openai/gpt-4o-2024-08-06": { + id: "openai/gpt-4o-2024-08-06", + name: "GPT-4o (2024-08-06)", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-08-06", + last_updated: "2024-08-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.499, output: 9.996 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT 5.1", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/o1": { + id: "openai/o1", + name: "OpenAI o1", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2024-12-17", + last_updated: "2024-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 14.993999999999998, output: 59.993 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-3.5-turbo": { + id: "openai/gpt-3.5-turbo", + name: "GPT-3.5 Turbo", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2022-11-30", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 16385, input: 16385, output: 4096 }, + }, + "openai/o3-deep-research": { + id: "openai/o3-deep-research", + name: "OpenAI o3 Deep Research", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/o3-mini": { + id: "openai/o3-mini", + name: "OpenAI o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-4-turbo-preview": { + id: "openai/gpt-4-turbo-preview", + name: "GPT-4 Turbo Preview", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2023-11-06", + last_updated: "2024-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 30.004999999999995 }, + limit: { context: 128000, input: 128000, output: 4096 }, + }, + "openai/o1-pro": { + id: "openai/o1-pro", + name: "OpenAI o1 Pro", + family: "o-pro", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-25", + last_updated: "2025-01-25", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 150, output: 600 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "GPT-5 Codex", + family: "gpt-codex", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "openai/gpt-5.1-chat-latest": { + id: "openai/gpt-5.1-chat-latest", + name: "GPT 5.1 Chat (Latest)", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 400000, output: 16384 }, + }, + "openai/gpt-4o-search-preview": { + id: "openai/gpt-4o-search-preview", + name: "GPT-4o Search Preview", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.47, output: 5.88 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/gpt-4.1-nano": { + id: "openai/gpt-4.1-nano", + name: "GPT 4.1 Nano", + family: "gpt-nano", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1047576, input: 1047576, output: 32768 }, + }, + "openai/o4-mini-high": { + id: "openai/o4-mini-high", + name: "OpenAI o4-mini high", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/o3": { + id: "openai/o3", + name: "OpenAI o3", + family: "o", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04, output: 0.15 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/gpt-5-pro": { + id: "openai/gpt-5-pro", + name: "GPT 5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 120 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-5.1-2025-11-13": { + id: "openai/gpt-5.1-2025-11-13", + name: "GPT-5.1 (2025-11-13)", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 1000000, input: 1000000, output: 32768 }, + }, + "openai/gpt-4o": { + id: "openai/gpt-4o", + name: "GPT-4o", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.499, output: 9.996 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/o3-mini-low": { + id: "openai/o3-mini-low", + name: "OpenAI o3-mini (Low)", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT 5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-oss-safeguard-20b": { + id: "openai/gpt-oss-safeguard-20b", + name: "GPT OSS Safeguard 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-10-29", + last_updated: "2025-10-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/o3-pro-2025-06-10": { + id: "openai/o3-pro-2025-06-10", + name: "OpenAI o3-pro (2025-06-10)", + family: "o-pro", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-06-10", + last_updated: "2025-06-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9.996, output: 19.992 }, + limit: { context: 200000, input: 200000, output: 100000 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.25 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "openai/gpt-5-chat-latest": { + id: "openai/gpt-5-chat-latest", + name: "GPT 5 Chat", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT 4.1", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-10", + last_updated: "2025-09-10", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8 }, + limit: { context: 1047576, input: 1047576, output: 32768 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "GPT 4.1 Mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.6 }, + limit: { context: 1047576, input: 1047576, output: 32768 }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT 5.1 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 400000, output: 128000 }, + }, + "openai/gpt-4o-2024-11-20": { + id: "openai/gpt-4o-2024-11-20", + name: "GPT-4o (2024-11-20)", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-11-20", + last_updated: "2024-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, input: 128000, output: 16384 }, + }, + "VongolaChouko/Starcannon-Unleashed-12B-v1.0": { + id: "VongolaChouko/Starcannon-Unleashed-12B-v1.0", + name: "Mistral Nemo Starcannon 12b v1", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "amazon/nova-lite-v1": { + id: "amazon/nova-lite-v1", + name: "Amazon Nova Lite 1.0", + family: "nova-lite", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0595, output: 0.238 }, + limit: { context: 300000, input: 300000, output: 5120 }, + }, + "amazon/nova-pro-v1": { + id: "amazon/nova-pro-v1", + name: "Amazon Nova Pro 1.0", + family: "nova-pro", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7989999999999999, output: 3.1959999999999997 }, + limit: { context: 300000, input: 300000, output: 32000 }, + }, + "amazon/nova-2-lite-v1": { + id: "amazon/nova-2-lite-v1", + name: "Amazon Nova 2 Lite", + family: "nova", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5099999999999999, output: 4.25 }, + limit: { context: 1000000, input: 1000000, output: 65535 }, + }, + "amazon/nova-micro-v1": { + id: "amazon/nova-micro-v1", + name: "Amazon Nova Micro 1.0", + family: "nova-micro", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0357, output: 0.1394 }, + limit: { context: 128000, input: 128000, output: 5120 }, + }, + "Sao10K/L3.3-70B-Euryale-v2.3": { + id: "Sao10K/L3.3-70B-Euryale-v2.3", + name: "Llama 3.3 70B Euryale", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 20480, input: 20480, output: 16384 }, + }, + "Sao10K/L3.1-70B-Euryale-v2.2": { + id: "Sao10K/L3.1-70B-Euryale-v2.2", + name: "Llama 3.1 70B Euryale", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.306, output: 0.357 }, + limit: { context: 20480, input: 20480, output: 16384 }, + }, + "Sao10K/L3.1-70B-Hanami-x1": { + id: "Sao10K/L3.1-70B-Hanami-x1", + name: "Llama 3.1 70B Hanami", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "Sao10K/L3-8B-Stheno-v3.2": { + id: "Sao10K/L3-8B-Stheno-v3.2", + name: "Sao10K Stheno 8b", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-11-29", + last_updated: "2024-11-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.2006 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "LatitudeGames/Wayfarer-Large-70B-Llama-3.3": { + id: "LatitudeGames/Wayfarer-Large-70B-Llama-3.3", + name: "Llama 3.3 70B Wayfarer", + 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: false, + cost: { input: 0.700000007, output: 0.700000007 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "z-ai/glm-4.6:thinking": { + id: "z-ai/glm-4.6:thinking", + name: "GLM 4.6 Thinking", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.5 }, + limit: { context: 200000, input: 200000, output: 65535 }, + }, + "z-ai/glm-4.5v": { + id: "z-ai/glm-4.5v", + name: "GLM 4.5V", + family: "glmv", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-22", + last_updated: "2025-11-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 1.7999999999999998 }, + limit: { context: 64000, input: 64000, output: 96000 }, + }, + "z-ai/glm-4.6": { + id: "z-ai/glm-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.5 }, + limit: { context: 200000, input: 200000, output: 65535 }, + }, + "z-ai/glm-4.5v:thinking": { + id: "z-ai/glm-4.5v:thinking", + name: "GLM 4.5V Thinking", + family: "glmv", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-22", + last_updated: "2025-11-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 1.7999999999999998 }, + limit: { context: 64000, input: 64000, output: 96000 }, + }, + "baidu/ernie-4.5-vl-28b-a3b": { + id: "baidu/ernie-4.5-vl-28b-a3b", + name: "ERNIE 4.5 VL 28B", + family: "ernie", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.13999999999999999, output: 0.5599999999999999 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "baidu/ernie-4.5-300b-a47b": { + id: "baidu/ernie-4.5-300b-a47b", + name: "ERNIE 4.5 300B", + family: "ernie", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 1.15 }, + limit: { context: 131072, input: 131072, output: 16384 }, + }, + "dmind/dmind-1": { + id: "dmind/dmind-1", + name: "DMind-1", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.6 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "dmind/dmind-1-mini": { + id: "dmind/dmind-1-mini", + name: "DMind-1-Mini", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.4 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "Infermatic/MN-12B-Inferor-v0.0": { + id: "Infermatic/MN-12B-Inferor-v0.0", + name: "Mistral Nemo Inferor 12B", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25499999999999995, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "meituan-longcat/LongCat-Flash-Chat-FP8": { + id: "meituan-longcat/LongCat-Flash-Chat-FP8", + name: "LongCat Flash", + family: "longcat", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-08-31", + last_updated: "2025-08-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.7 }, + limit: { context: 128000, input: 128000, output: 32768 }, + }, + "meganova-ai/manta-mini-1.0": { + id: "meganova-ai/manta-mini-1.0", + name: "Manta Mini 1.0", + family: "nova", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-20", + last_updated: "2025-12-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.02, output: 0.16 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + "meganova-ai/manta-pro-1.0": { + id: "meganova-ai/manta-pro-1.0", + name: "Manta Pro 1.0", + family: "nova", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-20", + last_updated: "2025-12-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.060000000000000005, output: 0.5 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "meganova-ai/manta-flash-1.0": { + id: "meganova-ai/manta-flash-1.0", + name: "Manta Flash 1.0", + family: "nova", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-20", + last_updated: "2025-12-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.02, output: 0.16 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "minimax/minimax-m2.7": { + id: "minimax/minimax-m2.7", + name: "MiniMax M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, input: 204800, output: 131072 }, + }, + "minimax/minimax-01": { + id: "minimax/minimax-01", + name: "MiniMax 01", + family: "minimax", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-15", + last_updated: "2025-01-15", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1394, output: 1.1219999999999999 }, + limit: { context: 1000192, input: 1000192, output: 16384 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "MiniMax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-12-19", + last_updated: "2025-12-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.33, output: 1.32 }, + limit: { context: 200000, input: 200000, output: 131072 }, + }, + "minimax/minimax-m2-her": { + id: "minimax/minimax-m2-her", + name: "MiniMax M2-her", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-01-24", + last_updated: "2026-01-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.30200000000000005, output: 1.2069999999999999 }, + limit: { context: 65532, input: 65532, output: 2048 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, input: 204800, output: 131072 }, + }, + "qwen/Qwen3.6-35B-A3B:thinking": { + id: "qwen/Qwen3.6-35B-A3B:thinking", + name: "Qwen3.6 35B A3B Thinking", + family: "qwen3.6", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2026-04-19", + last_updated: "2026-04-21", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 1.74 }, + limit: { context: 262144, output: 16384 }, + }, + "qwen/qwen3.5-397b-a17b": { + id: "qwen/qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-02-16", + last_updated: "2026-02-16", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 258048, input: 258048, output: 65536 }, + }, + "qwen/Qwen3.6-35B-A3B": { + id: "qwen/Qwen3.6-35B-A3B", + name: "Qwen3.6 35B A3B", + family: "qwen3.6", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2026-04-17", + last_updated: "2026-04-21", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 1.74 }, + limit: { context: 262144, output: 16384 }, + }, + "unsloth/gemma-3-1b-it": { + id: "unsloth/gemma-3-1b-it", + name: "Gemma 3 1B IT", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1003, output: 0.1003 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "unsloth/gemma-3-12b-it": { + id: "unsloth/gemma-3-12b-it", + name: "Gemma 3 12B IT", + family: "unsloth", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.272, output: 0.272 }, + limit: { context: 128000, input: 128000, output: 131072 }, + }, + "unsloth/gemma-3-4b-it": { + id: "unsloth/gemma-3-4b-it", + name: "Gemma 3 4B IT", + family: "unsloth", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.2006 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "unsloth/gemma-3-27b-it": { + id: "unsloth/gemma-3-27b-it", + name: "Gemma 3 27B IT", + family: "unsloth", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2992, output: 0.2992 }, + limit: { context: 128000, input: 128000, output: 96000 }, + }, + "THUDM/GLM-Z1-9B-0414": { + id: "THUDM/GLM-Z1-9B-0414", + name: "GLM Z1 9B 0414", + family: "glm-z", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 32000, input: 32000, output: 8000 }, + }, + "THUDM/GLM-4-9B-0414": { + id: "THUDM/GLM-4-9B-0414", + name: "GLM 4 9B 0414", + family: "glm", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 32000, input: 32000, output: 8000 }, + }, + "THUDM/GLM-Z1-Rumination-32B-0414": { + id: "THUDM/GLM-Z1-Rumination-32B-0414", + name: "GLM Z1 Rumination 32B 0414", + family: "glm-z", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 32000, input: 32000, output: 65536 }, + }, + "THUDM/GLM-4-32B-0414": { + id: "THUDM/GLM-4-32B-0414", + name: "GLM 4 32B 0414", + family: "glm", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "THUDM/GLM-Z1-32B-0414": { + id: "THUDM/GLM-Z1-32B-0414", + name: "GLM Z1 32B 0414", + family: "glm-z", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "google/gemini-3-flash-preview": { + id: "google/gemini-3-flash-preview", + name: "Gemini 3 Flash (Preview)", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "google/gemini-flash-1.5": { + id: "google/gemini-flash-1.5", + name: "Gemini 1.5 Flash", + family: "gemini-flash", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-05-14", + last_updated: "2024-05-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0748, output: 0.306 }, + limit: { context: 2000000, input: 2000000, output: 8192 }, + }, + "google/gemini-3-flash-preview-thinking": { + id: "google/gemini-3-flash-preview-thinking", + name: "Gemini 3 Flash Thinking", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3 }, + limit: { context: 1048756, input: 1048756, output: 65536 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + release_date: "2026-01-26", + last_updated: "2026-01-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.9 }, + limit: { context: 256000, input: 256000, output: 65536 }, + }, + "moonshotai/kimi-k2-instruct": { + id: "moonshotai/kimi-k2-instruct", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 2 }, + limit: { context: 256000, input: 256000, output: 8192 }, + }, + "moonshotai/kimi-k2-thinking-original": { + id: "moonshotai/kimi-k2-thinking-original", + name: "Kimi K2 Thinking Original", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "moonshotai/kimi-k2-instruct-0711": { + id: "moonshotai/kimi-k2-instruct-0711", + name: "Kimi K2 0711", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-07-11", + last_updated: "2025-07-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 2 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "moonshotai/Kimi-Dev-72B": { + id: "moonshotai/Kimi-Dev-72B", + name: "Kimi Dev 72B", + family: "kimi", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 128000, input: 128000, output: 131072 }, + }, + "moonshotai/kimi-k2-thinking-turbo-original": { + id: "moonshotai/kimi-k2-thinking-turbo-original", + name: "Kimi K2 Thinking Turbo Original", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.15, output: 8 }, + limit: { context: 256000, input: 256000, output: 16384 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + release_date: "2026-04-16", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.53, output: 2.73 }, + limit: { context: 256000, output: 65536 }, + }, + "moonshotai/kimi-k2.6:thinking": { + id: "moonshotai/kimi-k2.6:thinking", + name: "Kimi K2.6 Thinking", + family: "kimi-thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + release_date: "2026-04-16", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.53, output: 2.73 }, + limit: { context: 256000, output: 65536 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi K2 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 256000, input: 256000, output: 262144 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 256000, input: 256000, output: 262144 }, + }, + "moonshotai/kimi-k2.5:thinking": { + id: "moonshotai/kimi-k2.5:thinking", + name: "Kimi K2.5 Thinking", + family: "kimi-thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + release_date: "2026-01-26", + last_updated: "2026-01-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.9 }, + limit: { context: 256000, input: 256000, output: 65536 }, + }, + "Tongyi-Zhiwen/QwenLong-L1-32B": { + id: "Tongyi-Zhiwen/QwenLong-L1-32B", + name: "QwenLong L1 32B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-01-25", + last_updated: "2025-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.13999999999999999, output: 0.6 }, + limit: { context: 128000, input: 128000, output: 40960 }, + }, + "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", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "aion-labs/aion-1.0": { + id: "aion-labs/aion-1.0", + name: "Aion 1.0", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-02-01", + last_updated: "2025-02-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3.995, output: 7.99 }, + limit: { context: 65536, input: 65536, output: 8192 }, + }, + "aion-labs/aion-rp-llama-3.1-8b": { + id: "aion-labs/aion-rp-llama-3.1-8b", + name: "Llama 3.1 8b (uncensored)", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2006, output: 0.2006 }, + limit: { context: 32768, input: 32768, output: 16384 }, + }, + "aion-labs/aion-1.0-mini": { + id: "aion-labs/aion-1.0-mini", + name: "Aion 1.0 mini (DeepSeek)", + family: "deepseek", + 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: false, + cost: { input: 0.7989999999999999, output: 1.394 }, + limit: { context: 131072, input: 131072, output: 8192 }, + }, + "Alibaba-NLP/Tongyi-DeepResearch-30B-A3B": { + id: "Alibaba-NLP/Tongyi-DeepResearch-30B-A3B", + name: "Tongyi DeepResearch 30B A3B", + family: "yi", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.08, output: 0.24000000000000002 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "MiniMaxAI/MiniMax-M1-80k": { + id: "MiniMaxAI/MiniMax-M1-80k", + name: "MiniMax M1 80K", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-06-16", + last_updated: "2025-06-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6052, output: 2.4225000000000003 }, + limit: { context: 1000000, input: 1000000, output: 131072 }, + }, + "anthropic/claude-opus-4.6:thinking:low": { + id: "anthropic/claude-opus-4.6:thinking:low", + name: "Claude 4.6 Opus Thinking Low", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.6": { + id: "anthropic/claude-opus-4.6", + name: "Claude 4.6 Opus", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "anthropic/claude-sonnet-4.6:thinking": { + id: "anthropic/claude-sonnet-4.6:thinking", + name: "Claude Sonnet 4.6 Thinking", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.993999999999998 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.6:thinking:max": { + id: "anthropic/claude-opus-4.6:thinking:max", + name: "Claude 4.6 Opus Thinking Max", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.6:thinking:medium": { + id: "anthropic/claude-opus-4.6:thinking:medium", + name: "Claude 4.6 Opus Thinking Medium", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "anthropic/claude-sonnet-4.6": { + id: "anthropic/claude-sonnet-4.6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.992, output: 14.993999999999998 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.6:thinking": { + id: "anthropic/claude-opus-4.6:thinking", + name: "Claude 4.6 Opus Thinking", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.998, output: 25.007 }, + limit: { context: 1000000, input: 1000000, output: 128000 }, + }, + "abacusai/Dracarys-72B-Instruct": { + id: "abacusai/Dracarys-72B-Instruct", + name: "Llama 3.1 70B Dracarys 2", + 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: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "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", + 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: false, + cost: { input: 2.006, output: 2.006 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "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", + 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: false, + cost: { input: 0.7989999999999999, output: 0.7989999999999999 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "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", + 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: false, + cost: { input: 2.006, output: 2.006 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "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", + family: "qwen", + 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: false, + cost: { input: 0.7989999999999999, output: 0.7989999999999999 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated": { + id: "huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated", + name: "DeepSeek R1 Qwen Abliterated", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.4, output: 1.4 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated": { + id: "huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated", + name: "DeepSeek R1 Llama 70B Abliterated", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "huihui-ai/Llama-3.3-70B-Instruct-abliterated": { + id: "huihui-ai/Llama-3.3-70B-Instruct-abliterated", + name: "Llama 3.3 70B Instruct abliterated", + 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: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "huihui-ai/Qwen2.5-32B-Instruct-abliterated": { + id: "huihui-ai/Qwen2.5-32B-Instruct-abliterated", + name: "Qwen 2.5 32B Abliterated", + 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: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 32768, input: 32768, output: 8192 }, + }, + "huihui-ai/Llama-3.1-Nemotron-70B-Instruct-HF-abliterated": { + id: "huihui-ai/Llama-3.1-Nemotron-70B-Instruct-HF-abliterated", + name: "Nemotron 3.1 70B abliterated", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 16384, input: 16384, output: 16384 }, + }, + "xiaomi/mimo-v2-flash-thinking-original": { + id: "xiaomi/mimo-v2-flash-thinking-original", + name: "MiMo V2 Flash (Thinking) Original", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.102, output: 0.306 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "xiaomi/mimo-v2-flash-thinking": { + id: "xiaomi/mimo-v2-flash-thinking", + name: "MiMo V2 Flash (Thinking)", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.102, output: 0.306 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "xiaomi/mimo-v2-flash": { + id: "xiaomi/mimo-v2-flash", + name: "MiMo V2 Flash", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.102, output: 0.306 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "xiaomi/mimo-v2-flash-original": { + id: "xiaomi/mimo-v2-flash-original", + name: "MiMo V2 Flash Original", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.102, output: 0.306 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "tngtech/DeepSeek-TNG-R1T2-Chimera": { + id: "tngtech/DeepSeek-TNG-R1T2-Chimera", + name: "DeepSeek TNG R1T2 Chimera", + family: "tngtech", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.31, output: 0.31 }, + limit: { context: 128000, input: 128000, output: 8192 }, + }, + "tngtech/tng-r1t-chimera": { + id: "tngtech/tng-r1t-chimera", + name: "TNG R1T Chimera", + family: "tngtech", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2025-11-26", + last_updated: "2025-11-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 128000, input: 128000, output: 65536 }, + }, + "inflatebot/MN-12B-Mag-Mell-R1": { + id: "inflatebot/MN-12B-Mag-Mell-R1", + name: "Mag Mell R1", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.49299999999999994, output: 0.49299999999999994 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + "failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5": { + id: "failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5", + name: "Llama 3 70B abliterated", + 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: false, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 8192, input: 8192, output: 8192 }, + }, + }, + }, + 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: { + "gpt-5.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "GPT-5.1 Codex Max", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 200000, output: 64000 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 262144, output: 32768 }, + }, + "gemini-3.1-flash-lite-preview": { + id: "gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-01", + last_updated: "2026-03-01", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.3-chat-latest": { + id: "gpt-5.3-chat-latest", + name: "GPT-5.3 Chat Latest", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-01", + last_updated: "2026-03-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3 }, + limit: { context: 1048576, output: 65536 }, + }, + "llama-3.3-70b-versatile": { + id: "llama-3.3-70b-versatile", + name: "Llama 3.3 70B Versatile", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.59, output: 0.79 }, + limit: { context: 128000, output: 32768 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 1048576, output: 65536 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "Grok 4.1 Fast (Non-Reasoning)", + 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, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, output: 16384 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, output: 128000 }, + }, + "o3-pro": { + id: "o3-pro", + name: "o3-pro", + family: "o-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 20, output: 40 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-4o-mini": { + id: "gpt-4o-mini", + name: "GPT-4o Mini", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-max": { + id: "qwen3-max", + name: "Qwen3 Max", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-28", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 6 }, + limit: { context: 131072, output: 16384 }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.2-chat-latest": { + id: "gpt-5.2-chat-latest", + name: "GPT-5.2 Chat Latest", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-09-30", + release_date: "2026-01-01", + last_updated: "2026-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5.3-codex-xhigh": { + id: "gpt-5.3-codex-xhigh", + name: "GPT-5.3 Codex XHigh", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-01", + last_updated: "2025-09-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 256000, output: 16384 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "o3-mini": { + id: "o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, output: 100000 }, + }, + "grok-4-0709": { + id: "grok-4-0709", + name: "Grok 4", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 256000, output: 16384 }, + }, + "route-llm": { + id: "route-llm", + name: "Route LLM", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-01-01", + last_updated: "2024-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen-2.5-coder-32b": { + id: "qwen-2.5-coder-32b", + name: "Qwen 2.5 Coder 32B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-11", + last_updated: "2024-11-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.79, output: 0.79 }, + limit: { context: 128000, output: 8192 }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "GPT-5 Codex", + family: "gpt", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-5.1-chat-latest": { + id: "gpt-5.1-chat-latest", + name: "GPT-5.1 Chat Latest", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-sonnet-4-20250514": { + id: "claude-sonnet-4-20250514", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-14", + last_updated: "2025-05-14", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + "kimi-k2-turbo-preview": { + id: "kimi-k2-turbo-preview", + name: "Kimi K2 Turbo Preview", + family: "kimi", + 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, + cost: { input: 0.15, output: 8 }, + limit: { context: 256000, output: 8192 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 200000, output: 128000 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "GPT-4.1 Nano", + 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, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1047576, output: 32768 }, + }, + "claude-3-7-sonnet-20250219": { + id: "claude-3-7-sonnet-20250219", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 64000 }, + }, + o3: { + id: "o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-20250514": { + id: "claude-opus-4-20250514", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-14", + last_updated: "2025-05-14", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "GPT-4.1 Mini", + 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, + cost: { input: 0.4, output: 1.6 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-4o-2024-11-20": { + id: "gpt-4o-2024-11-20", + name: "GPT-4o (2024-11-20)", + 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", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "Grok 4 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 2000000, output: 16384 }, + }, + "deepseek/deepseek-v3.1": { + id: "deepseek/deepseek-v3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 1.66 }, + limit: { context: 128000, output: 8192 }, + }, + "Qwen/QwQ-32B": { + id: "Qwen/QwQ-32B", + name: "QwQ 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-11-28", + last_updated: "2024-11-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 32768, output: 32768 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.6 }, + limit: { context: 262144, output: 8192 }, + }, + "Qwen/Qwen3-32B": { + id: "Qwen/Qwen3-32B", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.29 }, + limit: { context: 128000, output: 8192 }, + }, + "Qwen/qwen3-coder-480b-a35b-instruct": { + id: "Qwen/qwen3-coder-480b-a35b-instruct", + name: "Qwen3 Coder 480B A35B Instruct", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-22", + last_updated: "2025-07-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 1.2 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen2.5-72B-Instruct": { + id: "Qwen/Qwen2.5-72B-Instruct", + name: "Qwen 2.5 72B Instruct", + 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, + cost: { input: 0.11, output: 0.38 }, + limit: { context: 128000, output: 8192 }, + }, + "zai-org/glm-4.7": { + id: "zai-org/glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 128000, output: 8192 }, + }, + "zai-org/glm-5": { + id: "zai-org/glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/glm-4.5": { + id: "zai-org/glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 128000, output: 8192 }, + }, + "zai-org/glm-4.6": { + id: "zai-org/glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-03-01", + last_updated: "2025-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 128000, output: 8192 }, + }, + "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", + 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, + cost: { input: 3.5, output: 3.5 }, + limit: { context: 128000, output: 4096 }, + }, + "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", + 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, + cost: { input: 0.14, output: 0.59 }, + limit: { context: 1000000, output: 32768 }, + }, + "meta-llama/Meta-Llama-3.1-8B-Instruct": { + id: "meta-llama/Meta-Llama-3.1-8B-Instruct", + name: "Llama 3.1 8B Instruct", + 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, + cost: { input: 0.02, output: 0.05 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek-ai/DeepSeek-R1": { + id: "deepseek-ai/DeepSeek-R1", + name: "DeepSeek R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 3, output: 7 }, + limit: { context: 128000, output: 8192 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-15", + last_updated: "2025-06-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.4 }, + limit: { context: 128000, output: 8192 }, + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + id: "deepseek-ai/DeepSeek-V3.1-Terminus", + name: "DeepSeek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT-OSS 120B", + family: "gpt-oss", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.44 }, + limit: { context: 128000, output: 32768 }, + }, + }, + }, + "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: { + "perplexity/sonar": { + id: "perplexity/sonar", + name: "Sonar", + 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, + cost: { input: 0.25, output: 2.5, cache_read: 0.0625 }, + limit: { context: 128000, output: 8192 }, + }, + "xai/grok-4-1-fast-non-reasoning": { + id: "xai/grok-4-1-fast-non-reasoning", + name: "Grok 4.1 Fast (Non-Reasoning)", + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "nvidia/nemotron-3-super-120b-a12b": { + id: "nvidia/nemotron-3-super-120b-a12b", + name: "Nemotron 3 Super 120B", + family: "nemotron", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.25, output: 2.5 }, + limit: { context: 1000000, output: 32000 }, + }, + "openai/gpt-5.5": { + id: "openai/gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "google/gemini-3.1-pro-preview": { + id: "google/gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-flash-preview": { + id: "google/gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.5, + output: 3, + cache_read: 0.05, + context_over_200k: { input: 0.5, output: 3, cache_read: 0.05 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.125, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.03 }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic/claude-haiku-4-5": { + id: "anthropic/claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4-6": { + id: "anthropic/claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4-7": { + id: "anthropic/claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4-5": { + id: "anthropic/claude-opus-4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4-6": { + id: "anthropic/claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5 }, + limit: { context: 200000, output: 128000 }, + }, + "anthropic/claude-sonnet-4-5": { + id: "anthropic/claude-sonnet-4-5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3 }, + limit: { context: 200000, output: 64000 }, + }, + }, + }, + "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: { + "Kwaipilot/KAT-Dev": { + id: "Kwaipilot/KAT-Dev", + name: "Kwaipilot/KAT-Dev", + family: "kat-coder", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-27", + last_updated: "2026-01-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 128000, output: 128000 }, + }, + "Qwen/Qwen3.5-397B-A17B": { + id: "Qwen/Qwen3.5-397B-A17B", + name: "Qwen/Qwen3.5-397B-A17B", + family: "qwen", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.29, output: 1.74 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3.5-35B-A3B": { + id: "Qwen/Qwen3.5-35B-A3B", + name: "Qwen/Qwen3.5-35B-A3B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-25", + last_updated: "2026-02-25", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.23, output: 1.86 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3.5-122B-A10B": { + id: "Qwen/Qwen3.5-122B-A10B", + name: "Qwen/Qwen3.5-122B-A10B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 2.32 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3.5-9B": { + id: "Qwen/Qwen3.5-9B", + name: "Qwen/Qwen3.5-9B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-03-03", + last_updated: "2026-03-03", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 1.74 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3.5-27B": { + id: "Qwen/Qwen3.5-27B", + name: "Qwen/Qwen3.5-27B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-25", + last_updated: "2026-02-25", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.26, output: 2.09 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3.5-4B": { + id: "Qwen/Qwen3.5-4B", + name: "Qwen/Qwen3.5-4B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-03-03", + last_updated: "2026-03-03", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3.6-35B-A3B": { + id: "Qwen/Qwen3.6-35B-A3B", + name: "Qwen/Qwen3.6-35B-A3B", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.23, output: 1.86 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen2.5-72B-Instruct": { + id: "Qwen/Qwen2.5-72B-Instruct", + name: "Qwen/Qwen2.5-72B-Instruct", + 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: false, + cost: { input: 0.59, output: 0.59 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + name: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-31", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-8B-Instruct": { + id: "Qwen/Qwen3-VL-8B-Instruct", + name: "Qwen/Qwen3-VL-8B-Instruct", + 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: false, + cost: { input: 0.18, output: 0.68 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-32B-Instruct": { + id: "Qwen/Qwen3-VL-32B-Instruct", + name: "Qwen/Qwen3-VL-32B-Instruct", + 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: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-30B-A3B-Thinking": { + id: "Qwen/Qwen3-VL-30B-A3B-Thinking", + name: "Qwen/Qwen3-VL-30B-A3B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + 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: false, + cost: { input: 0.29, output: 1 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-14B-Instruct": { + id: "Qwen/Qwen2.5-14B-Instruct", + name: "Qwen/Qwen2.5-14B-Instruct", + 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: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-VL-235B-A22B-Instruct": { + id: "Qwen/Qwen3-VL-235B-A22B-Instruct", + name: "Qwen/Qwen3-VL-235B-A22B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + id: "Qwen/Qwen3-Next-80B-A3B-Thinking", + name: "Qwen/Qwen3-Next-80B-A3B-Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-25", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-VL-32B-Instruct": { + id: "Qwen/Qwen2.5-VL-32B-Instruct", + name: "Qwen/Qwen2.5-VL-32B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-24", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.27 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-Omni-30B-A3B-Thinking": { + id: "Qwen/Qwen3-Omni-30B-A3B-Thinking", + name: "Qwen/Qwen3-Omni-30B-A3B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 66000, output: 66000 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen/Qwen3-235B-A22B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.13, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-32B-Instruct": { + id: "Qwen/Qwen2.5-32B-Instruct", + name: "Qwen/Qwen2.5-32B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-09-19", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen2.5-72B-Instruct-128K": { + id: "Qwen/Qwen2.5-72B-Instruct-128K", + name: "Qwen/Qwen2.5-72B-Instruct-128K", + 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: false, + cost: { input: 0.59, output: 0.59 }, + limit: { context: 131000, output: 4000 }, + }, + "Qwen/Qwen3-14B": { + id: "Qwen/Qwen3-14B", + name: "Qwen/Qwen3-14B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-Omni-30B-A3B-Instruct": { + id: "Qwen/Qwen3-Omni-30B-A3B-Instruct", + name: "Qwen/Qwen3-Omni-30B-A3B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 66000, output: 66000 }, + }, + "Qwen/Qwen3-Coder-30B-A3B-Instruct": { + id: "Qwen/Qwen3-Coder-30B-A3B-Instruct", + name: "Qwen/Qwen3-Coder-30B-A3B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-01", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-32B": { + id: "Qwen/Qwen3-32B", + name: "Qwen/Qwen3-32B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen/Qwen3-235B-A22B-Instruct-2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-23", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen/Qwen3-30B-A3B-Instruct-2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-30", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.3 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-8B": { + id: "Qwen/Qwen3-8B", + name: "Qwen/Qwen3-8B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.06, output: 0.06 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + id: "Qwen/Qwen3-Next-80B-A3B-Instruct", + name: "Qwen/Qwen3-Next-80B-A3B-Instruct", + family: "qwen", + 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: false, + cost: { input: 0.14, output: 1.4 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-8B-Thinking": { + id: "Qwen/Qwen3-VL-8B-Thinking", + name: "Qwen/Qwen3-VL-8B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + 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: false, + cost: { input: 0.18, output: 2 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-Omni-30B-A3B-Captioner": { + id: "Qwen/Qwen3-Omni-30B-A3B-Captioner", + name: "Qwen/Qwen3-Omni-30B-A3B-Captioner", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 66000, output: 66000 }, + }, + "Qwen/QwQ-32B": { + id: "Qwen/QwQ-32B", + name: "Qwen/QwQ-32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-06", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.58 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-VL-30B-A3B-Instruct": { + id: "Qwen/Qwen3-VL-30B-A3B-Instruct", + name: "Qwen/Qwen3-VL-30B-A3B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-05", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 1 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-Coder-32B-Instruct": { + id: "Qwen/Qwen2.5-Coder-32B-Instruct", + name: "Qwen/Qwen2.5-Coder-32B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-11-11", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen2.5-7B-Instruct": { + id: "Qwen/Qwen2.5-7B-Instruct", + name: "Qwen/Qwen2.5-7B-Instruct", + 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: false, + cost: { input: 0.05, output: 0.05 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-VL-235B-A22B-Thinking": { + id: "Qwen/Qwen3-VL-235B-A22B-Thinking", + name: "Qwen/Qwen3-VL-235B-A22B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.45, output: 3.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-30B-A3B-Thinking-2507": { + id: "Qwen/Qwen3-30B-A3B-Thinking-2507", + name: "Qwen/Qwen3-30B-A3B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-31", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.3 }, + limit: { context: 262000, output: 131000 }, + }, + "Qwen/Qwen3-VL-32B-Thinking": { + id: "Qwen/Qwen3-VL-32B-Thinking", + name: "Qwen/Qwen3-VL-32B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + 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: false, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-VL-72B-Instruct": { + id: "Qwen/Qwen2.5-VL-72B-Instruct", + name: "Qwen/Qwen2.5-VL-72B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-28", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.59, output: 0.59 }, + limit: { context: 131000, output: 4000 }, + }, + "stepfun-ai/Step-3.5-Flash": { + id: "stepfun-ai/Step-3.5-Flash", + name: "stepfun-ai/Step-3.5-Flash", + family: "step", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 262000, output: 262000 }, + }, + "zai-org/GLM-4.5V": { + id: "zai-org/GLM-4.5V", + name: "zai-org/GLM-4.5V", + family: "glm", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-13", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.86 }, + limit: { context: 66000, output: 66000 }, + }, + "zai-org/GLM-4.6": { + id: "zai-org/GLM-4.6", + name: "zai-org/GLM-4.6", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.9 }, + limit: { context: 205000, output: 205000 }, + }, + "zai-org/GLM-4.6V": { + id: "zai-org/GLM-4.6V", + name: "zai-org/GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-07", + last_updated: "2025-12-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 131000, output: 131000 }, + }, + "zai-org/GLM-4.5-Air": { + id: "zai-org/GLM-4.5-Air", + name: "zai-org/GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.86 }, + limit: { context: 131000, output: 131000 }, + }, + "inclusionAI/Ling-flash-2.0": { + id: "inclusionAI/Ling-flash-2.0", + name: "inclusionAI/Ling-flash-2.0", + 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: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "inclusionAI/Ling-mini-2.0": { + id: "inclusionAI/Ling-mini-2.0", + name: "inclusionAI/Ling-mini-2.0", + family: "ling", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-10", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 131000, output: 131000 }, + }, + "inclusionAI/Ring-flash-2.0": { + id: "inclusionAI/Ring-flash-2.0", + name: "inclusionAI/Ring-flash-2.0", + family: "ring", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "ascend-tribe/pangu-pro-moe": { + id: "ascend-tribe/pangu-pro-moe", + name: "ascend-tribe/pangu-pro-moe", + family: "pangu", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-07-02", + last_updated: "2026-01-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 128000, output: 128000 }, + }, + "tencent/Hunyuan-MT-7B": { + id: "tencent/Hunyuan-MT-7B", + name: "tencent/Hunyuan-MT-7B", + family: "hunyuan", + 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: false, + cost: { input: 0, output: 0 }, + limit: { context: 33000, output: 33000 }, + }, + "tencent/Hunyuan-A13B-Instruct": { + id: "tencent/Hunyuan-A13B-Instruct", + name: "tencent/Hunyuan-A13B-Instruct", + family: "hunyuan", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "Pro/zai-org/GLM-4.7": { + id: "Pro/zai-org/GLM-4.7", + name: "Pro/zai-org/GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 205000, output: 205000 }, + }, + "Pro/zai-org/GLM-5.1": { + id: "Pro/zai-org/GLM-5.1", + name: "Pro/zai-org/GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 4.4, cache_write: 0 }, + limit: { context: 205000, output: 205000 }, + }, + "Pro/zai-org/GLM-5": { + id: "Pro/zai-org/GLM-5", + name: "Pro/zai-org/GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3.2 }, + limit: { context: 205000, output: 205000 }, + }, + "Pro/deepseek-ai/DeepSeek-V3": { + id: "Pro/deepseek-ai/DeepSeek-V3", + name: "Pro/deepseek-ai/DeepSeek-V3", + 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, + cost: { input: 0.25, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "Pro/deepseek-ai/DeepSeek-R1": { + id: "Pro/deepseek-ai/DeepSeek-R1", + name: "Pro/deepseek-ai/DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.18 }, + limit: { context: 164000, output: 164000 }, + }, + "Pro/deepseek-ai/DeepSeek-V3.2": { + id: "Pro/deepseek-ai/DeepSeek-V3.2", + name: "Pro/deepseek-ai/DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 0.42 }, + limit: { context: 164000, output: 164000 }, + }, + "Pro/deepseek-ai/DeepSeek-V3.1-Terminus": { + id: "Pro/deepseek-ai/DeepSeek-V3.1-Terminus", + name: "Pro/deepseek-ai/DeepSeek-V3.1-Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "Pro/moonshotai/Kimi-K2-Thinking": { + id: "Pro/moonshotai/Kimi-K2-Thinking", + name: "Pro/moonshotai/Kimi-K2-Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-11-07", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.55, output: 2.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Pro/moonshotai/Kimi-K2.6": { + id: "Pro/moonshotai/Kimi-K2.6", + name: "Pro/moonshotai/Kimi-K2.6", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262000, output: 262000 }, + }, + "Pro/moonshotai/Kimi-K2-Instruct-0905": { + id: "Pro/moonshotai/Kimi-K2-Instruct-0905", + name: "Pro/moonshotai/Kimi-K2-Instruct-0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-08", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 262000, output: 262000 }, + }, + "Pro/moonshotai/Kimi-K2.5": { + id: "Pro/moonshotai/Kimi-K2.5", + name: "Pro/moonshotai/Kimi-K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 2.25 }, + limit: { context: 262000, output: 262000 }, + }, + "Pro/MiniMaxAI/MiniMax-M2.5": { + id: "Pro/MiniMaxAI/MiniMax-M2.5", + name: "Pro/MiniMaxAI/MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-13", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.22 }, + limit: { context: 192000, output: 131000 }, + }, + "Pro/MiniMaxAI/MiniMax-M2.1": { + id: "Pro/MiniMaxAI/MiniMax-M2.1", + name: "Pro/MiniMaxAI/MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 197000, output: 131000 }, + }, + "PaddlePaddle/PaddleOCR-VL": { + id: "PaddlePaddle/PaddleOCR-VL", + name: "PaddlePaddle/PaddleOCR-VL", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 16384, output: 16384 }, + }, + "PaddlePaddle/PaddleOCR-VL-1.5": { + id: "PaddlePaddle/PaddleOCR-VL-1.5", + name: "PaddlePaddle/PaddleOCR-VL-1.5", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 16384, output: 16384 }, + }, + "deepseek-ai/DeepSeek-OCR": { + id: "deepseek-ai/DeepSeek-OCR", + name: "deepseek-ai/DeepSeek-OCR", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-10-20", + last_updated: "2025-10-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 8192 }, + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + id: "deepseek-ai/DeepSeek-V3.1-Terminus", + name: "deepseek-ai/DeepSeek-V3.1-Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "deepseek-ai/DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 0.42 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { + id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131000, output: 131000 }, + }, + "deepseek-ai/DeepSeek-R1": { + id: "deepseek-ai/DeepSeek-R1", + name: "deepseek-ai/DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.18 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { + id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 131000, output: 131000 }, + }, + "deepseek-ai/DeepSeek-V3": { + id: "deepseek-ai/DeepSeek-V3", + name: "deepseek-ai/DeepSeek-V3", + 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, + cost: { input: 0.25, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/deepseek-vl2": { + id: "deepseek-ai/deepseek-vl2", + name: "deepseek-ai/deepseek-vl2", + family: "deepseek", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-13", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 4000, output: 4000 }, + }, + "baidu/ERNIE-4.5-300B-A47B": { + id: "baidu/ERNIE-4.5-300B-A47B", + name: "baidu/ERNIE-4.5-300B-A47B", + family: "ernie", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-02", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 1.1 }, + limit: { context: 131000, output: 131000 }, + }, + "THUDM/GLM-Z1-32B-0414": { + id: "THUDM/GLM-Z1-32B-0414", + name: "THUDM/GLM-Z1-32B-0414", + family: "glm-z", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "THUDM/GLM-4-32B-0414": { + id: "THUDM/GLM-4-32B-0414", + name: "THUDM/GLM-4-32B-0414", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.27 }, + limit: { context: 33000, output: 33000 }, + }, + "THUDM/GLM-4-9B-0414": { + id: "THUDM/GLM-4-9B-0414", + name: "THUDM/GLM-4-9B-0414", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.086, output: 0.086 }, + limit: { context: 33000, output: 33000 }, + }, + "THUDM/GLM-Z1-9B-0414": { + id: "THUDM/GLM-Z1-9B-0414", + name: "THUDM/GLM-Z1-9B-0414", + family: "glm-z", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.086, output: 0.086 }, + limit: { context: 131000, output: 131000 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "moonshotai/Kimi-K2-Instruct-0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-08", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 262000, output: 262000 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "moonshotai/Kimi-K2-Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-11-07", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.55, output: 2.5 }, + limit: { context: 262000, output: 262000 }, + }, + "ByteDance-Seed/Seed-OSS-36B-Instruct": { + id: "ByteDance-Seed/Seed-OSS-36B-Instruct", + name: "ByteDance-Seed/Seed-OSS-36B-Instruct", + 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: false, + cost: { input: 0.21, output: 0.57 }, + limit: { context: 262000, output: 262000 }, + }, + }, + }, + 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: { + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.3 }, + limit: { context: 262144, output: 131072 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", + name: "Qwen3 Coder 480B A35B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen3 235B A22B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 262144, output: 131072 }, + }, + "zai-org/GLM-4.5-Air": { + id: "zai-org/GLM-4.5-Air", + name: "GLM 4.5 Air", + family: "glm-air", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 131072, output: 131072 }, + }, + "zai-org/GLM-4.5-FP8": { + id: "zai-org/GLM-4.5-FP8", + name: "GLM 4.5 FP8", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 131072, output: 131072 }, + }, + "deepseek-ai/DeepSeek-V3.1": { + id: "deepseek-ai/DeepSeek-V3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 75000, output: 163840 }, + }, + "deepseek-ai/DeepSeek-V3-0324": { + id: "deepseek-ai/DeepSeek-V3-0324", + name: "DeepSeek V3 0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 75000, output: 163840 }, + }, + "deepseek-ai/DeepSeek-R1-0528": { + id: "deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek R1 0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 2.15 }, + limit: { context: 75000, output: 163840 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-23", + last_updated: "2025-08-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 131072, output: 32768 }, + }, + }, + }, + "minimax-coding-plan": { + id: "minimax-coding-plan", + env: ["MINIMAX_API_KEY"], + npm: "@ai-sdk/anthropic", + api: "https://api.minimax.io/anthropic/v1", + name: "MiniMax Coding Plan (minimax.io)", + doc: "https://platform.minimax.io/docs/coding-plan/intro", + models: { + "MiniMax-M2": { + id: "MiniMax-M2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 196608, output: 128000 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7": { + id: "MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7-highspeed": { + id: "MiniMax-M2.7-highspeed", + name: "MiniMax-M2.7-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.1": { + id: "MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.5-highspeed": { + id: "MiniMax-M2.5-highspeed", + name: "MiniMax-M2.5-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-13", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + 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", + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8192 }, + }, + "sonar-deep-research": { + id: "sonar-deep-research", + name: "Perplexity Sonar Deep Research", + attachment: false, + reasoning: true, + 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, + cost: { input: 2, output: 8, reasoning: 3 }, + limit: { context: 128000, output: 32768 }, + }, + sonar: { + id: "sonar", + name: "Sonar", + 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, + cost: { input: 1, output: 1 }, + limit: { context: 128000, output: 4096 }, + }, + "sonar-reasoning-pro": { + id: "sonar-reasoning-pro", + name: "Sonar Reasoning Pro", + family: "sonar-reasoning", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8 }, + limit: { context: 128000, output: 4096 }, + }, + }, + }, + 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-chat": { + id: "deepseek-chat", + name: "DeepSeek Chat", + family: "deepseek", + attachment: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek-reasoner": { + id: "deepseek-reasoner", + name: "DeepSeek Reasoner", + family: "deepseek-thinking", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1000000, output: 384000 }, + }, + }, + }, + llama: { + id: "llama", + env: ["LLAMA_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.llama.com/compat/v1/", + name: "Llama", + doc: "https://llama.developer.meta.com/docs/models", + models: { + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "cerebras-llama-4-maverick-17b-128e-instruct": { + id: "cerebras-llama-4-maverick-17b-128e-instruct", + name: "Cerebras-Llama-4-Maverick-17B-128E-Instruct", + 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"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "llama-3.3-8b-instruct": { + id: "llama-3.3-8b-instruct", + name: "Llama-3.3-8B-Instruct", + family: "llama", + attachment: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "cerebras-llama-4-scout-17b-16e-instruct": { + id: "cerebras-llama-4-scout-17b-16e-instruct", + name: "Cerebras-Llama-4-Scout-17B-16E-Instruct", + 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"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "groq-llama-4-maverick-17b-128e-instruct": { + id: "groq-llama-4-maverick-17b-128e-instruct", + name: "Groq-Llama-4-Maverick-17B-128E-Instruct", + 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"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "llama-4-scout-17b-16e-instruct-fp8": { + id: "llama-4-scout-17b-16e-instruct-fp8", + name: "Llama-4-Scout-17B-16E-Instruct-FP8", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "llama-4-maverick-17b-128e-instruct-fp8": { + id: "llama-4-maverick-17b-128e-instruct-fp8", + name: "Llama-4-Maverick-17B-128E-Instruct-FP8", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + }, + }, + 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: { + "liquid/lfm-2.5-1.2b-instruct:free": { + id: "liquid/lfm-2.5-1.2b-instruct:free", + name: "LFM2.5-1.2B-Instruct (free)", + family: "liquid", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2026-01-20", + last_updated: "2026-01-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 32768 }, + }, + "liquid/lfm-2.5-1.2b-thinking:free": { + id: "liquid/lfm-2.5-1.2b-thinking:free", + name: "LFM2.5-1.2B-Thinking (free)", + family: "liquid", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2026-01-20", + last_updated: "2026-01-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 32768 }, + }, + "deepseek/deepseek-chat-v3.1": { + id: "deepseek/deepseek-chat-v3.1", + name: "DeepSeek-V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek/deepseek-r1-distill-llama-70b": { + id: "deepseek/deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-01-23", + last_updated: "2025-01-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 8192 }, + }, + "deepseek/deepseek-r1": { + id: "deepseek/deepseek-r1", + name: "DeepSeek: R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.5 }, + limit: { context: 64000, output: 16000 }, + }, + "deepseek/deepseek-v3.2-speciale": { + id: "deepseek/deepseek-v3.2-speciale", + name: "DeepSeek V3.2 Speciale", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 0.41 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-v3.2": { + id: "deepseek/deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.28, output: 0.4 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-v3.1-terminus:exacto": { + id: "deepseek/deepseek-v3.1-terminus:exacto", + name: "DeepSeek V3.1 Terminus (exacto)", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-22", + last_updated: "2025-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1 }, + limit: { context: 131072, output: 65536 }, + }, + "deepseek/deepseek-chat-v3-0324": { + id: "deepseek/deepseek-chat-v3-0324", + name: "DeepSeek V3 0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 16384, output: 8192 }, + }, + "deepseek/deepseek-v3.1-terminus": { + id: "deepseek/deepseek-v3.1-terminus", + name: "DeepSeek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-22", + last_updated: "2025-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1 }, + limit: { context: 131072, output: 65536 }, + }, + "openrouter/owl-alpha": { + id: "openrouter/owl-alpha", + name: "Owl Alpha", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 1048756, output: 262144 }, + status: "alpha", + }, + "openrouter/pareto-code": { + id: "openrouter/pareto-code", + name: "Pareto Code Router", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 200000 }, + }, + "openrouter/elephant-alpha": { + id: "openrouter/elephant-alpha", + name: "Elephant (free)", + family: "elephant", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-13", + last_updated: "2026-04-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "openrouter/free": { + id: "openrouter/free", + name: "Free Models Router", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 200000, input: 200000, output: 8000 }, + }, + "arcee-ai/trinity-large-thinking": { + id: "arcee-ai/trinity-large-thinking", + name: "Trinity Large Thinking", + family: "trinity", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.85 }, + limit: { context: 262144, output: 80000 }, + }, + "arcee-ai/trinity-large-preview:free": { + id: "arcee-ai/trinity-large-preview:free", + name: "Trinity Large Preview", + family: "trinity", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-06", + release_date: "2026-01-28", + last_updated: "2026-01-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "cognitivecomputations/dolphin-mistral-24b-venice-edition:free": { + id: "cognitivecomputations/dolphin-mistral-24b-venice-edition:free", + name: "Uncensored (free)", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-07-09", + last_updated: "2026-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 32768 }, + }, + "bytedance-seed/seedream-4.5": { + id: "bytedance-seed/seedream-4.5", + name: "Seedream 4.5", + family: "seed", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-23", + last_updated: "2026-01-31", + modalities: { input: ["image", "text"], output: ["image"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 4096, output: 4096 }, + }, + "black-forest-labs/flux.2-max": { + id: "black-forest-labs/flux.2-max", + name: "FLUX.2 Max", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-16", + last_updated: "2026-01-31", + modalities: { input: ["image", "text"], output: ["image"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 46864, output: 46864 }, + }, + "black-forest-labs/flux.2-flex": { + id: "black-forest-labs/flux.2-flex", + name: "FLUX.2 Flex", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-11-25", + last_updated: "2026-01-31", + modalities: { input: ["image", "text"], output: ["image"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 67344, output: 67344 }, + }, + "black-forest-labs/flux.2-pro": { + id: "black-forest-labs/flux.2-pro", + name: "FLUX.2 Pro", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-11-25", + last_updated: "2026-01-31", + modalities: { input: ["image", "text"], output: ["image"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 46864, output: 46864 }, + }, + "black-forest-labs/flux.2-klein-4b": { + id: "black-forest-labs/flux.2-klein-4b", + name: "FLUX.2 Klein 4B", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2026-01-14", + last_updated: "2026-01-31", + modalities: { input: ["image", "text"], output: ["image"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 40960, output: 40960 }, + }, + "nousresearch/hermes-3-llama-3.1-405b:free": { + id: "nousresearch/hermes-3-llama-3.1-405b:free", + name: "Hermes 3 405B Instruct (free)", + family: "hermes", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-08-16", + last_updated: "2024-08-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "nousresearch/hermes-4-405b": { + id: "nousresearch/hermes-4-405b", + name: "Hermes 4 405B", + family: "hermes", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-08-25", + last_updated: "2025-08-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 131072, output: 131072 }, + }, + "nousresearch/hermes-4-70b": { + id: "nousresearch/hermes-4-70b", + name: "Hermes 4 70B", + family: "hermes", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-08-25", + last_updated: "2025-08-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.4 }, + limit: { context: 131072, output: 131072 }, + }, + "stepfun/step-3.5-flash": { + id: "stepfun/step-3.5-flash", + name: "Step 3.5 Flash", + family: "step", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.02 }, + limit: { context: 256000, output: 256000 }, + }, + "mistralai/mistral-small-3.1-24b-instruct": { + id: "mistralai/mistral-small-3.1-24b-instruct", + name: "Mistral Small 3.1 24B Instruct", + family: "mistral-small", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-17", + last_updated: "2025-03-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "mistralai/devstral-2512": { + id: "mistralai/devstral-2512", + name: "Devstral 2 2512", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2025-09-12", + last_updated: "2025-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/codestral-2508": { + id: "mistralai/codestral-2508", + name: "Codestral 2508", + family: "codestral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 256000 }, + }, + "mistralai/mistral-medium-3.1": { + id: "mistralai/mistral-medium-3.1", + name: "Mistral Medium 3.1", + family: "mistral-medium", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/mistral-small-2603": { + id: "mistralai/mistral-small-2603", + name: "Mistral Small 4", + family: "mistral-small", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/mistral-medium-3": { + id: "mistralai/mistral-medium-3", + name: "Mistral Medium 3", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, output: 131072 }, + }, + "mistralai/devstral-small-2505": { + id: "mistralai/devstral-small-2505", + name: "Devstral Small", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.12 }, + limit: { context: 128000, output: 128000 }, + }, + "mistralai/mistral-small-3.2-24b-instruct": { + id: "mistralai/mistral-small-3.2-24b-instruct", + name: "Mistral Small 3.2 24B Instruct", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 96000, output: 8192 }, + }, + "mistralai/devstral-medium-2507": { + id: "mistralai/devstral-medium-2507", + name: "Devstral Medium", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, output: 131072 }, + }, + "mistralai/devstral-small-2507": { + id: "mistralai/devstral-small-2507", + name: "Devstral Small 1.1", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 131072, output: 131072 }, + }, + "meta-llama/llama-3.2-11b-vision-instruct": { + id: "meta-llama/llama-3.2-11b-vision-instruct", + name: "Llama 3.2 11B Vision Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: 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, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "meta-llama/llama-3.2-3b-instruct:free": { + id: "meta-llama/llama-3.2-3b-instruct:free", + name: "Llama 3.2 3B Instruct (free)", + family: "llama", + attachment: true, + reasoning: false, + tool_call: 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, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "meta-llama/llama-3.3-70b-instruct:free": { + id: "meta-llama/llama-3.3-70b-instruct:free", + name: "Llama 3.3 70B Instruct (free)", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "x-ai/grok-4.20-multi-agent-beta": { + id: "x-ai/grok-4.20-multi-agent-beta", + name: "Grok 4.20 Multi - Agent Beta", + family: "grok", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-12", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12 } }, + limit: { context: 2000000, output: 30000 }, + status: "beta", + }, + "x-ai/grok-4-fast": { + id: "x-ai/grok-4-fast", + name: "Grok 4 Fast", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05, cache_write: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "x-ai/grok-code-fast-1": { + id: "x-ai/grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "x-ai/grok-3-beta": { + id: "x-ai/grok-3-beta", + name: "Grok 3 Beta", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75, cache_write: 15 }, + limit: { context: 131072, output: 8192 }, + }, + "x-ai/grok-4": { + id: "x-ai/grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75, cache_write: 15 }, + limit: { context: 256000, output: 64000 }, + }, + "x-ai/grok-3-mini": { + id: "x-ai/grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, cache_read: 0.075, cache_write: 0.5 }, + limit: { context: 131072, output: 8192 }, + }, + "x-ai/grok-4.1-fast": { + id: "x-ai/grok-4.1-fast", + name: "Grok 4.1 Fast", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-11-19", + last_updated: "2025-11-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05, cache_write: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "x-ai/grok-4.20-beta": { + id: "x-ai/grok-4.20-beta", + name: "Grok 4.20 Beta", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-12", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12 } }, + limit: { context: 2000000, output: 30000 }, + status: "beta", + }, + "x-ai/grok-3-mini-beta": { + id: "x-ai/grok-3-mini-beta", + name: "Grok 3 Mini Beta", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, cache_read: 0.075, cache_write: 0.5 }, + limit: { context: 131072, output: 8192 }, + }, + "x-ai/grok-3": { + id: "x-ai/grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75, cache_write: 15 }, + limit: { context: 131072, output: 8192 }, + }, + "tencent/hy3-preview": { + id: "tencent/hy3-preview", + name: "Hy3 preview", + family: "Hy", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.066, output: 0.26, cache_read: 0.029, cache_write: 0.029 }, + limit: { context: 256000, output: 64000 }, + }, + "poolside/laguna-m.1:free": { + id: "poolside/laguna-m.1:free", + name: "Laguna M.1", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "poolside/laguna-xs.2:free": { + id: "poolside/laguna-xs.2:free", + name: "Laguna XS.2", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "prime-intellect/intellect-3": { + id: "prime-intellect/intellect-3", + name: "Intellect 3", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-01-15", + last_updated: "2025-01-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 131072, output: 8192 }, + }, + "nvidia/nemotron-3-super-120b-a12b": { + id: "nvidia/nemotron-3-super-120b-a12b", + name: "Nemotron 3 Super", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 262144, output: 262144 }, + }, + "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)", + family: "nemotron", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 65536 }, + }, + "nvidia/nemotron-3-nano-30b-a3b:free": { + id: "nvidia/nemotron-3-nano-30b-a3b:free", + name: "Nemotron 3 Nano 30B A3B (free)", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-12-14", + last_updated: "2026-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 256000 }, + }, + "nvidia/nemotron-nano-9b-v2:free": { + id: "nvidia/nemotron-nano-9b-v2:free", + name: "Nemotron Nano 9B V2 (free)", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-09", + release_date: "2025-09-05", + last_updated: "2025-08-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 128000 }, + }, + "nvidia/nemotron-3-super-120b-a12b:free": { + id: "nvidia/nemotron-3-super-120b-a12b:free", + name: "Nemotron 3 Super (free)", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "nvidia/nemotron-nano-9b-v2": { + id: "nvidia/nemotron-nano-9b-v2", + name: "nvidia-nemotron-nano-9b-v2", + family: "nemotron", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.04, output: 0.16 }, + limit: { context: 131072, output: 131072 }, + }, + "nvidia/nemotron-nano-12b-v2-vl:free": { + id: "nvidia/nemotron-nano-12b-v2-vl:free", + name: "Nemotron Nano 12B 2 VL (free)", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-10-28", + last_updated: "2026-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 128000 }, + }, + "inception/mercury-edit-2": { + id: "inception/mercury-edit-2", + name: "Mercury Edit 2", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75, cache_read: 0.025 }, + limit: { context: 128000, output: 8192 }, + }, + "inception/mercury-2": { + id: "inception/mercury-2", + name: "Mercury 2", + family: "mercury", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-04", + last_updated: "2026-03-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75, cache_read: 0.025 }, + limit: { context: 128000, output: 50000 }, + }, + "openai/gpt-5.1-codex-max": { + id: "openai/gpt-5.1-codex-max", + name: "GPT-5.1-Codex-Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-chat": { + id: "openai/gpt-5.2-chat", + name: "GPT-5.2 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-oss-120b:exacto": { + id: "openai/gpt-oss-120b:exacto", + name: "GPT OSS 120B (exacto)", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.24 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-5-chat": { + id: "openai/gpt-5-chat", + name: "GPT-5 Chat (latest)", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-09-30", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "GPT-5.2 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 21, output: 168 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.4 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "GPT-5.3-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-oss-20b:free": { + id: "openai/gpt-oss-20b:free", + name: "gpt-oss-20b (free)", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2026-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o-mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.4-mini": { + id: "openai/gpt-5.4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1-chat": { + id: "openai/gpt-5.1-chat", + name: "GPT-5.1 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "o4 Mini", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-nano": { + id: "openai/gpt-5.4-nano", + name: "GPT-5.4 Nano", + family: "gpt-nano", + attachment: true, + reasoning: false, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT-5.2-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "GPT-5.1-Codex-Mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 100000 }, + }, + "openai/gpt-5-image": { + id: "openai/gpt-5-image", + name: "GPT-5 Image", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-10-14", + last_updated: "2025-10-14", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 5, output: 10, cache_read: 1.25 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.4-pro": { + id: "openai/gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, cache_read: 30 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "GPT-5 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.2 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-5-pro": { + id: "openai/gpt-5-pro", + name: "GPT-5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 400000, output: 272000 }, + }, + "openai/gpt-oss-120b:free": { + id: "openai/gpt-oss-120b:free", + name: "gpt-oss-120b (free)", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-oss-safeguard-20b": { + id: "openai/gpt-oss-safeguard-20b", + name: "GPT OSS Safeguard 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-29", + last_updated: "2025-10-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 131072, output: 65536 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.072, output: 0.28 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "GPT-4.1 Mini", + 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, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT-5.1-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "z-ai/glm-4.7": { + id: "z-ai/glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11 }, + limit: { context: 204800, output: 131072 }, + }, + "z-ai/glm-4.5-air:free": { + id: "z-ai/glm-4.5-air:free", + name: "GLM 4.5 Air (free)", + family: "glm-air", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 96000 }, + }, + "z-ai/glm-5": { + id: "z-ai/glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 202752, output: 131000 }, + }, + "z-ai/glm-5.1": { + id: "z-ai/glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 202752, output: 131072 }, + }, + "z-ai/glm-4.5": { + id: "z-ai/glm-4.5", + name: "GLM 4.5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 128000, output: 96000 }, + }, + "z-ai/glm-4.6:exacto": { + id: "z-ai/glm-4.6:exacto", + name: "GLM 4.6 (exacto)", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.9, cache_read: 0.11 }, + limit: { context: 200000, output: 128000 }, + }, + "z-ai/glm-4.5-air": { + id: "z-ai/glm-4.5-air", + name: "GLM 4.5 Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 128000, output: 96000 }, + }, + "z-ai/glm-5-turbo": { + id: "z-ai/glm-5-turbo", + name: "GLM-5-Turbo", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.96, output: 3.2, cache_read: 0.192, cache_write: 0 }, + limit: { context: 202752, output: 131072 }, + }, + "z-ai/glm-4.5v": { + id: "z-ai/glm-4.5v", + name: "GLM 4.5V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 64000, output: 16384 }, + }, + "z-ai/glm-4.6": { + id: "z-ai/glm-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2, cache_read: 0.11 }, + limit: { context: 200000, output: 128000 }, + }, + "z-ai/glm-4.7-flash": { + id: "z-ai/glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + structured_output: true, + temperature: true, + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.4 }, + limit: { context: 200000, output: 65535 }, + }, + "sourceful/riverflow-v2-standard-preview": { + id: "sourceful/riverflow-v2-standard-preview", + name: "Riverflow V2 Standard Preview", + family: "sourceful", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-08", + last_updated: "2026-01-28", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 8192 }, + }, + "sourceful/riverflow-v2-fast-preview": { + id: "sourceful/riverflow-v2-fast-preview", + name: "Riverflow V2 Fast Preview", + family: "sourceful", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-08", + last_updated: "2026-01-28", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 8192 }, + }, + "sourceful/riverflow-v2-max-preview": { + id: "sourceful/riverflow-v2-max-preview", + name: "Riverflow V2 Max Preview", + family: "sourceful", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-08", + last_updated: "2026-01-28", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 8192 }, + }, + "minimax/minimax-m2.7": { + id: "minimax/minimax-m2.7", + name: "MiniMax M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2": { + id: "minimax/minimax-m2", + name: "MiniMax M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + structured_output: true, + temperature: true, + release_date: "2025-10-23", + last_updated: "2025-10-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 1.15, cache_read: 0.28, cache_write: 1.15 }, + limit: { context: 196600, output: 118000 }, + }, + "minimax/minimax-01": { + id: "minimax/minimax-01", + name: "MiniMax-01", + family: "minimax", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-15", + last_updated: "2025-01-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 1000000, output: 1000000 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "MiniMax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + structured_output: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2.5:free": { + id: "minimax/minimax-m2.5:free", + name: "MiniMax M2.5 (free)", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m1": { + id: "minimax/minimax-m1", + name: "MiniMax M1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2.2 }, + limit: { context: 1000000, output: 40000 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen/qwen3-coder-plus": { + id: "qwen/qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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: true, + cost: { input: 0.65, output: 3.25, cache_read: 0.13, cache_write: 0.8125 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3.5-397b-a17b": { + id: "qwen/qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen2.5-vl-72b-instruct": { + id: "qwen/qwen2.5-vl-72b-instruct", + name: "Qwen2.5 VL 72B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-02-01", + last_updated: "2025-02-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "qwen/qwen-plus": { + id: "qwen/qwen-plus", + name: "Qwen: Qwen-Plus", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + knowledge: "2024-04", + release_date: "2025-01-25", + last_updated: "2025-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.26, output: 0.78, cache_read: 0.052, cache_write: 0.325 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen/qwen3.5-flash-02-23": { + id: "qwen/qwen3.5-flash-02-23", + name: "Qwen: Qwen3.5-Flash", + family: "qwen", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.065, output: 0.26 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3.6-plus": { + id: "qwen/qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.325, output: 1.95, cache_read: 0.0325, cache_write: 0.40625 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3-max": { + id: "qwen/qwen3-max", + name: "Qwen3 Max", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 6, cache_read: 0.156, cache_write: 0.975 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen/qwen3-coder:exacto": { + id: "qwen/qwen3-coder:exacto", + name: "Qwen3 Coder (exacto)", + 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: true, + cost: { input: 0.38, output: 1.53 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-30b-a3b-instruct-2507": { + id: "qwen/qwen3-30b-a3b-instruct-2507", + name: "Qwen3 30B A3B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 262000, output: 262000 }, + }, + "qwen/qwen-3.6-27b": { + id: "qwen/qwen-3.6-27b", + name: "Qwen3.6 27B", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-04-22", + last_updated: "2026-04-22", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.195, output: 1.56 }, + limit: { context: 262144, output: 81920 }, + }, + "qwen/qwen3-235b-a22b-thinking-2507": { + id: "qwen/qwen3-235b-a22b-thinking-2507", + name: "Qwen3 235B A22B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-25", + last_updated: "2025-07-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.078, output: 0.312 }, + limit: { context: 262144, output: 81920 }, + }, + "qwen/qwen3-next-80b-a3b-thinking": { + id: "qwen/qwen3-next-80b-a3b-thinking", + name: "Qwen3 Next 80B A3B Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-11", + last_updated: "2025-09-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 1.4 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3-30b-a3b-thinking-2507": { + id: "qwen/qwen3-30b-a3b-thinking-2507", + name: "Qwen3 30B A3B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 262000, output: 262000 }, + }, + "qwen/qwen3-coder-flash": { + id: "qwen/qwen3-coder-flash", + name: "Qwen3 Coder Flash", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-23", + last_updated: "2025-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.5, cache_read: 0.039, cache_write: 0.24375 }, + limit: { context: 128000, output: 66536 }, + }, + "qwen/qwen3-next-80b-a3b-instruct": { + id: "qwen/qwen3-next-80b-a3b-instruct", + name: "Qwen3 Next 80B A3B Instruct", + 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-09-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 1.4 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen-2.5-coder-32b-instruct": { + id: "qwen/qwen-2.5-coder-32b-instruct", + name: "Qwen2.5 Coder 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-11-11", + last_updated: "2024-11-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "qwen/qwen3-coder-30b-a3b-instruct": { + id: "qwen/qwen3-coder-30b-a3b-instruct", + name: "Qwen3 Coder 30B A3B Instruct", + 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, + cost: { input: 0.07, output: 0.27 }, + limit: { context: 160000, output: 65536 }, + }, + "qwen/qwen3-coder": { + id: "qwen/qwen3-coder", + name: "Qwen3 Coder", + 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: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 262144, output: 66536 }, + }, + "qwen/qwen3.5-plus-02-15": { + id: "qwen/qwen3.5-plus-02-15", + name: "Qwen3.5 Plus 2026-02-15", + family: "qwen", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.4, output: 2.4 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3-235b-a22b-07-25": { + id: "qwen/qwen3-235b-a22b-07-25", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04-28", + last_updated: "2025-07-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.85 }, + limit: { context: 262144, output: 131072 }, + }, + "google/gemini-2.5-pro-preview-05-06": { + id: "google/gemini-2.5-pro-preview-05-06", + name: "Gemini 2.5 Pro Preview 05-06", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-05-06", + last_updated: "2025-05-06", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3.1-pro-preview-customtools": { + id: "google/gemini-3.1-pro-preview-customtools", + name: "Gemini 3.1 Pro Preview Custom Tools", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, reasoning: 12, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemma-3-4b-it:free": { + id: "google/gemma-3-4b-it:free", + name: "Gemma 3 4B (free)", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "google/gemini-2.5-flash-lite-preview-09-2025": { + id: "google/gemini-2.5-flash-lite-preview-09-2025", + name: "Gemini 2.5 Flash Lite Preview 09-25", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.0-flash-001": { + id: "google/gemini-2.0-flash-001", + name: "Gemini 2.0 Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 8192 }, + }, + "google/gemma-3n-e4b-it": { + id: "google/gemma-3n-e4b-it", + name: "Gemma 3n 4B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.04 }, + limit: { context: 32768, output: 32768 }, + }, + "google/gemini-3.1-flash-lite-preview": { + id: "google/gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-03", + last_updated: "2026-03-03", + modalities: { input: ["text", "image", "video", "pdf", "audio"], output: ["text"] }, + open_weights: false, + cost: { + input: 0.25, + output: 1.5, + reasoning: 1.5, + cache_read: 0.025, + cache_write: 0.083, + input_audio: 0.5, + output_audio: 0.5, + }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemma-3n-e4b-it:free": { + id: "google/gemma-3n-e4b-it:free", + name: "Gemma 3n 4B (free)", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2000 }, + }, + "google/gemini-3.1-pro-preview": { + id: "google/gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, reasoning: 12, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-flash-preview": { + id: "google/gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.05 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-pro-preview": { + id: "google/gemini-3-pro-preview", + name: "Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-11-18", + last_updated: "2025-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12 }, + limit: { context: 1050000, output: 66000 }, + }, + "google/gemma-3n-e2b-it:free": { + id: "google/gemma-3n-e2b-it:free", + name: "Gemma 3n 2B (free)", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2000 }, + }, + "google/gemma-2-9b-it": { + id: "google/gemma-2-9b-it", + name: "Gemma 2 9B", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2024-06-28", + last_updated: "2024-06-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.09 }, + limit: { context: 8192, output: 8192 }, + }, + "google/gemma-4-31b-it": { + id: "google/gemma-4-31b-it", + name: "Gemma 4 31B", + family: "gemma", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.4 }, + limit: { context: 262144, output: 262144 }, + }, + "google/gemini-2.5-pro-preview-06-05": { + id: "google/gemini-2.5-pro-preview-06-05", + name: "Gemini 2.5 Pro Preview 06-05", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemma-3-12b-it": { + id: "google/gemma-3-12b-it", + name: "Gemma 3 12B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.1 }, + limit: { context: 131072, output: 131072 }, + }, + "google/gemma-3-27b-it:free": { + id: "google/gemma-3-27b-it:free", + name: "Gemma 3 27B (free)", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-07-17", + last_updated: "2025-07-17", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.0375 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3.1-flash-image-preview": { + id: "google/gemini-3.1-flash-image-preview", + name: "Gemini 3.1 Flash Image Preview (Nano Banana 2)", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.5, output: 3 }, + limit: { context: 65536, output: 65536 }, + }, + "google/gemma-4-31b-it:free": { + id: "google/gemma-4-31b-it:free", + name: "Gemma 4 31B (free)", + family: "gemma", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "google/gemma-3-12b-it:free": { + id: "google/gemma-3-12b-it:free", + name: "Gemma 3 12B (free)", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "google/gemma-3-4b-it": { + id: "google/gemma-3-4b-it", + name: "Gemma 3 4B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01703, output: 0.06815 }, + limit: { context: 96000, output: 96000 }, + }, + "google/gemini-2.5-flash-preview-09-2025": { + id: "google/gemini-2.5-flash-preview-09-2025", + name: "Gemini 2.5 Flash Preview 09-25", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.031 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemma-3-27b-it": { + id: "google/gemma-3-27b-it", + name: "Gemma 3 27B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.15 }, + limit: { context: 96000, output: 96000 }, + }, + "google/gemma-4-26b-a4b-it": { + id: "google/gemma-4-26b-a4b-it", + name: "Gemma 4 26B A4B", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-03", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.4 }, + limit: { context: 262144, output: 262144 }, + }, + "google/gemma-4-26b-a4b-it:free": { + id: "google/gemma-4-26b-a4b-it:free", + name: "Gemma 4 26B A4B (free)", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-03", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "google/gemini-2.5-flash-lite": { + id: "google/gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "Kimi K2 Instruct 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 16384 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + structured_output: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-0905:exacto": { + id: "moonshotai/kimi-k2-0905:exacto", + name: "Kimi K2 Instruct 0905 (exacto)", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 16384 }, + }, + "moonshotai/kimi-k2": { + id: "moonshotai/kimi-k2", + name: "Kimi K2", + family: "kimi", + 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, + cost: { input: 0.55, output: 2.2 }, + limit: { context: 131072, output: 32768 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "anthropic/claude-opus-4.1": { + id: "anthropic/claude-opus-4.1", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-3.7-sonnet": { + id: "anthropic/claude-3.7-sonnet", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-01", + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 128000 }, + }, + "anthropic/claude-opus-4.6": { + id: "anthropic/claude-opus-4.6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.7": { + id: "anthropic/claude-opus-4.7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4.5": { + id: "anthropic/claude-sonnet-4.5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 64000 }, + }, + "anthropic/claude-opus-4.5": { + id: "anthropic/claude-opus-4.5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05-30", + release_date: "2025-11-24", + last_updated: "2025-11-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-haiku-4.5": { + id: "anthropic/claude-haiku-4.5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4.6": { + id: "anthropic/claude-sonnet-4.6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "deepseek/deepseek-v4-flash": { + id: "deepseek/deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1048576, output: 393216 }, + }, + "deepseek/deepseek-v4-pro": { + id: "deepseek/deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1048576, output: 393216 }, + }, + "x-ai/grok-4.3": { + id: "x-ai/grok-4.3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-05-01", + last_updated: "2026-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 2.5, + cache_read: 0.2, + context_over_200k: { input: 2.5, output: 5, cache_read: 0.4 }, + }, + limit: { context: 1000000, output: 1000000 }, + }, + "openai/gpt-5.5": { + id: "openai/gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5.5-pro": { + id: "openai/gpt-5.5-pro", + name: "GPT-5.5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.125, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-3.5-haiku": { + id: "anthropic/claude-3.5-haiku", + name: "Claude Haiku 3.5", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "xiaomi/mimo-v2.5-pro": { + id: "xiaomi/mimo-v2.5-pro", + name: "Xiaomi: MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-omni": { + id: "xiaomi/mimo-v2-omni", + name: "Xiaomi: MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + temperature: true, + knowledge: "2024-12", + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2, cache_read: 0.08 }, + limit: { context: 262144, output: 131072 }, + }, + "xiaomi/mimo-v2.5": { + id: "xiaomi/mimo-v2.5", + name: "Xiaomi: MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.4, + output: 2, + cache_read: 0.08, + context_over_200k: { input: 0.8, output: 4, cache_read: 0.16 }, + }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-pro": { + id: "xiaomi/mimo-v2-pro", + name: "Xiaomi: MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + temperature: true, + knowledge: "2024-12", + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-flash": { + id: "xiaomi/mimo-v2-flash", + name: "Xiaomi: MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + temperature: true, + knowledge: "2024-12-01", + release_date: "2025-12-16", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.01 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + "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-5p1": { + id: "accounts/fireworks/models/glm-5p1", + name: "GLM 5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 202800, output: 131072 }, + }, + "accounts/fireworks/models/deepseek-v3p2": { + id: "accounts/fireworks/models/deepseek-v3p2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-09", + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.56, output: 1.68, cache_read: 0.28 }, + limit: { context: 160000, output: 160000 }, + }, + "accounts/fireworks/models/minimax-m2p5": { + id: "accounts/fireworks/models/minimax-m2p5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 196608, output: 196608 }, + }, + "accounts/fireworks/models/glm-4p5-air": { + id: "accounts/fireworks/models/glm-4p5-air", + name: "GLM 4.5 Air", + family: "glm-air", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.88 }, + limit: { context: 131072, output: 131072 }, + }, + "accounts/fireworks/models/glm-5": { + id: "accounts/fireworks/models/glm-5", + name: "GLM 5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1, output: 3.2, cache_read: 0.5 }, + limit: { context: 202752, output: 131072 }, + }, + "accounts/fireworks/models/deepseek-v3p1": { + id: "accounts/fireworks/models/deepseek-v3p1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.56, output: 1.68 }, + limit: { context: 163840, output: 163840 }, + }, + "accounts/fireworks/models/kimi-k2p6": { + id: "accounts/fireworks/models/kimi-k2p6", + name: "Kimi K2.6", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262000, output: 262000 }, + }, + "accounts/fireworks/models/kimi-k2-instruct": { + id: "accounts/fireworks/models/kimi-k2-instruct", + name: "Kimi K2 Instruct", + family: "kimi", + 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, + cost: { input: 1, output: 3 }, + limit: { context: 128000, output: 16384 }, + }, + "accounts/fireworks/models/qwen3p6-plus": { + id: "accounts/fireworks/models/qwen3p6-plus", + name: "Qwen 3.6 Plus", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-04", + last_updated: "2026-04-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.1 }, + limit: { context: 128000, output: 8192 }, + }, + "accounts/fireworks/models/minimax-m2p1": { + id: "accounts/fireworks/models/minimax-m2p1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 200000, output: 200000 }, + }, + "accounts/fireworks/models/minimax-m2p7": { + id: "accounts/fireworks/models/minimax-m2p7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-12", + last_updated: "2026-04-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 196608, output: 196608 }, + }, + "accounts/fireworks/models/glm-4p7": { + id: "accounts/fireworks/models/glm-4p7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.3 }, + limit: { context: 198000, output: 198000 }, + }, + "accounts/fireworks/models/glm-4p5": { + id: "accounts/fireworks/models/glm-4p5", + name: "GLM 4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 131072, output: 131072 }, + }, + "accounts/fireworks/models/kimi-k2p5": { + id: "accounts/fireworks/models/kimi-k2p5", + name: "Kimi K2.5", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 256000, output: 256000 }, + }, + "accounts/fireworks/models/gpt-oss-20b": { + id: "accounts/fireworks/models/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.2 }, + limit: { context: 131072, output: 32768 }, + }, + "accounts/fireworks/models/gpt-oss-120b": { + id: "accounts/fireworks/models/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 32768 }, + }, + "accounts/fireworks/models/kimi-k2-thinking": { + id: "accounts/fireworks/models/kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5, cache_read: 0.3 }, + limit: { context: 256000, output: 256000 }, + }, + "accounts/fireworks/routers/kimi-k2p5-turbo": { + id: "accounts/fireworks/routers/kimi-k2p5-turbo", + name: "Kimi K2.5 Turbo", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 256000, output: 256000 }, + }, + "accounts/fireworks/models/deepseek-v4-pro": { + id: "accounts/fireworks/models/deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.15 }, + limit: { context: 1000000, output: 384000 }, + }, + }, + }, + "kimi-for-coding": { + id: "kimi-for-coding", + env: ["KIMI_API_KEY"], + npm: "@ai-sdk/anthropic", + api: "https://api.kimi.com/coding/v1", + name: "Kimi For Coding", + doc: "https://www.kimi.com/coding/docs/en/third-party-agents.html", + models: { + k2p6: { + id: "k2p6", + name: "Kimi K2.6", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04", + last_updated: "2026-04", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + k2p5: { + id: "k2p5", + name: "Kimi K2.5", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-11", + last_updated: "2025-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + }, + }, + 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: { + "GLM-4.7": { + id: "GLM-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 3.5, output: 14 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.1": { + id: "MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.1, output: 8.4 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + "opencode-go": { + id: "opencode-go", + env: ["OPENCODE_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://opencode.ai/zen/go/v1", + name: "OpenCode Go", + doc: "https://opencode.ai/docs/zen", + models: { + "minimax-m2.7": { + id: "minimax-m2.7", + name: "MiniMax M2.7", + family: "minimax-m2.7", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi-k2.5", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 65536 }, + }, + "mimo-v2.5-pro": { + id: "mimo-v2.5-pro", + name: "MiMo V2.5 Pro", + family: "mimo-v2.5-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 128000 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 202752, output: 32768 }, + }, + "mimo-v2-omni": { + id: "mimo-v2-omni", + name: "MiMo V2 Omni", + family: "mimo-v2-omni", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 0.4, output: 2, cache_read: 0.08 }, + limit: { context: 262144, output: 128000 }, + status: "deprecated", + }, + "mimo-v2.5": { + id: "mimo-v2.5", + name: "MiMo V2.5", + family: "mimo-v2.5", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.4, + output: 2, + cache_read: 0.08, + context_over_200k: { input: 0.8, output: 4, cache_read: 0.16 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen3.6", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3, cache_read: 0.05, cache_write: 0.625 }, + limit: { context: 262144, output: 65536 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 202752, output: 32768 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.0028 }, + limit: { context: 1000000, output: 384000 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 65536 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.0145 }, + limit: { context: 1000000, output: 384000 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax-m2.5", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 204800, output: 65536 }, + }, + "mimo-v2-pro": { + id: "mimo-v2-pro", + name: "MiMo V2 Pro", + family: "mimo-v2-pro", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 128000 }, + status: "deprecated", + }, + "qwen3.5-plus": { + id: "qwen3.5-plus", + name: "Qwen3.5 Plus", + family: "qwen3.5", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.2, cache_read: 0.02, cache_write: 0.25 }, + limit: { context: 262144, output: 65536 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + }, + }, + "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: { + "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar": { + id: "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar", + name: "Qwen 3 Coder 480B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-15", + last_updated: "2025-01-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.95, cache_read: 0.11, cache_write: 0.44 }, + limit: { context: 106000, output: 4096 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + id: "Qwen/Qwen3-Next-80B-A3B-Instruct", + name: "Qwen 3 Next 80B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-10", + last_updated: "2025-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.8, cache_read: 0.05, cache_write: 0.2 }, + limit: { context: 262144, output: 4096 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen 3 235B Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11, output: 0.6, cache_read: 0.055, cache_write: 0.22 }, + limit: { context: 262144, output: 4096 }, + }, + "Qwen/Qwen2.5-VL-32B-Instruct": { + id: "Qwen/Qwen2.5-VL-32B-Instruct", + name: "Qwen 2.5 VL 32B Instruct", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.05, output: 0.22, cache_read: 0.025, cache_write: 0.1 }, + limit: { context: 32000, output: 4096 }, + }, + "zai-org/GLM-4.6": { + id: "zai-org/GLM-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-11-15", + last_updated: "2024-11-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.75, cache_read: 0.2, cache_write: 0.8 }, + limit: { context: 200000, output: 4096 }, + }, + "mistralai/Magistral-Small-2506": { + id: "mistralai/Magistral-Small-2506", + name: "Magistral Small 2506", + family: "magistral-small", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.5, cache_read: 0.25, cache_write: 1 }, + limit: { context: 128000, output: 4096 }, + }, + "mistralai/Mistral-Large-Instruct-2411": { + id: "mistralai/Mistral-Large-Instruct-2411", + name: "Mistral Large Instruct 2411", + family: "mistral-large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 1, cache_write: 4 }, + limit: { context: 128000, output: 4096 }, + }, + "mistralai/Mistral-Nemo-Instruct-2407": { + id: "mistralai/Mistral-Nemo-Instruct-2407", + name: "Mistral Nemo Instruct 2407", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-05", + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.04, cache_read: 0.01, cache_write: 0.04 }, + limit: { context: 128000, output: 4096 }, + }, + "mistralai/Devstral-Small-2505": { + id: "mistralai/Devstral-Small-2505", + name: "Devstral Small 2505", + 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, + cost: { input: 0.05, output: 0.22, cache_read: 0.025, cache_write: 0.1 }, + limit: { context: 128000, output: 4096 }, + }, + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama 3.3 70B Instruct", + 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, + cost: { input: 0.13, output: 0.38, cache_read: 0.065, cache_write: 0.26 }, + limit: { context: 128000, output: 4096 }, + }, + "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", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-15", + last_updated: "2025-01-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6, cache_read: 0.075, cache_write: 0.3 }, + limit: { context: 430000, output: 4096 }, + }, + "meta-llama/Llama-3.2-90B-Vision-Instruct": { + id: "meta-llama/Llama-3.2-90B-Vision-Instruct", + name: "Llama 3.2 90B Vision Instruct", + 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", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 0.4, cache_read: 0.175, cache_write: 0.7 }, + limit: { context: 16000, output: 4096 }, + }, + "deepseek-ai/DeepSeek-R1-0528": { + id: "deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 8.75, cache_read: 1, cache_write: 4 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT-OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.14, cache_read: 0.015, cache_write: 0.06 }, + limit: { context: 64000, output: 4096 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT-OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.4, cache_read: 0.02, cache_write: 0.08 }, + limit: { context: 131072, output: 4096 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.55, output: 2.25, cache_read: 0.275, cache_write: 1.1 }, + limit: { context: 32768, output: 4096 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-09-05", + last_updated: "2024-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.39, output: 1.9, cache_read: 0.195, cache_write: 0.78 }, + limit: { context: 32768, output: 4096 }, + }, + }, + }, + "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-235b-a22b": { + id: "qwen3-235b-a22b", + name: "Qwen3 235B-A22B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.287, output: 1.147, reasoning: 2.868 }, + limit: { context: 131072, output: 16384 }, + }, + "qwen-plus-character": { + id: "qwen-plus-character", + name: "Qwen Plus Character", + 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, + cost: { input: 0.115, output: 0.287 }, + limit: { context: 32768, output: 4096 }, + }, + "qwen2-5-math-7b-instruct": { + id: "qwen2-5-math-7b-instruct", + name: "Qwen2.5-Math 7B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.144, output: 0.287 }, + limit: { context: 4096, output: 3072 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Moonshot Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.574, output: 2.411 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen-doc-turbo": { + id: "qwen-doc-turbo", + name: "Qwen Doc Turbo", + 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, + cost: { input: 0.087, output: 0.144 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen-vl-ocr": { + id: "qwen-vl-ocr", + name: "Qwen-VL OCR", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.717, output: 0.717 }, + limit: { context: 34096, output: 4096 }, + }, + "qwen-omni-turbo-realtime": { + id: "qwen-omni-turbo-realtime", + name: "Qwen-Omni Turbo Realtime", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.23, output: 0.918, input_audio: 3.584, output_audio: 7.168 }, + limit: { context: 32768, output: 2048 }, + }, + "qwen3-8b": { + id: "qwen3-8b", + name: "Qwen3 8B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.072, output: 0.287, reasoning: 0.717 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3.5-397b-a17b": { + id: "qwen3.5-397b-a17b", + name: "Qwen3.5 397B-A17B", + family: "qwen", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.43, output: 2.58, reasoning: 2.58 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen-math-turbo": { + id: "qwen-math-turbo", + name: "Qwen Math Turbo", + 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, + cost: { input: 0.287, output: 0.861 }, + limit: { context: 4096, output: 3072 }, + }, + "qwq-plus": { + id: "qwq-plus", + name: "QwQ Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.23, output: 0.574 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen-vl-plus": { + id: "qwen-vl-plus", + name: "Qwen-VL Plus", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.115, output: 0.287 }, + limit: { context: 131072, output: 8192 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.86, output: 3.15 }, + limit: { context: 202752, output: 16384 }, + }, + "deepseek-r1-distill-llama-70b": { + id: "deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.287, output: 0.861 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.287, output: 1.147, reasoning: 2.868 }, + limit: { context: 131072, output: 16384 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen-max": { + id: "qwen-max", + name: "Qwen Max", + 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, + cost: { input: 0.345, output: 1.377 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen-plus": { + id: "qwen-plus", + name: "Qwen Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.115, output: 0.287, reasoning: 1.147 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen-omni-turbo": { + id: "qwen-omni-turbo", + name: "Qwen-Omni Turbo", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.058, output: 0.23, input_audio: 3.584, output_audio: 7.168 }, + limit: { context: 32768, output: 2048 }, + }, + "qwen-flash": { + id: "qwen-flash", + name: "Qwen Flash", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.022, output: 0.216 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen2-5-vl-7b-instruct": { + id: "qwen2-5-vl-7b-instruct", + name: "Qwen2.5-VL 7B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.287, output: 0.717 }, + limit: { context: 131072, output: 8192 }, + }, + "deepseek-r1": { + id: "deepseek-r1", + name: "DeepSeek R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.574, output: 2.294 }, + limit: { context: 131072, output: 16384 }, + }, + "qwen3.5-flash": { + id: "qwen3.5-flash", + name: "Qwen3.5 Flash", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: 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: false, + cost: { input: 0.172, output: 1.72, reasoning: 1.72 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.276, output: 1.651, cache_read: 0.028, cache_write: 0.344 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen3-max": { + id: "qwen3-max", + name: "Qwen3 Max", + 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, + cost: { input: 0.861, output: 3.441 }, + limit: { context: 262144, output: 65536 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.87, output: 3.48, cache_read: 0.17 }, + limit: { context: 202752, output: 128000 }, + }, + "qwen3-omni-flash": { + id: "qwen3-omni-flash", + name: "Qwen3-Omni Flash", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.058, output: 0.23, input_audio: 3.584, output_audio: 7.168 }, + limit: { context: 65536, output: 16384 }, + }, + "deepseek-v3-1": { + id: "deepseek-v3-1", + name: "DeepSeek V3.1", + 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, + cost: { input: 0.574, output: 1.721 }, + limit: { context: 131072, output: 65536 }, + }, + "qwen2-5-72b-instruct": { + id: "qwen2-5-72b-instruct", + name: "Qwen2.5 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.574, output: 1.721 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-vl-235b-a22b": { + id: "qwen3-vl-235b-a22b", + name: "Qwen3-VL 235B-A22B", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.286705, output: 1.14682, reasoning: 2.867051 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen-math-plus": { + id: "qwen-math-plus", + name: "Qwen Math Plus", + 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, + cost: { input: 0.574, output: 1.721 }, + limit: { context: 4096, output: 3072 }, + }, + "qwen2-5-coder-32b-instruct": { + id: "qwen2-5-coder-32b-instruct", + name: "Qwen2.5-Coder 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-11", + last_updated: "2024-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.287, output: 0.861 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-asr-flash": { + id: "qwen3-asr-flash", + name: "Qwen3-ASR Flash", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.032, output: 0.032 }, + limit: { context: 53248, output: 4096 }, + }, + "qwen-deep-research": { + id: "qwen-deep-research", + name: "Qwen Deep Research", + 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, + cost: { input: 7.742, output: 23.367 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen3-next-80b-a3b-thinking": { + id: "qwen3-next-80b-a3b-thinking", + name: "Qwen3-Next 80B-A3B (Thinking)", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09", + last_updated: "2025-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.144, output: 1.434 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen-mt-plus": { + id: "qwen-mt-plus", + name: "Qwen-MT Plus", + 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, + cost: { input: 0.259, output: 0.775 }, + limit: { context: 16384, output: 8192 }, + }, + "deepseek-r1-distill-qwen-32b": { + id: "deepseek-r1-distill-qwen-32b", + name: "DeepSeek R1 Distill Qwen 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.287, output: 0.861 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen-vl-max": { + id: "qwen-vl-max", + name: "Qwen-VL Max", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.23, output: 0.574 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-coder-flash": { + id: "qwen3-coder-flash", + name: "Qwen3 Coder Flash", + 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, + cost: { input: 0.144, output: 0.574 }, + limit: { context: 1000000, output: 65536 }, + }, + "deepseek-r1-distill-qwen-7b": { + id: "deepseek-r1-distill-qwen-7b", + name: "DeepSeek R1 Distill Qwen 7B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.072, output: 0.144 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen2-5-7b-instruct": { + id: "qwen2-5-7b-instruct", + name: "Qwen2.5 7B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.072, output: 0.144 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen2-5-14b-instruct": { + id: "qwen2-5-14b-instruct", + name: "Qwen2.5 14B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.144, output: 0.431 }, + limit: { context: 131072, output: 8192 }, + }, + "tongyi-intent-detect-v3": { + id: "tongyi-intent-detect-v3", + name: "Tongyi Intent Detect V3", + 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, + cost: { input: 0.058, output: 0.144 }, + limit: { context: 8192, output: 1024 }, + }, + "qwq-32b": { + id: "qwq-32b", + name: "QwQ 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-12", + last_updated: "2024-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.287, output: 0.861 }, + limit: { context: 131072, output: 8192 }, + }, + "moonshot-kimi-k2-instruct": { + id: "moonshot-kimi-k2-instruct", + name: "Moonshot Kimi K2 Instruct", + family: "kimi", + 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, + cost: { input: 0.574, output: 2.294 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen2-5-32b-instruct": { + id: "qwen2-5-32b-instruct", + name: "Qwen2.5 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.287, output: 0.861 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-next-80b-a3b-instruct": { + id: "qwen3-next-80b-a3b-instruct", + name: "Qwen3-Next 80B-A3B Instruct", + 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, + cost: { input: 0.144, output: 0.574 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen3-omni-flash-realtime": { + id: "qwen3-omni-flash-realtime", + name: "Qwen3-Omni Flash Realtime", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.23, output: 0.918, input_audio: 3.584, output_audio: 7.168 }, + limit: { context: 65536, output: 16384 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Moonshot Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.929, output: 3.858 }, + limit: { context: 262144, output: 16384 }, + }, + "qwen3-vl-30b-a3b": { + id: "qwen3-vl-30b-a3b", + name: "Qwen3-VL 30B-A3B", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.108, output: 0.431, reasoning: 1.076 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen3-vl-plus": { + id: "qwen3-vl-plus", + name: "Qwen3-VL Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.143353, output: 1.433525, reasoning: 4.300576 }, + limit: { context: 262144, output: 32768 }, + }, + "deepseek-v3-2-exp": { + id: "deepseek-v3-2-exp", + name: "DeepSeek V3.2 Exp", + 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, + cost: { input: 0.287, output: 0.431 }, + limit: { context: 131072, output: 65536 }, + }, + "qwen3-coder-480b-a35b-instruct": { + id: "qwen3-coder-480b-a35b-instruct", + name: "Qwen3-Coder 480B-A35B Instruct", + 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, + cost: { input: 0.861, output: 3.441 }, + limit: { context: 262144, output: 65536 }, + }, + "deepseek-r1-distill-qwen-1-5b": { + id: "deepseek-r1-distill-qwen-1-5b", + name: "DeepSeek R1 Distill Qwen 1.5B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3-Coder 30B-A3B Instruct", + 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, + cost: { input: 0.216, output: 0.861 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen2-5-coder-7b-instruct": { + id: "qwen2-5-coder-7b-instruct", + name: "Qwen2.5-Coder 7B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-11", + last_updated: "2024-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.144, output: 0.287 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen-turbo": { + id: "qwen-turbo", + name: "Qwen Turbo", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.044, output: 0.087, reasoning: 0.431 }, + limit: { context: 1000000, output: 16384 }, + }, + "qwen-mt-turbo": { + id: "qwen-mt-turbo", + name: "Qwen-MT Turbo", + 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, + cost: { input: 0.101, output: 0.28 }, + limit: { context: 16384, output: 8192 }, + }, + "qwen2-5-math-72b-instruct": { + id: "qwen2-5-math-72b-instruct", + name: "Qwen2.5-Math 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.574, output: 1.721 }, + limit: { context: 4096, output: 3072 }, + }, + "qwen3.6-max-preview": { + id: "qwen3.6-max-preview", + name: "Qwen3.6 Max Preview", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.32, output: 7.9, cache_read: 0.132 }, + limit: { context: 245800, output: 65536 }, + }, + "qwen2-5-omni-7b": { + id: "qwen2-5-omni-7b", + name: "Qwen2.5-Omni 7B", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.087, output: 0.345, input_audio: 5.448 }, + limit: { context: 32768, output: 2048 }, + }, + "qwen3.5-plus": { + id: "qwen3.5-plus", + name: "Qwen3.5 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.573, output: 3.44, reasoning: 3.44 }, + limit: { context: 1000000, output: 65536 }, + }, + "deepseek-r1-distill-qwen-14b": { + id: "deepseek-r1-distill-qwen-14b", + name: "DeepSeek R1 Distill Qwen 14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.144, output: 0.431 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen2-5-vl-72b-instruct": { + id: "qwen2-5-vl-72b-instruct", + name: "Qwen2.5-VL 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 2.294, output: 6.881 }, + limit: { context: 131072, output: 8192 }, + }, + "deepseek-v3": { + id: "deepseek-v3", + name: "DeepSeek V3", + 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, + cost: { input: 0.287, output: 1.147 }, + limit: { context: 65536, output: 8192 }, + }, + "deepseek-r1-0528": { + id: "deepseek-r1-0528", + name: "DeepSeek R1 0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-28", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.574, output: 2.294 }, + limit: { context: 131072, output: 16384 }, + }, + "qvq-max": { + id: "qvq-max", + name: "QVQ Max", + family: "qvq", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.147, output: 4.588 }, + limit: { context: 131072, output: 8192 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Moonshot Kimi K2 Thinking", + family: "kimi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.574, output: 2.294 }, + limit: { context: 262144, output: 16384 }, + }, + "qwen3-14b": { + id: "qwen3-14b", + name: "Qwen3 14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.144, output: 0.574, reasoning: 1.434 }, + limit: { context: 131072, output: 8192 }, + }, + "deepseek-r1-distill-llama-8b": { + id: "deepseek-r1-distill-llama-8b", + name: "DeepSeek R1 Distill Llama 8B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen-long": { + id: "qwen-long", + name: "Qwen Long", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2025-01-25", + last_updated: "2025-01-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.072, output: 0.287 }, + limit: { context: 10000000, output: 8192 }, + }, + "kimi/kimi-k2.5": { + id: "kimi/kimi-k2.5", + name: "kimi/kimi-k2.5", + family: "kimi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "MiniMax/MiniMax-M2.7": { + id: "MiniMax/MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "siliconflow/deepseek-v3-0324": { + id: "siliconflow/deepseek-v3-0324", + name: "siliconflow/deepseek-v3-0324", + 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, + cost: { input: 0.25, output: 1 }, + limit: { context: 163840, output: 163840 }, + }, + "siliconflow/deepseek-v3.2": { + id: "siliconflow/deepseek-v3.2", + name: "siliconflow/deepseek-v3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 0.42 }, + limit: { context: 163840, output: 65536 }, + }, + "siliconflow/deepseek-r1-0528": { + id: "siliconflow/deepseek-r1-0528", + name: "siliconflow/deepseek-r1-0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.18 }, + limit: { context: 163840, output: 32768 }, + }, + "siliconflow/deepseek-v3.1-terminus": { + id: "siliconflow/deepseek-v3.1-terminus", + name: "siliconflow/deepseek-v3.1-terminus", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 1 }, + limit: { context: 163840, output: 65536 }, + }, + "qwen3-coder-plus": { + id: "qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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, + cost: { input: 1, output: 5 }, + limit: { context: 1048576, output: 65536 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1000000, output: 384000 }, + }, + }, + }, + firepass: { + id: "firepass", + env: ["FIREPASS_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.fireworks.ai/inference/v1/", + name: "Fireworks (Firepass)", + doc: "https://docs.fireworks.ai/firepass", + models: { + "accounts/fireworks/routers/kimi-k2p6-turbo": { + id: "accounts/fireworks/routers/kimi-k2p6-turbo", + name: "Kimi K2.6 Turbo", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262000, output: 262000 }, + }, + }, + }, + "minimax-cn-coding-plan": { + id: "minimax-cn-coding-plan", + env: ["MINIMAX_API_KEY"], + npm: "@ai-sdk/anthropic", + api: "https://api.minimaxi.com/anthropic/v1", + name: "MiniMax Coding Plan (minimaxi.com)", + doc: "https://platform.minimaxi.com/docs/coding-plan/intro", + models: { + "MiniMax-M2": { + id: "MiniMax-M2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 196608, output: 128000 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7": { + id: "MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7-highspeed": { + id: "MiniMax-M2.7-highspeed", + name: "MiniMax-M2.7-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.1": { + id: "MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.5-highspeed": { + id: "MiniMax-M2.5-highspeed", + name: "MiniMax-M2.5-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-13", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + 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: { + "gpt-5.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "gpt-5.1-codex-max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.125, output: 9 }, + limit: { context: 400000, output: 128000 }, + }, + "grok-4-1-fast-reasoning": { + id: "grok-4-1-fast-reasoning", + name: "grok-4-1-fast-reasoning", + 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, + cost: { input: 0.18, output: 0.45 }, + limit: { context: 2000000, output: 2000000 }, + }, + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "claude-opus-4-5-20251101", + family: "claude-opus", + 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, + cost: { input: 4.5, output: 22.5 }, + limit: { context: 200000, output: 65536 }, + }, + "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", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.36 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.2-pro": { + id: "gpt-5.2-pro", + name: "gpt-5.2-pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 18.9, output: 151.2 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "gemini-3-flash-preview", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "gpt-5-mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.225, output: 1.8 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "gpt-5-nano", + family: "gpt-nano", + 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, + cost: { input: 0.045, output: 0.36 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "gemini-3-pro-preview", + family: "gemini-pro", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 1.8, output: 10.8 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-flash-preview-05-20": { + id: "gemini-2.5-flash-preview-05-20", + name: "gemini-2.5-flash-preview-05-20", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.135, output: 3.15 }, + limit: { context: 1048576, output: 200000 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "claude-sonnet-4-5-20250929", + family: "claude-sonnet", + 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, + cost: { input: 2.7, output: 13.5 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "gemini-2.5-pro", + family: "gemini-pro", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 1.125, output: 9 }, + limit: { context: 1048576, output: 65535 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "grok-4-1-fast-non-reasoning", + 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, + cost: { input: 0.18, output: 0.45 }, + limit: { context: 2000000, output: 2000000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "gpt-5.2", + family: "gpt", + 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, + cost: { input: 1.575, output: 12.6 }, + limit: { context: 400000, output: 128000 }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o", + 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, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, output: 100000 }, + }, + "gemini-2.5-pro-preview-06-05": { + id: "gemini-2.5-pro-preview-06-05", + name: "gemini-2.5-pro-preview-06-05", + family: "gemini-pro", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 1.125, output: 9 }, + limit: { context: 1048576, output: 200000 }, + }, + "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", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "video", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.36 }, + limit: { context: 1048576, output: 65535 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "gpt-5.2-codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "gemini-2.5-flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 2.25 }, + limit: { context: 1048576, output: 65535 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "gpt-5.1-codex-mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.225, output: 1.8 }, + limit: { context: 400000, output: 128000 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "grok-code-fast-1", + 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, + cost: { input: 0.18, output: 1.35 }, + limit: { context: 256000, output: 256000 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "gpt-5.1", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02", + last_updated: "2026-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.125, output: 9 }, + limit: { context: 400000, output: 128000 }, + }, + "grok-4-fast-reasoning": { + id: "grok-4-fast-reasoning", + name: "grok-4-fast-reasoning", + 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, + cost: { input: 0.18, output: 0.45 }, + limit: { context: 2000000, output: 2000000 }, + }, + "o3-mini": { + id: "o3-mini", + name: "o3-mini", + family: "o", + 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, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 131072, output: 131072 }, + }, + "grok-4-0709": { + id: "grok-4-0709", + name: "grok-4-0709", + 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, + cost: { input: 2.7, output: 13.5 }, + limit: { context: 256000, output: 8192 }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "gpt-5-codex", + family: "gpt-codex", + 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, + cost: { input: 1.125, output: 9 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "claude-opus-4-1-20250805", + family: "claude-opus", + 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, + cost: { input: 13.5, output: 67.5 }, + limit: { context: 200000, output: 32000 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "claude-haiku-4-5-20251001", + family: "claude-haiku", + 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, + cost: { input: 0.9, output: 4.5 }, + limit: { context: 20000, output: 64000 }, + }, + "claude-sonnet-4-20250514": { + id: "claude-sonnet-4-20250514", + name: "claude-sonnet-4-20250514", + family: "claude-sonnet", + 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, + cost: { input: 2.7, output: 13.5 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "claude-opus-4-6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02", + last_updated: "2026-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 1000000, output: 128000 }, + }, + o3: { + id: "o3", + name: "o3", + 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, + cost: { input: 10, output: 40 }, + limit: { context: 131072, output: 131072 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "gpt-5-pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 13.5, output: 108 }, + limit: { context: 400000, output: 272000 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "gemini-2.5-flash-lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.36 }, + limit: { context: 1048576, output: 65535 }, + }, + "gpt-5-chat-latest": { + id: "gpt-5-chat-latest", + name: "gpt-5-chat-latest", + family: "gpt", + 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, + cost: { input: 1.125, output: 9 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-20250514": { + id: "claude-opus-4-20250514", + name: "claude-opus-4-20250514", + family: "claude-opus", + 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, + cost: { input: 13.5, output: 67.5 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "gpt-5.1-codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.125, output: 9 }, + limit: { context: 400000, output: 128000 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "grok-4-fast-non-reasoning", + 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, + cost: { input: 0.18, output: 0.45 }, + limit: { context: 2000000, output: 2000000 }, + }, + "deepseek/deepseek-v3-0324": { + id: "deepseek/deepseek-v3-0324", + name: "DeepSeek V3 0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 1.14 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek/deepseek-v3.1": { + id: "deepseek/deepseek-v3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1 }, + limit: { context: 163840, output: 32768 }, + }, + "deepseek/deepseek-r1-0528": { + id: "deepseek/deepseek-r1-0528", + name: "DeepSeek R1 0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.5 }, + limit: { context: 163840, output: 32768 }, + }, + "zai-org/glm-4.7": { + id: "zai-org/glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/glm-4.5": { + id: "zai-org/glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 131072, output: 98304 }, + }, + "zai-org/glm-4.5v": { + id: "zai-org/glm-4.5v", + name: "GLM 4.5V", + family: "glmv", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 65536, output: 16384 }, + }, + "zai-org/glm-4.7-flash": { + id: "zai-org/glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.4 }, + limit: { context: 200000, output: 128000 }, + }, + "minimaxai/minimax-m1-80k": { + id: "minimaxai/minimax-m1-80k", + name: "MiniMax M1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.2 }, + limit: { context: 1000000, output: 40000 }, + }, + "xiaomimimo/mimo-v2-flash": { + id: "xiaomimimo/mimo-v2-flash", + name: "XiaomiMiMo/MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 131072 }, + }, + "baidu/ernie-4.5-vl-424b-a47b": { + id: "baidu/ernie-4.5-vl-424b-a47b", + name: "ERNIE 4.5 VL 424B A47B", + family: "ernie", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.42, output: 1.25 }, + limit: { context: 123000, output: 16000 }, + }, + "baidu/ernie-4.5-300b-a47b-paddle": { + id: "baidu/ernie-4.5-300b-a47b-paddle", + name: "ERNIE 4.5 300B A47B", + family: "ernie", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 1.1 }, + limit: { context: 123000, output: 12000 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "Minimax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen/qwen3-235b-a22b-instruct-2507": { + id: "qwen/qwen3-235b-a22b-instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.8 }, + limit: { context: 131072, output: 16384 }, + }, + "qwen/qwen3-32b-fp8": { + id: "qwen/qwen3-32b-fp8", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.45 }, + limit: { context: 40960, output: 20000 }, + }, + "qwen/qwen3-235b-a22b-thinking-2507": { + id: "qwen/qwen3-235b-a22b-thinking-2507", + name: "Qwen3 235B A22b Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 3 }, + limit: { context: 131072, output: 131072 }, + }, + "qwen/qwen3-next-80b-a3b-thinking": { + id: "qwen/qwen3-next-80b-a3b-thinking", + name: "Qwen3 Next 80B A3B Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.5 }, + limit: { context: 65536, output: 65536 }, + }, + "qwen/qwen3-next-80b-a3b-instruct": { + id: "qwen/qwen3-next-80b-a3b-instruct", + name: "Qwen3 Next 80B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.5 }, + limit: { context: 65536, output: 65536 }, + }, + "qwen/qwen3-30b-a3b-fp8": { + id: "qwen/qwen3-30b-a3b-fp8", + name: "Qwen3 30B A3B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.45 }, + limit: { context: 40960, output: 20000 }, + }, + "qwen/qwen3-coder-next": { + id: "qwen/qwen3-coder-next", + name: "qwen/qwen3-coder-next", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02", + last_updated: "2026-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-coder-480b-a35b-instruct": { + id: "qwen/qwen3-coder-480b-a35b-instruct", + name: "Qwen3 Coder 480B A35B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 1.2 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-235b-a22b-fp8": { + id: "qwen/qwen3-235b-a22b-fp8", + name: "Qwen3 235B A22B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 40960, output: 20000 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-instruct": { + id: "moonshotai/kimi-k2-instruct", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.57, output: 2.3 }, + limit: { context: 131072, output: 131072 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "Kimi K2 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + bailing: { + id: "bailing", + env: ["BAILING_API_TOKEN"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.tbox.cn/api/llm/v1/chat/completions", + name: "Bailing", + doc: "https://alipaytbox.yuque.com/sxs0ba/ling/intro", + models: { + "Ring-1T": { + id: "Ring-1T", + name: "Ring-1T", + family: "ring", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2025-10", + last_updated: "2025-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.57, output: 2.29 }, + limit: { context: 128000, output: 32000 }, + }, + "Ling-1T": { + id: "Ling-1T", + name: "Ling-1T", + 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, + cost: { input: 0.57, output: 2.29 }, + limit: { context: 128000, output: 32000 }, + }, + }, + }, + iflowcn: { + id: "iflowcn", + env: ["IFLOW_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://apis.iflow.cn/v1", + name: "iFlow", + doc: "https://platform.iflow.cn/en/docs", + models: { + "qwen3-coder-plus": { + id: "qwen3-coder-plus", + name: "Qwen3-Coder-Plus", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 64000 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3-32B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32000 }, + }, + "deepseek-r1": { + id: "deepseek-r1", + name: "DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32000 }, + }, + "qwen3-max": { + id: "qwen3-max", + name: "Qwen3-Max", + family: "qwen", + 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: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 32000 }, + }, + "qwen3-235b-a22b-instruct": { + id: "qwen3-235b-a22b-instruct", + name: "Qwen3-235B-A22B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 64000 }, + }, + "qwen3-235b-a22b-thinking-2507": { + id: "qwen3-235b-a22b-thinking-2507", + name: "Qwen3-235B-A22B-Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 64000 }, + }, + "kimi-k2-0905": { + id: "kimi-k2-0905", + name: "Kimi-K2-0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 64000 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2025-11-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 128000 }, + }, + "qwen3-vl-plus": { + id: "qwen3-vl-plus", + name: "Qwen3-VL-Plus", + 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: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 32000 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek-V3.2-Exp", + family: "deepseek", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 64000 }, + }, + "qwen3-235b": { + id: "qwen3-235b", + name: "Qwen3-235B-A22B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32000 }, + }, + "kimi-k2": { + id: "kimi-k2", + name: "Kimi-K2", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 64000 }, + }, + "qwen3-max-preview": { + id: "qwen3-max-preview", + name: "Qwen3-Max-Preview", + family: "qwen", + 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: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 32000 }, + }, + "deepseek-v3": { + id: "deepseek-v3", + name: "DeepSeek-V3", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-26", + last_updated: "2024-12-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32000 }, + }, + }, + }, + v0: { + id: "v0", + env: ["V0_API_KEY"], + npm: "@ai-sdk/vercel", + name: "v0", + doc: "https://sdk.vercel.ai/providers/ai-sdk-providers/vercel", + models: { + "v0-1.5-lg": { + id: "v0-1.5-lg", + name: "v0-1.5-lg", + family: "v0", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-09", + last_updated: "2025-06-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75 }, + limit: { context: 512000, output: 32000 }, + }, + "v0-1.0-md": { + id: "v0-1.0-md", + name: "v0-1.0-md", + family: "v0", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, output: 32000 }, + }, + "v0-1.5-md": { + id: "v0-1.5-md", + name: "v0-1.5-md", + family: "v0", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-09", + last_updated: "2025-06-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, output: 32000 }, + }, + }, + }, + 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: { + "Qwen/Qwen3.5-397B-A17B": { + id: "Qwen/Qwen3.5-397B-A17B", + name: "Qwen3.5-397B-A17B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-01", + last_updated: "2026-02-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 32768 }, + }, + "Qwen/Qwen3-Coder-Next": { + id: "Qwen/Qwen3-Coder-Next", + name: "Qwen3-Coder-Next", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-03", + last_updated: "2026-02-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + id: "Qwen/Qwen3-Next-80B-A3B-Instruct", + name: "Qwen3-Next-80B-A3B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-11", + last_updated: "2025-09-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 1 }, + limit: { context: 262144, output: 66536 }, + }, + "Qwen/Qwen3-Embedding-8B": { + id: "Qwen/Qwen3-Embedding-8B", + name: "Qwen 3 Embedding 8B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2024-12", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0 }, + limit: { context: 32000, output: 4096 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen3-235B-A22B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 3 }, + limit: { context: 262144, output: 131072 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + id: "Qwen/Qwen3-Next-80B-A3B-Thinking", + name: "Qwen3-Next-80B-A3B-Thinking", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-11", + last_updated: "2025-09-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2 }, + limit: { context: 262144, output: 131072 }, + }, + "Qwen/Qwen3-Embedding-4B": { + id: "Qwen/Qwen3-Embedding-4B", + name: "Qwen 3 Embedding 4B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2024-12", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0 }, + limit: { context: 32000, output: 2048 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + name: "Qwen3-Coder-480B-A35B-Instruct", + 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, + cost: { input: 2, output: 2 }, + limit: { context: 262144, output: 66536 }, + }, + "zai-org/GLM-4.7-Flash": { + id: "zai-org/GLM-4.7-Flash", + name: "GLM-4.7-Flash", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2025-08-08", + last_updated: "2025-08-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 128000 }, + }, + "zai-org/GLM-4.7": { + id: "zai-org/GLM-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/GLM-5.1": { + id: "zai-org/GLM-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-03", + last_updated: "2026-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 202752, output: 131072 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 202752, output: 131072 }, + }, + "XiaomiMiMo/MiMo-V2-Flash": { + id: "XiaomiMiMo/MiMo-V2-Flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 262144, output: 4096 }, + }, + "deepseek-ai/DeepSeek-R1-0528": { + id: "deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek-R1-0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 5 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.28, output: 0.4 }, + limit: { context: 163840, output: 65536 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "Kimi-K2-Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2.6": { + id: "moonshotai/Kimi-K2.6", + name: "Kimi-K2.6", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2-Instruct": { + id: "moonshotai/Kimi-K2-Instruct", + name: "Kimi-K2-Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-14", + last_updated: "2025-07-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 131072, output: 16384 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi-K2-Instruct-0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-04", + last_updated: "2025-09-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 262144, output: 16384 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi-K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01-01", + last_updated: "2026-01-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMaxAI/MiniMax-M2.7": { + id: "MiniMaxAI/MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMaxAI/MiniMax-M2.1": { + id: "MiniMaxAI/MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "deepseek-ai/DeepSeek-V4-Pro": { + id: "deepseek-ai/DeepSeek-V4-Pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1048576, output: 393216 }, + }, + }, + }, + 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: { + "deepseek/deepseek-chat": { + id: "deepseek/deepseek-chat", + name: "DeepSeek-V3.2 (Non-thinking Mode)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 0.42, cache_read: 0.03 }, + limit: { context: 128000, output: 64000 }, + }, + "deepseek/deepseek-v3.2-exp": { + id: "deepseek/deepseek-v3.2-exp", + name: "DeepSeek-V3.2-Exp", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.22, output: 0.33 }, + limit: { context: 163000, output: 64000 }, + }, + "deepseek/deepseek-v3.2": { + id: "deepseek/deepseek-v3.2", + name: "DeepSeek V3.2", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-05", + last_updated: "2025-12-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 0.43 }, + limit: { context: 128000, output: 64000 }, + }, + "inclusionai/ring-1t": { + id: "inclusionai/ring-1t", + name: "Ring-1T", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-10-12", + last_updated: "2025-10-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.56, output: 2.24, cache_read: 0.11 }, + limit: { context: 128000, output: 64000 }, + }, + "inclusionai/ling-1t": { + id: "inclusionai/ling-1t", + name: "Ling-1T", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-10-09", + last_updated: "2025-10-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.56, output: 2.24, cache_read: 0.11 }, + limit: { context: 128000, output: 64000 }, + }, + "stepfun/step-3.5-flash-free": { + id: "stepfun/step-3.5-flash-free", + name: "Step 3.5 Flash (Free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-02-02", + last_updated: "2026-02-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 64000 }, + }, + "stepfun/step-3.5-flash": { + id: "stepfun/step-3.5-flash", + name: "Step 3.5 Flash", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-02-02", + last_updated: "2026-02-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 256000, output: 64000 }, + }, + "stepfun/step-3": { + id: "stepfun/step-3", + name: "Step-3", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-07-31", + last_updated: "2025-07-31", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.21, output: 0.57 }, + limit: { context: 65536, output: 64000 }, + }, + "kuaishou/kat-coder-pro-v2": { + id: "kuaishou/kat-coder-pro-v2", + name: "KAT-Coder-Pro-V2", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 256000, output: 80000 }, + }, + "x-ai/grok-4-fast": { + id: "x-ai/grok-4-fast", + name: "Grok 4 Fast", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 64000 }, + }, + "x-ai/grok-code-fast-1": { + id: "x-ai/grok-code-fast-1", + name: "Grok Code Fast 1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 64000 }, + }, + "x-ai/grok-4.1-fast-non-reasoning": { + id: "x-ai/grok-4.1-fast-non-reasoning", + name: "Grok 4.1 Fast Non Reasoning", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-20", + last_updated: "2025-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 64000 }, + }, + "x-ai/grok-4": { + id: "x-ai/grok-4", + name: "Grok 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 64000 }, + }, + "x-ai/grok-4.1-fast": { + id: "x-ai/grok-4.1-fast", + name: "Grok 4.1 Fast", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-20", + last_updated: "2025-11-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 64000 }, + }, + "x-ai/grok-4.2-fast": { + id: "x-ai/grok-4.2-fast", + name: "Grok 4.2 Fast", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 9 }, + limit: { context: 2000000, output: 30000 }, + }, + "x-ai/grok-4.2-fast-non-reasoning": { + id: "x-ai/grok-4.2-fast-non-reasoning", + name: "Grok 4.2 Fast Non Reasoning", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 9 }, + limit: { context: 2000000, output: 30000 }, + }, + "openai/gpt-5.3-chat": { + id: "openai/gpt-5.3-chat", + name: "GPT-5.3 Chat", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 128000, output: 16380 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "GPT-5.2-Pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 21, output: 168 }, + limit: { context: 400000, output: 128000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "GPT-5.3 Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, output: 128000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2025-01-01", + release_date: "2025-12-11", + last_updated: "2025-12-11", + modalities: { input: ["image", "text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.17 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.4-mini": { + id: "openai/gpt-5.4-mini", + name: "GPT-5.4 Mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5 }, + limit: { context: 400000, output: 128000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.1-chat": { + id: "openai/gpt-5.1-chat", + name: "GPT-5.1 Chat", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["pdf", "image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12 }, + limit: { context: 128000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.4-nano": { + id: "openai/gpt-5.4-nano", + name: "GPT-5.4 Nano", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.25 }, + limit: { context: 400000, output: 128000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT-5.2-Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2025-01-01", + release_date: "2026-01-15", + last_updated: "2026-01-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.17 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "GPT-5.1-Codex-Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.03 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT-5.1", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["image", "text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.4-pro": { + id: "openai/gpt-5.4-pro", + name: "GPT-5.4 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 45, output: 225 }, + limit: { context: 1050000, output: 128000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "GPT-5 Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-09-23", + last_updated: "2025-09-23", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT-5.4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3.75, output: 18.75 }, + limit: { context: 1050000, output: 128000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT-5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT-5.1-Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12 }, + limit: { context: 400000, output: 64000 }, + provider: { npm: "@ai-sdk/openai", api: "https://zenmux.ai/api/v1" }, + }, + "z-ai/glm-4.7-flash-free": { + id: "z-ai/glm-4.7-flash-free", + name: "GLM 4.7 Flash (Free)", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 64000 }, + }, + "z-ai/glm-5v-turbo": { + id: "z-ai/glm-5v-turbo", + name: "GLM 5V Turbo", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.726, output: 3.1946, cache_read: 0.1743 }, + limit: { context: 200000, output: 128000 }, + }, + "z-ai/glm-4.7": { + id: "z-ai/glm-4.7", + name: "GLM 4.7", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 1.14, cache_read: 0.06 }, + limit: { context: 200000, output: 64000 }, + }, + "z-ai/glm-5": { + id: "z-ai/glm-5", + name: "GLM 5", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.58, output: 2.6, cache_read: 0.14 }, + limit: { context: 200000, output: 128000 }, + }, + "z-ai/glm-4.7-flashx": { + id: "z-ai/glm-4.7-flashx", + name: "GLM 4.7 FlashX", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.42, cache_read: 0.01 }, + limit: { context: 200000, output: 64000 }, + }, + "z-ai/glm-4.6v-flash-free": { + id: "z-ai/glm-4.6v-flash-free", + name: "GLM 4.6V Flash (Free)", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 64000 }, + }, + "z-ai/glm-5.1": { + id: "z-ai/glm-5.1", + name: "GLM-5.1", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-03", + last_updated: "2026-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8781, output: 3.5126, cache_read: 0.1903 }, + limit: { context: 200000, output: 131072 }, + }, + "z-ai/glm-4.6v-flash": { + id: "z-ai/glm-4.6v-flash", + name: "GLM 4.6V FlashX", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.02, output: 0.21, cache_read: 0.0043 }, + limit: { context: 200000, output: 64000 }, + }, + "z-ai/glm-4.5": { + id: "z-ai/glm-4.5", + name: "GLM 4.5", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-07-25", + last_updated: "2025-07-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 1.54, cache_read: 0.07 }, + limit: { context: 128000, output: 64000 }, + }, + "z-ai/glm-4.5-air": { + id: "z-ai/glm-4.5-air", + name: "GLM 4.5 Air", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-07-25", + last_updated: "2025-07-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.11, output: 0.56, cache_read: 0.02 }, + limit: { context: 128000, output: 64000 }, + }, + "z-ai/glm-5-turbo": { + id: "z-ai/glm-5-turbo", + name: "GLM 5 Turbo", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.88, output: 3.48 }, + limit: { context: 200000, output: 128000 }, + }, + "z-ai/glm-4.6": { + id: "z-ai/glm-4.6", + name: "GLM 4.6", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 1.54, cache_read: 0.07 }, + limit: { context: 200000, output: 64000 }, + }, + "z-ai/glm-4.6v": { + id: "z-ai/glm-4.6v", + name: "GLM 4.6V", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.42, cache_read: 0.03 }, + limit: { context: 200000, output: 64000 }, + }, + "volcengine/doubao-seed-2.0-code": { + id: "volcengine/doubao-seed-2.0-code", + name: "Doubao Seed 2.0 Code", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.9, output: 4.48 }, + limit: { context: 256000, output: 32000 }, + }, + "volcengine/doubao-seed-code": { + id: "volcengine/doubao-seed-code", + name: "Doubao-Seed-Code", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.17, output: 1.12, cache_read: 0.03 }, + limit: { context: 256000, output: 64000 }, + }, + "volcengine/doubao-seed-2.0-mini": { + id: "volcengine/doubao-seed-2.0-mini", + name: "Doubao-Seed-2.0-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.03, output: 0.28, cache_read: 0.01, cache_write: 0.0024 }, + limit: { context: 256000, output: 64000 }, + }, + "volcengine/doubao-seed-2.0-lite": { + id: "volcengine/doubao-seed-2.0-lite", + name: "Doubao-Seed-2.0-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.09, output: 0.51, cache_read: 0.02, cache_write: 0.0024 }, + limit: { context: 256000, output: 64000 }, + }, + "volcengine/doubao-seed-1.8": { + id: "volcengine/doubao-seed-1.8", + name: "Doubao-Seed-1.8", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-18", + last_updated: "2025-12-18", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.11, output: 0.28, cache_read: 0.02, cache_write: 0.0024 }, + limit: { context: 256000, output: 64000 }, + }, + "volcengine/doubao-seed-2.0-pro": { + id: "volcengine/doubao-seed-2.0-pro", + name: "Doubao-Seed-2.0-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.45, output: 2.24, cache_read: 0.09, cache_write: 0.0024 }, + limit: { context: 256000, output: 64000 }, + }, + "baidu/ernie-5.0-thinking-preview": { + id: "baidu/ernie-5.0-thinking-preview", + name: "ERNIE 5.0", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.84, output: 3.37 }, + limit: { context: 128000, output: 64000 }, + }, + "minimax/minimax-m2.7": { + id: "minimax/minimax-m2.7", + name: "MiniMax M2.7", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3055, output: 1.2219 }, + limit: { context: 204800, output: 131070 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "minimax/minimax-m2.7-highspeed": { + id: "minimax/minimax-m2.7-highspeed", + name: "MiniMax M2.7 highspeed", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.611, output: 2.4439 }, + limit: { context: 204800, output: 131070 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "minimax/minimax-m2": { + id: "minimax/minimax-m2", + name: "MiniMax M2", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.38 }, + limit: { context: 204000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "MiniMax M2.1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.38 }, + limit: { context: 204000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "minimax/minimax-m2.5-lightning": { + id: "minimax/minimax-m2.5-lightning", + name: "MiniMax M2.5 highspeed", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.6, output: 4.8, cache_read: 0.06, cache_write: 0.75 }, + limit: { context: 204800, output: 131072 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax M2.5", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "qwen/qwen3-coder-plus": { + id: "qwen/qwen3-coder-plus", + name: "Qwen3-Coder-Plus", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-07-23", + last_updated: "2025-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 1000000, output: 64000 }, + }, + "qwen/qwen3.5-flash": { + id: "qwen/qwen3.5-flash", + name: "Qwen3.5 Flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1020000, output: 1020000 }, + }, + "qwen/qwen3.6-plus": { + id: "qwen/qwen3.6-plus", + name: "Qwen3.6-Plus", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { + input: 0.5, + output: 3, + cache_read: 0.05, + cache_write: 0.625, + context_over_200k: { input: 2, output: 6, cache_read: 0.2, cache_write: 2.5 }, + }, + limit: { context: 1000000, output: 64000 }, + }, + "qwen/qwen3-max": { + id: "qwen/qwen3-max", + name: "Qwen3-Max-Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-01-23", + last_updated: "2026-01-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 6 }, + limit: { context: 256000, output: 64000 }, + }, + "qwen/qwen3.5-plus": { + id: "qwen/qwen3.5-plus", + name: "Qwen3.5 Plus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2026-03-20", + last_updated: "2026-03-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4.8 }, + limit: { context: 1000000, output: 64000 }, + }, + "google/gemini-3.1-flash-lite-preview": { + id: "google/gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-03-20", + last_updated: "2025-03-20", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5 }, + limit: { context: 1050000, output: 65530 }, + }, + "google/gemini-3.1-pro-preview": { + id: "google/gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2026-02-19", + release_date: "2026-02-19", + last_updated: "2026-02-19", + modalities: { input: ["text", "image", "pdf", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2, cache_write: 4.5 }, + limit: { context: 1048000, output: 64000 }, + }, + "google/gemini-3-flash-preview": { + id: "google/gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text", "image", "pdf", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.05, cache_write: 1 }, + limit: { context: 1048000, output: 64000 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini 2.5 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["pdf", "image", "text", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31, cache_write: 4.5 }, + limit: { context: 1048000, output: 64000 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini 2.5 Flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["pdf", "image", "text", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.07, cache_write: 1 }, + limit: { context: 1048000, output: 64000 }, + }, + "google/gemini-2.5-flash-lite": { + id: "google/gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-07-22", + last_updated: "2025-07-22", + modalities: { input: ["pdf", "image", "text", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.03, cache_write: 1 }, + limit: { context: 1048000, output: 64000 }, + }, + "sapiens-ai/agnes-1.5-lite": { + id: "sapiens-ai/agnes-1.5-lite", + name: "Agnes 1.5 Lite", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-26", + last_updated: "2026-03-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 0.6 }, + limit: { context: 256000, output: 256000 }, + }, + "sapiens-ai/agnes-1.5-pro": { + id: "sapiens-ai/agnes-1.5-pro", + name: "Agnes 1.5 Pro", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-21", + last_updated: "2026-03-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.16, output: 0.8 }, + limit: { context: 256000, output: 256000 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: false, + knowledge: "2025-01-01", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.58, output: 3.02, cache_read: 0.1 }, + limit: { context: 262000, output: 64000 }, + }, + "moonshotai/kimi-k2-thinking-turbo": { + id: "moonshotai/kimi-k2-thinking-turbo", + name: "Kimi K2 Thinking Turbo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.15, output: 8, cache_read: 0.15 }, + limit: { context: 262000, output: 64000 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "Kimi K2 0905", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-09-04", + last_updated: "2025-09-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262000, output: 64000 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "Kimi K2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: false, + knowledge: "2025-01-01", + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262140, output: 262140 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262000, output: 64000 }, + }, + "anthropic/claude-opus-4.1": { + id: "anthropic/claude-opus-4.1", + name: "Claude Opus 4.1", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["image", "text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-3.7-sonnet": { + id: "anthropic/claude-3.7-sonnet", + name: "Claude 3.7 Sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-opus-4.6": { + id: "anthropic/claude-opus-4.6", + name: "Claude Opus 4.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-06", + last_updated: "2026-02-06", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-opus-4.7": { + id: "anthropic/claude-opus-4.7", + name: "Claude Opus 4.7", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude Sonnet 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["image", "text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-sonnet-4.5": { + id: "anthropic/claude-sonnet-4.5", + name: "Claude Sonnet 4.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-opus-4.5": { + id: "anthropic/claude-opus-4.5", + name: "Claude Opus 4.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-11-24", + last_updated: "2025-11-24", + modalities: { input: ["pdf", "image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Claude Opus 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["image", "text", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-3.5-haiku": { + id: "anthropic/claude-3.5-haiku", + name: "Claude 3.5 Haiku", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2024-11-04", + last_updated: "2024-11-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-haiku-4.5": { + id: "anthropic/claude-haiku-4.5", + name: "Claude Haiku 4.5", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01-01", + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "anthropic/claude-sonnet-4.6": { + id: "anthropic/claude-sonnet-4.6", + name: "Claude Sonnet 4.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-18", + last_updated: "2026-02-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic", api: "https://zenmux.ai/api/anthropic/v1" }, + }, + "deepseek/deepseek-v4-flash": { + id: "deepseek/deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek/deepseek-v4-pro": { + id: "deepseek/deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1000000, output: 384000 }, + }, + "tencent/hy3-preview": { + id: "tencent/hy3-preview", + name: "Hy3 preview", + family: "Hy", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.172, output: 0.572, cache_read: 0.058, cache_write: 0 }, + limit: { context: 256000, output: 64000 }, + }, + "openai/gpt-5.5": { + id: "openai/gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + 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" } }, + }, + }, + }, + }, + "openai/gpt-5.5-pro": { + id: "openai/gpt-5.5-pro", + name: "GPT-5.5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "xiaomi/mimo-v2.5-pro": { + id: "xiaomi/mimo-v2.5-pro", + name: "MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-omni": { + id: "xiaomi/mimo-v2-omni", + name: "MiMo V2 Omni", + family: "mimo", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2, cache_read: 0.08 }, + limit: { context: 265000, output: 265000 }, + }, + "xiaomi/mimo-v2.5": { + id: "xiaomi/mimo-v2.5", + name: "MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.4, + output: 2, + cache_read: 0.08, + context_over_200k: { input: 0.8, output: 4, cache_read: 0.16 }, + }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-pro": { + id: "xiaomi/mimo-v2-pro", + name: "MiMo V2 Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1000000, output: 256000 }, + }, + "xiaomi/mimo-v2-flash": { + id: "xiaomi/mimo-v2-flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.3, cache_read: 0.01 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + 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-pro2": { + id: "solar-pro2", + name: "solar-pro2", + family: "solar-pro", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.25, output: 0.25 }, + limit: { context: 65536, output: 8192 }, + }, + "solar-mini": { + id: "solar-mini", + name: "solar-mini", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 32768, output: 4096 }, + }, + "solar-pro3": { + id: "solar-pro3", + name: "solar-pro3", + family: "solar-pro", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.25 }, + limit: { context: 131072, output: 8192 }, + }, + }, + }, + "novita-ai": { + id: "novita-ai", + env: ["NOVITA_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.novita.ai/openai", + name: "NovitaAI", + doc: "https://novita.ai/docs/guides/introduction", + models: { + "deepseek/deepseek-r1-turbo": { + id: "deepseek/deepseek-r1-turbo", + name: "DeepSeek R1 (Turbo)\t", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-03-05", + last_updated: "2025-03-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.5 }, + limit: { context: 64000, output: 16000 }, + }, + "deepseek/deepseek-v3-0324": { + id: "deepseek/deepseek-v3-0324", + name: "DeepSeek V3 0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1.12, cache_read: 0.135 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek/deepseek-ocr-2": { + id: "deepseek/deepseek-ocr-2", + name: "deepseek/deepseek-ocr-2", + attachment: true, + reasoning: false, + tool_call: false, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.03 }, + limit: { context: 8192, output: 8192 }, + }, + "deepseek/deepseek-ocr": { + id: "deepseek/deepseek-ocr", + name: "DeepSeek-OCR", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-10-24", + last_updated: "2025-10-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.03 }, + limit: { context: 8192, output: 8192 }, + }, + "deepseek/deepseek-r1-distill-llama-70b": { + id: "deepseek/deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill LLama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-01-27", + last_updated: "2025-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 0.8 }, + limit: { context: 8192, output: 8192 }, + }, + "deepseek/deepseek-prover-v2-671b": { + id: "deepseek/deepseek-prover-v2-671b", + name: "Deepseek Prover V2 671B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-30", + last_updated: "2025-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.5 }, + limit: { context: 160000, output: 160000 }, + }, + "deepseek/deepseek-r1-0528-qwen3-8b": { + id: "deepseek/deepseek-r1-0528-qwen3-8b", + name: "DeepSeek R1 0528 Qwen3 8B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-05-29", + last_updated: "2025-05-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.09 }, + limit: { context: 128000, output: 32000 }, + }, + "deepseek/deepseek-r1-distill-qwen-32b": { + id: "deepseek/deepseek-r1-distill-qwen-32b", + name: "DeepSeek R1 Distill Qwen 32B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 64000, output: 32000 }, + }, + "deepseek/deepseek-v3.2-exp": { + id: "deepseek/deepseek-v3.2-exp", + name: "Deepseek V3.2 Exp", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.27, output: 0.41 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-v3.1": { + id: "deepseek/deepseek-v3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 1, cache_read: 0.135 }, + limit: { context: 131072, output: 32768 }, + }, + "deepseek/deepseek-v3.2": { + id: "deepseek/deepseek-v3.2", + name: "Deepseek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.269, output: 0.4, cache_read: 0.1345 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-v3-turbo": { + id: "deepseek/deepseek-v3-turbo", + name: "DeepSeek V3 (Turbo)\t", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-03-05", + last_updated: "2025-03-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.3 }, + limit: { context: 64000, output: 16000 }, + }, + "deepseek/deepseek-r1-distill-qwen-14b": { + id: "deepseek/deepseek-r1-distill-qwen-14b", + name: "DeepSeek R1 Distill Qwen 14B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 32768, output: 16384 }, + }, + "deepseek/deepseek-r1-0528": { + id: "deepseek/deepseek-r1-0528", + name: "DeepSeek R1 0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + 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, + cost: { input: 0.7, output: 2.5, cache_read: 0.35 }, + limit: { context: 163840, output: 32768 }, + }, + "deepseek/deepseek-v3.1-terminus": { + id: "deepseek/deepseek-v3.1-terminus", + name: "Deepseek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.27, output: 1, cache_read: 0.135 }, + limit: { context: 131072, output: 32768 }, + }, + "inclusionai/ling-2.6-1t": { + id: "inclusionai/ling-2.6-1t", + name: "Ling-2.6-1T", + family: "ling", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-23", + last_updated: "2026-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "paddlepaddle/paddleocr-vl": { + id: "paddlepaddle/paddleocr-vl", + name: "PaddleOCR-VL", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-10-22", + last_updated: "2025-10-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.02 }, + limit: { context: 16384, output: 16384 }, + }, + "nousresearch/hermes-2-pro-llama-3-8b": { + id: "nousresearch/hermes-2-pro-llama-3-8b", + name: "Hermes 2 Pro Llama 3 8B", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-06-27", + last_updated: "2024-06-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.14 }, + limit: { context: 8192, output: 8192 }, + }, + "zai-org/glm-4.7": { + id: "zai-org/glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2, cache_read: 0.11 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/glm-5": { + id: "zai-org/glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 202800, output: 131072 }, + }, + "zai-org/glm-5.1": { + id: "zai-org/glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/glm-4.5": { + id: "zai-org/glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2, cache_read: 0.11 }, + limit: { context: 131072, output: 98304 }, + }, + "zai-org/glm-4.5-air": { + id: "zai-org/glm-4.5-air", + name: "GLM 4.5 Air", + family: "glm-air", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-10-13", + last_updated: "2025-10-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.85 }, + limit: { context: 131072, output: 98304 }, + }, + "zai-org/glm-4.5v": { + id: "zai-org/glm-4.5v", + name: "GLM 4.5V", + family: "glmv", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-08-11", + last_updated: "2025-08-11", + modalities: { input: ["text", "video", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.8, cache_read: 0.11 }, + limit: { context: 65536, output: 16384 }, + }, + "zai-org/glm-4.6": { + id: "zai-org/glm-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.2, cache_read: 0.11 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/glm-4.6v": { + id: "zai-org/glm-4.6v", + name: "GLM 4.6V", + family: "glmv", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text", "video", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9, cache_read: 0.055 }, + limit: { context: 131072, output: 32768 }, + }, + "zai-org/glm-4.7-flash": { + id: "zai-org/glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.4, cache_read: 0.01 }, + limit: { context: 200000, output: 128000 }, + }, + "zai-org/autoglm-phone-9b-multilingual": { + id: "zai-org/autoglm-phone-9b-multilingual", + name: "AutoGLM-Phone-9B-Multilingual", + 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, + cost: { input: 0.035, output: 0.138 }, + limit: { context: 65536, output: 65536 }, + }, + "mistralai/mistral-nemo": { + id: "mistralai/mistral-nemo", + name: "Mistral Nemo", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-07-30", + last_updated: "2024-07-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.17 }, + limit: { context: 60288, output: 16000 }, + }, + "baichuan/baichuan-m2-32b": { + id: "baichuan/baichuan-m2-32b", + name: "baichuan-m2-32b", + family: "baichuan", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + knowledge: "2024-12", + release_date: "2025-08-13", + last_updated: "2025-08-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.07 }, + limit: { context: 131072, output: 131072 }, + }, + "meta-llama/llama-4-scout-17b-16e-instruct": { + id: "meta-llama/llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout Instruct", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-06", + last_updated: "2025-04-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.18, output: 0.59 }, + limit: { context: 131072, output: 131072 }, + }, + "meta-llama/llama-3.3-70b-instruct": { + id: "meta-llama/llama-3.3-70b-instruct", + name: "Llama 3.3 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-12-07", + last_updated: "2024-12-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.135, output: 0.4 }, + limit: { context: 131072, output: 120000 }, + }, + "meta-llama/llama-3.2-3b-instruct": { + id: "meta-llama/llama-3.2-3b-instruct", + name: "Llama 3.2 3B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.05 }, + limit: { context: 32768, output: 32000 }, + }, + "meta-llama/llama-3-8b-instruct": { + id: "meta-llama/llama-3-8b-instruct", + name: "Llama 3 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-04-25", + last_updated: "2024-04-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 8192, output: 8192 }, + }, + "meta-llama/llama-3.1-8b-instruct": { + id: "meta-llama/llama-3.1-8b-instruct", + name: "Llama 3.1 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-07-24", + last_updated: "2024-07-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.05 }, + limit: { context: 16384, output: 16384 }, + }, + "meta-llama/llama-3-70b-instruct": { + id: "meta-llama/llama-3-70b-instruct", + name: "Llama3 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-04-25", + last_updated: "2024-04-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.51, output: 0.74 }, + limit: { context: 8192, output: 8000 }, + }, + "meta-llama/llama-4-maverick-17b-128e-instruct-fp8": { + id: "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", + name: "Llama 4 Maverick Instruct", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-06", + last_updated: "2025-04-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.85 }, + limit: { context: 1048576, output: 8192 }, + }, + "gryphe/mythomax-l2-13b": { + id: "gryphe/mythomax-l2-13b", + name: "Mythomax L2 13B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-04-25", + last_updated: "2024-04-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.09 }, + limit: { context: 4096, output: 3200 }, + }, + "sao10k/l31-70b-euryale-v2.2": { + id: "sao10k/l31-70b-euryale-v2.2", + name: "L31 70B Euryale V2.2", + 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, + cost: { input: 1.48, output: 1.48 }, + limit: { context: 8192, output: 8192 }, + }, + "sao10k/l3-70b-euryale-v2.1": { + id: "sao10k/l3-70b-euryale-v2.1", + name: "L3 70B Euryale V2.1\t", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-06-18", + last_updated: "2024-06-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.48, output: 1.48 }, + limit: { context: 8192, output: 8192 }, + }, + "sao10k/L3-8B-Stheno-v3.2": { + id: "sao10k/L3-8B-Stheno-v3.2", + name: "L3 8B Stheno V3.2", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-29", + last_updated: "2024-11-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.05 }, + limit: { context: 8192, output: 32000 }, + }, + "sao10k/l3-8b-lunaris": { + id: "sao10k/l3-8b-lunaris", + name: "Sao10k L3 8B Lunaris\t", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-11-28", + last_updated: "2024-11-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.05 }, + limit: { context: 8192, output: 8192 }, + }, + "microsoft/wizardlm-2-8x22b": { + id: "microsoft/wizardlm-2-8x22b", + name: "Wizardlm 2 8x22B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-04-24", + last_updated: "2024-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.62, output: 0.62 }, + limit: { context: 65535, output: 8000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "OpenAI: GPT OSS 20B", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.15 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "OpenAI GPT OSS 120B", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.25 }, + limit: { context: 131072, output: 32768 }, + }, + "minimaxai/minimax-m1-80k": { + id: "minimaxai/minimax-m1-80k", + name: "MiniMax M1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.2 }, + limit: { context: 1000000, output: 40000 }, + }, + "xiaomimimo/mimo-v2-flash": { + id: "xiaomimimo/mimo-v2-flash", + name: "XiaomiMiMo/MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-19", + last_updated: "2025-12-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.3 }, + limit: { context: 262144, output: 32000 }, + }, + "baidu/ernie-4.5-vl-28b-a3b-thinking": { + id: "baidu/ernie-4.5-vl-28b-a3b-thinking", + name: "ERNIE-4.5-VL-28B-A3B-Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-11-26", + last_updated: "2025-11-26", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.39, output: 0.39 }, + limit: { context: 131072, output: 65536 }, + }, + "baidu/ernie-4.5-vl-424b-a47b": { + id: "baidu/ernie-4.5-vl-424b-a47b", + name: "ERNIE 4.5 VL 424B A47B", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.42, output: 1.25 }, + limit: { context: 123000, output: 16000 }, + }, + "baidu/ernie-4.5-21B-a3b": { + id: "baidu/ernie-4.5-21B-a3b", + name: "ERNIE 4.5 21B A3B", + family: "ernie", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 120000, output: 8000 }, + }, + "baidu/ernie-4.5-300b-a47b-paddle": { + id: "baidu/ernie-4.5-300b-a47b-paddle", + name: "ERNIE 4.5 300B A47B", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 1.1 }, + limit: { context: 123000, output: 12000 }, + }, + "baidu/ernie-4.5-21B-a3b-thinking": { + id: "baidu/ernie-4.5-21B-a3b-thinking", + name: "ERNIE-4.5-21B-A3B-Thinking", + family: "ernie", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-03", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 131072, output: 65536 }, + }, + "baidu/ernie-4.5-vl-28b-a3b": { + id: "baidu/ernie-4.5-vl-28b-a3b", + name: "ERNIE 4.5 VL 28B A3B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 5.6 }, + limit: { context: 30000, output: 8000 }, + }, + "minimax/minimax-m2.7": { + id: "minimax/minimax-m2.7", + name: "MiniMax M2.7", + family: "minimax-m2.7", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2": { + id: "minimax/minimax-m2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "Minimax M2.1", + family: "minimax", + attachment: false, + reasoning: false, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 204800, output: 131100 }, + }, + "minimax/minimax-m2.5-highspeed": { + id: "minimax/minimax-m2.5-highspeed", + name: "MiniMax M2.5 Highspeed", + family: "minimax-m2.5", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.4, cache_read: 0.03 }, + limit: { context: 204800, output: 131100 }, + }, + "qwen/qwen2.5-7b-instruct": { + id: "qwen/qwen2.5-7b-instruct", + name: "Qwen2.5 7B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.07 }, + limit: { context: 32000, output: 32000 }, + }, + "qwen/qwen3.5-122b-a10b": { + id: "qwen/qwen3.5-122b-a10b", + name: "Qwen3.5-122B-A10B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 3.2 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3.6-27b": { + id: "qwen/qwen3.6-27b", + name: "Qwen3.6-27B", + family: "qwen3.6", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3.5-27b": { + id: "qwen/qwen3.5-27b", + name: "Qwen3.5-27B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.4 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-235b-a22b-instruct-2507": { + id: "qwen/qwen3-235b-a22b-instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + 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, + cost: { input: 0.09, output: 0.58 }, + limit: { context: 131072, output: 16384 }, + }, + "qwen/qwen3-omni-30b-a3b-instruct": { + id: "qwen/qwen3-omni-30b-a3b-instruct", + name: "Qwen3 Omni 30B A3B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text", "video", "audio", "image"], output: ["text", "audio"] }, + open_weights: true, + cost: { input: 0.25, output: 0.97, input_audio: 2.2, output_audio: 1.788 }, + limit: { context: 65536, output: 16384 }, + }, + "qwen/qwen3.5-397b-a17b": { + id: "qwen/qwen3.5-397b-a17b", + name: "Qwen3.5-397B-A17B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 64000 }, + }, + "qwen/qwen2.5-vl-72b-instruct": { + id: "qwen/qwen2.5-vl-72b-instruct", + name: "Qwen2.5 VL 72B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 0.8 }, + limit: { context: 32768, output: 32768 }, + }, + "qwen/qwen3-vl-235b-a22b-thinking": { + id: "qwen/qwen3-vl-235b-a22b-thinking", + name: "Qwen3 VL 235B A22B Thinking", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.98, output: 3.95 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-vl-30b-a3b-thinking": { + id: "qwen/qwen3-vl-30b-a3b-thinking", + name: "qwen/qwen3-vl-30b-a3b-thinking", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-11", + last_updated: "2025-10-11", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-omni-30b-a3b-thinking": { + id: "qwen/qwen3-omni-30b-a3b-thinking", + name: "Qwen3 Omni 30B A3B Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text", "audio", "video", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.97, input_audio: 2.2, output_audio: 1.788 }, + limit: { context: 65536, output: 16384 }, + }, + "qwen/qwen3-vl-8b-instruct": { + id: "qwen/qwen3-vl-8b-instruct", + name: "qwen/qwen3-vl-8b-instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-17", + last_updated: "2025-10-17", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.5 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-max": { + id: "qwen/qwen3-max", + name: "Qwen3 Max", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.11, output: 8.45 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-32b-fp8": { + id: "qwen/qwen3-32b-fp8", + name: "Qwen3 32B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.45 }, + limit: { context: 40960, output: 20000 }, + }, + "qwen/qwen3-4b-fp8": { + id: "qwen/qwen3-4b-fp8", + name: "Qwen3 4B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.03 }, + limit: { context: 128000, output: 20000 }, + }, + "qwen/qwen3-235b-a22b-thinking-2507": { + id: "qwen/qwen3-235b-a22b-thinking-2507", + name: "Qwen3 235B A22b Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 3 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-next-80b-a3b-thinking": { + id: "qwen/qwen3-next-80b-a3b-thinking", + name: "Qwen3 Next 80B A3B Thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-10", + last_updated: "2025-09-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.5 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen-mt-plus": { + id: "qwen/qwen-mt-plus", + name: "Qwen MT Plus", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-09-03", + last_updated: "2025-09-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.75 }, + limit: { context: 16384, output: 8192 }, + }, + "qwen/qwen3-next-80b-a3b-instruct": { + id: "qwen/qwen3-next-80b-a3b-instruct", + name: "Qwen3 Next 80B A3B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-10", + last_updated: "2025-09-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.5 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-30b-a3b-fp8": { + id: "qwen/qwen3-30b-a3b-fp8", + name: "Qwen3 30B A3B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.45 }, + limit: { context: 40960, output: 20000 }, + }, + "qwen/qwen3-coder-next": { + id: "qwen/qwen3-coder-next", + name: "Qwen3 Coder Next", + 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, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-coder-480b-a35b-instruct": { + id: "qwen/qwen3-coder-480b-a35b-instruct", + name: "Qwen3 Coder 480B A35B Instruct", + 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: true, + cost: { input: 0.3, output: 1.3 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-vl-30b-a3b-instruct": { + id: "qwen/qwen3-vl-30b-a3b-instruct", + name: "qwen/qwen3-vl-30b-a3b-instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-11", + last_updated: "2025-10-11", + modalities: { input: ["text", "video", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.7 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-coder-30b-a3b-instruct": { + id: "qwen/qwen3-coder-30b-a3b-instruct", + name: "Qwen3 Coder 30b A3B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-09", + last_updated: "2025-10-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.27 }, + limit: { context: 160000, output: 32768 }, + }, + "qwen/qwen3-235b-a22b-fp8": { + id: "qwen/qwen3-235b-a22b-fp8", + name: "Qwen3 235B A22B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 40960, output: 20000 }, + }, + "qwen/qwen3-8b-fp8": { + id: "qwen/qwen3-8b-fp8", + name: "Qwen3 8B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.035, output: 0.138 }, + limit: { context: 128000, output: 20000 }, + }, + "qwen/qwen3-vl-235b-a22b-instruct": { + id: "qwen/qwen3-vl-235b-a22b-instruct", + name: "Qwen3 VL 235B A22B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen-2.5-72b-instruct": { + id: "qwen/qwen-2.5-72b-instruct", + name: "Qwen 2.5 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-10-15", + last_updated: "2024-10-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.38, output: 0.4 }, + limit: { context: 32000, output: 8192 }, + }, + "qwen/qwen3.5-35b-a3b": { + id: "qwen/qwen3.5-35b-a3b", + name: "Qwen3.5-35B-A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 2 }, + limit: { context: 262144, output: 65536 }, + }, + "kwaipilot/kat-coder-pro": { + id: "kwaipilot/kat-coder-pro", + name: "Kat Coder Pro", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-05", + last_updated: "2026-01-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 256000, output: 128000 }, + }, + "google/gemma-4-31b-it": { + id: "google/gemma-4-31b-it", + name: "Gemma 4 31B", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.4 }, + limit: { context: 262144, output: 131072 }, + }, + "google/gemma-3-12b-it": { + id: "google/gemma-3-12b-it", + name: "Gemma 3 12B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "google/gemma-3-27b-it": { + id: "google/gemma-3-27b-it", + name: "Gemma 3 27B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-25", + last_updated: "2025-03-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.119, output: 0.2 }, + limit: { context: 98304, output: 16384 }, + }, + "google/gemma-4-26b-a4b-it": { + id: "google/gemma-4-26b-a4b-it", + name: "Gemma 4 26B A4B", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.4 }, + limit: { context: 262144, output: 131072 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-instruct": { + id: "moonshotai/kimi-k2-instruct", + name: "Kimi K2 Instruct", + 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, + cost: { input: 0.57, output: 2.3 }, + limit: { context: 131072, output: 131072 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "Kimi K2 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-11-07", + last_updated: "2025-11-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek/deepseek-v4-flash": { + id: "deepseek/deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1048576, output: 393216 }, + }, + "deepseek/deepseek-v4-pro": { + id: "deepseek/deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.69, output: 3.38, cache_read: 0.13 }, + limit: { context: 1048576, output: 393216 }, + }, + }, + }, + "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-tts": { + id: "mimo-v2-tts", + name: "MiMo-V2-TTS", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 16384 }, + }, + "mimo-v2.5-pro": { + id: "mimo-v2.5-pro", + name: "MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 0, output: 0, cache_read: 0 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-omni": { + id: "mimo-v2-omni", + name: "MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + 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", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 131072 }, + }, + "mimo-v2.5": { + id: "mimo-v2.5", + name: "MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 0, output: 0, cache_read: 0 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-pro": { + id: "mimo-v2-pro", + name: "MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-flash": { + id: "mimo-v2-flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + wandb: { + id: "wandb", + env: ["WANDB_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.inference.wandb.ai/v1", + name: "Weights & Biases", + doc: "https://docs.wandb.ai/guides/integrations/inference/", + models: { + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen3 30B A3B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-29", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04-28", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen3-235B-A22B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-25", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + name: "Qwen3-Coder-480B-A35B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-23", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 1.5 }, + limit: { context: 262144, output: 262144 }, + }, + "zai-org/GLM-5-FP8": { + id: "zai-org/GLM-5-FP8", + name: "GLM 5", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2 }, + limit: { context: 200000, output: 200000 }, + }, + "meta-llama/Llama-4-Scout-17B-16E-Instruct": { + id: "meta-llama/Llama-4-Scout-17B-16E-Instruct", + name: "Llama 4 Scout 17B 16E Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-31", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.66 }, + limit: { context: 64000, output: 64000 }, + }, + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-12-06", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.71, output: 0.71 }, + limit: { context: 128000, output: 128000 }, + }, + "meta-llama/Llama-3.1-8B-Instruct": { + id: "meta-llama/Llama-3.1-8B-Instruct", + name: "Meta-Llama-3.1-8B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-07-23", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.22 }, + limit: { context: 128000, output: 128000 }, + }, + "meta-llama/Llama-3.1-70B-Instruct": { + id: "meta-llama/Llama-3.1-70B-Instruct", + name: "Llama 3.1 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-23", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 0.8 }, + limit: { context: 128000, output: 128000 }, + }, + "OpenPipe/Qwen3-14B-Instruct": { + id: "OpenPipe/Qwen3-14B-Instruct", + name: "OpenPipe Qwen3 14B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-29", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.22 }, + limit: { context: 32768, output: 32768 }, + }, + "microsoft/Phi-4-mini-instruct": { + id: "microsoft/Phi-4-mini-instruct", + name: "Phi-4-mini-instruct", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-12-11", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.35 }, + limit: { context: 128000, output: 128000 }, + }, + "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8": { + id: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8", + name: "NVIDIA Nemotron 3 Super 120B", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek-ai/DeepSeek-V3.1": { + id: "deepseek-ai/DeepSeek-V3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-21", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 1.65 }, + limit: { context: 161000, output: 161000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "gpt-oss-20b", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.2 }, + limit: { context: 131072, output: 131072 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "gpt-oss-120b", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 131072 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2.85 }, + limit: { context: 262144, output: 262144 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 196608, output: 196608 }, + }, + "zai-org/GLM-5.1": { + id: "zai-org/GLM-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.4, output: 4.4, cache_read: 0.26, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + }, + }, + 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: { + "miromind-ai/MiroThinker-v1.5-235B": { + id: "miromind-ai/MiroThinker-v1.5-235B", + name: "MiroThinker V1.5 235B", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2026-01-10", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.15 }, + limit: { context: 262144, output: 8192 }, + }, + "OpenGVLab/InternVL3-78B-TEE": { + id: "OpenGVLab/InternVL3-78B-TEE", + name: "InternVL3 78B TEE", + family: "opengvlab", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-01-06", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.39 }, + limit: { context: 32768, output: 32768 }, + }, + "NousResearch/DeepHermes-3-Mistral-24B-Preview": { + id: "NousResearch/DeepHermes-3-Mistral-24B-Preview", + name: "DeepHermes 3 Mistral 24B Preview", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.1 }, + limit: { context: 32768, output: 32768 }, + }, + "NousResearch/Hermes-4-405B-FP8-TEE": { + id: "NousResearch/Hermes-4-405B-FP8-TEE", + name: "Hermes 4 405B FP8 TEE", + family: "nousresearch", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 131072, output: 65536 }, + }, + "NousResearch/Hermes-4.3-36B": { + id: "NousResearch/Hermes-4.3-36B", + name: "Hermes 4.3 36B", + family: "nousresearch", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.39 }, + limit: { context: 32768, output: 8192 }, + }, + "NousResearch/Hermes-4-14B": { + id: "NousResearch/Hermes-4-14B", + name: "Hermes 4 14B", + family: "nousresearch", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0.05 }, + limit: { context: 40960, output: 40960 }, + }, + "NousResearch/Hermes-4-70B": { + id: "NousResearch/Hermes-4-70B", + name: "Hermes 4 70B", + family: "nousresearch", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11, output: 0.38 }, + limit: { context: 131072, output: 131072 }, + }, + "Qwen/Qwen3-30B-A3B": { + id: "Qwen/Qwen3-30B-A3B", + name: "Qwen3 30B A3B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.22 }, + limit: { context: 40960, output: 40960 }, + }, + "Qwen/Qwen3-Coder-Next": { + id: "Qwen/Qwen3-Coder-Next", + name: "Qwen3 Coder Next", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.3 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen2.5-Coder-32B-Instruct": { + id: "Qwen/Qwen2.5-Coder-32B-Instruct", + name: "Qwen2.5 Coder 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.11 }, + limit: { context: 32768, output: 32768 }, + }, + "Qwen/Qwen3-235B-A22B": { + id: "Qwen/Qwen3-235B-A22B", + name: "Qwen3 235B A22B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 40960, output: 40960 }, + }, + "Qwen/Qwen2.5-VL-72B-Instruct-TEE": { + id: "Qwen/Qwen2.5-VL-72B-Instruct-TEE", + name: "Qwen2.5 VL 72B Instruct TEE", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 32768, output: 32768 }, + }, + "Qwen/Qwen3Guard-Gen-0.6B": { + id: "Qwen/Qwen3Guard-Gen-0.6B", + name: "Qwen3Guard Gen 0.6B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0.01, cache_read: 0.005 }, + limit: { context: 32768, output: 8192 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + id: "Qwen/Qwen3-Next-80B-A3B-Instruct", + name: "Qwen3 Next 80B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.8 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen3 30B A3B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.33 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-32B": { + id: "Qwen/Qwen3-32B", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.24, cache_read: 0.04 }, + limit: { context: 40960, output: 40960 }, + }, + "Qwen/Qwen3-14B": { + id: "Qwen/Qwen3-14B", + name: "Qwen3 14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.22 }, + limit: { context: 40960, output: 40960 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507-TEE": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507-TEE", + name: "Qwen3 235B A22B Instruct 2507 TEE", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.55, cache_read: 0.04 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen3 235B A22B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11, output: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen2.5-VL-32B-Instruct": { + id: "Qwen/Qwen2.5-VL-32B-Instruct", + name: "Qwen2.5 VL 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.22 }, + limit: { context: 16384, output: 16384 }, + }, + "Qwen/Qwen3.5-397B-A17B-TEE": { + id: "Qwen/Qwen3.5-397B-A17B-TEE", + name: "Qwen3.5 397B A17B TEE", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-18", + last_updated: "2026-02-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.39, output: 2.34, cache_read: 0.195 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8-TEE": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8-TEE", + name: "Qwen3 Coder 480B A35B Instruct FP8 TEE", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.95, cache_read: 0.11 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-VL-235B-A22B-Instruct": { + id: "Qwen/Qwen3-VL-235B-A22B-Instruct", + name: "Qwen3 VL 235B A22B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen2.5-72B-Instruct": { + id: "Qwen/Qwen2.5-72B-Instruct", + name: "Qwen2.5 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 32768, output: 32768 }, + }, + "zai-org/GLM-5.1-TEE": { + id: "zai-org/GLM-5.1-TEE", + name: "GLM 5.1 TEE", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 3.15, cache_read: 0.475 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-4.7-Flash": { + id: "zai-org/GLM-4.7-Flash", + name: "GLM 4.7 Flash", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.35 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-4.5-TEE": { + id: "zai-org/GLM-4.5-TEE", + name: "GLM 4.5 TEE", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.55 }, + limit: { context: 131072, output: 65536 }, + }, + "zai-org/GLM-4.6-FP8": { + id: "zai-org/GLM-4.6-FP8", + name: "GLM 4.6 FP8", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-4.5-Air": { + id: "zai-org/GLM-4.5-Air", + name: "GLM 4.5 Air", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.22 }, + limit: { context: 131072, output: 131072 }, + }, + "zai-org/GLM-4.7-FP8": { + id: "zai-org/GLM-4.7-FP8", + name: "GLM 4.7 FP8", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-5-TEE": { + id: "zai-org/GLM-5-TEE", + name: "GLM 5 TEE", + family: "glm", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 3.15, cache_read: 0.475 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-4.5-FP8": { + id: "zai-org/GLM-4.5-FP8", + name: "GLM 4.5 FP8", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 131072, output: 65536 }, + }, + "zai-org/GLM-4.7-TEE": { + id: "zai-org/GLM-4.7-TEE", + name: "GLM 4.7 TEE", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.5 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-4.6V": { + id: "zai-org/GLM-4.6V", + name: "GLM 4.6V", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9, cache_read: 0.15 }, + limit: { context: 131072, output: 65536 }, + }, + "zai-org/GLM-5-Turbo": { + id: "zai-org/GLM-5-Turbo", + name: "GLM 5 Turbo", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.49, output: 1.96, cache_read: 0.245 }, + limit: { context: 202752, output: 65535 }, + }, + "zai-org/GLM-4.6-TEE": { + id: "zai-org/GLM-4.6-TEE", + name: "GLM 4.6 TEE", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.7, cache_read: 0.2 }, + limit: { context: 202752, output: 65536 }, + }, + "mistralai/Devstral-2-123B-Instruct-2512-TEE": { + id: "mistralai/Devstral-2-123B-Instruct-2512-TEE", + name: "Devstral 2 123B Instruct 2512 TEE", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-10", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.22 }, + limit: { context: 262144, output: 65536 }, + }, + "XiaomiMiMo/MiMo-V2-Flash": { + id: "XiaomiMiMo/MiMo-V2-Flash", + name: "MiMo V2 Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.29 }, + limit: { context: 262144, output: 32000 }, + }, + "chutesai/Mistral-Small-3.2-24B-Instruct-2506": { + id: "chutesai/Mistral-Small-3.2-24B-Instruct-2506", + name: "Mistral Small 3.2 24B Instruct 2506", + family: "chutesai", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.18 }, + limit: { context: 131072, output: 131072 }, + }, + "chutesai/Mistral-Small-3.1-24B-Instruct-2503": { + id: "chutesai/Mistral-Small-3.1-24B-Instruct-2503", + name: "Mistral Small 3.1 24B Instruct 2503", + family: "chutesai", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.11, cache_read: 0.015 }, + limit: { context: 131072, output: 131072 }, + }, + "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16": { + id: "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16", + name: "NVIDIA Nemotron 3 Nano 30B A3B BF16", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.24 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek-ai/DeepSeek-R1-TEE": { + id: "deepseek-ai/DeepSeek-R1-TEE", + name: "DeepSeek R1 TEE", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek-ai/DeepSeek-V3": { + id: "deepseek-ai/DeepSeek-V3", + name: "DeepSeek V3", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": { + id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.11 }, + limit: { context: 131072, output: 131072 }, + }, + "deepseek-ai/DeepSeek-V3.1-TEE": { + id: "deepseek-ai/DeepSeek-V3.1-TEE", + name: "DeepSeek V3.1 TEE", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek-ai/DeepSeek-V3-0324-TEE": { + id: "deepseek-ai/DeepSeek-V3-0324-TEE", + name: "DeepSeek V3 0324 TEE", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.19, output: 0.87, cache_read: 0.095 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek-ai/DeepSeek-V3.2-Speciale-TEE": { + id: "deepseek-ai/DeepSeek-V3.2-Speciale-TEE", + name: "DeepSeek V3.2 Speciale TEE", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: false, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.41 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek-ai/DeepSeek-V3.1-Terminus-TEE": { + id: "deepseek-ai/DeepSeek-V3.1-Terminus-TEE", + name: "DeepSeek V3.1 Terminus TEE", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.23, output: 0.9 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek-ai/DeepSeek-R1-0528-TEE": { + id: "deepseek-ai/DeepSeek-R1-0528-TEE", + name: "DeepSeek R1 0528 TEE", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.75 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek-ai/DeepSeek-V3.2-TEE": { + id: "deepseek-ai/DeepSeek-V3.2-TEE", + name: "DeepSeek V3.2 TEE", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 0.42, cache_read: 0.14 }, + limit: { context: 131072, output: 65536 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "gpt oss 20b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.1 }, + limit: { context: 131072, output: 131072 }, + }, + "openai/gpt-oss-120b-TEE": { + id: "openai/gpt-oss-120b-TEE", + name: "gpt oss 120b TEE", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.18 }, + limit: { context: 131072, output: 65536 }, + }, + "unsloth/gemma-3-12b-it": { + id: "unsloth/gemma-3-12b-it", + name: "gemma 3 12b it", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.1 }, + limit: { context: 131072, output: 131072 }, + }, + "unsloth/Llama-3.2-3B-Instruct": { + id: "unsloth/Llama-3.2-3B-Instruct", + name: "Llama 3.2 3B Instruct", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-02-12", + last_updated: "2025-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0.01, cache_read: 0.005 }, + limit: { context: 16384, output: 16384 }, + }, + "unsloth/gemma-3-4b-it": { + id: "unsloth/gemma-3-4b-it", + name: "gemma 3 4b it", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0.03 }, + limit: { context: 96000, output: 96000 }, + }, + "unsloth/Llama-3.2-1B-Instruct": { + id: "unsloth/Llama-3.2-1B-Instruct", + name: "Llama 3.2 1B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0.01, cache_read: 0.005 }, + limit: { context: 32768, output: 8192 }, + }, + "unsloth/Mistral-Nemo-Instruct-2407": { + id: "unsloth/Mistral-Nemo-Instruct-2407", + name: "Mistral Nemo Instruct 2407", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.04, cache_read: 0.01 }, + limit: { context: 131072, output: 131072 }, + }, + "unsloth/Mistral-Small-24B-Instruct-2501": { + id: "unsloth/Mistral-Small-24B-Instruct-2501", + name: "Mistral Small 24B Instruct 2501", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.11 }, + limit: { context: 32768, output: 32768 }, + }, + "unsloth/gemma-3-27b-it": { + id: "unsloth/gemma-3-27b-it", + name: "gemma 3 27b it", + family: "unsloth", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.15, cache_read: 0.02 }, + limit: { context: 128000, output: 65536 }, + }, + "moonshotai/Kimi-K2-Thinking-TEE": { + id: "moonshotai/Kimi-K2-Thinking-TEE", + name: "Kimi K2 Thinking TEE", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.75 }, + limit: { context: 262144, output: 65535 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi K2 Instruct 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.39, output: 1.9, cache_read: 0.195 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2.6-TEE": { + id: "moonshotai/Kimi-K2.6-TEE", + name: "Kimi K2.6 TEE", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2026-04-20", + last_updated: "2026-04-23", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.44, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2.5-TEE": { + id: "moonshotai/Kimi-K2.5-TEE", + name: "Kimi K2.5 TEE", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 262144, output: 65535 }, + }, + "MiniMaxAI/MiniMax-M2.1-TEE": { + id: "MiniMaxAI/MiniMax-M2.1-TEE", + name: "MiniMax M2.1 TEE", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1.12 }, + limit: { context: 196608, output: 65536 }, + }, + "MiniMaxAI/MiniMax-M2.5-TEE": { + id: "MiniMaxAI/MiniMax-M2.5-TEE", + name: "MiniMax M2.5 TEE", + family: "minimax", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.1, cache_read: 0.15 }, + limit: { context: 196608, output: 65536 }, + }, + "rednote-hilab/dots.ocr": { + id: "rednote-hilab/dots.ocr", + name: "dots.ocr", + family: "rednote", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0.01, cache_read: 0.005 }, + limit: { context: 131072, output: 131072 }, + }, + "tngtech/TNG-R1T-Chimera-Turbo": { + id: "tngtech/TNG-R1T-Chimera-Turbo", + name: "TNG R1T Chimera Turbo", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.6 }, + limit: { context: 163840, output: 65536 }, + }, + "tngtech/DeepSeek-TNG-R1T2-Chimera": { + id: "tngtech/DeepSeek-TNG-R1T2-Chimera", + name: "DeepSeek TNG R1T2 Chimera", + family: "tngtech", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.85 }, + limit: { context: 163840, output: 163840 }, + }, + "tngtech/DeepSeek-R1T-Chimera": { + id: "tngtech/DeepSeek-R1T-Chimera", + name: "DeepSeek R1T Chimera", + family: "tngtech", + attachment: false, + reasoning: true, + tool_call: false, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 163840, output: 163840 }, + }, + "tngtech/TNG-R1T-Chimera-TEE": { + id: "tngtech/TNG-R1T-Chimera-TEE", + name: "TNG R1T Chimera TEE", + family: "tngtech", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.85 }, + limit: { context: 163840, output: 65536 }, + }, + }, + }, + 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: { + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT OSS 120B", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08", + last_updated: "2025-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.0675, output: 0.27 }, + limit: { context: 131072, output: 32768 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.45, output: 1.65 }, + limit: { context: 200000, output: 128000 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.75, output: 2.4 }, + limit: { context: 200000, output: 128000 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 3.89 }, + limit: { context: 200000, output: 128000 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.88 }, + limit: { context: 200000, output: 32000 }, + }, + }, + }, + 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.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "GPT-5.1 Codex Max", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-3.1-flash-lite-preview": { + id: "gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.03 }, + limit: { context: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "GPT-5.4 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.28, output: 0.42 }, + limit: { context: 128000, output: 128000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1000000, output: 384000 }, + provider: { npm: "@ai-sdk/openai-compatible" }, + }, + }, + }, + deepinfra: { + id: "deepinfra", + env: ["DEEPINFRA_API_KEY"], + npm: "@ai-sdk/deepinfra", + name: "Deep Infra", + doc: "https://deepinfra.com/models", + models: { + "Qwen/Qwen3.5-397B-A17B": { + id: "Qwen/Qwen3.5-397B-A17B", + name: "Qwen 3.5 397B A17B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-02-01", + last_updated: "2026-04-20", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.54, output: 3.4 }, + limit: { context: 262144, output: 81920 }, + }, + "Qwen/Qwen3.5-35B-A3B": { + id: "Qwen/Qwen3.5-35B-A3B", + name: "Qwen 3.5 35B A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-02-01", + last_updated: "2026-04-20", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.95 }, + limit: { context: 262144, output: 81920 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo", + name: "Qwen3 Coder 480B A35B Instruct Turbo", + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 262144, output: 66536 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + name: "Qwen3 Coder 480B A35B Instruct", + 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, + cost: { input: 0.4, output: 1.6 }, + limit: { context: 262144, output: 66536 }, + }, + "Qwen/Qwen3.6-35B-A3B": { + id: "Qwen/Qwen3.6-35B-A3B", + name: "Qwen3.6 35B A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1 }, + limit: { context: 262144, output: 81920 }, + }, + "zai-org/GLM-4.7-Flash": { + id: "zai-org/GLM-4.7-Flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.06, output: 0.4 }, + limit: { context: 202752, output: 16384 }, + }, + "zai-org/GLM-4.5": { + id: "zai-org/GLM-4.5", + name: "GLM-4.5", + family: "glm", + 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, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 131072, output: 98304 }, + status: "deprecated", + }, + "zai-org/GLM-4.7": { + id: "zai-org/GLM-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.43, output: 1.75, cache_read: 0.08 }, + limit: { context: 202752, output: 16384 }, + }, + "zai-org/GLM-5.1": { + id: "zai-org/GLM-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 202752, output: 16384 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-12", + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 2.56, cache_read: 0.16 }, + limit: { context: 202752, output: 16384 }, + }, + "zai-org/GLM-4.6V": { + id: "zai-org/GLM-4.6V", + name: "GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + 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", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/GLM-4.6": { + id: "zai-org/GLM-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.43, output: 1.74, cache_read: 0.08 }, + limit: { context: 204800, output: 131072 }, + }, + "meta-llama/Llama-4-Scout-17B-16E-Instruct": { + id: "meta-llama/Llama-4-Scout-17B-16E-Instruct", + name: "Llama 4 Scout 17B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.3 }, + limit: { context: 10000000, output: 16384 }, + }, + "meta-llama/Llama-3.1-8B-Instruct": { + id: "meta-llama/Llama-3.1-8B-Instruct", + name: "Llama 3.1 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.05 }, + limit: { context: 131072, output: 16384 }, + }, + "meta-llama/Llama-3.1-70B-Instruct": { + id: "meta-llama/Llama-3.1-70B-Instruct", + name: "Llama 3.1 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 131072, output: 16384 }, + }, + "meta-llama/Llama-3.1-8B-Instruct-Turbo": { + id: "meta-llama/Llama-3.1-8B-Instruct-Turbo", + name: "Llama 3.1 8B Turbo", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.03 }, + limit: { context: 131072, output: 16384 }, + }, + "meta-llama/Llama-3.3-70B-Instruct-Turbo": { + id: "meta-llama/Llama-3.3-70B-Instruct-Turbo", + name: "Llama 3.3 70B Turbo", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.32 }, + limit: { context: 131072, output: 16384 }, + }, + "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", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 1000000, output: 16384 }, + }, + "meta-llama/Llama-3.1-70B-Instruct-Turbo": { + id: "meta-llama/Llama-3.1-70B-Instruct-Turbo", + name: "Llama 3.1 70B Turbo", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 131072, output: 16384 }, + }, + "deepseek-ai/DeepSeek-R1-0528": { + id: "deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek-R1-0528", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.5, output: 2.15, cache_read: 0.35 }, + limit: { context: 163840, output: 64000 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek-V3.2", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.26, output: 0.38, cache_read: 0.13 }, + limit: { context: 163840, output: 64000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.14 }, + limit: { context: 131072, output: 16384 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.24 }, + limit: { context: 131072, output: 16384 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2025-11-06", + last_updated: "2025-11-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.47, output: 2 }, + limit: { context: 131072, output: 32768 }, + }, + "moonshotai/Kimi-K2.6": { + id: "moonshotai/Kimi-K2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.75, output: 3.5, cache_read: 0.15 }, + limit: { context: 262144, output: 16384 }, + }, + "moonshotai/Kimi-K2-Instruct": { + id: "moonshotai/Kimi-K2-Instruct", + name: "Kimi K2", + family: "kimi", + 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, + cost: { input: 0.5, output: 2 }, + limit: { context: 131072, output: 32768 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi K2 0905", + family: "kimi", + 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, + cost: { input: 0.4, output: 2, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.8 }, + limit: { context: 262144, output: 32768 }, + }, + "MiniMaxAI/MiniMax-M2": { + id: "MiniMaxAI/MiniMax-M2", + name: "MiniMax M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.254, output: 1.02 }, + limit: { context: 262144, output: 32768 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 0.95, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMaxAI/MiniMax-M2.1": { + id: "MiniMaxAI/MiniMax-M2.1", + name: "MiniMax M2.1", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 1.2 }, + limit: { context: 196608, output: 196608 }, + }, + "anthropic/claude-3-7-sonnet-latest": { + id: "anthropic/claude-3-7-sonnet-latest", + name: "Claude Sonnet 3.7 (Latest)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10-31", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3.3, output: 16.5, cache_read: 0.33 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-4-opus": { + id: "anthropic/claude-4-opus", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-06-12", + last_updated: "2025-06-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 16.5, output: 82.5 }, + limit: { context: 200000, output: 32000 }, + }, + "deepseek-ai/DeepSeek-V4-Flash": { + id: "deepseek-ai/DeepSeek-V4-Flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek-ai/DeepSeek-V4-Pro": { + id: "deepseek-ai/DeepSeek-V4-Pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 65536, output: 65536 }, + }, + "google/gemma-4-26B-A4B-it": { + id: "google/gemma-4-26B-A4B-it", + name: "Gemma 4 26B", + family: "gemma", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.34 }, + limit: { context: 256000, output: 8192 }, + }, + "google/gemma-4-31B-it": { + id: "google/gemma-4-31B-it", + name: "Gemma 4 31B", + family: "gemma", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.13, output: 0.38 }, + limit: { context: 256000, output: 8192 }, + }, + }, + }, + "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: { + "qwen3-235b-a22b": { + id: "qwen3-235b-a22b", + name: "Qwen 3 235B A22B", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 32000 }, + }, + "doubao-seed-1.6-flash": { + id: "doubao-seed-1.6-flash", + name: "Doubao-Seed 1.6 Flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-15", + last_updated: "2025-08-15", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 32000 }, + }, + "qwen3-235b-a22b-instruct-2507": { + id: "qwen3-235b-a22b-instruct-2507", + name: "Qwen3 235b A22B Instruct 2507", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-12", + last_updated: "2025-08-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 262144, output: 64000 }, + }, + "doubao-seed-2.0-code": { + id: "doubao-seed-2.0-code", + name: "Doubao Seed 2.0 Code", + attachment: true, + reasoning: true, + 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: 128000 }, + }, + "deepseek-v3-0324": { + id: "deepseek-v3-0324", + name: "DeepSeek-V3-0324", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + 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 }, + }, + "doubao-1.5-thinking-pro": { + id: "doubao-1.5-thinking-pro", + name: "Doubao 1.5 Thinking Pro", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + 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 }, + }, + "claude-3.7-sonnet": { + id: "claude-3.7-sonnet", + name: "Claude 3.7 Sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 128000 }, + }, + "qwen3.5-397b-a17b": { + id: "qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-02-22", + last_updated: "2026-02-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 64000 }, + }, + "qwen-vl-max-2025-01-25": { + id: "qwen-vl-max-2025-01-25", + name: "Qwen VL-MAX-2025-01-25", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + 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 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3 32B", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 40000, output: 4096 }, + }, + "doubao-1.5-pro-32k": { + id: "doubao-1.5-pro-32k", + name: "Doubao 1.5 Pro 32k", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + 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 }, + }, + "qwen2.5-vl-72b-instruct": { + id: "qwen2.5-vl-72b-instruct", + name: "Qwen 2.5 VL 72B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + 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: 8192 }, + }, + "gemini-2.0-flash": { + id: "gemini-2.0-flash", + name: "Gemini 2.0 Flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + 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: 1048576, output: 8192 }, + }, + "qwen3-vl-30b-a3b-thinking": { + id: "qwen3-vl-30b-a3b-thinking", + name: "Qwen3-Vl 30b A3b Thinking", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + 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 }, + }, + "gemini-3.0-pro-image-preview": { + id: "gemini-3.0-pro-image-preview", + name: "Gemini 3.0 Pro Image Preview", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + 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 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + limit: { context: 1048576, output: 65536 }, + }, + "claude-4.5-opus": { + id: "claude-4.5-opus", + name: "Claude 4.5 Opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-11-25", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 200000 }, + }, + "deepseek-r1": { + id: "deepseek-r1", + name: "DeepSeek-R1", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 32000 }, + }, + "claude-4.0-opus": { + id: "claude-4.0-opus", + name: "Claude 4.0 Opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 32000 }, + }, + "claude-4.5-haiku": { + id: "claude-4.5-haiku", + name: "Claude 4.5 Haiku", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-10-16", + last_updated: "2025-10-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 64000 }, + }, + "qwen3-max": { + id: "qwen3-max", + name: "Qwen3 Max", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 262144, output: 65536 }, + }, + "gemini-3.0-flash-preview": { + id: "gemini-3.0-flash-preview", + name: "Gemini 3.0 Flash Preview", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-18", + last_updated: "2025-12-18", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + limit: { context: 1000000, output: 64000 }, + }, + "gemini-2.5-flash-image": { + id: "gemini-2.5-flash-image", + name: "Gemini 2.5 Flash Image", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-10-22", + last_updated: "2025-10-22", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + limit: { context: 32768, output: 8192 }, + }, + "glm-4.5": { + id: "glm-4.5", + name: "GLM 4.5", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 131072, output: 98304 }, + }, + "claude-3.5-sonnet": { + id: "claude-3.5-sonnet", + name: "Claude 3.5 Sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-09", + last_updated: "2025-09-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 8200 }, + }, + "claude-4.0-sonnet": { + id: "claude-4.0-sonnet", + name: "Claude 4.0 Sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 64000 }, + }, + "qwen3-30b-a3b-instruct-2507": { + id: "qwen3-30b-a3b-instruct-2507", + name: "Qwen3 30b A3b Instruct 2507", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-02-04", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 32000 }, + }, + "doubao-seed-1.6-thinking": { + id: "doubao-seed-1.6-thinking", + name: "Doubao-Seed 1.6 Thinking", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + 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 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + 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: 1048576, output: 64000 }, + }, + "qwen3-235b-a22b-thinking-2507": { + id: "qwen3-235b-a22b-thinking-2507", + name: "Qwen3 235B A22B Thinking 2507", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-12", + last_updated: "2025-08-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 262144, output: 4096 }, + }, + "qwen3-next-80b-a3b-thinking": { + id: "qwen3-next-80b-a3b-thinking", + name: "Qwen3 Next 80B A3B Thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-12", + last_updated: "2025-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 131072, output: 32768 }, + }, + "qwen3-30b-a3b-thinking-2507": { + id: "qwen3-30b-a3b-thinking-2507", + name: "Qwen3 30b A3b Thinking 2507", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + 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 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM 4.5 Air", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 131000, output: 4096 }, + }, + "deepseek-v3.1": { + id: "deepseek-v3.1", + name: "DeepSeek-V3.1", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 32000 }, + }, + "qwen3-30b-a3b": { + id: "qwen3-30b-a3b", + name: "Qwen3 30B A3B", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 40000, output: 4096 }, + }, + "claude-4.1-opus": { + id: "claude-4.1-opus", + name: "Claude 4.1 Opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 32000 }, + }, + "doubao-seed-2.0-mini": { + id: "doubao-seed-2.0-mini", + name: "Doubao Seed 2.0 Mini", + attachment: true, + reasoning: true, + 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 }, + }, + "qwen3-next-80b-a3b-instruct": { + id: "qwen3-next-80b-a3b-instruct", + name: "Qwen3 Next 80B A3B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-12", + last_updated: "2025-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 131072, output: 32768 }, + }, + "doubao-seed-1.6": { + id: "doubao-seed-1.6", + name: "Doubao-Seed 1.6", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-15", + last_updated: "2025-08-15", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 32000 }, + }, + "qwen2.5-vl-7b-instruct": { + id: "qwen2.5-vl-7b-instruct", + name: "Qwen 2.5 VL 7B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + 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: 8192 }, + }, + "kling-v2-6": { + id: "kling-v2-6", + name: "Kling-V2 6", + 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 }, + }, + "MiniMax-M1": { + id: "MiniMax-M1", + name: "MiniMax M1", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 1000000, output: 80000 }, + }, + "gemini-3.0-pro-preview": { + id: "gemini-3.0-pro-preview", + name: "Gemini 3.0 Pro Preview", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-11-19", + last_updated: "2025-11-19", + modalities: { input: ["text", "image", "video", "pdf", "audio"], output: ["text"] }, + open_weights: false, + limit: { context: 1000000, output: 64000 }, + }, + "doubao-seed-2.0-lite": { + id: "doubao-seed-2.0-lite", + name: "Doubao Seed 2.0 Lite", + attachment: true, + reasoning: true, + 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 }, + }, + "qwen3-coder-480b-a35b-instruct": { + id: "qwen3-coder-480b-a35b-instruct", + name: "Qwen3 Coder 480B A35B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-14", + last_updated: "2025-08-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 262000, output: 4096 }, + }, + "claude-3.5-haiku": { + id: "claude-3.5-haiku", + name: "Claude 3.5 Haiku", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 8192 }, + }, + "gpt-oss-20b": { + id: "gpt-oss-20b", + name: "gpt-oss-20b", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 4096 }, + }, + "qwen-turbo": { + id: "qwen-turbo", + name: "Qwen-Turbo", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 1000000, output: 4096 }, + }, + "kimi-k2": { + id: "kimi-k2", + name: "Kimi K2", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 128000 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + 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: 1048576, output: 64000 }, + }, + "qwen3-max-preview": { + id: "qwen3-max-preview", + name: "Qwen3 Max Preview", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-06", + last_updated: "2025-09-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 64000 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "gpt-oss-120b", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 4096 }, + }, + "doubao-1.5-vision-pro": { + id: "doubao-1.5-vision-pro", + name: "Doubao 1.5 Vision Pro", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + 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 }, + }, + "claude-4.5-sonnet": { + id: "claude-4.5-sonnet", + name: "Claude 4.5 Sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 64000 }, + }, + "deepseek-v3": { + id: "deepseek-v3", + name: "DeepSeek-V3", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-08-13", + last_updated: "2025-08-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 16000 }, + }, + "deepseek-r1-0528": { + id: "deepseek-r1-0528", + name: "DeepSeek-R1-0528", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 32000 }, + }, + "gemini-2.0-flash-lite": { + id: "gemini-2.0-flash-lite", + name: "Gemini 2.0 Flash Lite", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + 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: 1048576, output: 8192 }, + }, + "qwen-max-2025-01-25": { + id: "qwen-max-2025-01-25", + name: "Qwen2.5-Max-2025-01-25", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 4096 }, + }, + "doubao-seed-2.0-pro": { + id: "doubao-seed-2.0-pro", + name: "Doubao Seed 2.0 Pro", + attachment: true, + reasoning: true, + 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: 128000 }, + }, + "deepseek/deepseek-v3.2-exp-thinking": { + id: "deepseek/deepseek-v3.2-exp-thinking", + name: "DeepSeek/DeepSeek-V3.2-Exp-Thinking", + attachment: false, + reasoning: true, + tool_call: false, + 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 }, + }, + "deepseek/deepseek-v3.1-terminus-thinking": { + id: "deepseek/deepseek-v3.1-terminus-thinking", + name: "DeepSeek/DeepSeek-V3.1-Terminus-Thinking", + attachment: false, + reasoning: true, + tool_call: false, + 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 }, + }, + "deepseek/deepseek-v3.2-exp": { + id: "deepseek/deepseek-v3.2-exp", + name: "DeepSeek/DeepSeek-V3.2-Exp", + 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 }, + }, + "deepseek/deepseek-v3.2-251201": { + id: "deepseek/deepseek-v3.2-251201", + name: "Deepseek/DeepSeek-V3.2", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 32000 }, + }, + "deepseek/deepseek-math-v2": { + id: "deepseek/deepseek-math-v2", + name: "Deepseek/Deepseek-Math-V2", + attachment: false, + reasoning: true, + 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 }, + }, + "deepseek/deepseek-v3.1-terminus": { + id: "deepseek/deepseek-v3.1-terminus", + name: "DeepSeek/DeepSeek-V3.1-Terminus", + 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 }, + }, + "stepfun-ai/gelab-zero-4b-preview": { + id: "stepfun-ai/gelab-zero-4b-preview", + name: "Stepfun-Ai/Gelab Zero 4b Preview", + 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 }, + }, + "stepfun/step-3.5-flash": { + id: "stepfun/step-3.5-flash", + name: "Stepfun/Step-3.5 Flash", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2026-02-02", + last_updated: "2026-02-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 64000, output: 4096 }, + }, + "x-ai/grok-4-fast": { + id: "x-ai/grok-4-fast", + name: "x-AI/Grok-4-Fast", + attachment: true, + reasoning: true, + 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 }, + }, + "x-ai/grok-code-fast-1": { + id: "x-ai/grok-code-fast-1", + name: "x-AI/Grok-Code-Fast 1", + attachment: false, + reasoning: true, + 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 }, + }, + "x-ai/grok-4-fast-reasoning": { + id: "x-ai/grok-4-fast-reasoning", + name: "X-Ai/Grok-4-Fast-Reasoning", + attachment: true, + reasoning: true, + 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 }, + }, + "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", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-19", + last_updated: "2025-12-19", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + limit: { context: 2000000, output: 2000000 }, + }, + "x-ai/grok-4.1-fast": { + id: "x-ai/grok-4.1-fast", + name: "x-AI/Grok-4.1-Fast", + attachment: false, + reasoning: true, + 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 }, + }, + "x-ai/grok-4-fast-non-reasoning": { + id: "x-ai/grok-4-fast-non-reasoning", + name: "X-Ai/Grok-4-Fast-Non-Reasoning", + attachment: true, + reasoning: true, + 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 }, + }, + "x-ai/grok-4.1-fast-reasoning": { + id: "x-ai/grok-4.1-fast-reasoning", + name: "X-Ai/Grok 4.1 Fast Reasoning", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-19", + last_updated: "2025-12-19", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + limit: { context: 20000000, output: 2000000 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "OpenAI/GPT-5.2", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-11", + last_updated: "2025-12-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "OpenAI/GPT-5", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 400000, output: 128000 }, + }, + "z-ai/glm-4.7": { + id: "z-ai/glm-4.7", + name: "Z-Ai/GLM 4.7", + attachment: false, + reasoning: true, + 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: 200000, output: 200000 }, + }, + "z-ai/glm-5": { + id: "z-ai/glm-5", + name: "Z-Ai/GLM 5", + attachment: false, + reasoning: true, + 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: false, + limit: { context: 200000, output: 128000 }, + }, + "z-ai/autoglm-phone-9b": { + id: "z-ai/autoglm-phone-9b", + name: "Z-Ai/Autoglm Phone 9b", + 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 }, + }, + "z-ai/glm-4.6": { + id: "z-ai/glm-4.6", + name: "Z-AI/GLM 4.6", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-10-11", + last_updated: "2025-10-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 200000 }, + }, + "minimax/minimax-m2": { + id: "minimax/minimax-m2", + name: "Minimax/Minimax-M2", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-10-28", + last_updated: "2025-10-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 128000 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "Minimax/Minimax-M2.1", + attachment: false, + reasoning: true, + 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: 204800, output: 128000 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "Minimax/Minimax-M2.5", + attachment: false, + reasoning: true, + 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: false, + limit: { context: 204800, output: 128000 }, + }, + "minimax/minimax-m2.5-highspeed": { + id: "minimax/minimax-m2.5-highspeed", + name: "Minimax/Minimax-M2.5 Highspeed", + attachment: false, + reasoning: true, + tool_call: true, + 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: 204800, output: 128000 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Moonshotai/Kimi-K2.5", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-01-28", + last_updated: "2026-01-28", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 256000 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "Kimi K2 0905", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-09-08", + last_updated: "2025-09-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 100000 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-11-07", + last_updated: "2025-11-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 100000 }, + }, + "meituan/longcat-flash-chat": { + id: "meituan/longcat-flash-chat", + name: "Meituan/Longcat-Flash-Chat", + 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 }, + }, + "meituan/longcat-flash-lite": { + id: "meituan/longcat-flash-lite", + name: "Meituan/Longcat-Flash-Lite", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + 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 }, + }, + "mimo-v2-flash": { + id: "mimo-v2-flash", + name: "Mimo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.3, cache_read: 0.01 }, + limit: { context: 256000, output: 256000 }, + }, + "xiaomi/mimo-v2-flash": { + id: "xiaomi/mimo-v2-flash", + name: "Xiaomi/Mimo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.3, cache_read: 0.01 }, + limit: { context: 256000, output: 256000 }, + }, + }, + }, + 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: { + "rekaai/reka-edge": { + id: "rekaai/reka-edge", + name: "Reka Edge", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-20", + last_updated: "2026-04-11", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 16384, output: 16384 }, + }, + "rekaai/reka-flash-3": { + id: "rekaai/reka-flash-3", + name: "Reka Flash 3", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-03-12", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.2 }, + limit: { context: 65536, output: 65536 }, + }, + "ai21/jamba-large-1.7": { + id: "ai21/jamba-large-1.7", + name: "AI21: Jamba Large 1.7", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-09", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8 }, + limit: { context: 256000, output: 4096 }, + }, + "alibaba/tongyi-deepresearch-30b-a3b": { + id: "alibaba/tongyi-deepresearch-30b-a3b", + name: "Tongyi DeepResearch 30B A3B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-18", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.45 }, + limit: { context: 131072, output: 131072 }, + }, + "inflection/inflection-3-pi": { + id: "inflection/inflection-3-pi", + name: "Inflection: Inflection 3 Pi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-10-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 8000, output: 1024 }, + }, + "inflection/inflection-3-productivity": { + id: "inflection/inflection-3-productivity", + name: "Inflection: Inflection 3 Productivity", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-10-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 8000, output: 1024 }, + }, + "liquid/lfm-2-24b-a2b": { + id: "liquid/lfm-2-24b-a2b", + name: "LiquidAI: LFM2-24B-A2B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.12 }, + limit: { context: 32768, output: 32768 }, + }, + "writer/palmyra-x5": { + id: "writer/palmyra-x5", + name: "Writer: Palmyra X5", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-28", + last_updated: "2025-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 6 }, + limit: { context: 1040000, output: 8192 }, + }, + "ibm-granite/granite-4.1-8b": { + id: "ibm-granite/granite-4.1-8b", + name: "IBM: Granite 4.1 8B", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-30", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.1, cache_read: 0.05 }, + limit: { context: 131072, output: 131072 }, + }, + "ibm-granite/granite-4.0-h-micro": { + id: "ibm-granite/granite-4.0-h-micro", + name: "IBM: Granite 4.0 Micro", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-10-20", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.017, output: 0.11 }, + limit: { context: 131000, output: 32768 }, + }, + "essentialai/rnj-1-instruct": { + id: "essentialai/rnj-1-instruct", + name: "EssentialAI: Rnj 1 Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-05", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 32768, output: 6554 }, + }, + "perplexity/sonar-pro": { + id: "perplexity/sonar-pro", + name: "Perplexity: Sonar Pro", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-01-01", + last_updated: "2025-09-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8000 }, + }, + "perplexity/sonar-deep-research": { + id: "perplexity/sonar-deep-research", + name: "Perplexity: Sonar Deep Research", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-01-27", + last_updated: "2025-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8 }, + limit: { context: 128000, output: 25600 }, + }, + "perplexity/sonar": { + id: "perplexity/sonar", + name: "Perplexity: Sonar", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-01-01", + last_updated: "2025-09-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 1 }, + limit: { context: 127072, output: 25415 }, + }, + "perplexity/sonar-pro-search": { + id: "perplexity/sonar-pro-search", + name: "Perplexity: Sonar Pro Search", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-10-31", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8000 }, + }, + "perplexity/sonar-reasoning-pro": { + id: "perplexity/sonar-reasoning-pro", + name: "Perplexity: Sonar Reasoning Pro", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2024-01-01", + last_updated: "2025-09-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8 }, + limit: { context: 128000, output: 25600 }, + }, + "deepseek/deepseek-chat-v3.1": { + id: "deepseek/deepseek-chat-v3.1", + name: "DeepSeek: DeepSeek V3.1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.75 }, + limit: { context: 32768, output: 7168 }, + }, + "deepseek/deepseek-chat": { + id: "deepseek/deepseek-chat", + name: "DeepSeek: DeepSeek V3", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.32, output: 0.89, cache_read: 0.15 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek/deepseek-r1-distill-llama-70b": { + id: "deepseek/deepseek-r1-distill-llama-70b", + name: "DeepSeek: R1 Distill Llama 70B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-01-23", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 0.8, cache_read: 0.015 }, + limit: { context: 131072, output: 16384 }, + }, + "deepseek/deepseek-r1": { + id: "deepseek/deepseek-r1", + name: "DeepSeek: R1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.5 }, + limit: { context: 64000, output: 16000 }, + }, + "deepseek/deepseek-v3.2-speciale": { + id: "deepseek/deepseek-v3.2-speciale", + name: "DeepSeek: DeepSeek V3.2 Speciale", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-12-01", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.2, cache_read: 0.135 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek/deepseek-r1-distill-qwen-32b": { + id: "deepseek/deepseek-r1-distill-qwen-32b", + name: "DeepSeek: R1 Distill Qwen 32B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 0.29 }, + limit: { context: 32768, output: 32768 }, + }, + "deepseek/deepseek-v3.2-exp": { + id: "deepseek/deepseek-v3.2-exp", + name: "DeepSeek: DeepSeek V3.2 Exp", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-09-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.41 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-v4-flash": { + id: "deepseek/deepseek-v4-flash", + name: "DeepSeek: DeepSeek V4 Flash", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.28, cache_read: 0.0028 }, + limit: { context: 1048576, output: 384000 }, + }, + "deepseek/deepseek-v4-pro": { + id: "deepseek/deepseek-v4-pro", + name: "DeepSeek: DeepSeek V4 Pro", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.435, output: 0.87, cache_read: 0.003625 }, + limit: { context: 1048576, output: 384000 }, + }, + "deepseek/deepseek-v3.2": { + id: "deepseek/deepseek-v3.2", + name: "DeepSeek: DeepSeek V3.2", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-01", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.26, output: 0.38, cache_read: 0.125 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-chat-v3-0324": { + id: "deepseek/deepseek-chat-v3-0324", + name: "DeepSeek: DeepSeek V3 0324", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-03-24", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.77, cache_read: 0.095 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-r1-0528": { + id: "deepseek/deepseek-r1-0528", + name: "DeepSeek: R1 0528", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-28", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 2.15, cache_read: 0.2 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek/deepseek-v3.1-terminus": { + id: "deepseek/deepseek-v3.1-terminus", + name: "DeepSeek: DeepSeek V3.1 Terminus", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-22", + last_updated: "2025-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.21, output: 0.79, cache_read: 0.13 }, + limit: { context: 163840, output: 32768 }, + }, + "openrouter/auto": { + id: "openrouter/auto", + name: "Auto Router", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 2000000, output: 32768 }, + }, + "openrouter/bodybuilder": { + id: "openrouter/bodybuilder", + name: "Body Builder (beta)", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + status: "beta", + }, + "openrouter/owl-alpha": { + id: "openrouter/owl-alpha", + name: "Owl Alpha", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 1048756, output: 262144 }, + status: "alpha", + }, + "openrouter/pareto-code": { + id: "openrouter/pareto-code", + name: "Pareto Code Router", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 65536 }, + }, + "openrouter/free": { + id: "openrouter/free", + name: "Free Models Router", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-01", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 32768 }, + }, + "inclusionai/ling-2.6-1t:free": { + id: "inclusionai/ling-2.6-1t:free", + name: "inclusionAI: Ling-2.6-1T (free)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-23", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "inclusionai/ling-2.6-flash": { + id: "inclusionai/ling-2.6-flash", + name: "inclusionAI: Ling-2.6 Flash", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-21", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.08, output: 0.24, cache_read: 0.016 }, + limit: { context: 262144, output: 32768 }, + }, + "arcee-ai/trinity-mini": { + id: "arcee-ai/trinity-mini", + name: "Arcee AI: Trinity Mini", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12", + last_updated: "2026-01-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.045, output: 0.15 }, + limit: { context: 131072, output: 131072 }, + }, + "arcee-ai/virtuoso-large": { + id: "arcee-ai/virtuoso-large", + name: "Arcee AI: Virtuoso Large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-05-06", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.75, output: 1.2 }, + limit: { context: 131072, output: 64000 }, + }, + "arcee-ai/trinity-large-thinking": { + id: "arcee-ai/trinity-large-thinking", + name: "Arcee AI: Trinity Large Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.85 }, + limit: { context: 262144, output: 262144 }, + }, + "arcee-ai/spotlight": { + id: "arcee-ai/spotlight", + name: "Arcee AI: Spotlight", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-05-06", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 131072, output: 65537 }, + }, + "arcee-ai/maestro-reasoning": { + id: "arcee-ai/maestro-reasoning", + name: "Arcee AI: Maestro Reasoning", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-05-06", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.9, output: 3.3 }, + limit: { context: 131072, output: 32000 }, + }, + "arcee-ai/coder-large": { + id: "arcee-ai/coder-large", + name: "Arcee AI: Coder Large", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-05-06", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 0.8 }, + limit: { context: 32768, output: 32768 }, + }, + "arcee-ai/trinity-large-preview": { + id: "arcee-ai/trinity-large-preview", + name: "Arcee AI: Trinity Large Preview", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-01-28", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.45 }, + limit: { context: 131000, output: 32768 }, + }, + "deepcogito/cogito-v2.1-671b": { + id: "deepcogito/cogito-v2.1-671b", + name: "Deep Cogito: Cogito v2.1 671B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.25, output: 1.25 }, + limit: { context: 128000, output: 32768 }, + }, + "upstage/solar-pro-3": { + id: "upstage/solar-pro-3", + name: "Upstage: Solar Pro 3", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 32768 }, + }, + "nex-agi/deepseek-v3.1-nex-n1": { + id: "nex-agi/deepseek-v3.1-nex-n1", + name: "Nex AGI: DeepSeek V3.1 Nex N1", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 1 }, + limit: { context: 131072, output: 163840 }, + }, + "bytedance-seed/seed-1.6": { + id: "bytedance-seed/seed-1.6", + name: "ByteDance Seed: Seed 1.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09", + last_updated: "2025-09", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2 }, + limit: { context: 262144, output: 32768 }, + }, + "bytedance-seed/seed-2.0-lite": { + id: "bytedance-seed/seed-2.0-lite", + name: "ByteDance Seed: Seed-2.0-Lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-10", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 2 }, + limit: { context: 262144, output: 131072 }, + }, + "bytedance-seed/seed-1.6-flash": { + id: "bytedance-seed/seed-1.6-flash", + name: "ByteDance Seed: Seed 1.6 Flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 262144, output: 32768 }, + }, + "bytedance-seed/seed-2.0-mini": { + id: "bytedance-seed/seed-2.0-mini", + name: "ByteDance Seed: Seed-2.0-Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-27", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 262144, output: 131072 }, + }, + "mancer/weaver": { + id: "mancer/weaver", + name: "Mancer: Weaver (alpha)", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2023-08-02", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 1 }, + limit: { context: 8000, output: 2000 }, + }, + "anthracite-org/magnum-v4-72b": { + id: "anthracite-org/magnum-v4-72b", + name: "Magnum v4 72B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-10-22", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 3, output: 5 }, + limit: { context: 16384, output: 2048 }, + }, + "~google/gemini-pro-latest": { + id: "~google/gemini-pro-latest", + name: "Google: Gemini Pro Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2, cache_write: 0.375 }, + limit: { context: 1048576, output: 65536 }, + }, + "~google/gemini-flash-latest": { + id: "~google/gemini-flash-latest", + name: "Google: Gemini Flash Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.05, cache_write: 0.08333333333333334 }, + limit: { context: 1048576, output: 65536 }, + }, + "kilo-auto/balanced": { + id: "kilo-auto/balanced", + name: "Kilo Auto Balanced", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 3 }, + limit: { context: 204800, output: 131072 }, + }, + "kilo-auto/frontier": { + id: "kilo-auto/frontier", + name: "Kilo Auto Frontier", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25 }, + limit: { context: 1000000, output: 128000 }, + }, + "kilo-auto/small": { + id: "kilo-auto/small", + name: "Kilo Auto Small", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.4 }, + limit: { context: 400000, output: 128000 }, + }, + "kilo-auto/free": { + id: "kilo-auto/free", + name: "Kilo Auto Free", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "undi95/remm-slerp-l2-13b": { + id: "undi95/remm-slerp-l2-13b", + name: "ReMM SLERP 13B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2023-07-22", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 0.65 }, + limit: { context: 6144, output: 4096 }, + }, + "allenai/olmo-3-32b-think": { + id: "allenai/olmo-3-32b-think", + name: "AllenAI: Olmo 3 32B Think", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-11-22", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.5 }, + limit: { context: 65536, output: 65536 }, + }, + "nousresearch/hermes-2-pro-llama-3-8b": { + id: "nousresearch/hermes-2-pro-llama-3-8b", + name: "NousResearch: Hermes 2 Pro - Llama-3 8B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-05-27", + last_updated: "2024-06-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.14 }, + limit: { context: 8192, output: 8192 }, + }, + "nousresearch/hermes-4-405b": { + id: "nousresearch/hermes-4-405b", + name: "Nous: Hermes 4 405B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-08-25", + last_updated: "2025-08-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 131072, output: 26215 }, + }, + "nousresearch/hermes-3-llama-3.1-70b": { + id: "nousresearch/hermes-3-llama-3.1-70b", + name: "Nous: Hermes 3 70B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-08-18", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 131072, output: 32768 }, + }, + "nousresearch/hermes-4-70b": { + id: "nousresearch/hermes-4-70b", + name: "Nous: Hermes 4 70B", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-08-25", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.4, cache_read: 0.055 }, + limit: { context: 131072, output: 131072 }, + }, + "nousresearch/hermes-3-llama-3.1-405b": { + id: "nousresearch/hermes-3-llama-3.1-405b", + name: "Nous: Hermes 3 405B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-08-16", + last_updated: "2024-08-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 1 }, + limit: { context: 131072, output: 16384 }, + }, + "morph/morph-v3-fast": { + id: "morph/morph-v3-fast", + name: "Morph: Morph V3 Fast", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-08-15", + last_updated: "2024-08-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 1.2 }, + limit: { context: 81920, output: 38000 }, + }, + "morph/morph-v3-large": { + id: "morph/morph-v3-large", + name: "Morph: Morph V3 Large", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-08-15", + last_updated: "2024-08-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.9, output: 1.9 }, + limit: { context: 262144, output: 131072 }, + }, + "stepfun/step-3.5-flash:free": { + id: "stepfun/step-3.5-flash:free", + name: "StepFun: Step 3.5 Flash (free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-26", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "stepfun/step-3.5-flash": { + id: "stepfun/step-3.5-flash", + name: "StepFun: Step 3.5 Flash", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-01-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.02 }, + limit: { context: 256000, output: 256000 }, + }, + "alpindale/goliath-120b": { + id: "alpindale/goliath-120b", + name: "Goliath 120B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2023-11-10", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 3.75, output: 7.5 }, + limit: { context: 6144, output: 1024 }, + }, + "mistralai/mistral-nemo": { + id: "mistralai/mistral-nemo", + name: "Mistral: Mistral Nemo", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-01", + last_updated: "2024-07-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.04 }, + limit: { context: 131072, output: 16384 }, + }, + "mistralai/mistral-saba": { + id: "mistralai/mistral-saba", + name: "Mistral: Saba", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-02-17", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 32768, output: 32768 }, + }, + "mistralai/mistral-large-2512": { + id: "mistralai/mistral-large-2512", + name: "Mistral: Mistral Large 3 2512", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-01", + last_updated: "2025-12-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 262144, output: 52429 }, + }, + "mistralai/devstral-medium": { + id: "mistralai/devstral-medium", + name: "Mistral: Devstral Medium", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, output: 26215 }, + }, + "mistralai/mistral-small-3.1-24b-instruct": { + id: "mistralai/mistral-small-3.1-24b-instruct", + name: "Mistral: Mistral Small 3.1 24B", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-17", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 0.56, cache_read: 0.015 }, + limit: { context: 128000, output: 131072 }, + }, + "mistralai/mistral-medium-3-5": { + id: "mistralai/mistral-medium-3-5", + name: "Mistral: Mistral Medium 3.5", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-30", + last_updated: "2026-05-07", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 7.5 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/pixtral-large-2411": { + id: "mistralai/pixtral-large-2411", + name: "Mistral: Pixtral Large 2411", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-19", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 131072, output: 32768 }, + }, + "mistralai/devstral-2512": { + id: "mistralai/devstral-2512", + name: "Mistral: Devstral 2 2512", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-12", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2, cache_read: 0.025 }, + limit: { context: 262144, output: 65536 }, + }, + "mistralai/codestral-2508": { + id: "mistralai/codestral-2508", + name: "Mistral: Codestral 2508", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 51200 }, + }, + "mistralai/mistral-small-24b-instruct-2501": { + id: "mistralai/mistral-small-24b-instruct-2501", + name: "Mistral: Mistral Small 3", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-29", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.08 }, + limit: { context: 32768, output: 16384 }, + }, + "mistralai/mistral-large-2411": { + id: "mistralai/mistral-large-2411", + name: "Mistral Large 2411", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-24", + last_updated: "2024-11-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 131072, output: 26215 }, + }, + "mistralai/mixtral-8x22b-instruct": { + id: "mistralai/mixtral-8x22b-instruct", + name: "Mistral: Mixtral 8x22B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-04-17", + last_updated: "2024-04-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 65536, output: 13108 }, + }, + "mistralai/mistral-large-2407": { + id: "mistralai/mistral-large-2407", + name: "Mistral Large 2407", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-19", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 131072, output: 32768 }, + }, + "mistralai/ministral-8b-2512": { + id: "mistralai/ministral-8b-2512", + name: "Mistral: Ministral 3 8B 2512", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-02", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 262144, output: 32768 }, + }, + "mistralai/mistral-medium-3.1": { + id: "mistralai/mistral-medium-3.1", + name: "Mistral: Mistral Medium 3.1", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-12", + last_updated: "2025-08-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, output: 26215 }, + }, + "mistralai/mistral-small-2603": { + id: "mistralai/mistral-small-2603", + name: "Mistral: Mistral Small 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-16", + last_updated: "2026-04-11", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6, cache_read: 0.015 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/ministral-3b-2512": { + id: "mistralai/ministral-3b-2512", + name: "Mistral: Ministral 3 3B 2512", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-02", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 32768 }, + }, + "mistralai/voxtral-small-24b-2507": { + id: "mistralai/voxtral-small-24b-2507", + name: "Mistral: Voxtral Small 24B 2507", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 32000, output: 6400 }, + }, + "mistralai/mixtral-8x7b-instruct": { + id: "mistralai/mixtral-8x7b-instruct", + name: "Mistral: Mixtral 8x7B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-12-10", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.54, output: 0.54 }, + limit: { context: 32768, output: 16384 }, + }, + "mistralai/mistral-medium-3": { + id: "mistralai/mistral-medium-3", + name: "Mistral: Mistral Medium 3", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, output: 26215 }, + }, + "mistralai/mistral-small-3.2-24b-instruct": { + id: "mistralai/mistral-small-3.2-24b-instruct", + name: "Mistral: Mistral Small 3.2 24B", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-06-20", + last_updated: "2025-06-20", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.18, cache_read: 0.03 }, + limit: { context: 131072, output: 131072 }, + }, + "mistralai/devstral-small": { + id: "mistralai/devstral-small", + name: "Mistral: Devstral Small 1.1", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-05-07", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 131072, output: 26215 }, + }, + "mistralai/mistral-large": { + id: "mistralai/mistral-large", + name: "Mistral Large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-24", + last_updated: "2025-12-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 25600 }, + }, + "mistralai/mistral-7b-instruct-v0.1": { + id: "mistralai/mistral-7b-instruct-v0.1", + name: "Mistral: Mistral 7B Instruct v0.1", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.11, output: 0.19 }, + limit: { context: 2824, output: 565 }, + }, + "mistralai/ministral-14b-2512": { + id: "mistralai/ministral-14b-2512", + name: "Mistral: Ministral 3 14B 2512", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 262144, output: 52429 }, + }, + "~anthropic/claude-haiku-latest": { + id: "~anthropic/claude-haiku-latest", + name: "Anthropic: Claude Haiku Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "~anthropic/claude-sonnet-latest": { + id: "~anthropic/claude-sonnet-latest", + name: "Anthropic: Claude Sonnet Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 128000 }, + }, + "~anthropic/claude-opus-latest": { + id: "~anthropic/claude-opus-latest", + name: "Anthropic: Claude Opus Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-16", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "meta-llama/llama-3.3-70b-instruct": { + id: "meta-llama/llama-3.3-70b-instruct", + name: "Meta: Llama 3.3 70B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-08-01", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.32 }, + limit: { context: 131072, output: 16384 }, + }, + "meta-llama/llama-4-scout": { + id: "meta-llama/llama-4-scout", + name: "Meta: Llama 4 Scout", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.3 }, + limit: { context: 327680, output: 16384 }, + }, + "meta-llama/llama-guard-3-8b": { + id: "meta-llama/llama-guard-3-8b", + name: "Llama Guard 3 8B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-04-18", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.06 }, + limit: { context: 131072, output: 26215 }, + }, + "meta-llama/llama-4-maverick": { + id: "meta-llama/llama-4-maverick", + name: "Meta: Llama 4 Maverick", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-12-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 1048576, output: 16384 }, + }, + "meta-llama/llama-3.2-11b-vision-instruct": { + id: "meta-llama/llama-3.2-11b-vision-instruct", + name: "Meta: Llama 3.2 11B Vision Instruct", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-09-25", + last_updated: "2024-09-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.049, output: 0.049 }, + limit: { context: 131072, output: 16384 }, + }, + "meta-llama/llama-guard-4-12b": { + id: "meta-llama/llama-guard-4-12b", + name: "Meta: Llama Guard 4 12B", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 163840, output: 32768 }, + }, + "meta-llama/llama-3.1-70b-instruct": { + id: "meta-llama/llama-3.1-70b-instruct", + name: "Meta: Llama 3.1 70B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-16", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 131072, output: 26215 }, + }, + "meta-llama/llama-3.2-1b-instruct": { + id: "meta-llama/llama-3.2-1b-instruct", + name: "Meta: Llama 3.2 1B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-09-18", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.027, output: 0.2 }, + limit: { context: 60000, output: 12000 }, + }, + "meta-llama/llama-3.2-3b-instruct": { + id: "meta-llama/llama-3.2-3b-instruct", + name: "Meta: Llama 3.2 3B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-09-18", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.051, output: 0.34 }, + limit: { context: 80000, output: 16384 }, + }, + "meta-llama/llama-3-8b-instruct": { + id: "meta-llama/llama-3-8b-instruct", + name: "Meta: Llama 3 8B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-04-25", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.04 }, + limit: { context: 8192, output: 16384 }, + }, + "meta-llama/llama-3.1-8b-instruct": { + id: "meta-llama/llama-3.1-8b-instruct", + name: "Meta: Llama 3.1 8B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.05 }, + limit: { context: 16384, output: 16384 }, + }, + "meta-llama/llama-3-70b-instruct": { + id: "meta-llama/llama-3-70b-instruct", + name: "Meta: Llama 3 70B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.51, output: 0.74 }, + limit: { context: 8192, output: 8000 }, + }, + "x-ai/grok-4.20": { + id: "x-ai/grok-4.20", + name: "xAI: Grok 4.20", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-31", + last_updated: "2026-04-11", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2 }, + limit: { context: 2000000, output: 2000000 }, + }, + "x-ai/grok-code-fast-1:optimized:free": { + id: "x-ai/grok-code-fast-1:optimized:free", + name: "xAI: Grok Code Fast 1 Optimized (experimental, free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-27", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 10000 }, + }, + "x-ai/grok-4.3": { + id: "x-ai/grok-4.3", + name: "xAI: Grok 4.3", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-05-01", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 2.5, cache_read: 0.2 }, + limit: { context: 1000000, output: 4096 }, + }, + "x-ai/grok-4-fast": { + id: "x-ai/grok-4-fast", + name: "xAI: Grok 4 Fast", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "x-ai/grok-code-fast-1": { + id: "x-ai/grok-code-fast-1", + name: "xAI: Grok Code Fast 1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "x-ai/grok-3-beta": { + id: "x-ai/grok-3-beta", + name: "xAI: Grok 3 Beta", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 26215 }, + }, + "x-ai/grok-4": { + id: "x-ai/grok-4", + name: "xAI: Grok 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 51200 }, + }, + "x-ai/grok-3-mini": { + id: "x-ai/grok-3-mini", + name: "xAI: Grok 3 Mini", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 26215 }, + }, + "x-ai/grok-4.1-fast": { + id: "x-ai/grok-4.1-fast", + name: "xAI: Grok 4.1 Fast", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-11-19", + last_updated: "2025-11-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "x-ai/grok-3-mini-beta": { + id: "x-ai/grok-3-mini-beta", + name: "xAI: Grok 3 Mini Beta", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 26215 }, + }, + "x-ai/grok-4.20-multi-agent": { + id: "x-ai/grok-4.20-multi-agent", + name: "xAI: Grok 4.20 Multi-Agent", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-31", + last_updated: "2026-04-11", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2 }, + limit: { context: 2000000, output: 2000000 }, + }, + "x-ai/grok-3": { + id: "x-ai/grok-3", + name: "xAI: Grok 3", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 26215 }, + }, + "tencent/hy3-preview:free": { + id: "tencent/hy3-preview:free", + name: "Tencent: Hy3 Preview (free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-22", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "tencent/hunyuan-a13b-instruct": { + id: "tencent/hunyuan-a13b-instruct", + name: "Tencent: Hunyuan A13B Instruct", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131072, output: 131072 }, + }, + "gryphe/mythomax-l2-13b": { + id: "gryphe/mythomax-l2-13b", + name: "MythoMax 13B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-04-25", + last_updated: "2024-04-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.06 }, + limit: { context: 4096, output: 4096 }, + }, + "sao10k/l3-euryale-70b": { + id: "sao10k/l3-euryale-70b", + name: "Sao10k: Llama 3 Euryale 70B v2.1", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-06-18", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.48, output: 1.48 }, + limit: { context: 8192, output: 8192 }, + }, + "sao10k/l3-lunaris-8b": { + id: "sao10k/l3-lunaris-8b", + name: "Sao10K: Llama 3 8B Lunaris", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-08-13", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.05 }, + limit: { context: 8192, output: 8192 }, + }, + "sao10k/l3.3-euryale-70b": { + id: "sao10k/l3.3-euryale-70b", + name: "Sao10K: Llama 3.3 Euryale 70B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-12-18", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.65, output: 0.75 }, + limit: { context: 131072, output: 16384 }, + }, + "sao10k/l3.1-70b-hanami-x1": { + id: "sao10k/l3.1-70b-hanami-x1", + name: "Sao10K: Llama 3.1 70B Hanami x1", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-01-08", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 3, output: 3 }, + limit: { context: 16000, output: 16000 }, + }, + "sao10k/l3.1-euryale-70b": { + id: "sao10k/l3.1-euryale-70b", + name: "Sao10K: Llama 3.1 Euryale 70B v2.2", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-08-28", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.85, output: 0.85 }, + limit: { context: 131072, output: 16384 }, + }, + "microsoft/wizardlm-2-8x22b": { + id: "microsoft/wizardlm-2-8x22b", + name: "WizardLM-2 8x22B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-04-24", + last_updated: "2024-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.62, output: 0.62 }, + limit: { context: 65535, output: 8000 }, + }, + "microsoft/phi-4-mini-instruct": { + id: "microsoft/phi-4-mini-instruct", + name: "Microsoft: Phi 4 Mini Instruct", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-10-17", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.35, cache_read: 0.08 }, + limit: { context: 128000, output: 128000 }, + }, + "microsoft/phi-4": { + id: "microsoft/phi-4", + name: "Microsoft: Phi 4", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.14 }, + limit: { context: 16384, output: 16384 }, + }, + "poolside/laguna-m.1:free": { + id: "poolside/laguna-m.1:free", + name: "Poolside: Laguna M.1 (free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "poolside/laguna-xs.2:free": { + id: "poolside/laguna-xs.2:free", + name: "Poolside: Laguna XS.2 (free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "cohere/command-r7b-12-2024": { + id: "cohere/command-r7b-12-2024", + name: "Cohere: Command R7B (12-2024)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-02-27", + last_updated: "2024-02-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.0375, output: 0.15 }, + limit: { context: 128000, output: 4000 }, + }, + "cohere/command-a": { + id: "cohere/command-a", + name: "Cohere: Command A", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, output: 8192 }, + }, + "cohere/command-r-plus-08-2024": { + id: "cohere/command-r-plus-08-2024", + name: "Cohere: Command R+ (08-2024)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-08-30", + last_updated: "2024-08-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 4000 }, + }, + "cohere/command-r-08-2024": { + id: "cohere/command-r-08-2024", + name: "Cohere: Command R (08-2024)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-08-30", + last_updated: "2024-08-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4000 }, + }, + "prime-intellect/intellect-3": { + id: "prime-intellect/intellect-3", + name: "Prime Intellect: INTELLECT-3", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-11-26", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 131072, output: 131072 }, + }, + "nvidia/llama-3.3-nemotron-super-49b-v1.5": { + id: "nvidia/llama-3.3-nemotron-super-49b-v1.5", + name: "NVIDIA: Llama 3.3 Nemotron Super 49B V1.5", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-03-16", + last_updated: "2025-03-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 131072, output: 26215 }, + }, + "nvidia/nemotron-3-super-120b-a12b": { + id: "nvidia/nemotron-3-super-120b-a12b", + name: "NVIDIA: Nemotron 3 Super", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.5, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "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)", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-05-01", + modalities: { input: ["text", "audio", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 65536 }, + }, + "nvidia/nemotron-3-nano-30b-a3b": { + id: "nvidia/nemotron-3-nano-30b-a3b", + name: "NVIDIA: Nemotron 3 Nano 30B A3B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-12", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.2 }, + limit: { context: 262144, output: 52429 }, + }, + "nvidia/nemotron-3-super-120b-a12b:free": { + id: "nvidia/nemotron-3-super-120b-a12b:free", + name: "NVIDIA: Nemotron 3 Super (free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-12", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "nvidia/nemotron-nano-9b-v2": { + id: "nvidia/nemotron-nano-9b-v2", + name: "NVIDIA: Nemotron Nano 9B V2", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-18", + last_updated: "2025-08-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.16 }, + limit: { context: 131072, output: 26215 }, + }, + "nvidia/llama-3.1-nemotron-70b-instruct": { + id: "nvidia/llama-3.1-nemotron-70b-instruct", + name: "NVIDIA: Llama 3.1 Nemotron 70B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-10-12", + last_updated: "2024-10-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 1.2 }, + limit: { context: 131072, output: 16384 }, + }, + "inception/mercury-2": { + id: "inception/mercury-2", + name: "Inception: Mercury 2", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-24", + last_updated: "2026-02-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75, cache_read: 0.025 }, + limit: { context: 128000, output: 50000 }, + }, + "openai/gpt-5.1-codex-max": { + id: "openai/gpt-5.1-codex-max", + name: "OpenAI: GPT-5.1-Codex-Max", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-chat": { + id: "openai/gpt-5.2-chat", + name: "OpenAI: GPT-5.2 Chat", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-12-11", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4o-mini-search-preview": { + id: "openai/gpt-4o-mini-search-preview", + name: "OpenAI: GPT-4o-mini Search Preview", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-01", + last_updated: "2025-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5-chat": { + id: "openai/gpt-5-chat", + name: "OpenAI: GPT-5 Chat", + attachment: true, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-08-07", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4o-2024-05-13": { + id: "openai/gpt-4o-2024-05-13", + name: "OpenAI: GPT-4o (2024-05-13)", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-05-13", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 15 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-5.3-chat": { + id: "openai/gpt-5.3-chat", + name: "OpenAI: GPT-5.3 Chat", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2026-03-04", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "OpenAI: GPT-5.2 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-11", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 21, output: 168 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4-1106-preview": { + id: "openai/gpt-4-1106-preview", + name: "OpenAI: GPT-4 Turbo (older v1106)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-11-06", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-chat-latest": { + id: "openai/gpt-chat-latest", + name: "OpenAI: GPT Chat Latest", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + release_date: "2026-05-05", + last_updated: "2026-05-07", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 30, cache_read: 0.5 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4o-audio-preview": { + id: "openai/gpt-4o-audio-preview", + name: "OpenAI: GPT-4o Audio", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-15", + last_updated: "2026-03-15", + modalities: { input: ["audio", "text"], output: ["audio", "text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.5": { + id: "openai/gpt-5.5", + name: "OpenAI: GPT-5.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-24", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 30, cache_read: 0.5 }, + limit: { context: 1050000, output: 128000 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "OpenAI: GPT-5 Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-07", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "OpenAI: GPT-5 Nano", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-07", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "OpenAI: GPT-5.3-Codex", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-02-25", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-3.5-turbo-16k": { + id: "openai/gpt-3.5-turbo-16k", + name: "OpenAI: GPT-3.5 Turbo 16k", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-08-28", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 4 }, + limit: { context: 16385, output: 4096 }, + }, + "openai/gpt-4-turbo": { + id: "openai/gpt-4-turbo", + name: "OpenAI: GPT-4 Turbo", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-09-13", + last_updated: "2024-04-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "OpenAI: GPT-5.2", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-11", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/o3-pro": { + id: "openai/o3-pro", + name: "OpenAI: o3 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-16", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 20, output: 80 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o3-mini-high": { + id: "openai/o3-mini-high", + name: "OpenAI: o3 Mini High", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-01-31", + last_updated: "2026-03-15", + modalities: { input: ["pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "OpenAI: GPT-4o-mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-18", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.075 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o4-mini-deep-research": { + id: "openai/o4-mini-deep-research", + name: "OpenAI: o4 Mini Deep Research", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-06-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-mini": { + id: "openai/gpt-5.4-mini", + name: "OpenAI: GPT-5.4 Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-03-17", + last_updated: "2026-04-11", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1-chat": { + id: "openai/gpt-5.1-chat", + name: "OpenAI: GPT-5.1 Chat", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-11-13", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "OpenAI: o4 Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-16", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.275 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-nano": { + id: "openai/gpt-5.4-nano", + name: "OpenAI: GPT-5.4 Nano", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-03-17", + last_updated: "2026-04-11", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "OpenAI: GPT-5.2-Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4o-mini-2024-07-18": { + id: "openai/gpt-4o-mini-2024-07-18", + name: "OpenAI: GPT-4o-mini (2024-07-18)", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-18", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "OpenAI: GPT-5.1-Codex-Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 100000 }, + }, + "openai/gpt-4o-2024-08-06": { + id: "openai/gpt-4o-2024-08-06", + name: "OpenAI: GPT-4o (2024-08-06)", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-08-06", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5-image": { + id: "openai/gpt-5-image", + name: "OpenAI: GPT-5 Image", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-14", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["image", "text"] }, + open_weights: false, + cost: { input: 10, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "OpenAI: GPT-5.1", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-13", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/o1": { + id: "openai/o1", + name: "OpenAI: o1", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-12-05", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-pro": { + id: "openai/gpt-5.4-pro", + name: "OpenAI: GPT-5.4 Pro", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-03-06", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 180 }, + limit: { context: 1050000, output: 128000 }, + }, + "openai/gpt-3.5-turbo": { + id: "openai/gpt-3.5-turbo", + name: "OpenAI: GPT-3.5 Turbo", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-03-01", + last_updated: "2023-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 16385, output: 4096 }, + }, + "openai/o3-deep-research": { + id: "openai/o3-deep-research", + name: "OpenAI: o3 Deep Research", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-06-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 40, cache_read: 2.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o3-mini": { + id: "openai/o3-mini", + name: "OpenAI: o3 Mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-12-20", + last_updated: "2026-03-15", + modalities: { input: ["pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4-turbo-preview": { + id: "openai/gpt-4-turbo-preview", + name: "OpenAI: GPT-4 Turbo Preview", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-01-25", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/o1-pro": { + id: "openai/o1-pro", + name: "OpenAI: o1-pro", + attachment: true, + reasoning: true, + tool_call: false, + temperature: false, + release_date: "2025-03-19", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 150, output: 600 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-image-2": { + id: "openai/gpt-5.4-image-2", + name: "OpenAI: GPT-5.4 Image 2", + attachment: true, + reasoning: true, + tool_call: false, + temperature: false, + release_date: "2026-04-21", + last_updated: "2026-05-01", + modalities: { input: ["image", "text", "pdf"], output: ["image", "text"] }, + open_weights: false, + cost: { input: 8, output: 15, cache_read: 2 }, + limit: { context: 272000, output: 128000 }, + }, + "openai/gpt-4": { + id: "openai/gpt-4", + name: "OpenAI: GPT-4", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-03-14", + last_updated: "2024-04-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 60 }, + limit: { context: 8191, output: 4096 }, + }, + "openai/gpt-4-0314": { + id: "openai/gpt-4-0314", + name: "OpenAI: GPT-4 (older v0314)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-05-28", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 60 }, + limit: { context: 8191, output: 4096 }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "OpenAI: GPT-5 Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "OpenAI: GPT-5.4", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-03-06", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 15 }, + limit: { context: 1050000, output: 128000 }, + }, + "openai/gpt-audio": { + id: "openai/gpt-audio", + name: "OpenAI: GPT Audio", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-01-20", + last_updated: "2026-03-15", + modalities: { input: ["audio", "text"], output: ["audio", "text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4o-search-preview": { + id: "openai/gpt-4o-search-preview", + name: "OpenAI: GPT-4o Search Preview", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2025-03-13", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4.1-nano": { + id: "openai/gpt-4.1-nano", + name: "OpenAI: GPT-4.1 Nano", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-14", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/o4-mini-high": { + id: "openai/o4-mini-high", + name: "OpenAI: o4 Mini High", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2025-04-17", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o3": { + id: "openai/o3", + name: "OpenAI: o3", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-16", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "OpenAI: gpt-oss-20b", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.14 }, + limit: { context: 131072, output: 26215 }, + }, + "openai/gpt-5-pro": { + id: "openai/gpt-5-pro", + name: "OpenAI: GPT-5 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-10-06", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 120 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-audio-mini": { + id: "openai/gpt-audio-mini", + name: "OpenAI: GPT Audio Mini", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-01-20", + last_updated: "2026-03-15", + modalities: { input: ["audio", "text"], output: ["audio", "text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.4 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4o": { + id: "openai/gpt-4o", + name: "OpenAI: GPT-4o", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-05-13", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-3.5-turbo-0613": { + id: "openai/gpt-3.5-turbo-0613", + name: "OpenAI: GPT-3.5 Turbo (older v0613)", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2023-06-13", + last_updated: "2023-06-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 2 }, + limit: { context: 4095, output: 4096 }, + }, + "openai/gpt-5-image-mini": { + id: "openai/gpt-5-image-mini", + name: "OpenAI: GPT-5 Image Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-16", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["image", "text"] }, + open_weights: false, + cost: { input: 2.5, output: 2 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "OpenAI: GPT-5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-07", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-oss-safeguard-20b": { + id: "openai/gpt-oss-safeguard-20b", + name: "OpenAI: gpt-oss-safeguard-20b", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-29", + last_updated: "2025-10-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3, cache_read: 0.037 }, + limit: { context: 131072, output: 65536 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "OpenAI: gpt-oss-120b", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.039, output: 0.19 }, + limit: { context: 131072, output: 26215 }, + }, + "openai/gpt-5.5-pro": { + id: "openai/gpt-5.5-pro", + name: "OpenAI: GPT-5.5 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-24", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 180 }, + limit: { context: 1050000, output: 128000 }, + }, + "openai/gpt-3.5-turbo-instruct": { + id: "openai/gpt-3.5-turbo-instruct", + name: "OpenAI: GPT-3.5 Turbo Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2023-03-01", + last_updated: "2023-09-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 2 }, + limit: { context: 4095, output: 4096 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "OpenAI: GPT-4.1", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-14", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "OpenAI: GPT-4.1 Mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-14", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "OpenAI: GPT-5.1-Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-13", + last_updated: "2025-11-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4o-2024-11-20": { + id: "openai/gpt-4o-2024-11-20", + name: "OpenAI: GPT-4o (2024-11-20)", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-20", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "amazon/nova-lite-v1": { + id: "amazon/nova-lite-v1", + name: "Amazon: Nova Lite 1.0", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-06", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.24 }, + limit: { context: 300000, output: 5120 }, + }, + "amazon/nova-pro-v1": { + id: "amazon/nova-pro-v1", + name: "Amazon: Nova Pro 1.0", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 3.2 }, + limit: { context: 300000, output: 5120 }, + }, + "amazon/nova-premier-v1": { + id: "amazon/nova-premier-v1", + name: "Amazon: Nova Premier 1.0", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-11-01", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 12.5 }, + limit: { context: 1000000, output: 32000 }, + }, + "amazon/nova-2-lite-v1": { + id: "amazon/nova-2-lite-v1", + name: "Amazon: Nova 2 Lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1000000, output: 65535 }, + }, + "amazon/nova-micro-v1": { + id: "amazon/nova-micro-v1", + name: "Amazon: Nova Micro 1.0", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-06", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.035, output: 0.14 }, + limit: { context: 128000, output: 5120 }, + }, + "z-ai/glm-5v-turbo": { + id: "z-ai/glm-5v-turbo", + name: "Z.ai: GLM 5V Turbo", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-11", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 1.2, output: 4, cache_read: 0.24 }, + limit: { context: 202752, output: 131072 }, + }, + "z-ai/glm-4.7": { + id: "z-ai/glm-4.7", + name: "Z.ai: GLM 4.7", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-22", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.38, output: 1.98, cache_read: 0.2 }, + limit: { context: 202752, output: 65535 }, + }, + "z-ai/glm-5": { + id: "z-ai/glm-5", + name: "Z.ai: GLM 5", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.72, output: 2.3 }, + limit: { context: 202752, output: 131072 }, + }, + "z-ai/glm-4-32b": { + id: "z-ai/glm-4-32b", + name: "Z.ai: GLM 4 32B ", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-25", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 32768 }, + }, + "z-ai/glm-5.1": { + id: "z-ai/glm-5.1", + name: "Z.ai: GLM 5.1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.26, output: 3.96 }, + limit: { context: 202752, output: 131072 }, + }, + "z-ai/glm-4.5": { + id: "z-ai/glm-4.5", + name: "Z.ai: GLM 4.5", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2, cache_read: 0.175 }, + limit: { context: 131072, output: 98304 }, + }, + "z-ai/glm-4.5-air": { + id: "z-ai/glm-4.5-air", + name: "Z.ai: GLM 4.5 Air", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.85, cache_read: 0.025 }, + limit: { context: 131072, output: 98304 }, + }, + "z-ai/glm-5-turbo": { + id: "z-ai/glm-5-turbo", + name: "Z.ai: GLM 5 Turbo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.2, output: 4, cache_read: 0.24 }, + limit: { context: 202752, output: 131072 }, + }, + "z-ai/glm-4.5v": { + id: "z-ai/glm-4.5v", + name: "Z.ai: GLM 4.5V", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-11", + last_updated: "2025-08-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.8, cache_read: 0.11 }, + limit: { context: 65536, output: 16384 }, + }, + "z-ai/glm-4.6": { + id: "z-ai/glm-4.6", + name: "Z.ai: GLM 4.6", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-30", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.39, output: 1.9, cache_read: 0.175 }, + limit: { context: 204800, output: 204800 }, + }, + "z-ai/glm-4.6v": { + id: "z-ai/glm-4.6v", + name: "Z.ai: GLM 4.6V", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-30", + last_updated: "2026-01-10", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 131072, output: 131072 }, + }, + "z-ai/glm-4.7-flash": { + id: "z-ai/glm-4.7-flash", + name: "Z.ai: GLM 4.7 Flash", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.4, cache_read: 0.01 }, + limit: { context: 202752, output: 40551 }, + }, + "baidu/ernie-4.5-vl-424b-a47b": { + id: "baidu/ernie-4.5-vl-424b-a47b", + name: "Baidu: ERNIE 4.5 VL 424B A47B ", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-06-30", + last_updated: "2026-01", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.42, output: 1.25 }, + limit: { context: 123000, output: 16000 }, + }, + "baidu/qianfan-ocr-fast:free": { + id: "baidu/qianfan-ocr-fast:free", + name: "Baidu: Qianfan-OCR-Fast (free)", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-05-01", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 65536, output: 28672 }, + }, + "baidu/cobuddy:free": { + id: "baidu/cobuddy:free", + name: "Baidu: CoBuddy (free)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-05-06", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 65536 }, + }, + "baidu/ernie-4.5-vl-28b-a3b": { + id: "baidu/ernie-4.5-vl-28b-a3b", + name: "Baidu: ERNIE 4.5 VL 28B A3B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-06-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.56 }, + limit: { context: 30000, output: 8000 }, + }, + "baidu/ernie-4.5-21b-a3b": { + id: "baidu/ernie-4.5-21b-a3b", + name: "Baidu: ERNIE 4.5 21B A3B", + 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, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 120000, output: 8000 }, + }, + "baidu/ernie-4.5-300b-a47b": { + id: "baidu/ernie-4.5-300b-a47b", + name: "Baidu: ERNIE 4.5 300B A47B ", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-06-30", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 1.1 }, + limit: { context: 123000, output: 12000 }, + }, + "baidu/ernie-4.5-21b-a3b-thinking": { + id: "baidu/ernie-4.5-21b-a3b-thinking", + name: "Baidu: ERNIE 4.5 21B A3B Thinking", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 131072, output: 65536 }, + }, + "relace/relace-apply-3": { + id: "relace/relace-apply-3", + name: "Relace: Relace Apply 3", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2025-09-26", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.85, output: 1.25 }, + limit: { context: 256000, output: 128000 }, + }, + "relace/relace-search": { + id: "relace/relace-search", + name: "Relace: Relace Search", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-09", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3 }, + limit: { context: 256000, output: 128000 }, + }, + "minimax/minimax-m2.7": { + id: "minimax/minimax-m2.7", + name: "MiniMax: MiniMax M2.7", + family: "minimax-m2.7", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2": { + id: "minimax/minimax-m2", + name: "MiniMax: MiniMax M2", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-23", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.255, output: 1, cache_read: 0.03 }, + limit: { context: 196608, output: 196608 }, + }, + "minimax/minimax-01": { + id: "minimax/minimax-01", + name: "MiniMax: MiniMax-01", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-01-15", + last_updated: "2025-01-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 1000192, output: 1000192 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "MiniMax: MiniMax M2.1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.95, cache_read: 0.03 }, + limit: { context: 196608, output: 39322 }, + }, + "minimax/minimax-m1": { + id: "minimax/minimax-m1", + name: "MiniMax: MiniMax M1", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-17", + last_updated: "2025-06-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2.2 }, + limit: { context: 1000000, output: 40000 }, + }, + "minimax/minimax-m2-her": { + id: "minimax/minimax-m2-her", + name: "MiniMax: MiniMax M2-her", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-01-23", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 65536, output: 2048 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax: MiniMax M2.5", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 1.2, cache_read: 0.029 }, + limit: { context: 196608, output: 196608 }, + }, + "~openai/gpt-latest": { + id: "~openai/gpt-latest", + name: "OpenAI: GPT Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 30, cache_read: 0.5 }, + limit: { context: 1050000, output: 128000 }, + }, + "~openai/gpt-mini-latest": { + id: "~openai/gpt-mini-latest", + name: "OpenAI: GPT Mini Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, output: 128000 }, + }, + "qwen/qwen3-235b-a22b": { + id: "qwen/qwen3-235b-a22b", + name: "Qwen: Qwen3 235B A22B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.455, output: 1.82, cache_read: 0.15 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen/qwen3.5-122b-a10b": { + id: "qwen/qwen3.5-122b-a10b", + name: "Qwen: Qwen3.5-122B-A10B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.26, output: 2.08 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-coder-plus": { + id: "qwen/qwen3-coder-plus", + name: "Qwen: Qwen3 Coder Plus", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-01", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.65, output: 3.25, cache_read: 0.2 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3.6-27b": { + id: "qwen/qwen3.6-27b", + name: "Qwen: Qwen3.6 27B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.325, output: 3.25 }, + limit: { context: 256000, output: 65536 }, + }, + "qwen/qwen3.5-27b": { + id: "qwen/qwen3.5-27b", + name: "Qwen: Qwen3.5-27B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.195, output: 1.56 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-235b-a22b-2507": { + id: "qwen/qwen3-235b-a22b-2507", + name: "Qwen: Qwen3 235B A22B Instruct 2507", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04", + last_updated: "2026-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.071, output: 0.1 }, + limit: { context: 262144, output: 52429 }, + }, + "qwen/qwen3-8b": { + id: "qwen/qwen3-8b", + name: "Qwen: Qwen3 8B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.4, cache_read: 0.05 }, + limit: { context: 40960, output: 8192 }, + }, + "qwen/qwen3.5-397b-a17b": { + id: "qwen/qwen3.5-397b-a17b", + name: "Qwen: Qwen3.5 397B A17B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.39, output: 2.34 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen-vl-plus": { + id: "qwen/qwen-vl-plus", + name: "Qwen: Qwen VL Plus", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-01-25", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1365, output: 0.4095, cache_read: 0.042 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen/qwen3-32b": { + id: "qwen/qwen3-32b", + name: "Qwen: Qwen3 32B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.24, cache_read: 0.04 }, + limit: { context: 40960, output: 40960 }, + }, + "qwen/qwen2.5-vl-72b-instruct": { + id: "qwen/qwen2.5-vl-72b-instruct", + name: "Qwen: Qwen2.5 VL 72B Instruct", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-02-01", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 0.8, cache_read: 0.075 }, + limit: { context: 32768, output: 32768 }, + }, + "qwen/qwen-max": { + id: "qwen/qwen-max", + name: "Qwen: Qwen-Max ", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-04-03", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.04, output: 4.16, cache_read: 0.32 }, + limit: { context: 32768, output: 8192 }, + }, + "qwen/qwen-plus": { + id: "qwen/qwen-plus", + name: "Qwen: Qwen-Plus", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-01-25", + last_updated: "2025-09-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.2, cache_read: 0.08 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen/qwen3.6-35b-a3b": { + id: "qwen/qwen3.6-35b-a3b", + name: "Qwen: Qwen3.6 35B A3B", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1612, output: 0.96525, cache_read: 0.1612 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-vl-235b-a22b-thinking": { + id: "qwen/qwen3-vl-235b-a22b-thinking", + name: "Qwen: Qwen3 VL 235B A22B Thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-24", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.26, output: 2.6 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-vl-30b-a3b-thinking": { + id: "qwen/qwen3-vl-30b-a3b-thinking", + name: "Qwen: Qwen3 VL 30B A3B Thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-11", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 1.56 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-vl-8b-instruct": { + id: "qwen/qwen3-vl-8b-instruct", + name: "Qwen: Qwen3 VL 8B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-10-15", + last_updated: "2025-11-25", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.5 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3.5-flash-02-23": { + id: "qwen/qwen3.5-flash-02-23", + name: "Qwen: Qwen3.5-Flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3.6-plus": { + id: "qwen/qwen3.6-plus", + name: "Qwen: Qwen3.6 Plus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-26", + last_updated: "2026-04-11", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.325, output: 1.95, cache_read: 0.0325, cache_write: 0.40625 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3-max": { + id: "qwen/qwen3-max", + name: "Qwen: Qwen3 Max", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-05", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 6, cache_read: 0.24 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen/qwen-plus-2025-07-28": { + id: "qwen/qwen-plus-2025-07-28", + name: "Qwen: Qwen Plus 0728", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-09", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.26, output: 0.78 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen/qwen3-30b-a3b-instruct-2507": { + id: "qwen/qwen3-30b-a3b-instruct-2507", + name: "Qwen: Qwen3 30B A3B Instruct 2507", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-29", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.3, cache_read: 0.04 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3-vl-32b-instruct": { + id: "qwen/qwen3-vl-32b-instruct", + name: "Qwen: Qwen3 VL 32B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-10-21", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.104, output: 0.416 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-235b-a22b-thinking-2507": { + id: "qwen/qwen3-235b-a22b-thinking-2507", + name: "Qwen: Qwen3 235B A22B Thinking 2507", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-25", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11, output: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3-next-80b-a3b-thinking": { + id: "qwen/qwen3-next-80b-a3b-thinking", + name: "Qwen: Qwen3 Next 80B A3B Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.0975, output: 0.78 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-30b-a3b-thinking-2507": { + id: "qwen/qwen3-30b-a3b-thinking-2507", + name: "Qwen: Qwen3 30B A3B Thinking 2507", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.051, output: 0.34 }, + limit: { context: 32768, output: 6554 }, + }, + "qwen/qwen-2.5-7b-instruct": { + id: "qwen/qwen-2.5-7b-instruct", + name: "Qwen: Qwen2.5 7B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-09", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.1 }, + limit: { context: 32768, output: 6554 }, + }, + "qwen/qwen-vl-max": { + id: "qwen/qwen-vl-max", + name: "Qwen: Qwen VL Max", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-04-08", + last_updated: "2025-08-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 3.2 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-coder-flash": { + id: "qwen/qwen3-coder-flash", + name: "Qwen: Qwen3 Coder Flash", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-23", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.195, output: 0.975, cache_read: 0.06 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3-30b-a3b": { + id: "qwen/qwen3-30b-a3b", + name: "Qwen: Qwen3 30B A3B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.28, cache_read: 0.03 }, + limit: { context: 40960, output: 40960 }, + }, + "qwen/qwen3-next-80b-a3b-instruct": { + id: "qwen/qwen3-next-80b-a3b-instruct", + name: "Qwen: Qwen3 Next 80B A3B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 1.1 }, + limit: { context: 131072, output: 52429 }, + }, + "qwen/qwen3.5-plus-20260420": { + id: "qwen/qwen3.5-plus-20260420", + name: "Qwen: Qwen3.5 Plus 2026-04-20", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2.4 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3-coder-next": { + id: "qwen/qwen3-coder-next", + name: "Qwen: Qwen3 Coder Next", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-02-02", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.75, cache_read: 0.035 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen-2.5-coder-32b-instruct": { + id: "qwen/qwen-2.5-coder-32b-instruct", + name: "Qwen2.5 Coder 32B Instruct", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-11-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2, cache_read: 0.015 }, + limit: { context: 32768, output: 8192 }, + }, + "qwen/qwen3-vl-30b-a3b-instruct": { + id: "qwen/qwen3-vl-30b-a3b-instruct", + name: "Qwen: Qwen3 VL 30B A3B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-10-05", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-coder-30b-a3b-instruct": { + id: "qwen/qwen3-coder-30b-a3b-instruct", + name: "Qwen: Qwen3 Coder 30B A3B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-31", + last_updated: "2025-07-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.27 }, + limit: { context: 160000, output: 32768 }, + }, + "qwen/qwen3-max-thinking": { + id: "qwen/qwen3-max-thinking", + name: "Qwen: Qwen3 Max Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-01-23", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.78, output: 3.9 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen/qwen-turbo": { + id: "qwen/qwen-turbo", + name: "Qwen: Qwen-Turbo", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-01", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0325, output: 0.13, cache_read: 0.01 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen/qwen3-vl-235b-a22b-instruct": { + id: "qwen/qwen3-vl-235b-a22b-instruct", + name: "Qwen: Qwen3 VL 235B A22B Instruct", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-09-23", + last_updated: "2026-01-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.88, cache_read: 0.11 }, + limit: { context: 262144, output: 52429 }, + }, + "qwen/qwen3-coder": { + id: "qwen/qwen3-coder", + name: "Qwen: Qwen3 Coder 480B A35B", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-23", + last_updated: "2025-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 1, cache_read: 0.022 }, + limit: { context: 262144, output: 52429 }, + }, + "qwen/qwen3.5-9b": { + id: "qwen/qwen3.5-9b", + name: "Qwen: Qwen3.5-9B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-10", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.15 }, + limit: { context: 256000, output: 32768 }, + }, + "qwen/qwen3-vl-8b-thinking": { + id: "qwen/qwen3-vl-8b-thinking", + name: "Qwen: Qwen3 VL 8B Thinking", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-15", + last_updated: "2025-11-25", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.117, output: 1.365 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3.6-max-preview": { + id: "qwen/qwen3.6-max-preview", + name: "Qwen: Qwen3.6 Max Preview", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.04, output: 6.24, cache_write: 1.3 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen-plus-2025-07-28:thinking": { + id: "qwen/qwen-plus-2025-07-28:thinking", + name: "Qwen: Qwen Plus 0728 (thinking)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-09", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.26, output: 0.78 }, + limit: { context: 1000000, output: 32768 }, + }, + "qwen/qwen-2.5-72b-instruct": { + id: "qwen/qwen-2.5-72b-instruct", + name: "Qwen2.5 72B Instruct", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-09", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.39 }, + limit: { context: 32768, output: 16384 }, + }, + "qwen/qwen3-14b": { + id: "qwen/qwen3-14b", + name: "Qwen: Qwen3 14B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.24, cache_read: 0.025 }, + limit: { context: 40960, output: 40960 }, + }, + "qwen/qwen3.5-35b-a3b": { + id: "qwen/qwen3.5-35b-a3b", + name: "Qwen: Qwen3.5-35B-A3B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1625, output: 1.3 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3.5-plus-02-15": { + id: "qwen/qwen3.5-plus-02-15", + name: "Qwen: Qwen3.5 Plus 2026-02-15", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-03-15", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.26, output: 1.56 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen/qwen3.6-flash": { + id: "qwen/qwen3.6-flash", + name: "Qwen: Qwen3.6 Flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5, cache_write: 0.3125 }, + limit: { context: 1000000, output: 65536 }, + }, + "alfredpros/codellama-7b-instruct-solidity": { + id: "alfredpros/codellama-7b-instruct-solidity", + name: "AlfredPros: CodeLLaMa 7B Instruct Solidity", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-14", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 1.2 }, + limit: { context: 4096, output: 4096 }, + }, + "kwaipilot/kat-coder-pro-v2": { + id: "kwaipilot/kat-coder-pro-v2", + name: "Kwaipilot: KAT-Coder-Pro V2", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 256000, output: 80000 }, + }, + "google/gemini-2.5-pro-preview-05-06": { + id: "google/gemini-2.5-pro-preview-05-06", + name: "Google: Gemini 2.5 Pro Preview 05-06", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-06", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, reasoning: 10, cache_read: 0.125, cache_write: 0.375 }, + limit: { context: 1048576, output: 65535 }, + }, + "google/lyria-3-clip-preview": { + id: "google/lyria-3-clip-preview", + name: "Google: Lyria 3 Clip Preview", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-04-11", + modalities: { input: ["image", "text"], output: ["audio", "text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3.1-pro-preview-customtools": { + id: "google/gemini-3.1-pro-preview-customtools", + name: "Google: Gemini 3.1 Pro Preview Custom Tools", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, reasoning: 12 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-flash-lite-preview-09-2025": { + id: "google/gemini-2.5-flash-lite-preview-09-2025", + name: "Google: Gemini 2.5 Flash Lite Preview 09-2025", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-25", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, reasoning: 0.4, cache_read: 0.01, cache_write: 0.083333 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.0-flash-001": { + id: "google/gemini-2.0-flash-001", + name: "Google: Gemini 2.0 Flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-11", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025, cache_write: 0.083333 }, + limit: { context: 1048576, output: 8192 }, + }, + "google/lyria-3-pro-preview": { + id: "google/lyria-3-pro-preview", + name: "Google: Lyria 3 Pro Preview", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-04-11", + modalities: { input: ["image", "text"], output: ["audio", "text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemma-3n-e4b-it": { + id: "google/gemma-3n-e4b-it", + name: "Google: Gemma 3n 4B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.04 }, + limit: { context: 32768, output: 6554 }, + }, + "google/gemini-3.1-flash-lite-preview": { + id: "google/gemini-3.1-flash-lite-preview", + name: "Google: Gemini 3.1 Flash Lite Preview", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-03", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5, reasoning: 1.5 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3.1-pro-preview": { + id: "google/gemini-3.1-pro-preview", + name: "Google: Gemini 3.1 Pro Preview", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-19", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, reasoning: 12 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-flash-preview": { + id: "google/gemini-3-flash-preview", + name: "Google: Gemini 3 Flash Preview", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-17", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, reasoning: 3, cache_read: 0.05, cache_write: 0.083333 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Google: Gemini 2.5 Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-03-20", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, reasoning: 10, cache_read: 0.125, cache_write: 0.375 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-pro-image-preview": { + id: "google/gemini-3-pro-image-preview", + name: "Google: Nano Banana Pro (Gemini 3 Pro Image Preview)", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-11-20", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["image", "text"] }, + open_weights: false, + cost: { input: 2, output: 12, reasoning: 12 }, + limit: { context: 65536, output: 32768 }, + }, + "google/gemma-4-31b-it": { + id: "google/gemma-4-31b-it", + name: "Google: Gemma 4 31B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-11", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.4 }, + limit: { context: 262144, output: 131072 }, + }, + "google/gemini-2.5-flash-image": { + id: "google/gemini-2.5-flash-image", + name: "Google: Nano Banana (Gemini 2.5 Flash Image)", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-10-08", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["image", "text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 32768, output: 32768 }, + }, + "google/gemma-3-12b-it": { + id: "google/gemma-3-12b-it", + name: "Google: Gemma 3 12B", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-13", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.13, cache_read: 0.015 }, + limit: { context: 131072, output: 131072 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Google: Gemini 2.5 Flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-17", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, reasoning: 2.5, cache_read: 0.03, cache_write: 0.083333 }, + limit: { context: 1048576, output: 65535 }, + }, + "google/gemini-3.1-flash-image-preview": { + id: "google/gemini-3.1-flash-image-preview", + name: "Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["image", "text"] }, + open_weights: false, + cost: { input: 0.5, output: 3 }, + limit: { context: 65536, output: 65536 }, + }, + "google/gemma-3-4b-it": { + id: "google/gemma-3-4b-it", + name: "Google: Gemma 3 4B", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-13", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.08 }, + limit: { context: 131072, output: 19200 }, + }, + "google/gemini-2.5-pro-preview": { + id: "google/gemini-2.5-pro-preview", + name: "Google: Gemini 2.5 Pro Preview 06-05", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-05", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, reasoning: 10, cache_read: 0.125, cache_write: 0.375 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemma-2-27b-it": { + id: "google/gemma-2-27b-it", + name: "Google: Gemma 2 27B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-06-24", + last_updated: "2024-06-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.65, output: 0.65 }, + limit: { context: 8192, output: 2048 }, + }, + "google/gemma-3-27b-it": { + id: "google/gemma-3-27b-it", + name: "Google: Gemma 3 27B", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-03-12", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.11, cache_read: 0.02 }, + limit: { context: 128000, output: 65536 }, + }, + "google/gemma-4-26b-a4b-it": { + id: "google/gemma-4-26b-a4b-it", + name: "Google: Gemma 4 26B A4B", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-03", + last_updated: "2026-04-11", + modalities: { input: ["image", "text", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.4 }, + limit: { context: 262144, output: 262144 }, + }, + "google/gemini-2.5-flash-lite": { + id: "google/gemini-2.5-flash-lite", + name: "Google: Gemini 2.5 Flash Lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-17", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, reasoning: 0.4, cache_read: 0.01, cache_write: 0.083333 }, + limit: { context: 1048576, output: 65535 }, + }, + "google/gemini-2.0-flash-lite-001": { + id: "google/gemini-2.0-flash-lite-001", + name: "Google: Gemini 2.0 Flash Lite", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-11", + last_updated: "2026-03-15", + modalities: { input: ["audio", "image", "pdf", "text", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 1048576, output: 8192 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "MoonshotAI: Kimi K2.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 2.2 }, + limit: { context: 262144, output: 65535 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "MoonshotAI: Kimi K2 0905", + 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, + cost: { input: 0.4, output: 2, cache_read: 0.15 }, + limit: { context: 131072, output: 26215 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "MoonshotAI: Kimi K2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + structured_output: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2": { + id: "moonshotai/kimi-k2", + name: "MoonshotAI: Kimi K2 0711", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-07-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.2 }, + limit: { context: 131000, output: 26215 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "MoonshotAI: Kimi K2 Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-11-06", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.47, output: 2, cache_read: 0.2 }, + limit: { context: 131072, output: 65535 }, + }, + "aion-labs/aion-1.0": { + id: "aion-labs/aion-1.0", + name: "AionLabs: Aion-1.0", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-02-05", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 4, output: 8 }, + limit: { context: 131072, output: 32768 }, + }, + "aion-labs/aion-rp-llama-3.1-8b": { + id: "aion-labs/aion-rp-llama-3.1-8b", + name: "AionLabs: Aion-RP 1.0 (8B)", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-02-05", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 1.6 }, + limit: { context: 32768, output: 32768 }, + }, + "aion-labs/aion-2.0": { + id: "aion-labs/aion-2.0", + name: "AionLabs: Aion-2.0", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-02-24", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 1.6 }, + limit: { context: 131072, output: 32768 }, + }, + "aion-labs/aion-1.0-mini": { + id: "aion-labs/aion-1.0-mini", + name: "AionLabs: Aion-1.0-Mini", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-02-05", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 1.4 }, + limit: { context: 131072, output: 32768 }, + }, + "~moonshotai/kimi-latest": { + id: "~moonshotai/kimi-latest", + name: "MoonshotAI: Kimi Latest", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-27", + last_updated: "2026-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.74, output: 3.49, cache_read: 0.14 }, + limit: { context: 262142, output: 262142 }, + }, + "thedrummer/unslopnemo-12b": { + id: "thedrummer/unslopnemo-12b", + name: "TheDrummer: UnslopNemo 12B", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-11-09", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 32768, output: 32768 }, + }, + "thedrummer/cydonia-24b-v4.1": { + id: "thedrummer/cydonia-24b-v4.1", + name: "TheDrummer: Cydonia 24B V4.1", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-09-27", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.5 }, + limit: { context: 131072, output: 131072 }, + }, + "thedrummer/skyfall-36b-v2": { + id: "thedrummer/skyfall-36b-v2", + name: "TheDrummer: Skyfall 36B V2", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-03-11", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 0.8 }, + limit: { context: 32768, output: 32768 }, + }, + "thedrummer/rocinante-12b": { + id: "thedrummer/rocinante-12b", + name: "TheDrummer: Rocinante 12B", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-09-30", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.43 }, + limit: { context: 32768, output: 32768 }, + }, + "anthropic/claude-opus-4.1": { + id: "anthropic/claude-opus-4.1", + name: "Anthropic: Claude Opus 4.1", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-3.7-sonnet:thinking": { + id: "anthropic/claude-3.7-sonnet:thinking", + name: "Anthropic: Claude 3.7 Sonnet (thinking)", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-02-19", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4.6-fast": { + id: "anthropic/claude-opus-4.6-fast", + name: "Anthropic: Claude Opus 4.6 (Fast)", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-04-07", + last_updated: "2026-04-11", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 150, cache_read: 3, cache_write: 37.5 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-3.7-sonnet": { + id: "anthropic/claude-3.7-sonnet", + name: "Anthropic: Claude 3.7 Sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-02-19", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4.6": { + id: "anthropic/claude-opus-4.6", + name: "Anthropic: Claude Opus 4.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.7": { + id: "anthropic/claude-opus-4.7", + name: "Anthropic: Claude Opus 4.7", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-16", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Anthropic: Claude Sonnet 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-22", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4.5": { + id: "anthropic/claude-sonnet-4.5", + name: "Anthropic: Claude Sonnet 4.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-29", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "anthropic/claude-opus-4.5": { + id: "anthropic/claude-opus-4.5", + name: "Anthropic: Claude Opus 4.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-11-24", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-3-haiku": { + id: "anthropic/claude-3-haiku", + name: "Anthropic: Claude 3 Haiku", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-03-07", + last_updated: "2024-03-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.25, cache_read: 0.03, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Anthropic: Claude Opus 4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-22", + last_updated: "2026-03-15", + modalities: { input: ["image", "pdf", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-3.5-haiku": { + id: "anthropic/claude-3.5-haiku", + name: "Anthropic: Claude 3.5 Haiku", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-haiku-4.5": { + id: "anthropic/claude-haiku-4.5", + name: "Anthropic: Claude Haiku 4.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4.6": { + id: "anthropic/claude-sonnet-4.6", + name: "Anthropic: Claude Sonnet 4.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 1000000, output: 128000 }, + }, + "switchpoint/router": { + id: "switchpoint/router", + name: "Switchpoint Router", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-07-12", + last_updated: "2026-03-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.85, output: 3.4 }, + limit: { context: 131072, output: 32768 }, + }, + "bytedance/ui-tars-1.5-7b": { + id: "bytedance/ui-tars-1.5-7b", + name: "ByteDance: UI-TARS 7B ", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-07-23", + last_updated: "2026-03-15", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.2 }, + limit: { context: 128000, output: 2048 }, + }, + "tngtech/deepseek-r1t2-chimera": { + id: "tngtech/deepseek-r1t2-chimera", + name: "TNG: DeepSeek R1T2 Chimera", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-08", + last_updated: "2025-07-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.85, cache_read: 0.125 }, + limit: { context: 163840, output: 163840 }, + }, + "xiaomi/mimo-v2.5-pro": { + id: "xiaomi/mimo-v2.5-pro", + name: "Xiaomi: MiMo V2.5 Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-omni": { + id: "xiaomi/mimo-v2-omni", + name: "Xiaomi: MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2, cache_read: 0.08 }, + limit: { context: 262144, output: 65536 }, + }, + "xiaomi/mimo-v2.5": { + id: "xiaomi/mimo-v2.5", + name: "Xiaomi: MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.4, + output: 2, + cache_read: 0.08, + context_over_200k: { input: 0.8, output: 4, cache_read: 0.16 }, + }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-pro": { + id: "xiaomi/mimo-v2-pro", + name: "Xiaomi: MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "xiaomi/mimo-v2-flash": { + id: "xiaomi/mimo-v2-flash", + name: "Xiaomi: MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.09, output: 0.29, cache_read: 0.045 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + "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: { + "anthropic--claude-4.6-opus": { + id: "anthropic--claude-4.6-opus", + name: "anthropic--claude-4.6-opus", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2026-02-05", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic--claude-3-haiku": { + id: "anthropic--claude-3-haiku", + name: "anthropic--claude-3-haiku", + 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, + cost: { input: 0.25, output: 1.25, cache_read: 0.03, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic--claude-3-opus": { + id: "anthropic--claude-3-opus", + name: "anthropic--claude-3-opus", + family: "claude-opus", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-02-29", + last_updated: "2024-02-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 4096 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "gpt-5-mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "gpt-5-nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "gemini-2.5-pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-25", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic--claude-3.7-sonnet": { + id: "anthropic--claude-3.7-sonnet", + name: "anthropic--claude-3.7-sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10-31", + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "sonar-pro": { + id: "sonar-pro", + name: "sonar-pro", + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic--claude-4.5-sonnet": { + id: "anthropic--claude-4.5-sonnet", + name: "anthropic--claude-4.5-sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic--claude-4.6-sonnet": { + id: "anthropic--claude-4.6-sonnet", + name: "anthropic--claude-4.6-sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2026-02-17", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "sonar-deep-research": { + id: "sonar-deep-research", + name: "sonar-deep-research", + family: "sonar-deep-research", + attachment: false, + reasoning: true, + 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, + cost: { input: 2, output: 8, reasoning: 3 }, + limit: { context: 128000, output: 32768 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "gemini-2.5-flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-25", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.03, input_audio: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic--claude-4.5-opus": { + id: "anthropic--claude-4.5-opus", + name: "anthropic--claude-4.5-opus", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + sonar: { + id: "sonar", + name: "sonar", + 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, + cost: { input: 1, output: 1 }, + limit: { context: 128000, output: 4096 }, + }, + "anthropic--claude-4-opus": { + id: "anthropic--claude-4-opus", + name: "anthropic--claude-4-opus", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic--claude-3-sonnet": { + id: "anthropic--claude-3-sonnet", + name: "anthropic--claude-3-sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-03-04", + last_updated: "2024-03-04", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic--claude-4-sonnet": { + id: "anthropic--claude-4-sonnet", + name: "anthropic--claude-4-sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "gemini-2.5-flash-lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic--claude-4.5-haiku": { + id: "anthropic--claude-4.5-haiku", + name: "anthropic--claude-4.5-haiku", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "gpt-5": { + id: "gpt-5", + name: "gpt-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "gpt-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "gpt-4.1-mini", + 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, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "anthropic--claude-3.5-sonnet": { + id: "anthropic--claude-3.5-sonnet", + name: "anthropic--claude-3.5-sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + }, + }, + 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: { + auto: { + id: "auto", + name: "Auto", + 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, + cost: { input: 0.85, output: 1.55 }, + limit: { context: 32000, output: 32000 }, + }, + "morph-v3-fast": { + id: "morph-v3-fast", + name: "Morph v3 Fast", + family: "morph", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-08-15", + last_updated: "2024-08-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 1.2 }, + limit: { context: 16000, output: 16000 }, + }, + "morph-v3-large": { + id: "morph-v3-large", + name: "Morph v3 Large", + family: "morph", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-08-15", + last_updated: "2024-08-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.9, output: 1.9 }, + limit: { context: 32000, output: 32000 }, + }, + }, + }, + "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: { + "workers-ai/@cf/myshell-ai/melotts": { + id: "workers-ai/@cf/myshell-ai/melotts", + name: "MyShell MeloTTS", + family: "melotts", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/ibm-granite/granite-4.0-h-micro": { + id: "workers-ai/@cf/ibm-granite/granite-4.0-h-micro", + name: "IBM Granite 4.0 H Micro", + family: "granite", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.017, output: 0.11 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/huggingface/distilbert-sst-2-int8": { + id: "workers-ai/@cf/huggingface/distilbert-sst-2-int8", + name: "DistilBERT SST-2 INT8", + family: "distilbert", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.026, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/zai-org/glm-4.7-flash": { + id: "workers-ai/@cf/zai-org/glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.06, output: 0.4 }, + limit: { context: 131072, output: 131072 }, + }, + "workers-ai/@cf/pipecat-ai/smart-turn-v2": { + id: "workers-ai/@cf/pipecat-ai/smart-turn-v2", + name: "Pipecat Smart Turn v2", + family: "smart-turn", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct": { + id: "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct", + name: "Mistral Small 3.1 24B Instruct", + family: "mistral-small", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-11", + last_updated: "2025-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 0.56 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/facebook/bart-large-cnn": { + id: "workers-ai/@cf/facebook/bart-large-cnn", + name: "BART Large CNN", + family: "bart", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-09", + last_updated: "2025-04-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it": { + id: "workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it", + name: "Gemma SEA-LION v4 27B IT", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 0.56 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/nvidia/nemotron-3-120b-a12b": { + id: "workers-ai/@cf/nvidia/nemotron-3-120b-a12b", + name: "Nemotron 3 Super 120B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 256000, output: 256000 }, + }, + "workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": { + id: "workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", + name: "DeepSeek R1 Distill Qwen 32B", + family: "deepseek-thinking", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 4.88 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/openai/gpt-oss-20b": { + id: "workers-ai/@cf/openai/gpt-oss-20b", + name: "GPT OSS 20B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/openai/gpt-oss-120b": { + id: "workers-ai/@cf/openai/gpt-oss-120b", + name: "GPT OSS 120B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 0.75 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/mistral/mistral-7b-instruct-v0.1": { + id: "workers-ai/@cf/mistral/mistral-7b-instruct-v0.1", + name: "Mistral 7B Instruct v0.1", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.11, output: 0.19 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct": { + id: "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17B 16E Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.85 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3-8b-instruct-awq": { + id: "workers-ai/@cf/meta/llama-3-8b-instruct-awq", + name: "Llama 3 8B Instruct AWQ", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 0.27 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-guard-3-8b": { + id: "workers-ai/@cf/meta/llama-guard-3-8b", + name: "Llama Guard 3 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.48, output: 0.03 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/m2m100-1.2b": { + id: "workers-ai/@cf/meta/m2m100-1.2b", + name: "M2M100 1.2B", + family: "m2m", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.34, output: 0.34 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-2-7b-chat-fp16": { + id: "workers-ai/@cf/meta/llama-2-7b-chat-fp16", + name: "Llama 2 7B Chat FP16", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.56, output: 6.67 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.2-11b-vision-instruct": { + id: "workers-ai/@cf/meta/llama-3.2-11b-vision-instruct", + name: "Llama 3.2 11B Vision Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.049, output: 0.68 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast": { + id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast", + name: "Llama 3.3 70B Instruct FP8 Fast", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 2.25 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.2-1b-instruct": { + id: "workers-ai/@cf/meta/llama-3.2-1b-instruct", + name: "Llama 3.2 1B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.027, output: 0.2 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8": { + id: "workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8", + name: "Llama 3.1 8B Instruct FP8", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.29 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.2-3b-instruct": { + id: "workers-ai/@cf/meta/llama-3.2-3b-instruct", + name: "Llama 3.2 3B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.051, output: 0.34 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.1-8b-instruct-awq": { + id: "workers-ai/@cf/meta/llama-3.1-8b-instruct-awq", + name: "Llama 3.1 8B Instruct AWQ", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 0.27 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3-8b-instruct": { + id: "workers-ai/@cf/meta/llama-3-8b-instruct", + name: "Llama 3 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 0.83 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/meta/llama-3.1-8b-instruct": { + id: "workers-ai/@cf/meta/llama-3.1-8b-instruct", + name: "Llama 3.1 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 0.8299999999999998 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct": { + id: "workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct", + name: "Qwen 2.5 Coder 32B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-11", + last_updated: "2025-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.66, output: 1 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/qwen/qwen3-embedding-0.6b": { + id: "workers-ai/@cf/qwen/qwen3-embedding-0.6b", + name: "Qwen3 Embedding 0.6B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.012, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/qwen/qwq-32b": { + id: "workers-ai/@cf/qwen/qwq-32b", + name: "QwQ 32B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-11", + last_updated: "2025-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.66, output: 1 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/qwen/qwen3-30b-a3b-fp8": { + id: "workers-ai/@cf/qwen/qwen3-30b-a3b-fp8", + name: "Qwen3 30B A3B FP8", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.051, output: 0.34 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/google/gemma-3-12b-it": { + id: "workers-ai/@cf/google/gemma-3-12b-it", + name: "Gemma 3 12B IT", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-11", + last_updated: "2025-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 0.56 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/moonshotai/kimi-k2.5": { + id: "workers-ai/@cf/moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 256000, output: 256000 }, + }, + "workers-ai/@cf/moonshotai/kimi-k2.6": { + id: "workers-ai/@cf/moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 256000, output: 256000 }, + }, + "workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B": { + id: "workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B", + name: "IndicTrans2 EN-Indic 1B", + family: "indictrans", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.34, output: 0.34 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/pfnet/plamo-embedding-1b": { + id: "workers-ai/@cf/pfnet/plamo-embedding-1b", + name: "PLaMo Embedding 1B", + family: "plamo", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.019, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/baai/bge-small-en-v1.5": { + id: "workers-ai/@cf/baai/bge-small-en-v1.5", + name: "BGE Small EN v1.5", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.02, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/baai/bge-large-en-v1.5": { + id: "workers-ai/@cf/baai/bge-large-en-v1.5", + name: "BGE Large EN v1.5", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/baai/bge-reranker-base": { + id: "workers-ai/@cf/baai/bge-reranker-base", + name: "BGE Reranker Base", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-09", + last_updated: "2025-04-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0031, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/baai/bge-base-en-v1.5": { + id: "workers-ai/@cf/baai/bge-base-en-v1.5", + name: "BGE Base EN v1.5", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.067, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/baai/bge-m3": { + id: "workers-ai/@cf/baai/bge-m3", + name: "BGE M3", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.012, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/deepgram/aura-2-en": { + id: "workers-ai/@cf/deepgram/aura-2-en", + name: "Deepgram Aura 2 (EN)", + family: "aura", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/deepgram/aura-2-es": { + id: "workers-ai/@cf/deepgram/aura-2-es", + name: "Deepgram Aura 2 (ES)", + family: "aura", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "workers-ai/@cf/deepgram/nova-3": { + id: "workers-ai/@cf/deepgram/nova-3", + name: "Deepgram Nova 3", + family: "nova", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "ai-gateway-provider" }, + }, + "openai/gpt-4-turbo": { + id: "openai/gpt-4-turbo", + name: "GPT-4 Turbo", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/o3-pro": { + id: "openai/o3-pro", + name: "o3-pro", + family: "o-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 20, output: 80 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o mini", + 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, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "ai-gateway-provider" }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/o1": { + id: "openai/o1", + name: "o1", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-3.5-turbo": { + id: "openai/gpt-3.5-turbo", + name: "GPT-3.5-turbo", + 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, + cost: { input: 0.5, output: 1.5, cache_read: 1.25 }, + limit: { context: 16385, output: 4096 }, + }, + "openai/o3-mini": { + id: "openai/o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4": { + id: "openai/gpt-4", + name: "GPT-4", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 60 }, + limit: { context: 8192, output: 8192 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + provider: { npm: "ai-gateway-provider" }, + }, + "openai/o3": { + id: "openai/o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o": { + id: "openai/gpt-4o", + name: "GPT-4o", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "anthropic/claude-haiku-4-5": { + id: "anthropic/claude-haiku-4-5", + name: "Claude Haiku 4.5 (latest)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4-6": { + id: "anthropic/claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "ai-gateway-provider" }, + }, + "anthropic/claude-opus-4-7": { + id: "anthropic/claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2026-01", + release_date: "2026-04-16", + last_updated: "2026-04-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "anthropic/claude-opus-4-1": { + id: "anthropic/claude-opus-4-1", + name: "Claude Opus 4.1 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-3-5-haiku": { + id: "anthropic/claude-3-5-haiku", + name: "Claude Haiku 3.5 (latest)", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-3.5-sonnet": { + id: "anthropic/claude-3.5-sonnet", + name: "Claude Sonnet 3.5 v2", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude Sonnet 4 (latest)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4-5": { + id: "anthropic/claude-opus-4-5", + name: "Claude Opus 4.5 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-3-haiku": { + id: "anthropic/claude-3-haiku", + name: "Claude Haiku 3", + 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, + cost: { input: 0.25, output: 1.25, cache_read: 0.03, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Claude Opus 4 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-opus-4-6": { + id: "anthropic/claude-opus-4-6", + name: "Claude Opus 4.6 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-3.5-haiku": { + id: "anthropic/claude-3.5-haiku", + name: "Claude Haiku 3.5 (latest)", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-sonnet-4-5": { + id: "anthropic/claude-sonnet-4-5", + name: "Claude Sonnet 4.5 (latest)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-3-sonnet": { + id: "anthropic/claude-3-sonnet", + name: "Claude Sonnet 3", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-03-04", + last_updated: "2024-03-04", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic/claude-3-opus": { + id: "anthropic/claude-3-opus", + name: "Claude Opus 3", + family: "claude-opus", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-02-29", + last_updated: "2024-02-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 4096 }, + }, + "openai/gpt-5.5": { + id: "openai/gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + }, + }, + "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.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "GPT-5.1-Codex-max", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-09-30", + release_date: "2025-12-04", + last_updated: "2025-12-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 128000, output: 128000 }, + status: "deprecated", + }, + "claude-opus-4.6": { + id: "claude-opus-4.6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 144000, input: 128000, output: 64000 }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 128000, output: 64000 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 128000, output: 64000 }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-04-22", + last_updated: "2026-04-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5-mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-08-13", + last_updated: "2025-08-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 264000, input: 128000, output: 64000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 128000, output: 64000 }, + status: "deprecated", + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-02-24", + last_updated: "2026-02-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 128000, output: 64000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 264000, input: 128000, output: 64000 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-opus-4.7": { + id: "claude-opus-4.7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 144000, input: 128000, output: 64000 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1-Codex-mini", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 128000, output: 128000 }, + status: "deprecated", + }, + "claude-sonnet-4": { + id: "claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: 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, + cost: { input: 0, output: 0 }, + limit: { context: 216000, input: 128000, output: 16000 }, + status: "deprecated", + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-27", + last_updated: "2025-08-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 128000, output: 64000 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 264000, input: 128000, output: 64000 }, + status: "deprecated", + }, + "claude-sonnet-4.5": { + id: "claude-sonnet-4.5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 144000, input: 128000, output: 32000 }, + }, + "claude-opus-41": { + id: "claude-opus-41", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: 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, + cost: { input: 0, output: 0 }, + limit: { context: 80000, output: 16000 }, + status: "deprecated", + }, + "claude-opus-4.5": { + id: "claude-opus-4.5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-24", + last_updated: "2025-08-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 160000, input: 128000, output: 32000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "GPT-4o", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 64000, output: 4096 }, + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 128000 }, + status: "deprecated", + }, + "claude-haiku-4.5": { + id: "claude-haiku-4.5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 144000, input: 128000, output: 32000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, input: 64000, output: 16384 }, + }, + "claude-sonnet-4.6": { + id: "claude-sonnet-4.6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, input: 128000, output: 32000 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 128000, output: 128000 }, + status: "deprecated", + }, + }, + }, + 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-122b-a10b": { + id: "qwen/qwen3.5-122b-a10b", + name: "Qwen3.5 122B A10B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 3.2 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3.5-27b": { + id: "qwen/qwen3.5-27b", + name: "Qwen3.5 27B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 2.4 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3.5-397b-a17b": { + id: "qwen/qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3.5-9b": { + id: "qwen/qwen3.5-9b", + name: "Qwen3.5 9B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen/qwen3.5-35b-a3b": { + id: "qwen/qwen3.5-35b-a3b", + name: "Qwen3.5 35B A3B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 1.3 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + "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-tts": { + id: "mimo-v2-tts", + name: "MiMo-V2-TTS", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 16384 }, + }, + "mimo-v2-flash": { + id: "mimo-v2-flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "mimo-v2-pro": { + id: "mimo-v2-pro", + name: "MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2.5": { + id: "mimo-v2.5", + name: "MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 0, output: 0, cache_read: 0 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-omni": { + id: "mimo-v2-omni", + name: "MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + 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", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 131072 }, + }, + "mimo-v2.5-pro": { + id: "mimo-v2.5-pro", + name: "MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 0, output: 0, cache_read: 0 } }, + limit: { context: 1048576, output: 131072 }, + }, + }, + }, + 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-5v-turbo": { + id: "glm-5v-turbo", + name: "GLM-5V-Turbo", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.2, output: 4, cache_read: 0.24, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1, output: 3.2, cache_read: 0.2, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-4.7-flashx": { + id: "glm-4.7-flashx", + name: "GLM-4.7-FlashX", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.4, cache_read: 0.01, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.4, output: 4.4, cache_read: 0.26, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.5": { + id: "glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.1, cache_read: 0.03, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-5-turbo": { + id: "glm-5-turbo", + name: "GLM-5-Turbo", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.2, output: 4, cache_read: 0.24, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.5v": { + id: "glm-4.5v", + name: "GLM-4.5V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 64000, output: 16384 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-4.6v": { + id: "glm-4.6v", + name: "GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 128000, output: 32768 }, + }, + "glm-4.5-flash": { + id: "glm-4.5-flash", + name: "GLM-4.5-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-4.7-flash": { + id: "glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + }, + }, + opencode: { + id: "opencode", + env: ["OPENCODE_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://opencode.ai/zen/v1", + name: "OpenCode Zen", + doc: "https://opencode.ai/docs/zen", + models: { + "minimax-m2.7": { + id: "minimax-m2.7", + name: "MiniMax M2.7", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + }, + "gpt-5.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "GPT-5.1 Codex Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.08 }, + limit: { context: 262144, output: 65536 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.1 }, + limit: { context: 204800, output: 131072 }, + status: "deprecated", + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-4.7-free": { + id: "glm-4.7-free", + name: "GLM-4.7 Free", + family: "glm-free", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 204800, output: 131072 }, + status: "deprecated", + }, + "gemini-3.1-pro": { + id: "gemini-3.1-pro", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + provider: { npm: "@ai-sdk/google" }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "kimi-k2.5-free": { + id: "kimi-k2.5-free", + name: "Kimi K2.5 Free", + family: "kimi-free", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 262144 }, + status: "deprecated", + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "minimax-m2.5-free": { + id: "minimax-m2.5-free", + name: "MiniMax M2.5 Free", + family: "minimax-free", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 204800, output: 131072 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "ring-2.6-1t-free": { + id: "ring-2.6-1t-free", + name: "Ring 2.6 1T Free", + family: "ring-1t-free", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262000, output: 66000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "big-pickle": { + id: "big-pickle", + name: "Big Pickle", + family: "big-pickle", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 128000 }, + }, + "claude-opus-4-1": { + id: "claude-opus-4-1", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen3.6", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3, cache_read: 0.05, cache_write: 0.625 }, + limit: { context: 262144, output: 65536 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "claude-3-5-haiku": { + id: "claude-3-5-haiku", + name: "Claude Haiku 3.5", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + status: "deprecated", + provider: { npm: "@ai-sdk/anthropic" }, + }, + "minimax-m2.1": { + id: "minimax-m2.1", + name: "MiniMax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.1 }, + limit: { context: 204800, output: 131072 }, + status: "deprecated", + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 204800, output: 131072 }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "GPT-5.4 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1 Codex Mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "claude-sonnet-4": { + id: "claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "gemini-3-flash": { + id: "gemini-3-flash", + name: "Gemini 3 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3, cache_read: 0.05 }, + limit: { context: 1048576, output: 65536 }, + provider: { npm: "@ai-sdk/google" }, + }, + "trinity-large-preview-free": { + id: "trinity-large-preview-free", + name: "Trinity Large Preview", + family: "trinity", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2026-01-28", + last_updated: "2026-01-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + status: "deprecated", + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.07, output: 8.5, cache_read: 0.107 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "gpt-5.4-pro": { + id: "gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, cache_read: 30 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "glm-5-free": { + id: "glm-5-free", + name: "GLM-5 Free", + family: "glm-free", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 204800, output: 131072 }, + status: "deprecated", + }, + "claude-opus-4-5": { + id: "claude-opus-4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "minimax-m2.1-free": { + id: "minimax-m2.1-free", + name: "MiniMax M2.1 Free", + family: "minimax-free", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 204800, output: 131072 }, + status: "deprecated", + provider: { npm: "@ai-sdk/anthropic" }, + }, + "qwen3.6-plus-free": { + id: "qwen3.6-plus-free", + name: "Qwen3.6 Plus Free", + family: "qwen-free", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-12", + release_date: "2026-03-30", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 1048576, output: 64000 }, + status: "deprecated", + }, + "glm-4.6": { + id: "glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.1 }, + limit: { context: 204800, output: 131072 }, + status: "deprecated", + }, + "ling-2.6-flash-free": { + id: "ling-2.6-flash-free", + name: "Ling 2.6 Flash Free", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262100, output: 32800 }, + status: "deprecated", + }, + "gemini-3-pro": { + id: "gemini-3-pro", + name: "Gemini 3 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + status: "deprecated", + provider: { npm: "@ai-sdk/google" }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 65536 }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "GPT-5 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.07, output: 8.5, cache_read: 0.107 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "grok-code": { + id: "grok-code", + name: "Grok Code Fast 1", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-20", + last_updated: "2025-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 256000, output: 256000 }, + status: "deprecated", + }, + "mimo-v2-flash-free": { + id: "mimo-v2-flash-free", + name: "MiMo V2 Flash Free", + family: "mimo-flash-free", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 65536 }, + status: "deprecated", + }, + "gpt-5.3-codex-spark": { + id: "gpt-5.3-codex-spark", + name: "GPT-5.3 Codex Spark", + family: "gpt-codex-spark", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, input: 128000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "hy3-preview-free": { + id: "hy3-preview-free", + name: "Hy3 preview Free", + family: "hy3-free", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 256000, output: 64000 }, + status: "deprecated", + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + }, + "kimi-k2": { + id: "kimi-k2", + name: "Kimi K2", + family: "kimi", + 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, + cost: { input: 0.4, output: 2.5, cache_read: 0.4 }, + limit: { context: 262144, output: 262144 }, + status: "deprecated", + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 64000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "qwen3-coder": { + id: "qwen3-coder", + name: "Qwen3 Coder", + 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, + cost: { input: 0.45, output: 1.8 }, + limit: { context: 262144, output: 65536 }, + status: "deprecated", + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.07, output: 8.5, cache_read: 0.107 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "qwen3.5-plus": { + id: "qwen3.5-plus", + name: "Qwen3.5 Plus", + family: "qwen3.5", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.2, cache_read: 0.02, cache_write: 0.25 }, + limit: { context: 262144, output: 65536 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + "mimo-v2-pro-free": { + id: "mimo-v2-pro-free", + name: "MiMo V2 Pro Free", + family: "mimo-pro-free", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 1048576, output: 64000 }, + status: "deprecated", + }, + "nemotron-3-super-free": { + id: "nemotron-3-super-free", + name: "Nemotron 3 Super Free", + family: "nemotron-free", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2026-02", + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 204800, output: 128000 }, + }, + "gpt-5.5-pro": { + id: "gpt-5.5-pro", + name: "GPT-5.5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + 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, + cost: { input: 30, output: 180, cache_read: 30 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2.5, cache_read: 0.4 }, + limit: { context: 262144, output: 262144 }, + status: "deprecated", + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.07, output: 8.5, cache_read: 0.107 }, + limit: { context: 400000, input: 272000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "mimo-v2-omni-free": { + id: "mimo-v2-omni-free", + name: "MiMo V2 Omni Free", + family: "mimo-omni-free", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 64000 }, + status: "deprecated", + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + provider: { npm: "@ai-sdk/openai" }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/anthropic" }, + }, + }, + }, + stepfun: { + id: "stepfun", + env: ["STEPFUN_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.stepfun.com/v1", + name: "StepFun", + doc: "https://platform.stepfun.com/docs/zh/overview/concept", + models: { + "step-3.5-flash-2603": { + id: "step-3.5-flash-2603", + name: "Step 3.5 Flash 2603", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-02", + last_updated: "2026-04-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.02 }, + limit: { context: 256000, input: 256000, output: 256000 }, + }, + "step-1-32k": { + id: "step-1-32k", + name: "Step 1 (32K)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-01-01", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.05, output: 9.59, cache_read: 0.41 }, + limit: { context: 32768, input: 32768, output: 32768 }, + }, + "step-3.5-flash": { + id: "step-3.5-flash", + name: "Step 3.5 Flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.096, output: 0.288, cache_read: 0.019 }, + limit: { context: 256000, input: 256000, output: 256000 }, + }, + "step-2-16k": { + id: "step-2-16k", + name: "Step 2 (16K)", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-01-01", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5.21, output: 16.44, cache_read: 1.04 }, + limit: { context: 16384, input: 16384, output: 8192 }, + }, + }, + }, + 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: { + "NousResearch/Hermes-4-70B": { + id: "NousResearch/Hermes-4-70B", + name: "Hermes-4-70B", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-11", + release_date: "2026-01-30", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.4, reasoning: 0.4, cache_read: 0.013, cache_write: 0.16 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "NousResearch/Hermes-4-405B": { + id: "NousResearch/Hermes-4-405B", + name: "Hermes-4-405B", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-11", + release_date: "2026-01-30", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3, reasoning: 3, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "Qwen/Qwen2.5-VL-72B-Instruct": { + id: "Qwen/Qwen2.5-VL-72B-Instruct", + name: "Qwen2.5-VL-72B-Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-20", + last_updated: "2026-02-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.75, cache_read: 0.025, cache_write: 0.31 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "Qwen/Qwen3.5-397B-A17B": { + id: "Qwen/Qwen3.5-397B-A17B", + name: "Qwen3.5-397B-A17B", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-15", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6, cache_read: 0.06, cache_write: 0.75 }, + limit: { context: 262144, input: 250000, output: 8192 }, + }, + "Qwen/Qwen3-Embedding-8B": { + id: "Qwen/Qwen3-Embedding-8B", + name: "Qwen3-Embedding-8B", + family: "text-embedding", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: false, + knowledge: "2025-10", + release_date: "2026-01-10", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0 }, + limit: { context: 32768, input: 32768, output: 0 }, + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen3-30B-A3B-Instruct-2507", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2026-01-28", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.01, cache_write: 0.125 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-25", + last_updated: "2025-10-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 262144, output: 8192 }, + }, + "Qwen/Qwen3-32B": { + id: "Qwen/Qwen3-32B", + name: "Qwen3-32B", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2026-01-28", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.01, cache_write: 0.125 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507-fast": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507-fast", + name: "Qwen3-235B-A22B-Thinking-2507-fast", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-25", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2, cache_read: 0.05, cache_write: 0.625 }, + limit: { context: 8000, input: 7000, output: 8192 }, + }, + "Qwen/Qwen3.5-397B-A17B-fast": { + id: "Qwen/Qwen3.5-397B-A17B-fast", + name: "Qwen3.5-397B-A17B-fast", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-15", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6, cache_read: 0.06, cache_write: 0.75 }, + limit: { context: 8000, input: 7000, output: 8192 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Thinking-fast": { + id: "Qwen/Qwen3-Next-80B-A3B-Thinking-fast", + name: "Qwen3-Next-80B-A3B-Thinking-fast", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-25", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.2, cache_read: 0.015, cache_write: 0.1875 }, + limit: { context: 8000, input: 7000, output: 8192 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + id: "Qwen/Qwen3-Next-80B-A3B-Thinking", + name: "Qwen3-Next-80B-A3B-Thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2026-01-28", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.2, reasoning: 1.2, cache_read: 0.015, cache_write: 0.18 }, + limit: { context: 128000, input: 120000, output: 16384 }, + }, + "PrimeIntellect/INTELLECT-3": { + id: "PrimeIntellect/INTELLECT-3", + name: "INTELLECT-3", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-10", + release_date: "2026-01-25", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 1.1, cache_read: 0.02, cache_write: 0.25 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "GLM-5", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-03-01", + last_updated: "2026-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3.2, cache_read: 0.1, cache_write: 1 }, + limit: { context: 200000, input: 200000, output: 16384 }, + }, + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama-3.3-70B-Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-12-05", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.4, cache_read: 0.013, cache_write: 0.16 }, + limit: { context: 128000, input: 120000, output: 8192 }, + }, + "meta-llama/Meta-Llama-3.1-8B-Instruct": { + id: "meta-llama/Meta-Llama-3.1-8B-Instruct", + name: "Meta-Llama-3.1-8B-Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-07-23", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.06, cache_read: 0.002, cache_write: 0.025 }, + limit: { context: 128000, input: 120000, output: 4096 }, + }, + "nvidia/nemotron-3-super-120b-a12b": { + id: "nvidia/nemotron-3-super-120b-a12b", + name: "Nemotron-3-Super-120B-A12B", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2026-02", + release_date: "2026-03-11", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, input: 256000, output: 32768 }, + }, + "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1": { + id: "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1", + name: "Llama-3.1-Nemotron-Ultra-253B-v1", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-15", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.8, cache_read: 0.06, cache_write: 0.75 }, + limit: { context: 128000, input: 120000, output: 4096 }, + }, + "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B": { + id: "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B", + name: "Nemotron-3-Nano-30B-A3B", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-08-10", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.24, cache_read: 0.006, cache_write: 0.075 }, + limit: { context: 32000, input: 30000, output: 4096 }, + }, + "nvidia/Nemotron-3-Nano-Omni": { + id: "nvidia/Nemotron-3-Nano-Omni", + name: "Nemotron-3-Nano-Omni", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-20", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.24, cache_read: 0.006, cache_write: 0.075 }, + limit: { context: 65536, input: 60000, output: 8192 }, + }, + "deepseek-ai/DeepSeek-V3.2-fast": { + id: "deepseek-ai/DeepSeek-V3.2-fast", + name: "DeepSeek-V3.2-fast", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-27", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2, cache_read: 0.04, cache_write: 0.5 }, + limit: { context: 8000, input: 7000, output: 8192 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek-V3.2", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-11", + release_date: "2026-01-20", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.45, reasoning: 0.45, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 163000, input: 160000, output: 16384 }, + }, + "openai/gpt-oss-120b-fast": { + id: "openai/gpt-oss-120b-fast", + name: "gpt-oss-120b-fast", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-06-10", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.5, cache_read: 0.01, cache_write: 0.125 }, + limit: { context: 8000, input: 7000, output: 8192 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "gpt-oss-120b", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-09", + release_date: "2026-01-10", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6, reasoning: 0.6, cache_read: 0.015, cache_write: 0.18 }, + limit: { context: 128000, input: 124000, output: 8192 }, + }, + "google/gemma-2-2b-it": { + id: "google/gemma-2-2b-it", + name: "Gemma-2-2b-it", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + knowledge: "2024-06", + release_date: "2024-07-31", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.06, cache_read: 0.002, cache_write: 0.025 }, + limit: { context: 8192, input: 8000, output: 4096 }, + }, + "google/gemma-3-27b-it": { + id: "google/gemma-3-27b-it", + name: "Gemma-3-27b-it", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-10", + release_date: "2026-01-20", + last_updated: "2026-02-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3, cache_read: 0.01, cache_write: 0.125 }, + limit: { context: 110000, input: 100000, output: 8192 }, + }, + "moonshotai/Kimi-K2.5-fast": { + id: "moonshotai/Kimi-K2.5-fast", + name: "Kimi-K2.5-fast", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-15", + last_updated: "2026-02-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2.5, cache_read: 0.05, cache_write: 0.625 }, + limit: { context: 256000, input: 256000, output: 8192 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi-K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-12-15", + last_updated: "2026-02-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2.5, reasoning: 2.5, cache_read: 0.05, cache_write: 0.625 }, + limit: { context: 256000, input: 256000, output: 8192 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-20", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 196608, input: 190000, output: 8192 }, + }, + "MiniMaxAI/MiniMax-M2.5-fast": { + id: "MiniMaxAI/MiniMax-M2.5-fast", + name: "MiniMax-M2.5-fast", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-20", + last_updated: "2026-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 8000, input: 7000, output: 8192 }, + }, + "deepseek-ai/DeepSeek-V4-Pro": { + id: "deepseek-ai/DeepSeek-V4-Pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.75, output: 3.5, cache_read: 0.15 }, + limit: { context: 1000000, output: 384000 }, + }, + }, + }, + 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: { + "topazlabs-co/topazlabs": { + id: "topazlabs-co/topazlabs", + name: "TopazLabs", + family: "topazlabs", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 204, output: 0 }, + }, + "novita/kimi-k2.5": { + id: "novita/kimi-k2.5", + name: "Kimi-K2.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 128000, output: 262144 }, + }, + "novita/glm-4.7": { + id: "novita/glm-4.7", + name: "glm-4.7", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 205000, output: 131072 }, + status: "deprecated", + }, + "novita/glm-5": { + id: "novita/glm-5", + name: "GLM-5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-02-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 205000, output: 131072 }, + }, + "novita/minimax-m2.1": { + id: "novita/minimax-m2.1", + name: "minimax-m2.1", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-26", + last_updated: "2025-12-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 205000, output: 131072 }, + }, + "novita/glm-4.6": { + id: "novita/glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "novita/kimi-k2.6": { + id: "novita/kimi-k2.6", + name: "Kimi-K2.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-04-20", + last_updated: "2026-05-02", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.96, output: 4.04, cache_read: 0.16 }, + limit: { context: 262144, input: 262144, output: 262144 }, + }, + "novita/glm-4.6v": { + id: "novita/glm-4.6v", + name: "glm-4.6v", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-09", + last_updated: "2025-12-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 131000, output: 32768 }, + }, + "novita/deepseek-v3.2": { + id: "novita/deepseek-v3.2", + name: "DeepSeek-V3.2", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.4, cache_read: 0.13 }, + limit: { context: 128000, output: 0 }, + }, + "novita/glm-4.7-flash": { + id: "novita/glm-4.7-flash", + name: "glm-4.7-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 200000, output: 65500 }, + }, + "novita/glm-4.7-n": { + id: "novita/glm-4.7-n", + name: "glm-4.7-n", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 205000, output: 131072 }, + }, + "novita/kimi-k2-thinking": { + id: "novita/kimi-k2-thinking", + name: "kimi-k2-thinking", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-07", + last_updated: "2025-11-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 0 }, + }, + "fireworks-ai/kimi-k2.5-fw": { + id: "fireworks-ai/kimi-k2.5-fw", + name: "Kimi-K2.5-FW", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, input: 245760, output: 16384 }, + }, + "empiriolabs/deepseek-v4-pro-el": { + id: "empiriolabs/deepseek-v4-pro-el", + name: "DeepSeek-V4-Pro-EL", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-04-24", + last_updated: "2026-05-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.67, output: 3.33 }, + limit: { context: 1000000, input: 1000000, output: 384000 }, + }, + "empiriolabs/deepseek-v4-flash-el": { + id: "empiriolabs/deepseek-v4-flash-el", + name: "DeepSeek-V4-Flash-EL", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-04-24", + last_updated: "2026-05-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.28 }, + limit: { context: 1000000, input: 1000000, output: 384000 }, + }, + "elevenlabs/elevenlabs-v2.5-turbo": { + id: "elevenlabs/elevenlabs-v2.5-turbo", + name: "ElevenLabs-v2.5-Turbo", + family: "elevenlabs", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-10-28", + last_updated: "2024-10-28", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + limit: { context: 128000, output: 0 }, + }, + "elevenlabs/elevenlabs-v3": { + id: "elevenlabs/elevenlabs-v3", + name: "ElevenLabs-v3", + family: "elevenlabs", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + limit: { context: 128000, output: 0 }, + }, + "elevenlabs/elevenlabs-music": { + id: "elevenlabs/elevenlabs-music", + name: "ElevenLabs-Music", + family: "elevenlabs", + attachment: true, + 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 }, + }, + "cerebras/gpt-oss-120b-cs": { + id: "cerebras/gpt-oss-120b-cs", + name: "GPT-OSS-120B-CS", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.35, output: 0.75 }, + limit: { context: 128000, output: 0 }, + }, + "cerebras/llama-3.1-8b-cs": { + id: "cerebras/llama-3.1-8b-cs", + name: "Llama-3.1-8B-CS", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-05-13", + last_updated: "2025-05-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 0 }, + }, + "cerebras/qwen3-32b-cs": { + id: "cerebras/qwen3-32b-cs", + name: "qwen3-32b-cs", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-05-15", + last_updated: "2025-05-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + status: "deprecated", + }, + "cerebras/qwen3-235b-2507-cs": { + id: "cerebras/qwen3-235b-2507-cs", + name: "qwen3-235b-2507-cs", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-06", + last_updated: "2025-08-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + status: "deprecated", + }, + "cerebras/llama-3.3-70b-cs": { + id: "cerebras/llama-3.3-70b-cs", + name: "llama-3.3-70b-cs", + attachment: true, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-05-13", + last_updated: "2025-05-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + status: "deprecated", + }, + "stabilityai/stablediffusionxl": { + id: "stabilityai/stablediffusionxl", + name: "StableDiffusionXL", + 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 }, + }, + "xai/grok-code-fast-1": { + id: "xai/grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-22", + last_updated: "2025-08-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 128000 }, + }, + "xai/grok-4-fast-reasoning": { + id: "xai/grok-4-fast-reasoning", + name: "Grok-4-Fast-Reasoning", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-09-16", + last_updated: "2025-09-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 128000 }, + }, + "xai/grok-4.1-fast-non-reasoning": { + id: "xai/grok-4.1-fast-non-reasoning", + name: "Grok-4.1-Fast-Non-Reasoning", + 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 }, + }, + "xai/grok-4": { + id: "xai/grok-4", + name: "Grok-4", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 128000 }, + }, + "xai/grok-3-mini": { + id: "xai/grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-11", + last_updated: "2025-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 8192 }, + }, + "xai/grok-4.20-multi-agent": { + id: "xai/grok-4.20-multi-agent", + name: "Grok-4.20-Multi-Agent", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2026-03-13", + last_updated: "2026-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2 }, + limit: { context: 128000, output: 0 }, + }, + "xai/grok-3": { + id: "xai/grok-3", + name: "Grok 3", + family: "grok", + attachment: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "xai/grok-4-fast-non-reasoning": { + id: "xai/grok-4-fast-non-reasoning", + name: "Grok-4-Fast-Non-Reasoning", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-09-16", + last_updated: "2025-09-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 128000 }, + }, + "xai/grok-4.1-fast-reasoning": { + id: "xai/grok-4.1-fast-reasoning", + name: "Grok-4.1-Fast-Reasoning", + family: "grok", + attachment: true, + reasoning: true, + 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 }, + }, + "runwayml/runway": { + id: "runwayml/runway", + name: "Runway", + 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 }, + }, + "runwayml/runway-gen-4-turbo": { + id: "runwayml/runway-gen-4-turbo", + name: "Runway-Gen-4-Turbo", + 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 }, + }, + "openai/gpt-5.1-codex-max": { + id: "openai/gpt-5.1-codex-max", + name: "GPT-5.1-Codex-Max", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/sora-2-pro": { + id: "openai/sora-2-pro", + name: "Sora-2-Pro", + 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 }, + }, + "openai/chatgpt-4o-latest": { + id: "openai/chatgpt-4o-latest", + name: "ChatGPT-4o-Latest", + 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, + cost: { input: 4.5, output: 14 }, + limit: { context: 128000, output: 8192 }, + status: "deprecated", + }, + "openai/gpt-5-chat": { + id: "openai/gpt-5-chat", + name: "GPT-5-Chat", + family: "gpt-codex", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "GPT-5.2-Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-11", + last_updated: "2025-12-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 19, output: 150 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4o-aug": { + id: "openai/gpt-4o-aug", + name: "GPT-4o-Aug", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-11-21", + last_updated: "2024-11-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.2, output: 9, cache_read: 1.1 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-image-2": { + id: "openai/gpt-image-2", + name: "GPT-Image-2", + 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, + cost: { input: 5.0505, output: 32.3232, cache_read: 1.2626 }, + limit: { context: 0, output: 0 }, + }, + "openai/gpt-4-classic-0314": { + id: "openai/gpt-4-classic-0314", + name: "GPT-4-Classic-0314", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-08-26", + last_updated: "2024-08-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 27, output: 54 }, + limit: { context: 8192, output: 4096 }, + status: "deprecated", + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT-5-mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-06-25", + last_updated: "2025-06-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.22, output: 1.8, cache_read: 0.022 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "GPT-5-nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.045, output: 0.36, cache_read: 0.0045 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "GPT-5.3-Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-02-10", + last_updated: "2026-02-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.6, output: 13, cache_read: 0.16 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4-turbo": { + id: "openai/gpt-4-turbo", + name: "GPT-4-Turbo", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2023-09-13", + last_updated: "2023-09-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 9, output: 27 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.6, output: 13, cache_read: 0.16 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/o3-pro": { + id: "openai/o3-pro", + name: "o3-pro", + family: "o-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-06-10", + last_updated: "2025-06-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 18, output: 72 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o3-mini-high": { + id: "openai/o3-mini-high", + name: "o3-mini-high", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.99, output: 4 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o-mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.54, cache_read: 0.068 }, + limit: { context: 124096, output: 4096 }, + }, + "openai/o4-mini-deep-research": { + id: "openai/o4-mini-deep-research", + name: "o4-mini-deep-research", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-06-27", + last_updated: "2025-06-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.8, output: 7.2, cache_read: 0.45 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-mini": { + id: "openai/gpt-5.4-mini", + name: "GPT-5.4-Mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-03-12", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.68, output: 4, cache_read: 0.068 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/dall-e-3": { + id: "openai/dall-e-3", + name: "DALL-E-3", + family: "dall-e", + attachment: true, + 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 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.99, output: 4, cache_read: 0.25 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-nano": { + id: "openai/gpt-5.4-nano", + name: "GPT-5.4-Nano", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 1.1, cache_read: 0.018 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-image-1": { + id: "openai/gpt-image-1", + name: "GPT-Image-1", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-03-31", + last_updated: "2025-03-31", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + limit: { context: 128000, output: 0 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT-5.2-Codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.6, output: 13, cache_read: 0.16 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "GPT-5.1-Codex-Mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-12", + last_updated: "2025-11-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.22, output: 1.8, cache_read: 0.022 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-12", + last_updated: "2025-11-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-image-1-mini": { + id: "openai/gpt-image-1-mini", + name: "GPT-Image-1-Mini", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "openai/o1": { + id: "openai/o1", + name: "o1", + family: "o", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2024-12-18", + last_updated: "2024-12-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 14, output: 54 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.4-pro": { + id: "openai/gpt-5.4-pro", + name: "GPT-5.4-Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-03-05", + last_updated: "2026-03-05", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + cost: { input: 27, output: 160 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-3.5-turbo": { + id: "openai/gpt-3.5-turbo", + name: "GPT-3.5-Turbo", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2023-09-13", + last_updated: "2023-09-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.45, output: 1.4 }, + limit: { context: 16384, output: 2048 }, + }, + "openai/o3-deep-research": { + id: "openai/o3-deep-research", + name: "o3-deep-research", + family: "o", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-06-27", + last_updated: "2025-06-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 9, output: 36, cache_read: 2.2 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o3-mini": { + id: "openai/o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.99, output: 4 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o1-pro": { + id: "openai/o1-pro", + name: "o1-pro", + family: "o-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-03-19", + last_updated: "2025-03-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 140, output: 540 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o-search": { + id: "openai/gpt-4o-search", + name: "GPT-4o-Search", + family: "gpt", + attachment: true, + 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, + cost: { input: 2.2, output: 9 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "GPT-5-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-09-23", + last_updated: "2025-09-23", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT-5.4", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text", "image", "pdf"], output: ["image"] }, + open_weights: false, + cost: { input: 2.2, output: 14, cache_read: 0.22 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5.3-codex-spark": { + id: "openai/gpt-5.3-codex-spark", + name: "GPT-5.3-Codex-Spark", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-03-04", + last_updated: "2026-03-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-3.5-turbo-raw": { + id: "openai/gpt-3.5-turbo-raw", + name: "GPT-3.5-Turbo-Raw", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2023-09-27", + last_updated: "2023-09-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.45, output: 1.4 }, + limit: { context: 4524, output: 2048 }, + }, + "openai/gpt-4.1-nano": { + id: "openai/gpt-4.1-nano", + name: "GPT-4.1-nano", + family: "gpt-nano", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.36, cache_read: 0.022 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/o3": { + id: "openai/o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.8, output: 7.2, cache_read: 0.45 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5-pro": { + id: "openai/gpt-5-pro", + name: "GPT-5-Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-10-06", + last_updated: "2025-10-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 14, output: 110 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/sora-2": { + id: "openai/sora-2", + name: "Sora-2", + 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 }, + }, + "openai/gpt-4o": { + id: "openai/gpt-4o", + name: "GPT-4o", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-instant": { + id: "openai/gpt-5.2-instant", + name: "GPT-5.2-Instant", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-12-11", + last_updated: "2025-12-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.6, output: 13, cache_read: 0.16 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4o-mini-search": { + id: "openai/gpt-4o-mini-search", + name: "GPT-4o-mini-Search", + family: "gpt-mini", + attachment: true, + 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, + cost: { input: 0.14, output: 0.54 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-image-1.5": { + id: "openai/gpt-image-1.5", + name: "gpt-image-1.5", + attachment: true, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + limit: { context: 128000, output: 0 }, + }, + "openai/gpt-3.5-turbo-instruct": { + id: "openai/gpt-3.5-turbo-instruct", + name: "GPT-3.5-Turbo-Instruct", + 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, + cost: { input: 1.4, output: 1.8 }, + limit: { context: 3500, output: 1024 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT-4.1", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.8, output: 7.2, cache_read: 0.45 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-5.1-instant": { + id: "openai/gpt-5.1-instant", + name: "GPT-5.1-Instant", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-12", + last_updated: "2025-11-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "GPT-4.1-mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-04-15", + last_updated: "2025-04-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.36, output: 1.4, cache_read: 0.09 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-4-classic": { + id: "openai/gpt-4-classic", + name: "GPT-4-Classic", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-03-25", + last_updated: "2024-03-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 27, output: 54 }, + limit: { context: 8192, output: 4096 }, + status: "deprecated", + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT-5.1-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-12", + last_updated: "2025-11-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.3-instant": { + id: "openai/gpt-5.3-instant", + name: "GPT-5.3-Instant", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2026-03-03", + last_updated: "2026-03-03", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.6, output: 13, cache_read: 0.16 }, + limit: { context: 128000, input: 111616, output: 16384 }, + }, + "google/veo-3-fast": { + id: "google/veo-3-fast", + name: "Veo-3-Fast", + family: "veo", + attachment: true, + 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 }, + }, + "google/veo-3.1-fast": { + id: "google/veo-3.1-fast", + name: "Veo-3.1-Fast", + 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/gemini-3.1-pro": { + id: "google/gemini-3.1-pro", + name: "Gemini-3.1-Pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-02-19", + last_updated: "2026-02-19", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/imagen-3-fast": { + id: "google/imagen-3-fast", + name: "Imagen-3-Fast", + family: "imagen", + attachment: true, + 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 }, + }, + "google/gemini-2.0-flash": { + id: "google/gemini-2.0-flash", + name: "Gemini-2.0-Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.42 }, + limit: { context: 990000, output: 8192 }, + }, + "google/gemini-deep-research": { + id: "google/gemini-deep-research", + name: "gemini-deep-research", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.6, output: 9.6 }, + limit: { context: 1048576, output: 0 }, + status: "deprecated", + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini-2.5-Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-02-05", + last_updated: "2025-02-05", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.87, output: 7, cache_read: 0.087 }, + limit: { context: 1065535, output: 65535 }, + }, + "google/imagen-3": { + id: "google/imagen-3", + name: "Imagen-3", + family: "imagen", + attachment: true, + 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 }, + }, + "google/nano-banana": { + id: "google/nano-banana", + name: "Nano-Banana", + family: "nano-banana", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.21, output: 1.8, cache_read: 0.021 }, + limit: { context: 65536, output: 0 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini-2.5-Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-04-26", + last_updated: "2025-04-26", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.21, output: 1.8, cache_read: 0.021 }, + limit: { context: 1065535, output: 65535 }, + }, + "google/gemini-3.1-flash-lite": { + id: "google/gemini-3.1-flash-lite", + name: "Gemini-3.1-Flash-Lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-02-18", + last_updated: "2026-02-18", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-flash": { + id: "google/gemini-3-flash", + name: "Gemini-3-Flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-10-07", + last_updated: "2025-10-07", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2.4, cache_read: 0.04 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/veo-3.1": { + id: "google/veo-3.1", + name: "Veo-3.1", + family: "veo", + attachment: true, + 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/lyria": { + id: "google/lyria", + name: "Lyria", + family: "lyria", + attachment: true, + 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 }, + }, + "google/imagen-4-ultra": { + id: "google/imagen-4-ultra", + name: "Imagen-4-Ultra", + family: "imagen", + attachment: true, + 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 }, + }, + "google/nano-banana-pro": { + id: "google/nano-banana-pro", + name: "Nano-Banana-Pro", + family: "nano-banana", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-11-19", + last_updated: "2025-11-19", + modalities: { input: ["text", "image"], output: ["image"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2 }, + limit: { context: 65536, output: 0 }, + }, + "google/gemini-3-pro": { + id: "google/gemini-3-pro", + name: "Gemini-3-Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-10-22", + last_updated: "2025-10-22", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 1.6, output: 9.6, cache_read: 0.16 }, + limit: { context: 1048576, output: 65536 }, + status: "deprecated", + }, + "google/imagen-4-fast": { + id: "google/imagen-4-fast", + name: "Imagen-4-Fast", + family: "imagen", + attachment: true, + 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": { + id: "google/veo-3", + name: "Veo-3", + family: "veo", + attachment: true, + 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 }, + }, + "google/gemini-2.5-flash-lite": { + id: "google/gemini-2.5-flash-lite", + name: "Gemini-2.5-Flash-Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-06-19", + last_updated: "2025-06-19", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 1024000, output: 64000 }, + }, + "google/imagen-4": { + id: "google/imagen-4", + name: "Imagen-4", + family: "imagen", + attachment: true, + 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/gemma-4-31b": { + id: "google/gemma-4-31b", + name: "Gemma-4-31B", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2026-04-02", + last_updated: "2026-04-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 8192 }, + }, + "google/gemini-2.0-flash-lite": { + id: "google/gemini-2.0-flash-lite", + name: "Gemini-2.0-Flash-Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2025-02-05", + last_updated: "2025-02-05", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.052, output: 0.21 }, + limit: { context: 990000, output: 8192 }, + }, + "google/veo-2": { + id: "google/veo-2", + name: "Veo-2", + family: "veo", + attachment: true, + 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 }, + }, + "lumalabs/ray2": { + id: "lumalabs/ray2", + name: "Ray2", + 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 }, + }, + "anthropic/claude-opus-4.1": { + id: "anthropic/claude-opus-4.1", + name: "Claude-Opus-4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 13, output: 64, cache_read: 1.3, cache_write: 16 }, + limit: { context: 196608, output: 32000 }, + }, + "anthropic/claude-sonnet-3.5": { + id: "anthropic/claude-sonnet-3.5", + name: "Claude-Sonnet-3.5", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-06-05", + last_updated: "2024-06-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.6, output: 13, cache_read: 0.26, cache_write: 3.2 }, + limit: { context: 189096, output: 8192 }, + status: "deprecated", + }, + "anthropic/claude-haiku-3": { + id: "anthropic/claude-haiku-3", + name: "Claude-Haiku-3", + family: "claude-haiku", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-03-09", + last_updated: "2024-03-09", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.21, output: 1.1, cache_read: 0.021, cache_write: 0.26 }, + limit: { context: 189096, output: 8192 }, + }, + "anthropic/claude-opus-4.6": { + id: "anthropic/claude-opus-4.6", + name: "Claude-Opus-4.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-02-04", + last_updated: "2026-02-04", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.3, output: 21, cache_read: 0.43, cache_write: 5.3 }, + limit: { context: 983040, output: 128000 }, + }, + "anthropic/claude-opus-4.7": { + id: "anthropic/claude-opus-4.7", + name: "Claude-Opus-4.7", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-15", + last_updated: "2026-04-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.3, output: 21, cache_read: 0.43, cache_write: 5.4 }, + limit: { context: 1048576, output: 128000 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude-Sonnet-4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-05-21", + last_updated: "2025-05-21", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.6, output: 13, cache_read: 0.26, cache_write: 3.2 }, + limit: { context: 983040, output: 64000 }, + }, + "anthropic/claude-sonnet-4.5": { + id: "anthropic/claude-sonnet-4.5", + name: "Claude-Sonnet-4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-09-26", + last_updated: "2025-09-26", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.6, output: 13, cache_read: 0.26, cache_write: 3.2 }, + limit: { context: 983040, output: 32768 }, + }, + "anthropic/claude-opus-4.5": { + id: "anthropic/claude-opus-4.5", + name: "Claude-Opus-4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-11-21", + last_updated: "2025-11-21", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 4.3, output: 21, cache_read: 0.43, cache_write: 5.3 }, + limit: { context: 196608, output: 64000 }, + }, + "anthropic/claude-sonnet-3.7": { + id: "anthropic/claude-sonnet-3.7", + name: "Claude-Sonnet-3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.6, output: 13, cache_read: 0.26, cache_write: 3.2 }, + limit: { context: 196608, output: 128000 }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Claude-Opus-4", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-05-21", + last_updated: "2025-05-21", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 13, output: 64, cache_read: 1.3, cache_write: 16 }, + limit: { context: 192512, output: 28672 }, + }, + "anthropic/claude-haiku-3.5": { + id: "anthropic/claude-haiku-3.5", + name: "Claude-Haiku-3.5", + family: "claude-haiku", + attachment: true, + reasoning: false, + tool_call: true, + temperature: false, + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.68, output: 3.4, cache_read: 0.068, cache_write: 0.85 }, + limit: { context: 189096, output: 8192 }, + }, + "anthropic/claude-haiku-4.5": { + id: "anthropic/claude-haiku-4.5", + name: "Claude-Haiku-4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.85, output: 4.3, cache_read: 0.085, cache_write: 1.1 }, + limit: { context: 192000, output: 64000 }, + }, + "anthropic/claude-sonnet-3.5-june": { + id: "anthropic/claude-sonnet-3.5-june", + name: "Claude-Sonnet-3.5-June", + 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, + cost: { input: 2.6, output: 13, cache_read: 0.26, cache_write: 3.2 }, + limit: { context: 189096, output: 8192 }, + status: "deprecated", + }, + "anthropic/claude-sonnet-4.6": { + id: "anthropic/claude-sonnet-4.6", + name: "Claude-Sonnet-4.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.6, output: 13, cache_read: 0.26, cache_write: 3.2 }, + limit: { context: 983040, output: 128000 }, + }, + "ideogramai/ideogram": { + id: "ideogramai/ideogram", + name: "Ideogram", + 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", + name: "Ideogram-v2", + 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 }, + }, + "ideogramai/ideogram-v2a-turbo": { + id: "ideogramai/ideogram-v2a-turbo", + name: "Ideogram-v2a-Turbo", + family: "ideogram", + attachment: true, + 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": { + id: "ideogramai/ideogram-v2a", + name: "Ideogram-v2a", + family: "ideogram", + attachment: true, + 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 }, + }, + "trytako/tako": { + id: "trytako/tako", + name: "Tako", + family: "tako", + attachment: true, + 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 }, + }, + "poetools/claude-code": { + id: "poetools/claude-code", + name: "claude-code", + attachment: true, + reasoning: true, + 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.5": { + id: "openai/gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-12-01", + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 4.5455, output: 27.2727, cache_read: 0.4545 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.5-pro": { + id: "openai/gpt-5.5-pro", + name: "GPT-5.5-Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: false, + knowledge: "2025-12-01", + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 27.2727, output: 163.6364 }, + limit: { context: 400000, output: 128000 }, + }, + }, + }, + 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: { + "mistral-nemo": { + id: "mistral-nemo", + name: "Mistral Nemo", + 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", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 20, output: 40 }, + limit: { context: 128000, output: 16400 }, + }, + "grok-4-1-fast-reasoning": { + id: "grok-4-1-fast-reasoning", + name: "xAI Grok 4.1 Fast Reasoning", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-17", + last_updated: "2025-11-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.19999999999999998, output: 0.5, cache_read: 0.049999999999999996 }, + limit: { context: 2000000, output: 2000000 }, + }, + "gemma2-9b-it": { + id: "gemma2-9b-it", + name: "Google Gemma 2", + 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, + cost: { input: 0.01, output: 0.03 }, + limit: { context: 8192, output: 8192 }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Meta Llama 3.3 70B Instruct", + 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: false, + cost: { input: 0.13, output: 0.39 }, + limit: { context: 128000, output: 16400 }, + }, + "llama-4-scout": { + id: "llama-4-scout", + name: "Meta Llama 4 Scout 17B 16E", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.08, output: 0.3 }, + limit: { context: 131072, output: 8192 }, + }, + "chatgpt-4o-latest": { + id: "chatgpt-4o-latest", + name: "OpenAI ChatGPT-4o", + family: "gpt", + attachment: false, + 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, + cost: { input: 5, output: 20, cache_read: 2.5 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-3.5-sonnet-v2": { + id: "claude-3.5-sonnet-v2", + name: "Anthropic: Claude 3.5 Sonnet v2", + family: "claude-sonnet", + attachment: false, + 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, + cost: { input: 3, output: 15, cache_read: 0.30000000000000004, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "hermes-2-pro-llama-3-8b": { + id: "hermes-2-pro-llama-3-8b", + name: "Hermes 2 Pro Llama 3 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-05", + release_date: "2024-05-27", + last_updated: "2024-05-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.14 }, + limit: { context: 131072, output: 131072 }, + }, + "claude-3.7-sonnet": { + id: "claude-3.7-sonnet", + name: "Anthropic: Claude 3.7 Sonnet", + family: "claude-sonnet", + attachment: false, + 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, + cost: { input: 3, output: 15, cache_read: 0.30000000000000004, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "llama-prompt-guard-2-22m": { + id: "llama-prompt-guard-2-22m", + name: "Meta Llama Prompt Guard 2 22M", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.01, output: 0.01 }, + limit: { context: 512, output: 2 }, + }, + "o1-mini": { + id: "o1-mini", + name: "OpenAI: o1-mini", + family: "o-mini", + attachment: false, + reasoning: false, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 128000, output: 65536 }, + }, + "gpt-4.1-mini-2025-04-14": { + id: "gpt-4.1-mini-2025-04-14", + name: "OpenAI GPT-4.1 Mini", + family: "gpt-mini", + attachment: false, + 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, + cost: { input: 0.39999999999999997, output: 1.5999999999999999, cache_read: 0.09999999999999999 }, + limit: { context: 1047576, output: 32768 }, + }, + "deepseek-r1-distill-llama-70b": { + id: "deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.03, output: 0.13 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.29, output: 0.59 }, + limit: { context: 131072, output: 40960 }, + }, + "llama-3.3-70b-versatile": { + id: "llama-3.3-70b-versatile", + name: "Meta Llama 3.3 70B Versatile", + 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: false, + cost: { input: 0.59, output: 0.7899999999999999 }, + limit: { context: 131072, output: 32678 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "OpenAI GPT-5 Mini", + family: "gpt-mini", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.024999999999999998 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "OpenAI GPT-5 Nano", + family: "gpt-nano", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.049999999999999996, output: 0.39999999999999997, cache_read: 0.005 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "Google Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: false, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.19999999999999998 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-3-haiku-20240307": { + id: "claude-3-haiku-20240307", + name: "Anthropic: Claude 3 Haiku", + family: "claude-haiku", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-03-07", + last_updated: "2024-03-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.25, cache_read: 0.03, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "llama-4-maverick": { + id: "llama-4-maverick", + name: "Meta Llama 4 Maverick 17B 128E", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 8192 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "Anthropic: Claude Sonnet 4.5 (20250929)", + family: "claude-sonnet", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.30000000000000004, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Google Gemini 2.5 Pro", + family: "gemini-pro", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.3125, cache_write: 1.25 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-4.5-opus": { + id: "claude-4.5-opus", + name: "Anthropic: Claude Opus 4.5", + family: "claude-opus", + attachment: false, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "xAI Grok 4.1 Fast Non-Reasoning", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-17", + last_updated: "2025-11-17", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.19999999999999998, output: 0.5, cache_read: 0.049999999999999996 }, + limit: { context: 2000000, output: 30000 }, + }, + "sonar-pro": { + id: "sonar-pro", + name: "Perplexity Sonar Pro", + family: "sonar-pro", + attachment: false, + reasoning: false, + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 4096 }, + }, + "mistral-large-2411": { + id: "mistral-large-2411", + name: "Mistral-Large", + family: "mistral-large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2024-07-24", + last_updated: "2024-07-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 32768 }, + }, + "o3-pro": { + id: "o3-pro", + name: "OpenAI o3 Pro", + family: "o-pro", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2024-06", + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 20, output: 80 }, + limit: { context: 200000, output: 100000 }, + }, + "claude-opus-4-1": { + id: "claude-opus-4-1", + name: "Anthropic: Claude Opus 4.1", + family: "claude-opus", + attachment: false, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-4o-mini": { + id: "gpt-4o-mini", + name: "OpenAI GPT-4o-mini", + family: "gpt-mini", + 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", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.075 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-4.5-haiku": { + id: "claude-4.5-haiku", + name: "Anthropic: Claude 4.5 Haiku", + family: "claude-haiku", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-10", + release_date: "2025-10-01", + last_updated: "2025-10-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.09999999999999999, cache_write: 1.25 }, + limit: { context: 200000, output: 8192 }, + }, + "kimi-k2-0711": { + id: "kimi-k2-0711", + name: "Kimi K2 (07/11)", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5700000000000001, output: 2.3 }, + limit: { context: 131072, output: 16384 }, + }, + "o4-mini": { + id: "o4-mini", + name: "OpenAI o4 Mini", + family: "o-mini", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2024-06", + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.275 }, + limit: { context: 200000, output: 100000 }, + }, + "sonar-deep-research": { + id: "sonar-deep-research", + name: "Perplexity Sonar Deep Research", + family: "sonar-deep-research", + attachment: false, + reasoning: true, + 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, + cost: { input: 2, output: 8 }, + limit: { context: 127000, output: 4096 }, + }, + "gemma-3-12b-it": { + id: "gemma-3-12b-it", + name: "Google Gemma 3 12B", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.049999999999999996, output: 0.09999999999999999 }, + limit: { context: 131072, output: 8192 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Google Gemini 2.5 Flash", + family: "gemini-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, cache_write: 0.3 }, + limit: { context: 1048576, output: 65535 }, + }, + "deepseek-tng-r1t2-chimera": { + id: "deepseek-tng-r1t2-chimera", + name: "DeepSeek TNG R1T2 Chimera", + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 130000, output: 163840 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "OpenAI: GPT-5.1 Codex Mini", + family: "gpt-codex", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.024999999999999998 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-sonnet-4": { + id: "claude-sonnet-4", + name: "Anthropic: Claude Sonnet 4", + family: "claude-sonnet", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-05-14", + last_updated: "2025-05-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.30000000000000004, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "xAI Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-25", + last_updated: "2024-08-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.19999999999999998, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "OpenAI GPT-5.1", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12500000000000003 }, + limit: { context: 400000, output: 128000 }, + }, + "deepseek-reasoner": { + id: "deepseek-reasoner", + name: "DeepSeek Reasoner", + family: "deepseek-thinking", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.56, output: 1.68, cache_read: 0.07 }, + limit: { context: 128000, output: 64000 }, + }, + "grok-4-fast-reasoning": { + id: "grok-4-fast-reasoning", + name: "xAI: Grok 4 Fast Reasoning", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-01", + last_updated: "2025-09-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.19999999999999998, output: 0.5, cache_read: 0.049999999999999996 }, + limit: { context: 2000000, output: 2000000 }, + }, + o1: { + id: "o1", + name: "OpenAI: o1", + family: "o", + attachment: false, + reasoning: false, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "llama-3.1-8b-instant": { + id: "llama-3.1-8b-instant", + name: "Meta Llama 3.1 8B Instant", + family: "llama", + 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: false, + cost: { input: 0.049999999999999996, output: 0.08 }, + limit: { context: 131072, output: 32678 }, + }, + "o3-mini": { + id: "o3-mini", + name: "OpenAI o3 Mini", + family: "o-mini", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2023-10", + release_date: "2023-10-01", + last_updated: "2023-10-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + sonar: { + id: "sonar", + name: "Perplexity Sonar", + family: "sonar", + attachment: false, + reasoning: false, + 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, + cost: { input: 1, output: 1 }, + limit: { context: 127000, output: 4096 }, + }, + "kimi-k2-0905": { + id: "kimi-k2-0905", + name: "Kimi K2 (09/05)", + family: "kimi", + 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: false, + cost: { input: 0.5, output: 2, cache_read: 0.39999999999999997 }, + limit: { context: 262144, output: 16384 }, + }, + "mistral-small": { + id: "mistral-small", + name: "Mistral Small", + family: "mistral-small", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-02", + release_date: "2024-02-26", + last_updated: "2024-02-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 75, output: 200 }, + limit: { context: 128000, output: 128000 }, + }, + "qwen3-30b-a3b": { + id: "qwen3-30b-a3b", + name: "Qwen3 30B A3B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.08, output: 0.29 }, + limit: { context: 41000, output: 41000 }, + }, + "grok-4": { + id: "grok-4", + name: "xAI Grok 4", + 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, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 256000 }, + }, + "qwen3-235b-a22b-thinking": { + id: "qwen3-235b-a22b-thinking", + name: "Qwen3 235B A22B Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-25", + last_updated: "2025-07-25", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.9000000000000004 }, + limit: { context: 262144, output: 81920 }, + }, + "qwen2.5-coder-7b-fast": { + id: "qwen2.5-coder-7b-fast", + name: "Qwen2.5 Coder 7B fast", + 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, + cost: { input: 0.03, output: 0.09 }, + limit: { context: 32000, output: 8192 }, + }, + "llama-3.1-8b-instruct-turbo": { + id: "llama-3.1-8b-instruct-turbo", + name: "Meta Llama 3.1 8B Instruct Turbo", + 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: false, + cost: { input: 0.02, output: 0.03 }, + limit: { context: 128000, output: 128000 }, + }, + "qwen3-next-80b-a3b-instruct": { + id: "qwen3-next-80b-a3b-instruct", + name: "Qwen3 Next 80B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 1.4 }, + limit: { context: 262000, output: 16384 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "Zai GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.44999999999999996, output: 1.5 }, + limit: { context: 204800, output: 131072 }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "OpenAI: GPT-5 Codex", + family: "gpt-codex", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12500000000000003 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "Anthropic: Claude Opus 4.1 (20250805)", + family: "claude-opus", + attachment: false, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-5.1-chat-latest": { + id: "gpt-5.1-chat-latest", + name: "OpenAI GPT-5.1 Chat", + family: "gpt-codex", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12500000000000003 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "Anthropic: Claude 4.5 Haiku (20251001)", + family: "claude-haiku", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-10", + release_date: "2025-10-01", + last_updated: "2025-10-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.09999999999999999, cache_write: 1.25 }, + limit: { context: 200000, output: 8192 }, + }, + "sonar-reasoning": { + id: "sonar-reasoning", + name: "Perplexity Sonar Reasoning", + family: "sonar-reasoning", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 5 }, + limit: { context: 127000, output: 4096 }, + }, + "claude-opus-4": { + id: "claude-opus-4", + name: "Anthropic: Claude Opus 4", + family: "claude-opus", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-05-14", + last_updated: "2025-05-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "llama-prompt-guard-2-86m": { + id: "llama-prompt-guard-2-86m", + name: "Meta Llama Prompt Guard 2 86M", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.01, output: 0.01 }, + limit: { context: 512, output: 2 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "OpenAI GPT-4.1 Nano", + family: "gpt-nano", + attachment: false, + 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, + cost: { input: 0.09999999999999999, output: 0.39999999999999997, cache_read: 0.024999999999999998 }, + limit: { context: 1047576, output: 32768 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3 Coder 30B A3B Instruct", + 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: false, + cost: { input: 0.09999999999999999, output: 0.3 }, + limit: { context: 262144, output: 262144 }, + }, + "claude-3.5-haiku": { + id: "claude-3.5-haiku", + name: "Anthropic: Claude 3.5 Haiku", + family: "claude-haiku", + attachment: false, + 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, + cost: { input: 0.7999999999999999, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "grok-3-mini": { + id: "grok-3-mini", + name: "xAI Grok 3 Mini", + 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, + cost: { input: 0.3, output: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 131072 }, + }, + o3: { + id: "o3", + name: "OpenAI o3", + family: "o", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2024-06", + release_date: "2024-06-01", + last_updated: "2024-06-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: false, + 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, + cost: { input: 0.27, output: 0.41 }, + limit: { context: 163840, output: 65536 }, + }, + "gpt-oss-20b": { + id: "gpt-oss-20b", + name: "OpenAI GPT-OSS 20b", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.049999999999999996, output: 0.19999999999999998 }, + limit: { context: 131072, output: 131072 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "OpenAI: GPT-5 Pro", + family: "gpt-pro", + attachment: false, + reasoning: false, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 128000, output: 32768 }, + }, + "llama-guard-4": { + id: "llama-guard-4", + name: "Meta Llama Guard 4 12B", + family: "llama", + attachment: false, + 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, + cost: { input: 0.21, output: 0.21 }, + limit: { context: 131072, output: 1024 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "OpenAI GPT-4o", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-05", + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-vl-235b-a22b-instruct": { + id: "qwen3-vl-235b-a22b-instruct", + name: "Qwen3 VL 235B A22B Instruct", + family: "qwen", + attachment: false, + 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: false, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 256000, output: 16384 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "Google Gemini 2.5 Flash Lite", + family: "gemini-flash-lite", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-22", + last_updated: "2025-07-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 0.09999999999999999, + output: 0.39999999999999997, + cache_read: 0.024999999999999998, + cache_write: 0.09999999999999999, + }, + limit: { context: 1048576, output: 65535 }, + }, + "qwen3-coder": { + id: "qwen3-coder", + name: "Qwen3 Coder 480B A35B Instruct Turbo", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-23", + last_updated: "2025-07-23", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.22, output: 0.95 }, + limit: { context: 262144, output: 16384 }, + }, + "gpt-5": { + id: "gpt-5", + name: "OpenAI GPT-5", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12500000000000003 }, + limit: { context: 400000, output: 128000 }, + }, + "ernie-4.5-21b-a3b-thinking": { + id: "ernie-4.5-21b-a3b-thinking", + name: "Baidu Ernie 4.5 21B A3B Thinking", + family: "ernie", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 128000, output: 8000 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "OpenAI GPT-OSS 120b", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.04, output: 0.16 }, + limit: { context: 131072, output: 131072 }, + }, + "gpt-5-chat-latest": { + id: "gpt-5-chat-latest", + name: "OpenAI GPT-5 Chat Latest", + family: "gpt-codex", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2024-09", + release_date: "2024-09-30", + last_updated: "2024-09-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12500000000000003 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-4.5-sonnet": { + id: "claude-4.5-sonnet", + name: "Anthropic: Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.30000000000000004, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "deepseek-v3": { + id: "deepseek-v3", + name: "DeepSeek V3", + 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, + cost: { input: 0.56, output: 1.68, cache_read: 0.07 }, + limit: { context: 128000, output: 8192 }, + }, + "llama-3.1-8b-instruct": { + id: "llama-3.1-8b-instruct", + name: "Meta Llama 3.1 8B Instruct", + 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: false, + cost: { input: 0.02, output: 0.049999999999999996 }, + limit: { context: 16384, output: 16384 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "OpenAI GPT-4.1", + family: "gpt", + attachment: false, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.48, output: 2 }, + limit: { context: 256000, output: 262144 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "OpenAI GPT-4.1 Mini", + family: "gpt-mini", + attachment: false, + 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, + cost: { input: 0.39999999999999997, output: 1.5999999999999999, cache_read: 0.09999999999999999 }, + limit: { context: 1047576, output: 32768 }, + }, + "deepseek-v3.1-terminus": { + id: "deepseek-v3.1-terminus", + name: "DeepSeek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 1, cache_read: 0.21600000000000003 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "OpenAI: GPT-5.1 Codex", + family: "gpt-codex", + attachment: false, + reasoning: false, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.12500000000000003 }, + limit: { context: 400000, output: 128000 }, + }, + "grok-3": { + id: "grok-3", + name: "xAI Grok 3", + 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, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 131072 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "xAI Grok 4 Fast Non-Reasoning", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.19999999999999998, output: 0.5, cache_read: 0.049999999999999996 }, + limit: { context: 2000000, output: 2000000 }, + }, + "sonar-reasoning-pro": { + id: "sonar-reasoning-pro", + name: "Perplexity Sonar Reasoning Pro", + family: "sonar-reasoning", + attachment: false, + reasoning: true, + 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, + cost: { input: 2, output: 8 }, + limit: { context: 127000, output: 4096 }, + }, + }, + }, + "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: { + "minimax-m2.7": { + id: "minimax-m2.7", + name: "minimax-m2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 196608, output: 196608 }, + }, + "gpt-oss:20b": { + id: "gpt-oss:20b", + name: "gpt-oss:20b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-08-05", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 131072, output: 32768 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "kimi-k2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "glm-4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-12-22", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 202752, output: 131072 }, + }, + "gemma4:31b": { + id: "gemma4:31b", + name: "gemma4:31b", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + knowledge: "2025-01", + release_date: "2026-04-02", + last_updated: "2026-04-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "gpt-oss:120b": { + id: "gpt-oss:120b", + name: "gpt-oss:120b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-08-05", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 131072, output: 32768 }, + }, + "qwen3.5:397b": { + id: "qwen3.5:397b", + name: "qwen3.5:397b", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + release_date: "2026-02-15", + last_updated: "2026-02-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 65536 }, + }, + "deepseek-v3.1:671b": { + id: "deepseek-v3.1:671b", + name: "deepseek-v3.1:671b", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-08-21", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 163840, output: 163840 }, + }, + "glm-5": { + id: "glm-5", + name: "glm-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 202752, output: 131072 }, + }, + "qwen3-vl:235b-instruct": { + id: "qwen3-vl:235b-instruct", + name: "qwen3-vl:235b-instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2025-09-22", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 131072 }, + }, + "gemma3:4b": { + id: "gemma3:4b", + name: "gemma3:4b", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + release_date: "2024-12-01", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 131072, output: 131072 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "gemini-3-flash-preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + knowledge: "2025-01", + release_date: "2025-12-17", + last_updated: "2026-04-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 1048576, output: 65536 }, + }, + "ministral-3:14b": { + id: "ministral-3:14b", + name: "ministral-3:14b", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2024-12-01", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 128000 }, + }, + "minimax-m2": { + id: "minimax-m2", + name: "minimax-m2", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-10-23", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 204800, output: 128000 }, + }, + "qwen3-next:80b": { + id: "qwen3-next:80b", + name: "qwen3-next:80b", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-09-15", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 32768 }, + }, + "qwen3-vl:235b": { + id: "qwen3-vl:235b", + name: "qwen3-vl:235b", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2025-09-22", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 32768 }, + }, + "rnj-1:8b": { + id: "rnj-1:8b", + name: "rnj-1:8b", + family: "rnj", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-12-06", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 32768, output: 4096 }, + }, + "minimax-m2.1": { + id: "minimax-m2.1", + name: "minimax-m2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-12-23", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 204800, output: 131072 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "glm-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + release_date: "2026-03-27", + last_updated: "2026-04-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 202752, output: 131072 }, + }, + "mistral-large-3:675b": { + id: "mistral-large-3:675b", + name: "mistral-large-3:675b", + family: "mistral-large", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2025-12-02", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "ministral-3:8b": { + id: "ministral-3:8b", + name: "ministral-3:8b", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2024-12-01", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 128000 }, + }, + "gemma3:12b": { + id: "gemma3:12b", + name: "gemma3:12b", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + release_date: "2024-12-01", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 131072, output: 131072 }, + }, + "qwen3-coder:480b": { + id: "qwen3-coder:480b", + name: "qwen3-coder:480b", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-07-22", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 65536 }, + }, + "kimi-k2.6:cloud": { + id: "kimi-k2.6:cloud", + name: "kimi-k2.6:cloud", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "nemotron-3-nano:30b": { + id: "nemotron-3-nano:30b", + name: "nemotron-3-nano:30b", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-12-15", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 1048576, output: 131072 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "deepseek-v4-flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2026-04-24", + last_updated: "2026-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 1048576, output: 1048576 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "glm-4.6", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-09-29", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 202752, output: 131072 }, + }, + "ministral-3:3b": { + id: "ministral-3:3b", + name: "ministral-3:3b", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2024-10-22", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 128000 }, + }, + "gemma3:27b": { + id: "gemma3:27b", + name: "gemma3:27b", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + release_date: "2025-07-27", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 131072, output: 131072 }, + }, + "devstral-2:123b": { + id: "devstral-2:123b", + name: "devstral-2:123b", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-12-09", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "cogito-2.1:671b": { + id: "cogito-2.1:671b", + name: "cogito-2.1:671b", + family: "cogito", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-11-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 163840, output: 32000 }, + }, + "qwen3-coder-next": { + id: "qwen3-coder-next", + name: "qwen3-coder-next", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2026-02-02", + last_updated: "2026-02-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 65536 }, + }, + "nemotron-3-super": { + id: "nemotron-3-super", + name: "nemotron-3-super", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2026-03-11", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 65536 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "deepseek-v4-pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2026-04-24", + last_updated: "2026-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 1048576, output: 1048576 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "minimax-m2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: 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 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "deepseek-v3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-06-15", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 163840, output: 65536 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "kimi-k2-thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + knowledge: "2024-08", + release_date: "2025-11-06", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "devstral-small-2:24b": { + id: "devstral-small-2:24b", + name: "devstral-small-2:24b", + family: "devstral", + attachment: true, + reasoning: false, + tool_call: true, + release_date: "2025-12-09", + last_updated: "2026-01-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2:1t": { + id: "kimi-k2:1t", + name: "kimi-k2:1t", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + knowledge: "2024-10", + release_date: "2025-07-11", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + "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-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-5-turbo": { + id: "glm-5-turbo", + name: "GLM-5-Turbo", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-5v-turbo": { + id: "glm-5v-turbo", + name: "GLM-5V-Turbo", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + }, + }, + "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: { + "openai.gpt-oss-safeguard-120b": { + id: "openai.gpt-oss-safeguard-120b", + name: "GPT OSS Safeguard 120B", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia.nemotron-nano-3-30b": { + id: "nvidia.nemotron-nano-3-30b", + name: "NVIDIA Nemotron Nano 3 30B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.24 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia.nemotron-super-3-120b": { + id: "nvidia.nemotron-super-3-120b", + name: "NVIDIA Nemotron 3 Super 120B A12B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.65 }, + limit: { context: 262144, output: 131072 }, + }, + "writer.palmyra-x5-v1:0": { + id: "writer.palmyra-x5-v1:0", + name: "Palmyra X5", + family: "palmyra", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04-28", + last_updated: "2025-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 6 }, + limit: { context: 1040000, output: 8192 }, + }, + "mistral.ministral-3-8b-instruct": { + id: "mistral.ministral-3-8b-instruct", + name: "Ministral 3 8B", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 4096 }, + }, + "au.anthropic.claude-opus-4-6-v1": { + id: "au.anthropic.claude-opus-4-6-v1", + name: "AU Anthropic Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 16.5, output: 82.5, cache_read: 1.65, cache_write: 20.625 }, + limit: { context: 1000000, output: 128000 }, + }, + "mistral.ministral-3-3b-instruct": { + id: "mistral.ministral-3-3b-instruct", + name: "Ministral 3 3B", + 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", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 256000, output: 8192 }, + }, + "anthropic.claude-sonnet-4-5-20250929-v1:0": { + id: "anthropic.claude-sonnet-4-5-20250929-v1:0", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "mistral.devstral-2-123b": { + id: "mistral.devstral-2-123b", + name: "Devstral 2 123B", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2 }, + limit: { context: 256000, output: 8192 }, + }, + "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)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "mistral.voxtral-small-24b-2507": { + id: "mistral.voxtral-small-24b-2507", + name: "Voxtral Small 24B 2507", + family: "mistral", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-01", + last_updated: "2025-07-01", + modalities: { input: ["text", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.35 }, + limit: { context: 32000, output: 8192 }, + }, + "google.gemma-3-12b-it": { + id: "google.gemma-3-12b-it", + name: "Google Gemma 3 12B", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.049999999999999996, output: 0.09999999999999999 }, + limit: { context: 131072, output: 8192 }, + }, + "amazon.nova-pro-v1:0": { + id: "amazon.nova-pro-v1:0", + name: "Nova Pro", + 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, + cost: { input: 0.8, output: 3.2, cache_read: 0.2 }, + limit: { context: 300000, output: 8192 }, + }, + "anthropic.claude-haiku-4-5-20251001-v1:0": { + id: "anthropic.claude-haiku-4-5-20251001-v1:0", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "minimax.minimax-m2": { + id: "minimax.minimax-m2", + name: "MiniMax M2", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204608, output: 128000 }, + }, + "global.anthropic.claude-opus-4-7": { + id: "global.anthropic.claude-opus-4-7", + name: "Claude Opus 4.7 (Global)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "mistral.pixtral-large-2502-v1:0": { + id: "mistral.pixtral-large-2502-v1:0", + name: "Pixtral Large (25.02)", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-08", + last_updated: "2025-04-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 8192 }, + }, + "meta.llama4-maverick-17b-instruct-v1:0": { + id: "meta.llama4-maverick-17b-instruct-v1:0", + name: "Llama 4 Maverick 17B Instruct", + 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, + cost: { input: 0.24, output: 0.97 }, + limit: { context: 1000000, output: 16384 }, + }, + "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)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "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)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "amazon.nova-micro-v1:0": { + id: "amazon.nova-micro-v1:0", + name: "Nova Micro", + 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, + cost: { input: 0.035, output: 0.14, cache_read: 0.00875 }, + limit: { context: 128000, output: 8192 }, + }, + "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)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "openai.gpt-oss-20b-1:0": { + id: "openai.gpt-oss-20b-1:0", + name: "gpt-oss-20b", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.3 }, + limit: { context: 128000, output: 4096 }, + }, + "zai.glm-5": { + id: "zai.glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3.2 }, + limit: { context: 202752, output: 101376 }, + }, + "qwen.qwen3-32b-v1:0": { + id: "qwen.qwen3-32b-v1:0", + name: "Qwen3 32B (dense)", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2025-09-18", + last_updated: "2025-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 16384, output: 16384 }, + }, + "deepseek.v3.2": { + id: "deepseek.v3.2", + name: "DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2026-02-06", + last_updated: "2026-02-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.62, output: 1.85 }, + limit: { context: 163840, output: 81920 }, + }, + "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)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "zai.glm-4.7-flash": { + id: "zai.glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.4 }, + limit: { context: 200000, output: 131072 }, + }, + "us.anthropic.claude-opus-4-7": { + id: "us.anthropic.claude-opus-4-7", + name: "Claude Opus 4.7 (US)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "amazon.nova-2-lite-v1:0": { + id: "amazon.nova-2-lite-v1:0", + name: "Nova 2 Lite", + family: "nova", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.33, output: 2.75 }, + limit: { context: 128000, output: 4096 }, + }, + "anthropic.claude-opus-4-5-20251101-v1:0": { + id: "anthropic.claude-opus-4-5-20251101-v1:0", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen.qwen3-coder-480b-a35b-v1:0": { + id: "qwen.qwen3-coder-480b-a35b-v1:0", + name: "Qwen3 Coder 480B A35B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2025-09-18", + last_updated: "2025-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 1.8 }, + limit: { context: 131072, output: 65536 }, + }, + "amazon.nova-lite-v1:0": { + id: "amazon.nova-lite-v1:0", + name: "Nova Lite", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.24, cache_read: 0.015 }, + limit: { context: 300000, output: 8192 }, + }, + "meta.llama3-1-8b-instruct-v1:0": { + id: "meta.llama3-1-8b-instruct-v1:0", + name: "Llama 3.1 8B Instruct", + 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, + cost: { input: 0.22, output: 0.22 }, + limit: { context: 128000, output: 4096 }, + }, + "anthropic.claude-opus-4-7": { + id: "anthropic.claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "google.gemma-3-27b-it": { + id: "google.gemma-3-27b-it", + name: "Google Gemma 3 27B Instruct", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-27", + last_updated: "2025-07-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.2 }, + limit: { context: 202752, output: 8192 }, + }, + "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)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "google.gemma-3-4b-it": { + id: "google.gemma-3-4b-it", + name: "Gemma 3 4B IT", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04, output: 0.08 }, + limit: { context: 128000, output: 4096 }, + }, + "meta.llama4-scout-17b-instruct-v1:0": { + id: "meta.llama4-scout-17b-instruct-v1:0", + name: "Llama 4 Scout 17B Instruct", + 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, + cost: { input: 0.17, output: 0.66 }, + limit: { context: 3500000, output: 16384 }, + }, + "deepseek.v3-v1:0": { + id: "deepseek.v3-v1:0", + name: "DeepSeek-V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-09-18", + last_updated: "2025-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.58, output: 1.68 }, + limit: { context: 163840, output: 81920 }, + }, + "mistral.magistral-small-2509": { + id: "mistral.magistral-small-2509", + name: "Magistral Small 1.2", + family: "magistral", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 128000, output: 40000 }, + }, + "qwen.qwen3-next-80b-a3b": { + id: "qwen.qwen3-next-80b-a3b", + name: "Qwen/Qwen3-Next-80B-A3B-Instruct", + family: "qwen", + 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: false, + cost: { input: 0.14, output: 1.4 }, + limit: { context: 262000, output: 262000 }, + }, + "zai.glm-4.7": { + id: "zai.glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 204800, output: 131072 }, + }, + "moonshot.kimi-k2-thinking": { + id: "moonshot.kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + structured_output: true, + temperature: true, + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 256000, output: 256000 }, + }, + "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)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "mistral.ministral-3-14b-instruct": { + id: "mistral.ministral-3-14b-instruct", + name: "Ministral 14B 3.0", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek.r1-v1:0": { + id: "deepseek.r1-v1:0", + name: "DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 128000, output: 32768 }, + }, + "mistral.voxtral-mini-3b-2507": { + id: "mistral.voxtral-mini-3b-2507", + name: "Voxtral Mini 3B 2507", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["audio", "text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 128000, output: 4096 }, + }, + "openai.gpt-oss-120b-1:0": { + id: "openai.gpt-oss-120b-1:0", + name: "gpt-oss-120b", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia.nemotron-nano-12b-v2": { + id: "nvidia.nemotron-nano-12b-v2", + name: "NVIDIA Nemotron Nano 12B v2 VL BF16", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 128000, output: 4096 }, + }, + "eu.anthropic.claude-opus-4-7": { + id: "eu.anthropic.claude-opus-4-7", + name: "Claude Opus 4.7 (EU)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "minimax.minimax-m2.5": { + id: "minimax.minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 196608, output: 98304 }, + }, + "meta.llama3-3-70b-instruct-v1:0": { + id: "meta.llama3-3-70b-instruct-v1:0", + name: "Llama 3.3 70B Instruct", + 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, + cost: { input: 0.72, output: 0.72 }, + limit: { context: 128000, output: 4096 }, + }, + "meta.llama3-1-70b-instruct-v1:0": { + id: "meta.llama3-1-70b-instruct-v1:0", + name: "Llama 3.1 70B Instruct", + 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, + cost: { input: 0.72, output: 0.72 }, + limit: { context: 128000, output: 4096 }, + }, + "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)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "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)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "moonshotai.kimi-k2.5": { + id: "moonshotai.kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + release_date: "2026-02-06", + last_updated: "2026-02-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 256000, output: 256000 }, + }, + "au.anthropic.claude-sonnet-4-6": { + id: "au.anthropic.claude-sonnet-4-6", + name: "AU Anthropic Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3.3, output: 16.5, cache_read: 0.33, cache_write: 4.125 }, + limit: { context: 1000000, output: 128000 }, + }, + "openai.gpt-oss-safeguard-20b": { + id: "openai.gpt-oss-safeguard-20b", + name: "GPT OSS Safeguard 20B", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.2 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen.qwen3-coder-30b-a3b-v1:0": { + id: "qwen.qwen3-coder-30b-a3b-v1:0", + name: "Qwen3 Coder 30B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2025-09-18", + last_updated: "2025-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 262144, output: 131072 }, + }, + "minimax.minimax-m2.1": { + id: "minimax.minimax-m2.1", + name: "MiniMax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen.qwen3-vl-235b-a22b": { + id: "qwen.qwen3-vl-235b-a22b", + name: "Qwen/Qwen3-VL-235B-A22B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 262000, output: 262000 }, + }, + "qwen.qwen3-coder-next": { + id: "qwen.qwen3-coder-next", + name: "Qwen3 Coder Next", + family: "qwen", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.22, output: 1.8 }, + limit: { context: 131072, output: 65536 }, + }, + "nvidia.nemotron-nano-9b-v2": { + id: "nvidia.nemotron-nano-9b-v2", + name: "NVIDIA Nemotron Nano 9B v2", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.23 }, + limit: { context: 128000, output: 4096 }, + }, + "mistral.mistral-large-3-675b-instruct": { + id: "mistral.mistral-large-3-675b-instruct", + name: "Mistral Large 3", + family: "mistral", + 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", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 256000, output: 8192 }, + }, + "qwen.qwen3-235b-a22b-2507-v1:0": { + id: "qwen.qwen3-235b-a22b-2507-v1:0", + name: "Qwen3 235B A22B 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2025-09-18", + last_updated: "2025-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.88 }, + limit: { context: 262144, output: 131072 }, + }, + "writer.palmyra-x4-v1:0": { + id: "writer.palmyra-x4-v1:0", + name: "Palmyra X4", + family: "palmyra", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04-28", + last_updated: "2025-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 122880, output: 8192 }, + }, + "anthropic.claude-opus-4-1-20250805-v1:0": { + id: "anthropic.claude-opus-4-1-20250805-v1:0", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "us.deepseek.r1-v1:0": { + id: "us.deepseek.r1-v1:0", + name: "DeepSeek-R1 (US)", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 128000, output: 32768 }, + }, + "eu.anthropic.claude-opus-4-6-v1": { + id: "eu.anthropic.claude-opus-4-6-v1", + name: "Claude Opus 4.6 (EU)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "us.meta.llama4-maverick-17b-instruct-v1:0": { + id: "us.meta.llama4-maverick-17b-instruct-v1:0", + name: "Llama 4 Maverick 17B Instruct (US)", + 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, + cost: { input: 0.24, output: 0.97 }, + limit: { context: 1000000, output: 16384 }, + }, + "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)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "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)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic.claude-sonnet-4-6": { + id: "anthropic.claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "jp.anthropic.claude-sonnet-4-6": { + id: "jp.anthropic.claude-sonnet-4-6", + name: "Claude Sonnet 4.6 (JP)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "global.anthropic.claude-sonnet-4-6": { + id: "global.anthropic.claude-sonnet-4-6", + name: "Claude Sonnet 4.6 (Global)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "us.anthropic.claude-sonnet-4-6": { + id: "us.anthropic.claude-sonnet-4-6", + name: "Claude Sonnet 4.6 (US)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "global.anthropic.claude-opus-4-6-v1": { + id: "global.anthropic.claude-opus-4-6-v1", + name: "Claude Opus 4.6 (Global)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "us.anthropic.claude-opus-4-6-v1": { + id: "us.anthropic.claude-opus-4-6-v1", + name: "Claude Opus 4.6 (US)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "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)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "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)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "eu.anthropic.claude-sonnet-4-6": { + id: "eu.anthropic.claude-sonnet-4-6", + name: "Claude Sonnet 4.6 (EU)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "us.meta.llama4-scout-17b-instruct-v1:0": { + id: "us.meta.llama4-scout-17b-instruct-v1:0", + name: "Llama 4 Scout 17B Instruct (US)", + 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, + cost: { input: 0.17, output: 0.66 }, + limit: { context: 3500000, output: 16384 }, + }, + "anthropic.claude-opus-4-6-v1": { + id: "anthropic.claude-opus-4-6-v1", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "jp.anthropic.claude-opus-4-7": { + id: "jp.anthropic.claude-opus-4-7", + name: "Claude Opus 4.7 (JP)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + }, + }, + "the-grid-ai": { + id: "the-grid-ai", + env: ["THEGRIDAI_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.thegrid.ai/v1", + name: "The Grid AI", + doc: "https://thegrid.ai/docs", + models: { + "text-prime": { + id: "text-prime", + name: "Text Prime", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 30000 }, + status: "beta", + }, + "text-standard": { + id: "text-standard", + name: "Text Standard", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-02-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 16000 }, + status: "beta", + }, + "text-max": { + id: "text-max", + name: "Text Max", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-24", + last_updated: "2026-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 1000000, output: 128000 }, + status: "beta", + }, + }, + }, + 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/development/model-apis/overview", + models: { + "zai-org/GLM-4.7": { + id: "zai-org/GLM-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 204800, output: 131072 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2026-01", + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 3.15 }, + limit: { context: 202752, output: 131072 }, + }, + "zai-org/GLM-4.6": { + id: "zai-org/GLM-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2025-09-16", + last_updated: "2025-09-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 200000, output: 200000 }, + }, + "nvidia/Nemotron-120B-A12B": { + id: "nvidia/Nemotron-120B-A12B", + name: "Nemotron 3 Super", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2026-02", + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.75 }, + limit: { context: 262144, output: 32678 }, + }, + "deepseek-ai/DeepSeek-V3.1": { + id: "deepseek-ai/DeepSeek-V3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-25", + last_updated: "2025-08-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 164000, output: 131000 }, + }, + "deepseek-ai/DeepSeek-V3-0324": { + id: "deepseek-ai/DeepSeek-V3-0324", + name: "DeepSeek V3 0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.77, output: 0.77 }, + limit: { context: 164000, output: 131000 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-10", + release_date: "2025-12-01", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.45 }, + limit: { context: 163800, output: 131100 }, + status: "deprecated", + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 128000, output: 128000 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-08", + release_date: "2025-11-06", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 262144 }, + status: "deprecated", + }, + "moonshotai/Kimi-K2.6": { + id: "moonshotai/Kimi-K2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi K2 Instruct 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-09-05", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 262144 }, + status: "deprecated", + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-12", + release_date: "2026-01-30", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 262144, output: 8192 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2026-01", + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204000, output: 204000 }, + }, + "deepseek-ai/DeepSeek-V4-Pro": { + id: "deepseek-ai/DeepSeek-V4-Pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.15 }, + limit: { context: 1000000, output: 384000 }, + }, + }, + }, + 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-reasoning": { + id: "grok-4-1-fast-reasoning", + name: "Grok 4.1 Fast (Reasoning)", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-25", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 128000 }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi-K2.5", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "1970-01-01", + last_updated: "1970-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 256000, output: 128000 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3, cache_read: 0.05 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 128000 }, + }, + "zai-glm-5-1": { + id: "zai-glm-5-1", + name: "Z.AI GLM-5.1", + family: "glm", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-01-20", + last_updated: "2025-02-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 198000, output: 8192 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "Grok 4.1 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-25", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 128000 }, + }, + "gpt-5-4-nano": { + id: "gpt-5-4-nano", + name: "GPT-5.4 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-07-17", + last_updated: "2025-07-17", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.075 }, + limit: { context: 1048576, output: 65536 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok 4.1 Fast (Reasoning)", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 128000 }, + }, + "gpt-5-5": { + id: "gpt-5-5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 272000, output: 128000 }, + }, + "grok-4-3": { + id: "grok-4-3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-11", + release_date: "2026-04-30", + last_updated: "2026-04-30", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 2.5, cache_read: 0.2 }, + limit: { context: 1000000, output: 128000 }, + }, + "gpt-5-4-mini": { + id: "gpt-5-4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 128000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek v4 Pro", + family: "deepseek", + attachment: true, + 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: false, + cost: { input: 1.74, output: 3.48, cache_read: 0.14 }, + limit: { context: 128000, output: 8192 }, + }, + "gpt-oss-20b": { + id: "gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "1970-01-01", + last_updated: "1970-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.2 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen-3-6-plus": { + id: "qwen-3-6-plus", + name: "Qwen 3.6 Plus", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.1 }, + limit: { context: 1000000, output: 64000 }, + }, + "minimax-m2-7": { + id: "minimax-m2-7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: true, + 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: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 192000, output: 8192 }, + }, + "minimax-m2-5": { + id: "minimax-m2-5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2025-01-15", + last_updated: "2025-02-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.03 }, + limit: { context: 192000, output: 8192 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "GPT-4o", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "1970-01-01", + last_updated: "1970-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 32768 }, + }, + "gemini-3-1-pro-preview": { + id: "gemini-3-1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-02-18", + last_updated: "2026-02-18", + modalities: { input: ["text", "image", "video", "audio", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2 }, + limit: { context: 1000000, output: 64000 }, + }, + "kimi-k2-6": { + id: "kimi-k2-6", + name: "Kimi-K2.6", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "1970-01-01", + last_updated: "1970-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 256000, output: 128000 }, + }, + "gpt-5-3-codex": { + id: "gpt-5-3-codex", + name: "GPT-5.3 Codex", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2026-01-31", + release_date: "2026-02-15", + last_updated: "2026-02-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + }, + }, + "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-5v-turbo": { + id: "glm-5v-turbo", + name: "GLM-5V-Turbo", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-5-turbo": { + id: "glm-5-turbo", + name: "GLM-5-Turbo", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + "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-coder-plus": { + id: "qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 65536 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 202752, output: 16384 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 202752, output: 16384 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 196608, input: 196601, output: 24576 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen3-max-2026-01-23": { + id: "qwen3-max-2026-01-23", + name: "Qwen3 Max", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen3-coder-next": { + id: "qwen3-coder-next", + name: "Qwen3 Coder Next", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3.5-plus": { + id: "qwen3.5-plus", + name: "Qwen3.5 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 65536 }, + }, + }, + }, + venice: { + id: "venice", + env: ["VENICE_API_KEY"], + npm: "venice-ai-sdk-provider", + name: "Venice AI", + doc: "https://docs.venice.ai", + models: { + "openai-gpt-4o-mini-2024-07-18": { + id: "openai-gpt-4o-mini-2024-07-18", + name: "GPT-4o Mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-28", + last_updated: "2026-03-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1875, output: 0.75, cache_read: 0.09375 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-next-80b": { + id: "qwen3-next-80b", + name: "Qwen 3 Next 80b", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-04-29", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.9 }, + limit: { context: 256000, output: 16384 }, + }, + "grok-4-20-multi-agent": { + id: "grok-4-20-multi-agent", + name: "Grok 4.20 Multi-Agent", + family: "grok", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2026-03-12", + last_updated: "2026-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.42, + output: 2.83, + cache_read: 0.23, + context_over_200k: { input: 2.83, output: 5.67, cache_read: 0.45 }, + }, + limit: { context: 2000000, output: 128000 }, + }, + "qwen3-235b-a22b-instruct-2507": { + id: "qwen3-235b-a22b-instruct-2507", + name: "Qwen 3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-04-29", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.75 }, + limit: { context: 128000, output: 16384 }, + }, + "z-ai-glm-5v-turbo": { + id: "z-ai-glm-5v-turbo", + name: "GLM 5V Turbo", + family: "glmv", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 5, cache_read: 0.3 }, + limit: { context: 200000, output: 32768 }, + }, + "gemma-4-uncensored": { + id: "gemma-4-uncensored", + name: "Gemma 4 Uncensored", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-13", + last_updated: "2026-04-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1625, output: 0.5 }, + limit: { context: 256000, output: 8192 }, + }, + "grok-41-fast": { + id: "grok-41-fast", + name: "Grok 4.1 Fast", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-12-01", + last_updated: "2026-04-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.23, output: 0.57, cache_read: 0.06 }, + limit: { context: 1000000, output: 30000 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-03-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3.6, output: 18, cache_read: 0.36, cache_write: 4.5 }, + limit: { context: 1000000, output: 64000 }, + }, + "nvidia-nemotron-cascade-2-30b-a3b": { + id: "nvidia-nemotron-cascade-2-30b-a3b", + name: "Nemotron Cascade 2 30B A3B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-24", + last_updated: "2026-04-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.8 }, + limit: { context: 256000, output: 32768 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-12-19", + last_updated: "2026-03-12", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7, output: 3.75, cache_read: 0.07 }, + limit: { context: 256000, output: 65536 }, + }, + "grok-4-20": { + id: "grok-4-20", + name: "Grok 4.20", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-12", + last_updated: "2026-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.42, + output: 2.83, + cache_read: 0.23, + context_over_200k: { input: 2.83, output: 5.67, cache_read: 0.45 }, + }, + limit: { context: 2000000, output: 128000 }, + }, + "google-gemma-4-26b-a4b-it": { + id: "google-gemma-4-26b-a4b-it", + name: "Google Gemma 4 26B A4B Instruct", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-12", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1625, output: 0.5 }, + limit: { context: 256000, output: 8192 }, + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + release_date: "2026-04-16", + last_updated: "2026-04-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 6, output: 30, cache_read: 0.6, cache_write: 7.5 }, + limit: { context: 1000000, output: 128000 }, + }, + "qwen3-coder-480b-a35b-instruct-turbo": { + id: "qwen3-coder-480b-a35b-instruct-turbo", + name: "Qwen 3 Coder 480B Turbo", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-02-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.5, cache_read: 0.04 }, + limit: { context: 256000, output: 65536 }, + }, + "qwen3-5-397b-a17b": { + id: "qwen3-5-397b-a17b", + name: "Qwen 3.5 397B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-16", + last_updated: "2026-04-16", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.75, output: 4.5 }, + limit: { context: 128000, output: 32768 }, + }, + "zai-org-glm-4.7": { + id: "zai-org-glm-4.7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-12-24", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.65, cache_read: 0.11 }, + limit: { context: 198000, output: 16384 }, + }, + "openai-gpt-54": { + id: "openai-gpt-54", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-05", + last_updated: "2026-03-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3.13, output: 18.8, cache_read: 0.313 }, + limit: { context: 1000000, output: 131072 }, + }, + "zai-org-glm-4.7-flash": { + id: "zai-org-glm-4.7-flash", + name: "GLM 4.7 Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-29", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 128000, output: 16384 }, + }, + "nvidia-nemotron-3-nano-30b-a3b": { + id: "nvidia-nemotron-3-nano-30b-a3b", + name: "NVIDIA Nemotron 3 Nano 30B", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-vl-235b-a22b": { + id: "qwen3-vl-235b-a22b", + name: "Qwen3 VL 235B", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-16", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 1.5 }, + limit: { context: 256000, output: 16384 }, + }, + "openai-gpt-53-codex": { + id: "openai-gpt-53-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-24", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.19, output: 17.5, cache_read: 0.219 }, + limit: { context: 400000, output: 128000 }, + }, + "venice-uncensored-1-2": { + id: "venice-uncensored-1-2", + name: "Venice Uncensored 1.2", + family: "venice", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.9 }, + limit: { context: 128000, output: 8192 }, + }, + "openai-gpt-52": { + id: "openai-gpt-52", + name: "GPT-5.2", + family: "gpt", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2025-12-13", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.19, output: 17.5, cache_read: 0.219 }, + limit: { context: 256000, output: 65536 }, + }, + "mistral-small-3-2-24b-instruct": { + id: "mistral-small-3-2-24b-instruct", + name: "Mistral Small 3.2 24B Instruct", + family: "mistral-small", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-15", + last_updated: "2026-03-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09375, output: 0.25 }, + limit: { context: 256000, output: 16384 }, + }, + "minimax-m27": { + id: "minimax-m27", + name: "MiniMax M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-04-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.375, output: 1.5, cache_read: 0.075 }, + limit: { context: 198000, output: 32768 }, + }, + "qwen3-235b-a22b-thinking-2507": { + id: "qwen3-235b-a22b-thinking-2507", + name: "Qwen 3 235B A22B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-04-29", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 3.5 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-5-35b-a3b": { + id: "qwen3-5-35b-a3b", + name: "Qwen 3.5 35B A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-25", + last_updated: "2026-04-16", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3125, output: 1.25, cache_read: 0.15625 }, + limit: { context: 256000, output: 65536 }, + }, + "mercury-2": { + id: "mercury-2", + name: "Mercury 2", + family: "mercury", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-20", + last_updated: "2026-04-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3125, output: 0.9375, cache_read: 0.03125 }, + limit: { context: 128000, output: 50000 }, + }, + "google-gemma-3-27b-it": { + id: "google-gemma-3-27b-it", + name: "Google Gemma 3 27B Instruct", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-11-04", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.2 }, + limit: { context: 198000, output: 16384 }, + }, + "olafangensan-glm-4.7-flash-heretic": { + id: "olafangensan-glm-4.7-flash-heretic", + name: "GLM 4.7 Flash Heretic", + family: "glm-flash", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-04", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.8 }, + limit: { context: 200000, output: 24000 }, + }, + "openai-gpt-55-pro": { + id: "openai-gpt-55-pro", + name: "GPT-5.5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 37.5, output: 225 }, + limit: { context: 1000000, output: 128000 }, + }, + "openai-gpt-52-codex": { + id: "openai-gpt-52-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-01-15", + last_updated: "2026-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.19, output: 17.5, cache_read: 0.219 }, + limit: { context: 256000, output: 65536 }, + }, + "venice-uncensored-role-play": { + id: "venice-uncensored-role-play", + name: "Venice Role Play Uncensored", + family: "venice", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-20", + last_updated: "2026-03-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2 }, + limit: { context: 128000, output: 4096 }, + }, + "zai-org-glm-5": { + id: "zai-org-glm-5", + name: "GLM 5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 198000, output: 32000 }, + }, + "zai-org-glm-4.6": { + id: "zai-org-glm-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2024-04-01", + last_updated: "2026-04-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.85, output: 2.75, cache_read: 0.3 }, + limit: { context: 198000, output: 16384 }, + }, + "grok-4-3": { + id: "grok-4-3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-18", + last_updated: "2026-05-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.42, + output: 2.83, + cache_read: 0.23, + context_over_200k: { input: 2.83, output: 5.67, cache_read: 0.45 }, + }, + limit: { context: 1000000, output: 32000 }, + }, + "mistral-small-2603": { + id: "mistral-small-2603", + name: "Mistral Small 4", + family: "mistral-small", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-16", + last_updated: "2026-04-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1875, output: 0.75 }, + limit: { context: 256000, output: 65536 }, + }, + "openai-gpt-oss-120b": { + id: "openai-gpt-oss-120b", + name: "OpenAI GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-11-06", + last_updated: "2026-05-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + }, + "claude-opus-4-5": { + id: "claude-opus-4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-06", + last_updated: "2026-04-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 6, output: 30, cache_read: 0.6, cache_write: 7.5 }, + limit: { context: 198000, output: 32768 }, + }, + "qwen3-5-9b": { + id: "qwen3-5-9b", + name: "Qwen 3.5 9B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-05", + last_updated: "2026-04-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.15 }, + limit: { context: 256000, output: 32768 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.35, cache_read: 0.028 }, + limit: { context: 1000000, output: 32768 }, + }, + "openai-gpt-54-pro": { + id: "openai-gpt-54-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-05", + last_updated: "2026-03-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 37.5, output: 225, context_over_200k: { input: 75, output: 337.5 } }, + limit: { context: 1000000, output: 128000 }, + }, + "openai-gpt-54-mini": { + id: "openai-gpt-54-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.9375, output: 5.625, cache_read: 0.09375 }, + limit: { context: 400000, output: 128000 }, + }, + "minimax-m25": { + id: "minimax-m25", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-04-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.34, output: 1.19, cache_read: 0.04 }, + limit: { context: 198000, output: 32768 }, + }, + "zai-org-glm-5-1": { + id: "zai-org-glm-5-1", + name: "GLM 5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-07", + last_updated: "2026-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.75, output: 5.5, cache_read: 0.325 }, + limit: { context: 200000, output: 24000 }, + }, + "openai-gpt-55": { + id: "openai-gpt-55", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-23", + last_updated: "2026-04-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 6.25, + output: 37.5, + cache_read: 0.625, + context_over_200k: { input: 12.5, output: 56.25, cache_read: 1.25 }, + }, + limit: { context: 1000000, output: 131072 }, + }, + "qwen3-6-27b": { + id: "qwen3-6-27b", + name: "Qwen 3.6 27B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-29", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.325, output: 3.25 }, + limit: { context: 256000, output: 65536 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-03-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 6, output: 30, cache_read: 0.6, cache_write: 7.5 }, + limit: { context: 1000000, output: 128000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.73, output: 3.796, cache_read: 0.33 }, + limit: { context: 1000000, output: 32768 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-10", + release_date: "2025-12-04", + last_updated: "2026-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.33, output: 0.48, cache_read: 0.16 }, + limit: { context: 160000, output: 32768 }, + }, + "qwen-3-6-plus": { + id: "qwen-3-6-plus", + name: "Qwen 3.6 Plus Uncensored", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-06", + last_updated: "2026-04-12", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { + input: 0.625, + output: 3.75, + cache_read: 0.0625, + cache_write: 0.78, + context_over_200k: { input: 2.5, output: 7.5, cache_read: 0.0625, cache_write: 0.78 }, + }, + limit: { context: 1000000, output: 65536 }, + }, + "aion-labs-aion-2-0": { + id: "aion-labs-aion-2-0", + name: "Aion 2.0", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-24", + last_updated: "2026-04-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 2, cache_read: 0.25 }, + limit: { context: 128000, output: 32768 }, + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-15", + last_updated: "2026-04-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3.75, output: 18.75, cache_read: 0.375, cache_write: 4.69 }, + limit: { context: 198000, output: 64000 }, + }, + "openai-gpt-4o-2024-11-20": { + id: "openai-gpt-4o-2024-11-20", + name: "GPT-4o", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-28", + last_updated: "2026-03-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3.125, output: 12.5 }, + limit: { context: 128000, output: 16384 }, + }, + "llama-3.3-70b": { + id: "llama-3.3-70b", + name: "Llama 3.3 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-04-06", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.8 }, + limit: { context: 128000, output: 4096 }, + }, + "kimi-k2-5": { + id: "kimi-k2-5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-01-27", + last_updated: "2026-04-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.56, output: 3.5, cache_read: 0.22 }, + limit: { context: 256000, output: 65536 }, + }, + "llama-3.2-3b": { + id: "llama-3.2-3b", + name: "Llama 3.2 3B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-10-03", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4096 }, + }, + "arcee-trinity-large-thinking": { + id: "arcee-trinity-large-thinking", + name: "Trinity Large Thinking", + family: "trinity", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3125, output: 1.125, cache_read: 0.075 }, + limit: { context: 256000, output: 65536 }, + }, + "hermes-3-llama-3.1-405b": { + id: "hermes-3-llama-3.1-405b", + name: "Hermes 3 Llama 3.1 405b", + family: "hermes", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-04", + release_date: "2025-09-25", + last_updated: "2026-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.1, output: 3 }, + limit: { context: 128000, output: 16384 }, + }, + "gemini-3-1-pro-preview": { + id: "gemini-3-1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-19", + last_updated: "2026-03-12", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { + input: 2.5, + output: 15, + cache_read: 0.5, + cache_write: 0.5, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1000000, output: 32768 }, + }, + "kimi-k2-6": { + id: "kimi-k2-6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.85, output: 4.655, cache_read: 0.22 }, + limit: { context: 256000, output: 65536 }, + }, + "claude-opus-4-6-fast": { + id: "claude-opus-4-6-fast", + name: "Claude Opus 4.6 Fast", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 36, output: 180, cache_read: 3.6, cache_write: 45 }, + limit: { context: 1000000, output: 128000 }, + }, + "z-ai-glm-5-turbo": { + id: "z-ai-glm-5-turbo", + name: "GLM 5 Turbo", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-04-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.2, output: 4, cache_read: 0.24 }, + limit: { context: 200000, output: 32768 }, + }, + "google-gemma-4-31b-it": { + id: "google-gemma-4-31b-it", + name: "Google Gemma 4 31B Instruct", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-03", + last_updated: "2026-04-12", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.175, output: 0.5 }, + limit: { context: 256000, output: 8192 }, + }, + }, + }, + aihubmix: { + id: "aihubmix", + env: ["AIHUBMIX_API_KEY"], + npm: "@aihubmix/ai-sdk-provider", + name: "AIHubMix", + doc: "https://docs.aihubmix.com", + models: { + "minimax-m2.7": { + id: "minimax-m2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2958, output: 1.1832, cache_read: 0.05916 }, + limit: { context: 200000, output: 128000 }, + }, + "coding-glm-5.1-free": { + id: "coding-glm-5.1-free", + name: "Coding GLM 5.1 (free)", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-11", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 204800, output: 128000 }, + }, + "gemini-3.1-pro-preview-customtools": { + id: "gemini-3.1-pro-preview-customtools", + name: "Gemini 3.1 Pro Preview Custom Tools", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi-k2.5", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.105 }, + limit: { context: 256000, output: 0 }, + }, + "glm-5v-turbo": { + id: "glm-5v-turbo", + name: "GLM 5 Vision Turbo", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-05-09", + last_updated: "2026-05-09", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.7042, output: 3.09848, cache_read: 0.169008 }, + limit: { context: 200000, output: 128000 }, + }, + "grok-4.3": { + id: "grok-4.3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-05-01", + last_updated: "2026-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 2.5, + cache_read: 0.2, + context_over_200k: { input: 2.5, output: 5, cache_read: 0.4 }, + }, + limit: { context: 1000000, output: 1000000 }, + }, + "coding-minimax-m2.7-highspeed": { + id: "coding-minimax-m2.7-highspeed", + name: "Coding MiniMax M2.7 Highspeed", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 204800, output: 13100 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2 }, + limit: { context: 1048576, output: 65536 }, + }, + "coding-glm-5.1": { + id: "coding-glm-5.1", + name: "Coding-GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-11", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.22 }, + limit: { context: 200000, output: 128000 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.05 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5 }, + limit: { context: 1050000, output: 128000 }, + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "deepseek-v4-flash-think": { + id: "deepseek-v4-flash-think", + name: "DeepSeek V4 Flash Think", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.154, output: 0.308, cache_read: 0.0308 }, + limit: { context: 1000000, output: 384000 }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-05-09", + last_updated: "2026-05-09", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.282, output: 1.692, cache_read: 0.0282, cache_write: 0.3525 }, + limit: { context: 991000, output: 64000 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4-Mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: false, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, output: 128000 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.845, output: 3.38, cache_read: 0.183112 }, + limit: { context: 200000, output: 128000 }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.275 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + knowledge: "2025-08-31", + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.499, cache_read: 0.03 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1 Codex mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-3.1-flash-lite": { + id: "gemini-3.1-flash-lite", + name: "Gemini 3.1 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5, cache_read: 0.25 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-15", + last_updated: "2025-11-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-6-think": { + id: "claude-opus-4-6-think", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 32000 }, + }, + "coding-minimax-m2.7-free": { + id: "coding-minimax-m2.7-free", + name: "Coding-MiniMax-M2.7-Free", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 13100 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.154, output: 0.308, cache_read: 0.0308 }, + limit: { context: 1000000, output: 384000 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0.95, output: 3.9995, cache_read: 0.160835 }, + limit: { context: 262144, output: 262144 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.478, output: 0.956, cache_read: 0.004302 }, + limit: { context: 1000000, output: 384000 }, + }, + "claude-opus-4-7-think": { + id: "claude-opus-4-7-think", + name: "Claude Opus 4.7 Thinking", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 32000 }, + }, + "coding-minimax-m2.7": { + id: "coding-minimax-m2.7", + name: "Coding MiniMax M2.7", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 204800, output: 13100 }, + }, + "qwen3.6-max-preview": { + id: "qwen3.6-max-preview", + name: "Qwen3.6 Max Preview", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-05-09", + last_updated: "2026-05-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.268, output: 7.608, cache_read: 0.1268, cache_write: 1.585 }, + limit: { context: 240000, output: 64000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "GPT-4.1 mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-sonnet-4-6-think": { + id: "claude-sonnet-4-6-think", + name: "Claude Sonnet 4.6 Think", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 200000, output: 64000 }, + }, + "qwen3.6-flash": { + id: "qwen3.6-flash", + name: "Qwen3.6 Flash", + family: "qwen", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.169, output: 1.014, cache_read: 0.0169, cache_write: 0.21125 }, + limit: { context: 991000, output: 64000 }, + }, + }, + }, + cerebras: { + id: "cerebras", + env: ["CEREBRAS_API_KEY"], + npm: "@ai-sdk/cerebras", + name: "Cerebras", + doc: "https://inference-docs.cerebras.ai/models/overview", + models: { + "llama3.1-8b": { + id: "llama3.1-8b", + name: "Llama 3.1 8B", + 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, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 32000, output: 8000 }, + }, + "qwen-3-235b-a22b-instruct-2507": { + id: "qwen-3-235b-a22b-instruct-2507", + name: "Qwen 3 235B Instruct", + 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, + cost: { input: 0.6, output: 1.2 }, + limit: { context: 131000, output: 32000 }, + }, + "zai-glm-4.7": { + id: "zai-glm-4.7", + name: "Z.AI GLM-4.7", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-01-10", + last_updated: "2026-01-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.25, output: 2.75, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 40000 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.69 }, + limit: { context: 131072, output: 32768 }, + }, + }, + }, + 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: { + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 32768 }, + }, + "qwen/qwen3-coder-30b": { + id: "qwen/qwen3-coder-30b", + name: "Qwen3 Coder 30B", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwen3-30b-a3b-2507": { + id: "qwen/qwen3-30b-a3b-2507", + name: "Qwen3 30B A3B 2507", + family: "qwen", + attachment: false, + reasoning: false, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 16384 }, + }, + }, + }, + lucidquery: { + id: "lucidquery", + env: ["LUCIDQUERY_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://lucidquery.com/api/v1", + name: "LucidQuery AI", + doc: "https://lucidquery.com/api/docs", + models: { + "lucidnova-rf1-100b": { + id: "lucidnova-rf1-100b", + name: "LucidNova RF1 100B", + family: "nova", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 5 }, + limit: { context: 120000, output: 8000 }, + }, + "lucidquery-nexus-coder": { + id: "lucidquery-nexus-coder", + name: "LucidQuery Nexus Coder", + family: "lucid", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 5 }, + limit: { context: 250000, output: 60000 }, + }, + }, + }, + "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-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2-0711-preview": { + id: "kimi-k2-0711-preview", + name: "Kimi K2 0711", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-14", + last_updated: "2025-07-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 131072, output: 16384 }, + }, + "kimi-k2-turbo-preview": { + id: "kimi-k2-turbo-preview", + name: "Kimi K2 Turbo", + family: "kimi", + 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, + cost: { input: 2.4, output: 10, cache_read: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2-thinking-turbo": { + id: "kimi-k2-thinking-turbo", + name: "Kimi K2 Thinking Turbo", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.15, output: 8, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi-k2.5", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2-0905-preview": { + id: "kimi-k2-0905-preview", + name: "Kimi K2 0905", + family: "kimi", + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + "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: { + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-02-31", + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "claude-opus-4-1": { + id: "claude-opus-4-1", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "claude-opus-4-5": { + id: "claude-opus-4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-22", + last_updated: "2026-04-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4 }, + limit: { context: 262144, output: 262144 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", + shape: "completions", + }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 200000, output: 128000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "mai-ds-r1": { + id: "mai-ds-r1", + name: "MAI-DS-R1", + family: "mai", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 128000, output: 8192 }, + }, + "llama-4-maverick-17b-128e-instruct-fp8": { + id: "llama-4-maverick-17b-128e-instruct-fp8", + name: "Llama 4 Maverick 17B 128E Instruct FP8", + 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, + cost: { input: 0.25, output: 1 }, + limit: { context: 128000, output: 8192 }, + }, + "codestral-2501": { + id: "codestral-2501", + name: "Codestral 25.01", + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 256000 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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", "audio"], output: ["text", "image", "audio"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-08", + release_date: "2025-11-06", + last_updated: "2025-12-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek-r1-0528": { + id: "deepseek-r1-0528", + name: "DeepSeek-R1-0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 163840, output: 163840 }, + }, + "gpt-3.5-turbo-instruct": { + id: "gpt-3.5-turbo-instruct", + name: "GPT-3.5 Turbo Instruct", + 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, + cost: { input: 1.5, output: 2 }, + limit: { context: 4096, output: 4096 }, + }, + "mistral-medium-2505": { + id: "mistral-medium-2505", + name: "Mistral Medium 3", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 128000, output: 128000 }, + }, + "phi-4-reasoning-plus": { + id: "phi-4-reasoning-plus", + name: "Phi-4-reasoning-plus", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 32000, output: 4096 }, + }, + "cohere-embed-v3-english": { + id: "cohere-embed-v3-english", + name: "Embed v3 English", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 512, output: 1024 }, + }, + "gpt-4-32k": { + id: "gpt-4-32k", + name: "GPT-4 32K", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-11", + release_date: "2023-03-14", + last_updated: "2023-03-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 60, output: 120 }, + limit: { context: 32768, output: 32768 }, + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 272000, output: 128000 }, + }, + "phi-4": { + id: "phi-4", + name: "Phi-4", + 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, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-3.5-turbo-0613": { + id: "gpt-3.5-turbo-0613", + name: "GPT-3.5 Turbo 0613", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2021-08", + release_date: "2023-06-13", + last_updated: "2023-06-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 4 }, + limit: { context: 16384, output: 16384 }, + }, + "phi-3-medium-128k-instruct": { + id: "phi-3-medium-128k-instruct", + name: "Phi-3-medium-instruct (128k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.58, output: 1.68 }, + limit: { context: 128000, output: 128000 }, + }, + "phi-3-small-128k-instruct": { + id: "phi-3-small-128k-instruct", + name: "Phi-3-small-instruct (128k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-3.5-turbo-0301": { + id: "gpt-3.5-turbo-0301", + name: "GPT-3.5 Turbo 0301", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2021-08", + release_date: "2023-03-01", + last_updated: "2023-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 2 }, + limit: { context: 4096, output: 4096 }, + }, + "phi-4-mini": { + id: "phi-4-mini", + name: "Phi-4-mini", + 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, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "GPT-5-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, output: 128000 }, + }, + "meta-llama-3-8b-instruct": { + id: "meta-llama-3-8b-instruct", + name: "Meta-Llama-3-8B-Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.61 }, + limit: { context: 8192, output: 2048 }, + }, + "gpt-4": { + id: "gpt-4", + name: "GPT-4", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-11", + release_date: "2023-03-14", + last_updated: "2023-03-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 60, output: 120 }, + limit: { context: 8192, output: 8192 }, + }, + "phi-4-mini-reasoning": { + id: "phi-4-mini-reasoning", + name: "Phi-4-mini-reasoning", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 128000, output: 4096 }, + }, + "meta-llama-3.1-70b-instruct": { + id: "meta-llama-3.1-70b-instruct", + name: "Meta-Llama-3.1-70B-Instruct", + 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, + cost: { input: 2.68, output: 3.54 }, + limit: { context: 128000, output: 32768 }, + }, + "phi-3-mini-4k-instruct": { + id: "phi-3-mini-4k-instruct", + name: "Phi-3-mini-instruct (4k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 4096, output: 1024 }, + }, + "deepseek-v3.1": { + id: "deepseek-v3.1", + name: "DeepSeek-V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.56, output: 1.68 }, + limit: { context: 131072, output: 131072 }, + }, + "text-embedding-3-small": { + id: "text-embedding-3-small", + name: "text-embedding-3-small", + 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, + cost: { input: 0.02, output: 0 }, + limit: { context: 8191, output: 1536 }, + }, + "gpt-3.5-turbo-1106": { + id: "gpt-3.5-turbo-1106", + name: "GPT-3.5 Turbo 1106", + 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, + cost: { input: 1, output: 2 }, + limit: { context: 16384, output: 16384 }, + }, + "model-router": { + id: "model-router", + name: "Model Router", + 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, + cost: { input: 0.14, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "mistral-small-2503": { + id: "mistral-small-2503", + name: "Mistral Small 3.1", + 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, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 32768 }, + }, + o1: { + id: "o1", + name: "o1", + family: "o", + attachment: false, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "grok-4-fast-reasoning": { + id: "grok-4-fast-reasoning", + name: "Grok 4 Fast (Reasoning)", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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", "audio"], output: ["text", "image", "audio"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 272000, output: 128000 }, + }, + "cohere-embed-v3-multilingual": { + id: "cohere-embed-v3-multilingual", + name: "Embed v3 Multilingual", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 512, output: 1024 }, + }, + "o1-preview": { + id: "o1-preview", + name: "o1-preview", + family: "o", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2023-09", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 16.5, output: 66, cache_read: 8.25 }, + limit: { context: 128000, output: 32768 }, + }, + "gpt-3.5-turbo-0125": { + id: "gpt-3.5-turbo-0125", + name: "GPT-3.5 Turbo 0125", + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 16384, output: 16384 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1 Codex Mini", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 128000 }, + }, + "cohere-embed-v-4-0": { + id: "cohere-embed-v-4-0", + name: "Embed v4", + 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, + cost: { input: 0.12, output: 0 }, + limit: { context: 128000, output: 1536 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-4-turbo-vision": { + id: "gpt-4-turbo-vision", + name: "GPT-4 Turbo Vision", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5.1-chat": { + id: "gpt-5.1-chat", + name: "GPT-5.1 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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", "audio"], output: ["text", "image", "audio"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "meta-llama-3.1-405b-instruct": { + id: "meta-llama-3.1-405b-instruct", + name: "Meta-Llama-3.1-405B-Instruct", + 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, + cost: { input: 5.33, output: 16 }, + limit: { context: 128000, output: 32768 }, + }, + "llama-3.2-11b-vision-instruct": { + id: "llama-3.2-11b-vision-instruct", + name: "Llama-3.2-11B-Vision-Instruct", + 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, + cost: { input: 0.37, output: 0.37 }, + limit: { context: 128000, output: 8192 }, + }, + "cohere-command-a": { + id: "cohere-command-a", + name: "Command A", + family: "command-a", + attachment: false, + reasoning: true, + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, output: 8000 }, + }, + "mistral-large-2411": { + id: "mistral-large-2411", + name: "Mistral Large 24.11", + family: "mistral-large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 32768 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "deepseek-v3.2-speciale": { + id: "deepseek-v3.2-speciale", + name: "DeepSeek-V3.2-Speciale", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.58, output: 1.68 }, + limit: { context: 128000, output: 128000 }, + }, + "deepseek-r1": { + id: "deepseek-r1", + name: "DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 163840, output: 163840 }, + }, + "llama-3.2-90b-vision-instruct": { + id: "llama-3.2-90b-vision-instruct", + name: "Llama-3.2-90B-Vision-Instruct", + 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, + cost: { input: 2.04, output: 2.04 }, + limit: { context: 128000, output: 8192 }, + }, + "text-embedding-ada-002": { + id: "text-embedding-ada-002", + name: "text-embedding-ada-002", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "phi-3-small-8k-instruct": { + id: "phi-3-small-8k-instruct", + name: "Phi-3-small-instruct (8k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 8192, output: 2048 }, + }, + "meta-llama-3-70b-instruct": { + id: "meta-llama-3-70b-instruct", + name: "Meta-Llama-3-70B-Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.68, output: 3.54 }, + limit: { context: 8192, output: 2048 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.01 }, + limit: { context: 272000, output: 128000 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.03 }, + limit: { context: 272000, output: 128000 }, + }, + "phi-4-reasoning": { + id: "phi-4-reasoning", + name: "Phi-4-reasoning", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 32000, output: 4096 }, + }, + "phi-3-mini-128k-instruct": { + id: "phi-3-mini-128k-instruct", + name: "Phi-3-mini-instruct (128k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 128000, output: 4096 }, + }, + "text-embedding-3-large": { + id: "text-embedding-3-large", + name: "text-embedding-3-large", + 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, + cost: { input: 0.13, output: 0 }, + limit: { context: 8191, output: 3072 }, + }, + "o1-mini": { + id: "o1-mini", + name: "o1-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2023-09", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 128000, output: 65536 }, + }, + "phi-3.5-moe-instruct": { + id: "phi-3.5-moe-instruct", + name: "Phi-3.5-MoE-instruct", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.16, output: 0.64 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5-chat": { + id: "gpt-5-chat", + name: "GPT-5 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2024-10-24", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 128000, output: 16384 }, + }, + "deepseek-v3-0324": { + id: "deepseek-v3-0324", + name: "DeepSeek-V3-0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.14, output: 4.56 }, + limit: { context: 131072, output: 131072 }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama-3.3-70B-Instruct", + 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, + cost: { input: 0.71, output: 0.71 }, + limit: { context: 128000, output: 32768 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-02-06", + last_updated: "2026-02-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 262144, output: 262144 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", + shape: "completions", + }, + }, + "meta-llama-3.1-8b-instruct": { + id: "meta-llama-3.1-8b-instruct", + name: "Meta-Llama-3.1-8B-Instruct", + 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, + cost: { input: 0.3, output: 0.61 }, + limit: { context: 128000, output: 32768 }, + }, + "ministral-3b": { + id: "ministral-3b", + name: "Ministral 3B", + 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, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 128000, output: 8192 }, + }, + "phi-3-medium-4k-instruct": { + id: "phi-3-medium-4k-instruct", + name: "Phi-3-medium-instruct (4k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 4096, output: 1024 }, + }, + "llama-4-scout-17b-16e-instruct": { + id: "llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17B 16E Instruct", + 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, + cost: { input: 0.2, output: 0.78 }, + limit: { context: 128000, output: 8192 }, + }, + "phi-3.5-mini-instruct": { + id: "phi-3.5-mini-instruct", + name: "Phi-3.5-mini-instruct", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 128000, output: 4096 }, + }, + "phi-4-multimodal": { + id: "phi-4-multimodal", + name: "Phi-4-multimodal", + 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, + cost: { input: 0.08, output: 0.32, input_audio: 4 }, + limit: { context: 128000, output: 4096 }, + }, + "codex-mini": { + id: "codex-mini", + name: "Codex Mini", + family: "gpt-codex-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-04", + release_date: "2025-05-16", + last_updated: "2025-05-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 6, cache_read: 0.375 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.2-chat": { + id: "gpt-5.2-chat", + name: "GPT-5.2 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "mistral-nemo": { + id: "mistral-nemo", + name: "Mistral Nemo", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 128000 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "GPT-5.4 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.4-pro": { + id: "gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "Grok 4 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-3": { + id: "grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "GPT-4.1 mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "cohere-command-r-plus-08-2024": { + id: "cohere-command-r-plus-08-2024", + name: "Command R+", + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 4000 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "GPT-4o", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "GPT-5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 400000, output: 272000 }, + }, + o3: { + id: "o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "grok-3-mini": { + id: "grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, reasoning: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 8192 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "GPT-4.1 nano", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.03 }, + limit: { context: 1047576, output: 32768 }, + }, + "grok-4": { + id: "grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, reasoning: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 64000 }, + }, + "o3-mini": { + id: "o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "cohere-command-r-08-2024": { + id: "cohere-command-r-08-2024", + name: "Command R", + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4000 }, + }, + "gpt-4o-mini": { + id: "gpt-4o-mini", + name: "GPT-4o mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-4-turbo": { + id: "gpt-4-turbo", + name: "GPT-4 Turbo", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + }, + }, + "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": { + id: "abliterated-model", + name: "Abliterated Model", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-01-06", + last_updated: "2026-01-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 3, output: 3 }, + limit: { context: 150000, input: 150000, output: 8192 }, + }, + }, + }, + "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: { + "Qwen3.5-397B-A17B": { + id: "Qwen3.5-397B-A17B", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "GLM-5.1": { + id: "GLM-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 202752, output: 131072 }, + }, + "MiniMax-M2.7": { + id: "MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "DeepSeek-V4-Pro": { + id: "DeepSeek-V4-Pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 384000 }, + }, + }, + }, + cohere: { + id: "cohere", + env: ["COHERE_API_KEY"], + npm: "@ai-sdk/cohere", + name: "Cohere", + doc: "https://docs.cohere.com/docs/models", + models: { + "command-a-reasoning-08-2025": { + id: "command-a-reasoning-08-2025", + name: "Command A Reasoning", + family: "command-a", + attachment: false, + reasoning: true, + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, output: 32000 }, + }, + "command-r7b-12-2024": { + id: "command-r7b-12-2024", + name: "Command R7B", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-06-01", + release_date: "2024-02-27", + last_updated: "2024-02-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.0375, output: 0.15 }, + limit: { context: 128000, output: 4000 }, + }, + "c4ai-aya-vision-8b": { + id: "c4ai-aya-vision-8b", + name: "Aya Vision 8B", + attachment: true, + reasoning: false, + tool_call: 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 }, + }, + "command-r-plus-08-2024": { + id: "command-r-plus-08-2024", + name: "Command R+", + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 4000 }, + }, + "c4ai-aya-expanse-8b": { + id: "c4ai-aya-expanse-8b", + name: "Aya Expanse 8B", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-10-24", + last_updated: "2024-10-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 8000, output: 4000 }, + }, + "command-r7b-arabic-02-2025": { + id: "command-r7b-arabic-02-2025", + name: "Command R7B Arabic", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: 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, + cost: { input: 0.0375, output: 0.15 }, + limit: { context: 128000, output: 4000 }, + }, + "command-a-vision-07-2025": { + id: "command-a-vision-07-2025", + name: "Command A Vision", + family: "command-a", + attachment: false, + reasoning: false, + tool_call: false, + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 8000 }, + }, + "c4ai-aya-vision-32b": { + id: "c4ai-aya-vision-32b", + name: "Aya Vision 32B", + attachment: true, + reasoning: false, + tool_call: 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 }, + }, + "command-a-translate-08-2025": { + id: "command-a-translate-08-2025", + name: "Command A Translate", + family: "command-a", + attachment: false, + reasoning: false, + tool_call: 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 8000, output: 8000 }, + }, + "command-r-08-2024": { + id: "command-r-08-2024", + name: "Command R", + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4000 }, + }, + "c4ai-aya-expanse-32b": { + id: "c4ai-aya-expanse-32b", + name: "Aya Expanse 32B", + attachment: false, + reasoning: false, + tool_call: 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 }, + }, + "command-a-03-2025": { + id: "command-a-03-2025", + name: "Command A", + family: "command-a", + attachment: false, + reasoning: false, + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, output: 8000 }, + }, + }, + }, + "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: { + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama 3.3 70B Instruct", + 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, + cost: { input: 2.92, output: 2.92 }, + limit: { context: 70000, output: 70000 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "OpenAI GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 2.92, output: 2.92 }, + limit: { context: 131000, output: 131000 }, + }, + "speakleash/Bielik-11B-v3.0-Instruct": { + id: "speakleash/Bielik-11B-v3.0-Instruct", + name: "Bielik 11B v3.0 Instruct", + 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, + cost: { input: 0.67, output: 0.67 }, + limit: { context: 32000, output: 32000 }, + }, + "speakleash/Bielik-11B-v2.6-Instruct": { + id: "speakleash/Bielik-11B-v2.6-Instruct", + name: "Bielik 11B v2.6 Instruct", + 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, + cost: { input: 0.67, output: 0.67 }, + limit: { context: 32000, output: 32000 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-03-05", + last_updated: "2026-03-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 196000, input: 180000, output: 16000 }, + }, + }, + }, + "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", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + xai: { + id: "xai", + env: ["XAI_API_KEY"], + npm: "@ai-sdk/xai", + name: "xAI", + doc: "https://docs.x.ai/docs/models", + models: { + "grok-2-1212": { + id: "grok-2-1212", + name: "Grok 2 (1212)", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-12-12", + last_updated: "2024-12-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-vision-beta": { + id: "grok-vision-beta", + name: "Grok Vision Beta", + family: "grok-vision", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 15, cache_read: 5 }, + limit: { context: 8192, output: 4096 }, + }, + "grok-4.3": { + id: "grok-4.3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-05-01", + last_updated: "2026-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 2.5, + cache_read: 0.2, + context_over_200k: { input: 2.5, output: 5, cache_read: 0.4 }, + }, + limit: { context: 1000000, output: 30000 }, + }, + "grok-3-mini-fast": { + id: "grok-3-mini-fast", + name: "Grok 3 Mini Fast", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 4, reasoning: 4, cache_read: 0.15 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-3-mini-latest": { + id: "grok-3-mini-latest", + name: "Grok 3 Mini Latest", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, reasoning: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-3-fast": { + id: "grok-3-fast", + name: "Grok 3 Fast", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 1.25 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-2-vision-latest": { + id: "grok-2-vision-latest", + name: "Grok 2 Vision Latest", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-20", + last_updated: "2024-12-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 8192, output: 4096 }, + }, + "grok-4.20-0309-reasoning": { + id: "grok-4.20-0309-reasoning", + name: "Grok 4.20 (Reasoning)", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-09", + last_updated: "2026-03-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12, cache_read: 0.4 } }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "Grok 4.1 Fast (Non-Reasoning)", + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-3-mini-fast-latest": { + id: "grok-3-mini-fast-latest", + name: "Grok 3 Mini Fast Latest", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 4, reasoning: 4, cache_read: 0.15 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-4-fast": { + id: "grok-4-fast", + name: "Grok 4 Fast", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-3-latest": { + id: "grok-3-latest", + name: "Grok 3 Latest", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-2": { + id: "grok-2", + name: "Grok 2", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "grok-4.20-0309-non-reasoning": { + id: "grok-4.20-0309-non-reasoning", + name: "Grok 4.20 (Non-Reasoning)", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12, cache_read: 0.4 } }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-3-fast-latest": { + id: "grok-3-fast-latest", + name: "Grok 3 Fast Latest", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 1.25 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-4.20-multi-agent-0309": { + id: "grok-4.20-multi-agent-0309", + name: "Grok 4.20 Multi-Agent", + family: "grok", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-09", + last_updated: "2026-03-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12, cache_read: 0.4 } }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-4": { + id: "grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, reasoning: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 64000 }, + }, + "grok-2-latest": { + id: "grok-2-latest", + name: "Grok 2 Latest", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-20", + last_updated: "2024-12-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-beta": { + id: "grok-beta", + name: "Grok Beta", + family: "grok-beta", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 15, cache_read: 5 }, + limit: { context: 131072, output: 4096 }, + }, + "grok-2-vision": { + id: "grok-2-vision", + name: "Grok 2 Vision", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 8192, output: 4096 }, + }, + "grok-4-1-fast": { + id: "grok-4-1-fast", + name: "Grok 4.1 Fast", + family: "grok", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "grok-3-mini": { + id: "grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, reasoning: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-2-vision-1212": { + id: "grok-2-vision-1212", + name: "Grok 2 Vision (1212)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-20", + last_updated: "2024-12-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 8192, output: 4096 }, + }, + "grok-3": { + id: "grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "Grok 4 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + }, + }, + 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: { + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-23", + last_updated: "2025-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3.5-Plus": { + id: "Qwen/Qwen3.5-Plus", + name: "Qwen3.5 Plus", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02", + last_updated: "2026-02", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2.4, reasoning: 2.4 }, + limit: { context: 1000000, output: 65536 }, + }, + "Qwen/Qwen2.5-VL-32B-Instruct": { + id: "Qwen/Qwen2.5-VL-32B-Instruct", + name: "Qwen2.5 VL 32B Instruct", + 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, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 16384, output: 16384 }, + }, + "zai-org/GLM-4.7": { + id: "zai-org/GLM-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 202752, output: 131072 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.8, output: 2.56 }, + limit: { context: 202752, output: 131072 }, + }, + "zai-org/GLM-4.6": { + id: "zai-org/GLM-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.45, output: 1.9 }, + limit: { context: 202752, output: 131072 }, + }, + "mistralai/Mistral-Small-3.2-24B-Instruct-2506": { + id: "mistralai/Mistral-Small-3.2-24B-Instruct-2506", + name: "Mistral Small 3.2 24B Instruct", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "mistralai/Mistral-Nemo-Instruct-2407": { + id: "mistralai/Mistral-Nemo-Instruct-2407", + name: "Mistral Nemo Instruct 2407", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0.04 }, + limit: { context: 131072, output: 65536 }, + }, + "XiaomiMiMo/MiMo-V2-Flash": { + id: "XiaomiMiMo/MiMo-V2-Flash", + name: "MiMo V2 Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12-01", + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 262144, output: 32000 }, + }, + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama 3.3 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-12-06", + last_updated: "2024-12-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 131072, output: 16384 }, + }, + "deepseek-ai/DeepSeek-V3.1": { + id: "deepseek-ai/DeepSeek-V3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-25", + last_updated: "2025-08-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-V3-0324": { + id: "deepseek-ai/DeepSeek-V3-0324", + name: "DeepSeek V3 0324", + 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, + cost: { input: 0.25, output: 0.88 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek-ai/DeepSeek-V3.2-Exp": { + id: "deepseek-ai/DeepSeek-V3.2-Exp", + name: "DeepSeek V3.2 Exp", + 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, + cost: { input: 0.27, output: 0.4 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-R1-0528": { + id: "deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek R1 0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.15 }, + limit: { context: 163840, output: 64000 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: false, + 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: true, + cost: { input: 0.26, output: 0.38 }, + limit: { context: 164000, output: 164000 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.6 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.45, output: 2.8 }, + limit: { context: 262144, output: 262144 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMaxAI/MiniMax-M2.1": { + id: "MiniMaxAI/MiniMax-M2.1", + name: "MiniMax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.28, output: 1.2 }, + limit: { context: 196608, output: 131072 }, + }, + }, + }, + "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-haiku-4-5@20251001": { + id: "claude-haiku-4-5@20251001", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-sonnet-4-6@default": { + id: "claude-sonnet-4-6@default", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 200000, output: 64000 }, + }, + "claude-3-5-haiku@20241022": { + id: "claude-3-5-haiku@20241022", + name: "Claude Haiku 3.5", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-3-5-sonnet@20241022": { + id: "claude-3-5-sonnet@20241022", + name: "Claude Sonnet 3.5 v2", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-opus-4-1@20250805": { + id: "claude-opus-4-1@20250805", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "claude-sonnet-4@20250514": { + id: "claude-sonnet-4@20250514", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-3-7-sonnet@20250219": { + id: "claude-3-7-sonnet@20250219", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4@20250514": { + id: "claude-opus-4@20250514", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "claude-opus-4-5@20251101": { + id: "claude-opus-4-5@20251101", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-sonnet-4-5@20250929": { + id: "claude-sonnet-4-5@20250929", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-6@default": { + id: "claude-opus-4-6@default", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "claude-opus-4-7@default": { + id: "claude-opus-4-7@default", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + }, + }, + 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: { + "Qwen/Qwen3-VL-30B-A3B-Instruct": { + id: "Qwen/Qwen3-VL-30B-A3B-Instruct", + name: "Qwen3 VL 30B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-07-30", + last_updated: "2025-07-30", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.24, output: 0.94 }, + limit: { context: 100000, output: 100000 }, + }, + "Qwen/Qwen3-Embedding-8B": { + id: "Qwen/Qwen3-Embedding-8B", + name: "Qwen3 Embedding 8B", + family: "text-embedding", + 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, + cost: { input: 0.12, output: 0.12 }, + limit: { context: 40960, output: 40960 }, + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507-FP8": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507-FP8", + name: "Qwen3 30B 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-07-30", + last_updated: "2025-07-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 1.42 }, + limit: { context: 64000, output: 64000 }, + }, + "mistralai/devstral-small-2-24b-instruct-2512": { + id: "mistralai/devstral-small-2-24b-instruct-2512", + name: "Devstral Small 2 24B Instruct 2512", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.47 }, + limit: { context: 32768, output: 32768 }, + }, + "mistralai/Voxtral-Small-24B-2507": { + id: "mistralai/Voxtral-Small-24B-2507", + name: "Voxtral Small 24B", + family: "voxtral", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2025-03-01", + last_updated: "2025-03-01", + modalities: { input: ["audio", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.00236, output: 0.00236, output_audio: 2.36 }, + limit: { context: 32000, output: 32000 }, + }, + "mistralai/Magistral-Small-2509": { + id: "mistralai/Magistral-Small-2509", + name: "Magistral Small 1.2 24B", + family: "magistral-small", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2025-06-01", + last_updated: "2025-06-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.59, output: 2.36 }, + limit: { context: 131072, output: 131072 }, + }, + "microsoft/Phi-4-multimodal-instruct": { + id: "microsoft/Phi-4-multimodal-instruct", + name: "Phi-4 15B", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.24, output: 0.47 }, + limit: { context: 32000, output: 32000 }, + }, + "KBLab/kb-whisper-large": { + id: "KBLab/kb-whisper-large", + name: "KB Whisper", + family: "whisper", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.00236, output: 0.00236, output_audio: 2.36 }, + limit: { context: 448, output: 448 }, + }, + "nvidia/Llama-3.3-70B-Instruct-FP8": { + id: "nvidia/Llama-3.3-70B-Instruct-FP8", + name: "Llama 3.3 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.18, output: 1.18 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/whisper-large-v3": { + id: "openai/whisper-large-v3", + name: "Whisper 3 Large", + family: "whisper", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.00236, output: 0.00236, output_audio: 2.36 }, + limit: { context: 448, output: 4096 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.24, output: 0.94 }, + limit: { context: 65536, output: 65536 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 1.47, output: 5.9 }, + limit: { context: 262144, output: 262144 }, + }, + "intfloat/multilingual-e5-large-instruct": { + id: "intfloat/multilingual-e5-large-instruct", + name: "E5 Multi-Lingual Large Embeddings 0.6B", + 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, + cost: { input: 0.12, output: 0.12 }, + limit: { context: 512, output: 512 }, + }, + }, + }, + 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:meta-llama/Llama-3.1-405B-Instruct": { + id: "hf:meta-llama/Llama-3.1-405B-Instruct", + name: "Llama-3.1-405B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 3 }, + limit: { context: 128000, output: 32768 }, + }, + "hf:meta-llama/Llama-4-Scout-17B-16E-Instruct": { + id: "hf:meta-llama/Llama-4-Scout-17B-16E-Instruct", + name: "Llama-4-Scout-17B-16E-Instruct", + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 328000, output: 4096 }, + }, + "hf:meta-llama/Llama-3.3-70B-Instruct": { + id: "hf:meta-llama/Llama-3.3-70B-Instruct", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.9, output: 0.9 }, + limit: { context: 128000, output: 32768 }, + }, + "hf:meta-llama/Llama-3.1-8B-Instruct": { + id: "hf:meta-llama/Llama-3.1-8B-Instruct", + name: "Llama-3.1-8B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 128000, output: 32768 }, + }, + "hf:meta-llama/Llama-3.1-70B-Instruct": { + id: "hf:meta-llama/Llama-3.1-70B-Instruct", + name: "Llama-3.1-70B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.9, output: 0.9 }, + limit: { context: 128000, output: 32768 }, + }, + "hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": { + id: "hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8", + name: "Llama-4-Maverick-17B-128E-Instruct-FP8", + 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, + cost: { input: 0.22, output: 0.88 }, + limit: { context: 524000, output: 4096 }, + }, + "hf:MiniMaxAI/MiniMax-M2": { + id: "hf:MiniMaxAI/MiniMax-M2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 196608, output: 131000 }, + }, + "hf:MiniMaxAI/MiniMax-M2.5": { + id: "hf:MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-07", + last_updated: "2026-02-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.6 }, + limit: { context: 191488, output: 65536 }, + }, + "hf:MiniMaxAI/MiniMax-M2.1": { + id: "hf:MiniMaxAI/MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 204800, output: 131072 }, + }, + "hf:Qwen/Qwen3.5-397B-A17B": { + id: "hf:Qwen/Qwen3.5-397B-A17B", + name: "Qwen3.5-97B-A17B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.6 }, + limit: { context: 262144, output: 65536 }, + status: "beta", + }, + "hf:Qwen/Qwen2.5-Coder-32B-Instruct": { + id: "hf:Qwen/Qwen2.5-Coder-32B-Instruct", + name: "Qwen2.5-Coder-32B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-11-11", + last_updated: "2024-11-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 0.8 }, + limit: { context: 32768, output: 32768 }, + }, + "hf:Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "hf:Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen 3 235B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04-28", + last_updated: "2025-07-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 256000, output: 32000 }, + }, + "hf:Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "hf:Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen3 235B A22B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.65, output: 3 }, + limit: { context: 256000, output: 32000 }, + }, + "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct": { + id: "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct", + name: "Qwen 3 Coder 480B", + 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, + cost: { input: 2, output: 2 }, + limit: { context: 256000, output: 32000 }, + }, + "hf:deepseek-ai/DeepSeek-V3.1": { + id: "hf:deepseek-ai/DeepSeek-V3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.56, output: 1.68 }, + limit: { context: 128000, output: 128000 }, + }, + "hf:deepseek-ai/DeepSeek-V3-0324": { + id: "hf:deepseek-ai/DeepSeek-V3-0324", + name: "DeepSeek V3 (0324)", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 1.2 }, + limit: { context: 128000, output: 128000 }, + }, + "hf:deepseek-ai/DeepSeek-V3": { + id: "hf:deepseek-ai/DeepSeek-V3", + name: "DeepSeek V3", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 1.25 }, + limit: { context: 128000, output: 128000 }, + }, + "hf:deepseek-ai/DeepSeek-R1": { + id: "hf:deepseek-ai/DeepSeek-R1", + name: "DeepSeek R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 128000, output: 128000 }, + }, + "hf:deepseek-ai/DeepSeek-R1-0528": { + id: "hf:deepseek-ai/DeepSeek-R1-0528", + name: "DeepSeek R1 (0528)", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 8 }, + limit: { context: 128000, output: 128000 }, + }, + "hf:deepseek-ai/DeepSeek-V3.2": { + id: "hf:deepseek-ai/DeepSeek-V3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.4, cache_read: 0.27, cache_write: 0 }, + limit: { context: 162816, input: 162816, output: 8000 }, + }, + "hf:deepseek-ai/DeepSeek-V3.1-Terminus": { + id: "hf:deepseek-ai/DeepSeek-V3.1-Terminus", + name: "DeepSeek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-09-22", + last_updated: "2025-09-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 1.2 }, + limit: { context: 128000, output: 128000 }, + }, + "hf:openai/gpt-oss-120b": { + id: "hf:openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 32768 }, + }, + "hf:moonshotai/Kimi-K2-Thinking": { + id: "hf:moonshotai/Kimi-K2-Thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-07", + last_updated: "2025-11-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 262144, output: 262144 }, + }, + "hf:moonshotai/Kimi-K2-Instruct-0905": { + id: "hf:moonshotai/Kimi-K2-Instruct-0905", + name: "Kimi K2 0905", + family: "kimi", + 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, + cost: { input: 1.2, output: 1.2 }, + limit: { context: 262144, output: 32768 }, + }, + "hf:moonshotai/Kimi-K2.5": { + id: "hf:moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 262144, output: 65536 }, + }, + "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4": { + id: "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4", + name: "Nemotron 3 Super 120B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-03-11", + last_updated: "2026-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1, cache_read: 0.3 }, + limit: { context: 262144, output: 65536 }, + }, + "hf:nvidia/Kimi-K2.5-NVFP4": { + id: "hf:nvidia/Kimi-K2.5-NVFP4", + name: "Kimi K2.5 (NVFP4)", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 262144, output: 65536 }, + }, + "hf:zai-org/GLM-4.7-Flash": { + id: "hf:zai-org/GLM-4.7-Flash", + name: "GLM-4.7-Flash", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-01-18", + last_updated: "2026-01-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.4, cache_read: 0.06 }, + limit: { context: 196608, output: 65536 }, + }, + "hf:zai-org/GLM-4.7": { + id: "hf:zai-org/GLM-4.7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 200000, output: 64000 }, + }, + "hf:zai-org/GLM-5.1": { + id: "hf:zai-org/GLM-5.1", + name: "GLM 5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-04-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3, cache_read: 1 }, + limit: { context: 196608, output: 65536 }, + }, + "hf:zai-org/GLM-5": { + id: "hf:zai-org/GLM-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3, cache_read: 1 }, + limit: { context: 196608, output: 65536 }, + }, + "hf:zai-org/GLM-4.6": { + id: "hf:zai-org/GLM-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.55, output: 2.19 }, + limit: { context: 200000, output: 64000 }, + }, + "hf:moonshotai/Kimi-K2.6": { + id: "hf:moonshotai/Kimi-K2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.95 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + 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: { + "black-forest-labs/flux.1-dev": { + id: "black-forest-labs/flux.1-dev", + name: "FLUX.1-dev", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-01", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 4096, output: 0 }, + }, + "stepfun-ai/step-3.5-flash": { + id: "stepfun-ai/step-3.5-flash", + name: "Step 3.5 Flash", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-02", + last_updated: "2026-02-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 16384 }, + }, + "mistralai/codestral-22b-instruct-v0.1": { + id: "mistralai/codestral-22b-instruct-v0.1", + name: "Codestral 22b Instruct V0.1", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-05-29", + last_updated: "2024-05-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "mistralai/mistral-large-3-675b-instruct-2512": { + id: "mistralai/mistral-large-3-675b-instruct-2512", + name: "Mistral Large 3 675B Instruct 2512", + family: "mistral-large", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/devstral-2-123b-instruct-2512": { + id: "mistralai/devstral-2-123b-instruct-2512", + name: "Devstral-2-123B-Instruct-2512", + family: "devstral", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2025-12-08", + last_updated: "2025-12-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/ministral-14b-instruct-2512": { + id: "mistralai/ministral-14b-instruct-2512", + name: "Ministral 3 14B Instruct 2512", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2025-12-01", + last_updated: "2025-12-08", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/mistral-small-3.1-24b-instruct-2503": { + id: "mistralai/mistral-small-3.1-24b-instruct-2503", + name: "Mistral Small 3.1 24b Instruct 2503", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-11", + last_updated: "2025-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "mistralai/mamba-codestral-7b-v0.1": { + id: "mistralai/mamba-codestral-7b-v0.1", + name: "Mamba Codestral 7b V0.1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-07-16", + last_updated: "2024-07-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "mistralai/mistral-large-2-instruct": { + id: "mistralai/mistral-large-2-instruct", + name: "Mistral Large 2 Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-24", + last_updated: "2024-07-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-medium-4k-instruct": { + id: "microsoft/phi-3-medium-4k-instruct", + name: "Phi 3 Medium 4k Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-05-07", + last_updated: "2024-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 4000, output: 4096 }, + }, + "microsoft/phi-3.5-moe-instruct": { + id: "microsoft/phi-3.5-moe-instruct", + name: "Phi 3.5 Moe Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-08-17", + last_updated: "2024-08-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-4-mini-instruct": { + id: "microsoft/phi-4-mini-instruct", + name: "Phi-4-Mini", + family: "phi", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2025-09-05", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "microsoft/phi-3-small-8k-instruct": { + id: "microsoft/phi-3-small-8k-instruct", + name: "Phi 3 Small 8k Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-05-07", + last_updated: "2024-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8000, output: 4096 }, + }, + "microsoft/phi-3-vision-128k-instruct": { + id: "microsoft/phi-3-vision-128k-instruct", + name: "Phi 3 Vision 128k Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-05-19", + last_updated: "2024-05-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3.5-vision-instruct": { + id: "microsoft/phi-3.5-vision-instruct", + name: "Phi 3.5 Vision Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-08-16", + last_updated: "2024-08-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-small-128k-instruct": { + id: "microsoft/phi-3-small-128k-instruct", + name: "Phi 3 Small 128k Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-05-07", + last_updated: "2024-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-medium-128k-instruct": { + id: "microsoft/phi-3-medium-128k-instruct", + name: "Phi 3 Medium 128k Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-05-07", + last_updated: "2024-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning": { + id: "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning", + name: "Nemotron 3 Nano Omni", + family: "nemotron", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 65536 }, + }, + "nvidia/llama-3.3-nemotron-super-49b-v1": { + id: "nvidia/llama-3.3-nemotron-super-49b-v1", + name: "Llama 3.3 Nemotron Super 49b V1", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-03-16", + last_updated: "2025-03-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia/nemotron-4-340b-instruct": { + id: "nvidia/nemotron-4-340b-instruct", + name: "Nemotron 4 340b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-06-13", + last_updated: "2024-06-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia/llama3-chatqa-1.5-70b": { + id: "nvidia/llama3-chatqa-1.5-70b", + name: "Llama3 Chatqa 1.5 70b", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-04-28", + last_updated: "2024-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "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", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-03-16", + last_updated: "2025-03-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia/nemotron-3-super-120b-a12b": { + id: "nvidia/nemotron-3-super-120b-a12b", + name: "Nemotron 3 Super", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 262144, output: 262144 }, + }, + "nvidia/parakeet-tdt-0.6b-v2": { + id: "nvidia/parakeet-tdt-0.6b-v2", + name: "Parakeet TDT 0.6B v2", + family: "parakeet", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2024-01", + release_date: "2024-01-01", + last_updated: "2025-09-05", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 0, output: 4096 }, + }, + "nvidia/nemotron-3-nano-30b-a3b": { + id: "nvidia/nemotron-3-nano-30b-a3b", + name: "nemotron-3-nano-30b-a3b", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2024-12", + last_updated: "2024-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "nvidia/llama-3.1-nemotron-ultra-253b-v1": { + id: "nvidia/llama-3.1-nemotron-ultra-253b-v1", + name: "Llama-3.1-Nemotron-Ultra-253B-v1", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2024-07-01", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "nvidia/nvidia-nemotron-nano-9b-v2": { + id: "nvidia/nvidia-nemotron-nano-9b-v2", + name: "nvidia-nemotron-nano-9b-v2", + family: "nemotron", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "nvidia/cosmos-nemotron-34b": { + id: "nvidia/cosmos-nemotron-34b", + name: "Cosmos Nemotron 34B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-01", + release_date: "2024-01-01", + last_updated: "2025-09-05", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "nvidia/llama-embed-nemotron-8b": { + id: "nvidia/llama-embed-nemotron-8b", + name: "Llama Embed Nemotron 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2025-03", + release_date: "2025-03-18", + last_updated: "2025-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 2048 }, + }, + "nvidia/llama-3.1-nemotron-51b-instruct": { + id: "nvidia/llama-3.1-nemotron-51b-instruct", + name: "Llama 3.1 Nemotron 51b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-09-22", + last_updated: "2024-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia/llama-3.1-nemotron-70b-instruct": { + id: "nvidia/llama-3.1-nemotron-70b-instruct", + name: "Llama 3.1 Nemotron 70b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-10-12", + last_updated: "2024-10-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "nvidia/nemoretriever-ocr-v1": { + id: "nvidia/nemoretriever-ocr-v1", + name: "NeMo Retriever OCR v1", + family: "nemoretriever", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2024-01", + release_date: "2024-01-01", + last_updated: "2025-09-05", + modalities: { input: ["image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 0, output: 4096 }, + }, + "deepseek-ai/deepseek-r1": { + id: "deepseek-ai/deepseek-r1", + name: "Deepseek R1", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek-ai/deepseek-v3.1": { + id: "deepseek-ai/deepseek-v3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-08-20", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "deepseek-ai/deepseek-coder-6.7b-instruct": { + id: "deepseek-ai/deepseek-coder-6.7b-instruct", + name: "Deepseek Coder 6.7b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2023-10-29", + last_updated: "2023-10-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek-ai/deepseek-v3.2": { + id: "deepseek-ai/deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0, output: 0 }, + limit: { context: 163840, output: 65536 }, + }, + "deepseek-ai/deepseek-r1-0528": { + id: "deepseek-ai/deepseek-r1-0528", + name: "Deepseek R1 0528", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek-ai/deepseek-v3.1-terminus": { + id: "deepseek-ai/deepseek-v3.1-terminus", + name: "DeepSeek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-22", + last_updated: "2025-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/whisper-large-v3": { + id: "openai/whisper-large-v3", + name: "Whisper Large v3", + family: "whisper", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2023-09", + release_date: "2023-09-01", + last_updated: "2025-09-05", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 0, output: 4096 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT-OSS-120B", + family: "gpt-oss", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-04", + last_updated: "2025-08-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "minimaxai/minimax-m2.7": { + id: "minimaxai/minimax-m2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-04-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "minimaxai/minimax-m2.1": { + id: "minimaxai/minimax-m2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "minimaxai/minimax-m2.5": { + id: "minimaxai/minimax-m2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "z-ai/glm4.7": { + id: "z-ai/glm4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "z-ai/glm5": { + id: "z-ai/glm5", + name: "GLM5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 202752, output: 131000 }, + }, + "z-ai/glm-5.1": { + id: "z-ai/glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 131072 }, + }, + "meta/llama-4-scout-17b-16e-instruct": { + id: "meta/llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17b 16e Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-02", + release_date: "2025-04-02", + last_updated: "2025-04-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-3.3-70b-instruct": { + id: "meta/llama-3.3-70b-instruct", + name: "Llama 3.3 70b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-11-26", + last_updated: "2024-11-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama3-8b-instruct": { + id: "meta/llama3-8b-instruct", + name: "Llama3 8b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-04-17", + last_updated: "2024-04-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama3-70b-instruct": { + id: "meta/llama3-70b-instruct", + name: "Llama3 70b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-04-17", + last_updated: "2024-04-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/codellama-70b": { + id: "meta/codellama-70b", + name: "Codellama 70b", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-01-29", + last_updated: "2024-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-3.2-11b-vision-instruct": { + id: "meta/llama-3.2-11b-vision-instruct", + name: "Llama 3.2 11b Vision Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-3.1-70b-instruct": { + id: "meta/llama-3.1-70b-instruct", + name: "Llama 3.1 70b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-16", + last_updated: "2024-07-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-3.2-1b-instruct": { + id: "meta/llama-3.2-1b-instruct", + name: "Llama 3.2 1b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-4-maverick-17b-128e-instruct": { + id: "meta/llama-4-maverick-17b-128e-instruct", + name: "Llama 4 Maverick 17b 128e Instruct", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-02", + release_date: "2025-04-01", + last_updated: "2025-04-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-3.1-405b-instruct": { + id: "meta/llama-3.1-405b-instruct", + name: "Llama 3.1 405b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-16", + last_updated: "2024-07-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen/qwen3-235b-a22b": { + id: "qwen/qwen3-235b-a22b", + name: "Qwen3-235B-A22B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen/qwen2.5-coder-7b-instruct": { + id: "qwen/qwen2.5-coder-7b-instruct", + name: "Qwen2.5 Coder 7b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-09-17", + last_updated: "2024-09-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen/qwen2.5-coder-32b-instruct": { + id: "qwen/qwen2.5-coder-32b-instruct", + name: "Qwen2.5 Coder 32b Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-11-06", + last_updated: "2024-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen/qwen3.5-397b-a17b": { + id: "qwen/qwen3.5-397b-a17b", + name: "Qwen3.5-397B-A17B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-02-16", + last_updated: "2026-02-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 8192 }, + }, + "qwen/qwen3-next-80b-a3b-thinking": { + id: "qwen/qwen3-next-80b-a3b-thinking", + name: "Qwen3-Next-80B-A3B-Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 16384 }, + }, + "qwen/qwq-32b": { + id: "qwen/qwq-32b", + name: "Qwq 32b", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-03-05", + last_updated: "2025-03-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen/qwen3-next-80b-a3b-instruct": { + id: "qwen/qwen3-next-80b-a3b-instruct", + name: "Qwen3-Next-80B-A3B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 16384 }, + }, + "qwen/qwen3-coder-480b-a35b-instruct": { + id: "qwen/qwen3-coder-480b-a35b-instruct", + name: "Qwen3 Coder 480B A35B Instruct", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 66536 }, + }, + "google/gemma-2-2b-it": { + id: "google/gemma-2-2b-it", + name: "Gemma 2 2b It", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-16", + last_updated: "2024-07-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/gemma-3n-e4b-it": { + id: "google/gemma-3n-e4b-it", + name: "Gemma 3n E4b It", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-06-03", + last_updated: "2025-06-03", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/gemma-3-1b-it": { + id: "google/gemma-3-1b-it", + name: "Gemma 3 1b It", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-10", + last_updated: "2025-03-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/codegemma-7b": { + id: "google/codegemma-7b", + name: "Codegemma 7b", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-03-21", + last_updated: "2024-03-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/gemma-4-31b-it": { + id: "google/gemma-4-31b-it", + name: "Gemma-4-31B-IT", + family: "gemma", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 16384 }, + }, + "google/gemma-3-12b-it": { + id: "google/gemma-3-12b-it", + name: "Gemma 3 12b It", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-01", + last_updated: "2025-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/codegemma-1.1-7b": { + id: "google/codegemma-1.1-7b", + name: "Codegemma 1.1 7b", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-04-30", + last_updated: "2024-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/gemma-3n-e2b-it": { + id: "google/gemma-3n-e2b-it", + name: "Gemma 3n E2b It", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-06-12", + last_updated: "2025-06-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/gemma-2-27b-it": { + id: "google/gemma-2-27b-it", + name: "Gemma 2 27b It", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-06-24", + last_updated: "2024-06-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "google/gemma-3-27b-it": { + id: "google/gemma-3-27b-it", + name: "Gemma-3-27B-IT", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2024-12-01", + last_updated: "2025-09-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-07", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-instruct": { + id: "moonshotai/kimi-k2-instruct", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-01", + release_date: "2025-01-01", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-instruct-0905": { + id: "moonshotai/kimi-k2-instruct-0905", + name: "Kimi K2 0905", + family: "kimi", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + structured_output: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-11", + last_updated: "2025-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/mistral-medium-3.5-128b": { + id: "mistralai/mistral-medium-3.5-128b", + name: "Mistral Medium 3.5 128B", + family: "mistral-medium", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek-ai/deepseek-v4-flash": { + id: "deepseek-ai/deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1048576, output: 393216 }, + }, + "deepseek-ai/deepseek-v4-pro": { + id: "deepseek-ai/deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1048576, output: 393216 }, + }, + }, + }, + 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", + family: "mistral-nemo", + 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, + cost: { input: 0.038, output: 0.1 }, + limit: { context: 16000, output: 4096 }, + }, + "meta/llama-3.2-11b-vision-instruct": { + id: "meta/llama-3.2-11b-vision-instruct", + name: "Llama 3.2 11B Vision Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.055, output: 0.055 }, + limit: { context: 16000, output: 4096 }, + }, + "meta/llama-3.2-1b-instruct": { + id: "meta/llama-3.2-1b-instruct", + name: "Llama 3.2 1B Instruct", + 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, + cost: { input: 0.01, output: 0.01 }, + limit: { context: 16000, output: 4096 }, + }, + "meta/llama-3.2-3b-instruct": { + id: "meta/llama-3.2-3b-instruct", + name: "Llama 3.2 3B Instruct", + 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, + cost: { input: 0.02, output: 0.02 }, + limit: { context: 16000, output: 4096 }, + }, + "meta/llama-3.1-8b-instruct": { + id: "meta/llama-3.1-8b-instruct", + name: "Llama 3.1 8B Instruct", + 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, + cost: { input: 0.025, output: 0.025 }, + limit: { context: 16000, output: 4096 }, + }, + "qwen/qwen-2.5-7b-vision-instruct": { + id: "qwen/qwen-2.5-7b-vision-instruct", + name: "Qwen 2.5 7B Vision Instruct", + 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, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 125000, output: 4096 }, + }, + "qwen/qwen3-embedding-4b": { + id: "qwen/qwen3-embedding-4b", + name: "Qwen 3 Embedding 4B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2024-12", + release_date: "2025-01-01", + last_updated: "2025-01-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0 }, + limit: { context: 32000, output: 2048 }, + }, + "google/gemma-3": { + id: "google/gemma-3", + name: "Google Gemma 3", + 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, + cost: { input: 0.15, output: 0.3 }, + limit: { context: 125000, output: 4096 }, + }, + "osmosis/osmosis-structure-0.6b": { + id: "osmosis/osmosis-structure-0.6b", + name: "Osmosis Structure 0.6B", + 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, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 4000, output: 2048 }, + }, + }, + }, + inception: { + id: "inception", + env: ["INCEPTION_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.inceptionlabs.ai/v1/", + name: "Inception", + doc: "https://platform.inceptionlabs.ai/docs", + models: { + "mercury-edit-2": { + id: "mercury-edit-2", + name: "Mercury Edit 2", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75, cache_read: 0.025 }, + limit: { context: 128000, output: 8192 }, + }, + "mercury-2": { + id: "mercury-2", + name: "Mercury 2", + family: "mercury", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.25, output: 0.75, cache_read: 0.025 }, + limit: { context: 128000, output: 50000 }, + }, + }, + }, + openai: { + id: "openai", + env: ["OPENAI_API_KEY"], + npm: "@ai-sdk/openai", + name: "OpenAI", + doc: "https://platform.openai.com/docs/models", + models: { + "gpt-5.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "GPT-5.1 Codex Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-4o-2024-05-13": { + id: "gpt-4o-2024-05-13", + name: "GPT-4o (2024-05-13)", + 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, + cost: { input: 5, output: 15 }, + limit: { context: 128000, output: 4096 }, + }, + "o1-mini": { + id: "o1-mini", + name: "o1-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: false, + knowledge: "2023-09", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 128000, output: 65536 }, + }, + "gpt-5.2-pro": { + id: "gpt-5.2-pro", + name: "GPT-5.2 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 21, output: 168 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "text-embedding-3-large": { + id: "text-embedding-3-large", + name: "text-embedding-3-large", + 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, + cost: { input: 0.13, output: 0 }, + limit: { context: 8191, output: 3072 }, + }, + "gpt-5.3-chat-latest": { + id: "gpt-5.3-chat-latest", + name: "GPT-5.3 Chat (latest)", + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + 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" } }, + }, + }, + }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-4-turbo": { + id: "gpt-4-turbo", + name: "GPT-4 Turbo", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "text-embedding-ada-002": { + id: "text-embedding-ada-002", + name: "text-embedding-ada-002", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "o3-pro": { + id: "o3-pro", + name: "o3-pro", + family: "o-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 20, output: 80 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-4o-mini": { + id: "gpt-4o-mini", + name: "GPT-4o mini", + 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, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "o4-mini-deep-research": { + id: "o4-mini-deep-research", + name: "o4-mini-deep-research", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-05", + release_date: "2024-06-26", + last_updated: "2024-06-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + 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" } }, + }, + }, + }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "GPT-5.4 nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-image-1": { + id: "gpt-image-1", + name: "gpt-image-1", + 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, input: 0, output: 0 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.2-chat-latest": { + id: "gpt-5.2-chat-latest", + name: "GPT-5.2 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1 Codex mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "o1-preview": { + id: "o1-preview", + name: "o1-preview", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2023-09", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 128000, output: 32768 }, + }, + "gpt-4o-2024-08-06": { + id: "gpt-4o-2024-08-06", + name: "GPT-4o (2024-08-06)", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-image-1-mini": { + id: "gpt-image-1-mini", + name: "gpt-image-1-mini", + 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 }, + }, + o1: { + id: "o1", + name: "o1", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.4-pro": { + id: "gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-3.5-turbo": { + id: "gpt-3.5-turbo", + name: "GPT-3.5-turbo", + 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, + cost: { input: 0.5, output: 1.5, cache_read: 1.25 }, + limit: { context: 16385, output: 4096 }, + }, + "o3-deep-research": { + id: "o3-deep-research", + name: "o3-deep-research", + family: "o", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-05", + release_date: "2024-06-26", + last_updated: "2024-06-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 40, cache_read: 2.5 }, + limit: { context: 200000, output: 100000 }, + }, + "o3-mini": { + id: "o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "text-embedding-3-small": { + id: "text-embedding-3-small", + name: "text-embedding-3-small", + 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, + cost: { input: 0.02, output: 0 }, + limit: { context: 8191, output: 1536 }, + }, + "o1-pro": { + id: "o1-pro", + name: "o1-pro", + family: "o-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 150, output: 600 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-4": { + id: "gpt-4", + name: "GPT-4", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 60 }, + limit: { context: 8192, output: 8192 }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "GPT-5-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + experimental: { + modes: { + fast: { cost: { input: 5, output: 30, cache_read: 0.5 }, provider: { body: { service_tier: "priority" } } }, + }, + }, + }, + "gpt-5.1-chat-latest": { + id: "gpt-5.1-chat-latest", + name: "GPT-5.1 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5.3-codex-spark": { + id: "gpt-5.3-codex-spark", + name: "GPT-5.3 Codex Spark", + family: "gpt-codex-spark", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, input: 100000, output: 32000 }, + }, + "chatgpt-image-latest": { + id: "chatgpt-image-latest", + name: "chatgpt-image-latest", + 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 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "GPT-4.1 nano", + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.03 }, + limit: { context: 1047576, output: 32768 }, + }, + o3: { + id: "o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "GPT-5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 400000, input: 272000, output: 272000 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "GPT-4o", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5-chat-latest": { + id: "gpt-5-chat-latest", + name: "GPT-5 Chat (latest)", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-09-30", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-image-1.5": { + id: "gpt-image-1.5", + name: "gpt-image-1.5", + 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 }, + }, + "gpt-5.5-pro": { + id: "gpt-5.5-pro", + name: "GPT-5.5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "GPT-4.1 mini", + 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, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-4o-2024-11-20": { + id: "gpt-4o-2024-11-20", + name: "GPT-4o (2024-11-20)", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + }, + }, + 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: { + "xai/grok-4-fast": { + id: "xai/grok-4-fast", + name: "Grok 4 Fast", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05, cache_write: 0.2 }, + limit: { context: 2000000, output: 64000 }, + }, + "xai/grok-4": { + id: "xai/grok-4", + name: "Grok 4", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-09", + last_updated: "2025-09-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75, cache_write: 3 }, + limit: { context: 256000, output: 64000 }, + }, + "openai/gpt-5.1-codex-max": { + id: "openai/gpt-5.1-codex-max", + name: "GPT-5.1-Codex-Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 9, cache_read: 0.11 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-chat": { + id: "openai/gpt-5-chat", + name: "GPT-5 Chat (latest)", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-09-30", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "GPT-5.2 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 21, output: 168 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.03 }, + limit: { context: 128000, output: 32000 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.01 }, + limit: { context: 16000, output: 4000 }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "GPT-5.3-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o Mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.1-chat": { + id: "openai/gpt-5.1-chat", + name: "GPT-5.1 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "o4 Mini", + family: "o-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT-5.2-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-01-14", + last_updated: "2026-01-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "GPT-5.1-Codex-Mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 100000 }, + }, + "openai/gpt-5-image": { + id: "openai/gpt-5-image", + name: "GPT-5 Image", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-10-14", + last_updated: "2025-10-14", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 5, output: 10, cache_read: 1.25 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.1": { + id: "openai/gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.4-pro": { + id: "openai/gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, cache_read: 30 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "GPT-5 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-09-30", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "audio", "image", "video"], output: ["text", "audio", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "GPT-4.1 Mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT-5.1-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "google/gemini-3-flash-preview": { + id: "google/gemini-3-flash-preview", + name: "Gemini 3 Flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3, cache_read: 0.05, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3-pro-preview": { + id: "google/gemini-3-pro-preview", + name: "Gemini 3 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2, cache_write: 4.5 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, cache_write: 0.55 }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic/claude-haiku-4-5": { + id: "anthropic/claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-02-01", + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 62000 }, + }, + "anthropic/claude-sonnet-4-6": { + id: "anthropic/claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-3-7-sonnet": { + id: "anthropic/claude-3-7-sonnet", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-01", + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4-5": { + id: "anthropic/claude-opus-4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-opus-4-6": { + id: "anthropic/claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "openai/gpt-5.2-chat": { + id: "openai/gpt-5.2-chat", + name: "GPT-5.2 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-5-pro": { + id: "openai/gpt-5-pro", + name: "GPT-5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 400000, output: 272000 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.31, + cache_write: 2.375, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "anthropic/claude-opus-4-1": { + id: "anthropic/claude-opus-4-1", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4-5": { + id: "anthropic/claude-sonnet-4-5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + }, + }, + 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: { + "openai-gpt-4o-mini": { + id: "openai-gpt-4o-mini", + name: "GPT-4o mini", + 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, + cost: { input: 0.15, output: 0.6, cache_read: 0.075 }, + limit: { context: 128000, output: 16384 }, + }, + "multi-qa-mpnet-base-dot-v1": { + id: "multi-qa-mpnet-base-dot-v1", + name: "Multi-QA-mpnet-base-dot-v1", + family: "text-embedding", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2021-08-30", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.009, output: 0 }, + limit: { context: 512, output: 768 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2.7 }, + limit: { context: 262144, output: 32768 }, + }, + "nemotron-3-nano-omni": { + id: "nemotron-3-nano-omni", + name: "Nemotron Nano 3 Omni", + family: "nemotron", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-28", + last_updated: "2026-04-30", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 0.9 }, + limit: { context: 65536, output: 65536 }, + }, + "llama3-8b-instruct": { + id: "llama3-8b-instruct", + name: "Llama 3.1 Instruct (8B)", + 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, + cost: { input: 0.198, output: 0.198 }, + limit: { context: 131072, output: 131072 }, + }, + "anthropic-claude-opus-4.7": { + id: "anthropic-claude-opus-4.7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic-claude-sonnet-4": { + id: "anthropic-claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.3, cache_write: 3.75 }, + }, + limit: { context: 1000000, output: 64000 }, + }, + "wan2-2-t2v-a14b": { + id: "wan2-2-t2v-a14b", + name: "Wan2.2-T2V-A14B", + 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, + cost: { input: 0.6, output: 0 }, + limit: { context: 100, output: 1 }, + }, + "qwen-2.5-14b-instruct": { + id: "qwen-2.5-14b-instruct", + name: "Qwen 2.5 14B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2024-09-19", + last_updated: "2024-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 131072, output: 131072 }, + }, + "openai-gpt-5.4": { + id: "openai-gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "qwen3.5-397b-a17b": { + id: "qwen3.5-397b-a17b", + name: "Qwen 3.5 397B A17B", + family: "qwen3.5", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 3.5 }, + limit: { context: 262144, output: 81920 }, + }, + "openai-o3": { + id: "openai-o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "e5-large-v2": { + id: "e5-large-v2", + name: "E5 Large v2", + family: "text-embedding", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2023-05-19", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0 }, + limit: { context: 512, output: 1024 }, + }, + "openai-gpt-5.2-pro": { + id: "openai-gpt-5.2-pro", + name: "GPT-5.2 pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 21, output: 168 }, + limit: { context: 400000, output: 128000 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM 5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + release_date: "2026-02-11", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2 }, + limit: { context: 202752, output: 128000 }, + }, + "openai-gpt-5.4-nano": { + id: "openai-gpt-5.4-nano", + name: "GPT-5.4 nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, output: 128000 }, + }, + "mistral-7b-instruct-v0.3": { + id: "mistral-7b-instruct-v0.3", + name: "Mistral 7B Instruct v0.3", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-05-22", + last_updated: "2024-05-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 32768, output: 32768 }, + }, + "llama3.3-70b-instruct": { + id: "llama3.3-70b-instruct", + name: "Llama 3.3 Instruct 70B", + 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, + cost: { input: 0.65, output: 0.65 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral-3-14B": { + id: "mistral-3-14B", + name: "Ministral 3 14B Instruct", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-15", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 262144, output: 128000 }, + }, + "deepseek-r1-distill-llama-70b": { + id: "deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-30", + last_updated: "2025-01-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.99, output: 0.99 }, + limit: { context: 131072, output: 32768 }, + }, + "alibaba-qwen3-32b": { + id: "alibaba-qwen3-32b", + name: "Qwen3-32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-30", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.55 }, + limit: { context: 131000, output: 40960 }, + }, + "anthropic-claude-opus-4.5": { + id: "anthropic-claude-opus-4.5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "openai-o1": { + id: "openai-o1", + name: "o1", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "anthropic-claude-3-opus": { + id: "anthropic-claude-3-opus", + name: "Claude 3 Opus", + family: "claude-opus", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08", + release_date: "2024-02-29", + last_updated: "2024-02-29", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 4096 }, + status: "deprecated", + }, + "stable-diffusion-3.5-large": { + id: "stable-diffusion-3.5-large", + name: "Stable Diffusion 3.5 Large", + 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, + cost: { input: 0.08, output: 0 }, + limit: { context: 256, output: 1 }, + }, + "openai-gpt-5-nano": { + id: "openai-gpt-5-nano", + name: "GPT-5 nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, output: 128000 }, + }, + "llama-4-maverick": { + id: "llama-4-maverick", + name: "Llama 4 Maverick 17B 128E Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-08", + release_date: "2025-04-05", + last_updated: "2026-04-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.87 }, + limit: { context: 1000000, output: 16384 }, + }, + "anthropic-claude-4.5-sonnet": { + id: "anthropic-claude-4.5-sonnet", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.3, cache_write: 3.75 }, + }, + limit: { context: 1000000, output: 64000 }, + }, + "qwen3-embedding-0.6b": { + id: "qwen3-embedding-0.6b", + name: "Qwen3 Embedding 0.6B", + 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, + cost: { input: 0.04, output: 0 }, + limit: { context: 8000, output: 1024 }, + status: "beta", + }, + "anthropic-claude-4.5-haiku": { + id: "anthropic-claude-4.5-haiku", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "gte-large-en-v1.5": { + id: "gte-large-en-v1.5", + name: "GTE Large (v1.5)", + 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, + cost: { input: 0.09, output: 0 }, + limit: { context: 8192, output: 1024 }, + }, + "openai-gpt-4.1": { + id: "openai-gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "anthropic-claude-3.5-haiku": { + id: "anthropic-claude-3.5-haiku", + name: "Claude 3.5 Haiku", + family: "claude-haiku", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2024-11-05", + last_updated: "2024-11-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + status: "deprecated", + }, + "openai-gpt-5.2": { + id: "openai-gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "deepseek-3.2": { + id: "deepseek-3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-12", + release_date: "2025-12-02", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.6 }, + limit: { context: 128000, output: 64000 }, + }, + "nemotron-3-nano-30b": { + id: "nemotron-3-nano-30b", + name: "Nemotron 3 Nano 30B A3B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "anthropic-claude-opus-4": { + id: "anthropic-claude-opus-4", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "openai-gpt-oss-20b": { + id: "openai-gpt-oss-20b", + name: "gpt-oss-20b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-08-05", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.45 }, + limit: { context: 131072, output: 131072 }, + }, + "qwen3-coder-flash": { + id: "qwen3-coder-flash", + name: "Qwen3 Coder Flash", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-28", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 1.7 }, + limit: { context: 262144, output: 65536 }, + }, + "openai-o3-mini": { + id: "openai-o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "openai-gpt-oss-120b": { + id: "openai-gpt-oss-120b", + name: "gpt-oss-120b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-08-05", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.7 }, + limit: { context: 131072, output: 131072 }, + }, + "gemma-4-31B-it": { + id: "gemma-4-31B-it", + name: "Gemma 4 31B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-22", + last_updated: "2026-04-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.18, output: 0.5 }, + limit: { context: 256000, output: 8192 }, + }, + "nemotron-nano-12b-v2-vl": { + id: "nemotron-nano-12b-v2-vl", + name: "Nemotron Nano 12B v2 VL", + family: "nemotron", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-01", + last_updated: "2026-04-30", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 128000, output: 16384 }, + }, + "anthropic-claude-4.1-opus": { + id: "anthropic-claude-4.1-opus", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01", + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4 }, + limit: { context: 262144, output: 262144 }, + }, + "openai-gpt-image-2": { + id: "openai-gpt-image-2", + name: "GPT Image 2", + 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 }, + }, + "anthropic-claude-4.6-sonnet": { + id: "anthropic-claude-4.6-sonnet", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.3, cache_write: 3.75 }, + }, + limit: { context: 1000000, output: 64000 }, + }, + "openai-gpt-5-mini": { + id: "openai-gpt-5-mini", + name: "GPT-5 mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 128000 }, + }, + "anthropic-claude-haiku-4.5": { + id: "anthropic-claude-haiku-4.5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48 }, + limit: { context: 1048576, output: 393216 }, + }, + "ministral-3-8b-instruct-2512": { + id: "ministral-3-8b-instruct-2512", + name: "Ministral 3 8B", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-15", + last_updated: "2025-12-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + limit: { context: 262144, output: 262144 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax-m2.5", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 128000 }, + status: "beta", + }, + "openai-gpt-image-1": { + id: "openai-gpt-image-1", + name: "GPT Image 1", + 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, + cost: { input: 5, output: 40, cache_read: 1.25 }, + limit: { context: 0, output: 0 }, + }, + "openai-gpt-5.5": { + id: "openai-gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-12-01", + release_date: "2026-04-23", + last_updated: "2026-04-30", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1000000, output: 128000 }, + }, + "nvidia-nemotron-3-super-120b": { + id: "nvidia-nemotron-3-super-120b", + name: "Nemotron-3-Super-120B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2026-02", + release_date: "2026-03-11", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.65 }, + limit: { context: 256000, output: 32768 }, + status: "beta", + }, + "openai-gpt-5.4-pro": { + id: "openai-gpt-5.4-pro", + name: "GPT-5.4 pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180 }, + limit: { context: 400000, output: 128000 }, + }, + "all-mini-lm-l6-v2": { + id: "all-mini-lm-l6-v2", + name: "All-MiniLM-L6-v2", + family: "text-embedding", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2021-08-30", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.009, output: 0 }, + limit: { context: 256, output: 384 }, + }, + "bge-m3": { + id: "bge-m3", + name: "BGE M3", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-01-30", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.02, output: 0 }, + limit: { context: 8192, output: 1024 }, + }, + "openai-gpt-5.1-codex-max": { + id: "openai-gpt-5.1-codex-max", + name: "GPT-5.1 Codex Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "anthropic-claude-opus-4.6": { + id: "anthropic-claude-opus-4.6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 0.5, cache_write: 6.25 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "openai-gpt-4o": { + id: "openai-gpt-4o", + name: "GPT-4o", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "openai-gpt-5.4-mini": { + id: "openai-gpt-5.4-mini", + name: "GPT-5.4 mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, output: 128000 }, + }, + "openai-gpt-5": { + id: "openai-gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "arcee-trinity-large-thinking": { + id: "arcee-trinity-large-thinking", + name: "Trinity Large Thinking", + family: "trinity", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.9, cache_read: 0.06 }, + limit: { context: 256000, output: 128000 }, + status: "beta", + }, + "mistral-nemo-instruct-2407": { + id: "mistral-nemo-instruct-2407", + name: "Mistral Nemo Instruct", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + status: "deprecated", + }, + "deepseek-v3": { + id: "deepseek-v3", + name: "DeepSeek V3", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2024-12-26", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + limit: { context: 163840, output: 131072 }, + }, + "bge-reranker-v2-m3": { + id: "bge-reranker-v2-m3", + name: "BGE Reranker v2 M3", + family: "bge", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-03-12", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.01, output: 0 }, + limit: { context: 8192, output: 1 }, + }, + "anthropic-claude-3.7-sonnet": { + id: "anthropic-claude-3.7-sonnet", + name: "Claude 3.7 Sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + status: "deprecated", + }, + "qwen3-tts-voicedesign": { + id: "qwen3-tts-voicedesign", + name: "Qwen3 TTS VoiceDesign", + 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 }, + }, + "openai-gpt-image-1.5": { + id: "openai-gpt-image-1.5", + name: "GPT Image 1.5", + 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, + cost: { input: 5, output: 10, cache_read: 1 }, + limit: { context: 0, output: 0 }, + }, + "openai-gpt-5.3-codex": { + id: "openai-gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "anthropic-claude-3.5-sonnet": { + id: "anthropic-claude-3.5-sonnet", + name: "Claude 3.5 Sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-06-20", + last_updated: "2024-10-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + status: "deprecated", + }, + "fal-ai/fast-sdxl": { + id: "fal-ai/fast-sdxl", + name: "Fast SDXL", + 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/flux/schnell": { + id: "fal-ai/flux/schnell", + name: "FLUX.1 [schnell]", + 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/elevenlabs/tts/multilingual-v2": { + id: "fal-ai/elevenlabs/tts/multilingual-v2", + name: "ElevenLabs Multilingual TTS v2", + family: "elevenlabs", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2023-08-22", + last_updated: "2026-04-16", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "fal-ai/stable-audio-25/text-to-audio": { + id: "fal-ai/stable-audio-25/text-to-audio", + name: "Stable Audio 2.5 (Text-to-Audio)", + 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 }, + }, + }, + }, + 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: { + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2025-02-11", + last_updated: "2025-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 194000, output: 4096 }, + }, + "GLM-5-FP8": { + id: "GLM-5-FP8", + name: "GLM 5 FP8", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.85, output: 3.1 }, + limit: { context: 200000, output: 131072 }, + }, + "DeepSeek-V3.2": { + id: "DeepSeek-V3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: false, + 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, + cost: { input: 0.55, output: 1.65 }, + limit: { context: 127000, output: 4096 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT OSS 120B", + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 129000, output: 4096 }, + }, + "Kimi-K2.5": { + id: "Kimi-K2.5", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.75 }, + limit: { context: 254000, output: 32768 }, + }, + }, + }, + "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-coder-plus": { + id: "qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 65536 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 202752, output: 16384 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 202752, output: 16384 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 196608, output: 24576 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 65536 }, + }, + "qwen3-max-2026-01-23": { + id: "qwen3-max-2026-01-23", + name: "Qwen3 Max", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "qwen3-coder-next": { + id: "qwen3-coder-next", + name: "Qwen3 Coder Next", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3.5-plus": { + id: "qwen3.5-plus", + name: "Qwen3.5 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 65536 }, + }, + }, + }, + mistral: { + id: "mistral", + env: ["MISTRAL_API_KEY"], + npm: "@ai-sdk/mistral", + name: "Mistral", + doc: "https://docs.mistral.ai/getting-started/models/", + models: { + "mistral-small-latest": { + id: "mistral-small-latest", + name: "Mistral Small (latest)", + family: "mistral-small", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 256000, output: 256000 }, + }, + "mistral-nemo": { + id: "mistral-nemo", + name: "Mistral Nemo", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral-large-2512": { + id: "mistral-large-2512", + name: "Mistral Large 3", + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 262144, output: 262144 }, + }, + "labs-devstral-small-2512": { + id: "labs-devstral-small-2512", + name: "Devstral Small 2", + 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", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 256000 }, + }, + "devstral-2512": { + id: "devstral-2512", + name: "Devstral 2", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "magistral-medium-latest": { + id: "magistral-medium-latest", + name: "Magistral Medium (latest)", + family: "magistral-medium", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 2, output: 5 }, + limit: { context: 128000, output: 16384 }, + }, + "open-mixtral-8x7b": { + id: "open-mixtral-8x7b", + name: "Mixtral 8x7B", + family: "mixtral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-01", + release_date: "2023-12-11", + last_updated: "2023-12-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 0.7 }, + limit: { context: 32000, output: 32000 }, + }, + "pixtral-large-latest": { + id: "pixtral-large-latest", + name: "Pixtral Large (latest)", + 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, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral-large-2411": { + id: "mistral-large-2411", + name: "Mistral Large 2.1", + family: "mistral-large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2024-11-01", + last_updated: "2024-11-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 131072, output: 16384 }, + }, + "codestral-latest": { + id: "codestral-latest", + name: "Codestral (latest)", + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 4096 }, + }, + "mistral-large-latest": { + id: "mistral-large-latest", + name: "Mistral Large (latest)", + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 262144, output: 262144 }, + }, + "mistral-small-2506": { + id: "mistral-small-2506", + name: "Mistral Small 3.2", + family: "mistral-small", + attachment: false, + 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, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + }, + "pixtral-12b": { + id: "pixtral-12b", + name: "Pixtral 12B", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 128000 }, + }, + "ministral-8b-latest": { + id: "ministral-8b-latest", + name: "Ministral 8B (latest)", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral-embed": { + id: "mistral-embed", + name: "Mistral Embed", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 8000, output: 3072 }, + }, + "magistral-small": { + id: "magistral-small", + name: "Magistral Small", + family: "magistral-small", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-03-17", + last_updated: "2025-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral-small-2603": { + id: "mistral-small-2603", + name: "Mistral Small 4", + family: "mistral-small", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 256000, output: 256000 }, + }, + "ministral-3b-latest": { + id: "ministral-3b-latest", + name: "Ministral 3B (latest)", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 128000, output: 128000 }, + }, + "open-mixtral-8x22b": { + id: "open-mixtral-8x22b", + name: "Mixtral 8x22B", + family: "mixtral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-04-17", + last_updated: "2024-04-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 64000, output: 64000 }, + }, + "mistral-medium-2604": { + id: "mistral-medium-2604", + name: "Mistral Medium 3.5", + family: "mistral-medium", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.5, output: 7.5 }, + limit: { context: 262144, output: 262144 }, + }, + "devstral-small-2505": { + id: "devstral-small-2505", + name: "Devstral Small 2505", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 128000 }, + }, + "devstral-medium-2507": { + id: "devstral-medium-2507", + name: "Devstral Medium", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 2 }, + limit: { context: 128000, output: 128000 }, + }, + "open-mistral-7b": { + id: "open-mistral-7b", + name: "Mistral 7B", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2023-09-27", + last_updated: "2023-09-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.25 }, + limit: { context: 8000, output: 8000 }, + }, + "devstral-medium-latest": { + id: "devstral-medium-latest", + name: "Devstral 2 (latest)", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "mistral-medium-2505": { + id: "mistral-medium-2505", + name: "Mistral Medium 3", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 131072, output: 131072 }, + }, + "devstral-small-2507": { + id: "devstral-small-2507", + name: "Devstral Small", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral-medium-2508": { + id: "mistral-medium-2508", + name: "Mistral Medium 3.1", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "mistral-medium-latest": { + id: "mistral-medium-latest", + name: "Mistral Medium (latest)", + family: "mistral-medium", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.5, output: 7.5 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + 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", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-01", + last_updated: "2025-04-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.74, output: 0.74 }, + limit: { context: 131072, output: 131072 }, + }, + "mistral-7b-instruct-v0.3": { + id: "mistral-7b-instruct-v0.3", + name: "Mistral-7B-Instruct-v0.3", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-01", + last_updated: "2025-04-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11, output: 0.11 }, + limit: { context: 65536, output: 65536 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3-32B", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-16", + last_updated: "2025-07-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.25 }, + limit: { context: 32768, output: 32768 }, + }, + "qwen2.5-vl-72b-instruct": { + id: "qwen2.5-vl-72b-instruct", + name: "Qwen2.5-VL-72B-Instruct", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-03-31", + last_updated: "2025-03-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 1.01, output: 1.01 }, + limit: { context: 32768, output: 32768 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3-Coder-30B-A3B-Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-28", + last_updated: "2025-10-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.26 }, + limit: { context: 262144, output: 262144 }, + }, + "gpt-oss-20b": { + id: "gpt-oss-20b", + name: "gpt-oss-20b", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.18 }, + limit: { context: 131072, output: 131072 }, + }, + "mistral-small-3.2-24b-instruct-2506": { + id: "mistral-small-3.2-24b-instruct-2506", + name: "Mistral-Small-3.2-24B-Instruct-2506", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-16", + last_updated: "2025-07-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.31 }, + limit: { context: 131072, output: 131072 }, + }, + "qwen3.5-9b": { + id: "qwen3.5-9b", + name: "Qwen3.5-9B", + attachment: true, + reasoning: false, + 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, + cost: { input: 0.1, output: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "gpt-oss-120b", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.47 }, + limit: { context: 131072, output: 131072 }, + }, + "mistral-nemo-instruct-2407": { + id: "mistral-nemo-instruct-2407", + name: "Mistral-Nemo-Instruct-2407", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-11-20", + last_updated: "2024-11-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.14 }, + limit: { context: 65536, output: 65536 }, + }, + "llama-3.1-8b-instruct": { + id: "llama-3.1-8b-instruct", + name: "Llama-3.1-8B-Instruct", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-06-11", + last_updated: "2025-06-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11, output: 0.11 }, + limit: { context: 131072, output: 131072 }, + }, + }, + }, + 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: { + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-29", + last_updated: "2026-01-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.8 }, + limit: { context: 262144, output: 262144 }, + }, + "zai-org/GLM-5.1": { + id: "zai-org/GLM-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 202752, output: 202752 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3.2, cache_read: 0.5 }, + limit: { context: 202752, output: 202752 }, + }, + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama 3.3 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-08-01", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 0.6 }, + limit: { context: 131072, output: 131072 }, + }, + "meta-llama/Llama-3.1-8B-Instruct": { + id: "meta-llama/Llama-3.1-8B-Instruct", + name: "Llama 3.1 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-08-01", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8000 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 196608, output: 196608 }, + }, + }, + }, + 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: { + "minimax-m2.7": { + id: "minimax-m2.7", + name: "MiniMax-m2.7", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.47, output: 1.4 }, + limit: { context: 202752, output: 196072 }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.09, output: 5.43 }, + limit: { context: 200000, output: 200000 }, + }, + "qwen3-235b-a22b-instruct-2507": { + id: "qwen3-235b-a22b-instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.062, output: 0.408 }, + limit: { context: 131000, output: 131000 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.55, output: 2.76 }, + limit: { context: 256000, output: 256000 }, + }, + "deepseek-v3-0324": { + id: "deepseek-v3-0324", + name: "DeepSeek V3 0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.551, output: 1.654 }, + limit: { context: 128000, output: 128000 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.45, output: 2.23 }, + limit: { context: 198000, output: 198000 }, + }, + "claude-opus4-7": { + id: "claude-opus4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5.6, output: 27.99, cache_read: 0.56, cache_write: 6.99 }, + limit: { context: 1000000, output: 128000 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM 5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1.08, output: 3.44 }, + limit: { context: 202752, output: 202752 }, + }, + "nova-pro-v1": { + id: "nova-pro-v1", + name: "Nova Pro 1.0", + family: "nova-pro", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-12-03", + last_updated: "2024-12-03", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.016, output: 4.061 }, + limit: { context: 300000, output: 5000 }, + }, + "devstral-2512": { + id: "devstral-2512", + name: "Devstral 2 2512", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262000, output: 262000 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-04-29", + last_updated: "2025-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.099, output: 0.33 }, + limit: { context: 16384, output: 16384 }, + }, + "codestral-2508": { + id: "codestral-2508", + name: "Codestral 2508", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-07-30", + last_updated: "2025-07-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.9, cache_read: 0.03 }, + limit: { context: 256000, output: 256000 }, + }, + "claude-4-5-sonnet": { + id: "claude-4-5-sonnet", + name: "Claude 4.5 Sonnet", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3.259, output: 16.296 }, + limit: { context: 200000, output: 200000 }, + }, + "kimi-k2-instruct": { + id: "kimi-k2-instruct", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-07-11", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.551, output: 2.646 }, + limit: { context: 131000, output: 131000 }, + }, + "nemotron-3-super-120b-a12b": { + id: "nemotron-3-super-120b-a12b", + name: "Nemotron 3 Super 120B A12B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-12", + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.266, output: 0.799 }, + limit: { context: 262144, output: 262144 }, + }, + "minimax-m2": { + id: "minimax-m2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-11", + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.39, output: 1.57 }, + limit: { context: 400000, output: 400000 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.654, output: 11.024 }, + limit: { context: 1048576, output: 65535 }, + }, + "claude-opus4-6": { + id: "claude-opus4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5.98, output: 29.89 }, + limit: { context: 1000000, output: 1000000 }, + }, + "devstral-small-2512": { + id: "devstral-small-2512", + name: "Devstral Small 2 2512", + 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", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262000, output: 262000 }, + }, + "minimax-m2.1": { + id: "minimax-m2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.34, output: 1.34 }, + limit: { context: 196000, output: 196000 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.31, output: 4.1, cache_read: 0.24 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-4.5": { + id: "glm-4.5", + name: "GLM 4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-29", + last_updated: "2025-07-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.67, output: 2.46 }, + limit: { context: 131072, output: 131072 }, + }, + "claude-opus4-5": { + id: "claude-opus4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5.98, output: 29.89 }, + limit: { context: 200000, output: 200000 }, + }, + "claude-sonnet-4": { + id: "claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3.307, output: 16.536 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen3-next-80b-a3b-thinking": { + id: "qwen3-next-80b-a3b-thinking", + name: "Qwen3 Next 80B A3B Thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-11", + last_updated: "2025-09-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.164, output: 1.311 }, + limit: { context: 128000, output: 128000 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM 4.5 Air", + family: "glm-air", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-08-01", + last_updated: "2025-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 1.34 }, + limit: { context: 131072, output: 131072 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.81, output: 3.54, cache_read: 0.2 }, + limit: { context: 256000, output: 256000 }, + }, + "qwen3-coder-next": { + id: "qwen3-coder-next", + name: "Qwen3 Coder Next 80B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2026-02-04", + last_updated: "2026-02-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.158, output: 0.84 }, + limit: { context: 256000, output: 65536 }, + }, + "claude-4-6-sonnet": { + id: "claude-4-6-sonnet", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3.59, output: 17.92 }, + limit: { context: 1000000, output: 1000000 }, + }, + "qwen3-coder-480b-a35b-instruct": { + id: "qwen3-coder-480b-a35b-instruct", + name: "Qwen3 Coder 480B A35B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-07-25", + last_updated: "2025-07-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.441, output: 1.984 }, + limit: { context: 262000, output: 262000 }, + }, + "mixtral-8x7B-instruct-v0.1": { + id: "mixtral-8x7B-instruct-v0.1", + name: "Mixtral 8x7B Instruct v0.1", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2023-09", + release_date: "2023-12-11", + last_updated: "2023-12-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.438, output: 0.68 }, + limit: { context: 32000, output: 32000 }, + }, + "hermes-4-70b": { + id: "hermes-4-70b", + name: "Hermes 4 70B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.116, output: 0.358 }, + limit: { context: 128000, output: 128000 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.32, output: 1.18 }, + limit: { context: 196608, output: 196608 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.266, output: 0.444 }, + limit: { context: 163840, output: 163840 }, + }, + "intellect-3": { + id: "intellect-3", + name: "INTELLECT 3", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-26", + last_updated: "2025-11-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.219, output: 1.202 }, + limit: { context: 128000, output: 128000 }, + }, + "glm-4.7-flash": { + id: "glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-04", + release_date: "2025-08-08", + last_updated: "2025-08-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.53 }, + limit: { context: 203000, output: 203000 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT Oss 120b", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-01", + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 128000 }, + }, + "qwen-2.5-72b-instruct": { + id: "qwen-2.5-72b-instruct", + name: "Qwen2.5 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-09-19", + last_updated: "2024-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.062, output: 0.231 }, + limit: { context: 33000, output: 33000 }, + }, + "deepseek-r1-0528": { + id: "deepseek-r1-0528", + name: "DeepSeek R1 0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.585, output: 2.307 }, + limit: { context: 164000, output: 164000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT 4.1", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-04-14", + last_updated: "2025-04-14", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.354, output: 9.417 }, + limit: { context: 1047576, output: 32768 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2025-12", + release_date: "2025-12-08", + last_updated: "2025-12-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.656, output: 2.731 }, + limit: { context: 262000, output: 262000 }, + }, + "llama-3.1-405b-instruct": { + id: "llama-3.1-405b-instruct", + name: "Llama 3.1 405B Instruct", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 128000 }, + }, + "qwen3.5-122b-a10b": { + id: "qwen3.5-122b-a10b", + name: "Qwen3.5 122B A10B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-02-24", + last_updated: "2026-02-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.444, output: 3.106 }, + limit: { context: 262144, output: 262144 }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama 3.3 70B Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.089, output: 0.275 }, + limit: { context: 131000, output: 131000 }, + }, + "mistral-large-2512": { + id: "mistral-large-2512", + name: "Mistral Large 3 2512", + family: "mistral-large", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-12", + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5, cache_read: 0.05 }, + limit: { context: 256000, output: 256000 }, + }, + "qwen3.5-397b-a17b": { + id: "qwen3.5-397b-a17b", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-02-16", + last_updated: "2026-02-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 250000, output: 250000 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.133, output: 0.266, cache_read: 0.028 }, + limit: { context: 1048576, output: 384000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.553, output: 3.106, cache_read: 0.145 }, + limit: { context: 1048576, output: 384000 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3 Coder 30B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.053, output: 0.222 }, + limit: { context: 262000, output: 262000 }, + }, + }, + }, + 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: { + "nex-agi/DeepSeek-V3.1-Nex-N1": { + id: "nex-agi/DeepSeek-V3.1-Nex-N1", + name: "nex-agi/DeepSeek-V3.1-Nex-N1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-01", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 2 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen2.5-VL-72B-Instruct": { + id: "Qwen/Qwen2.5-VL-72B-Instruct", + name: "Qwen/Qwen2.5-VL-72B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-28", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.59, output: 0.59 }, + limit: { context: 131000, output: 4000 }, + }, + "Qwen/Qwen3-VL-32B-Thinking": { + id: "Qwen/Qwen3-VL-32B-Thinking", + name: "Qwen/Qwen3-VL-32B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + 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: false, + cost: { input: 0.2, output: 1.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-30B-A3B-Thinking-2507": { + id: "Qwen/Qwen3-30B-A3B-Thinking-2507", + name: "Qwen/Qwen3-30B-A3B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-31", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.3 }, + limit: { context: 262000, output: 131000 }, + }, + "Qwen/Qwen3-VL-235B-A22B-Thinking": { + id: "Qwen/Qwen3-VL-235B-A22B-Thinking", + name: "Qwen/Qwen3-VL-235B-A22B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.45, output: 3.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-7B-Instruct": { + id: "Qwen/Qwen2.5-7B-Instruct", + name: "Qwen/Qwen2.5-7B-Instruct", + 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: false, + cost: { input: 0.05, output: 0.05 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen2.5-Coder-32B-Instruct": { + id: "Qwen/Qwen2.5-Coder-32B-Instruct", + name: "Qwen/Qwen2.5-Coder-32B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-11-11", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-VL-30B-A3B-Instruct": { + id: "Qwen/Qwen3-VL-30B-A3B-Instruct", + name: "Qwen/Qwen3-VL-30B-A3B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-05", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 1 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/QwQ-32B": { + id: "Qwen/QwQ-32B", + name: "Qwen/QwQ-32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-06", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.58 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-235B-A22B": { + id: "Qwen/Qwen3-235B-A22B", + name: "Qwen/Qwen3-235B-A22B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.35, output: 1.42 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-Omni-30B-A3B-Captioner": { + id: "Qwen/Qwen3-Omni-30B-A3B-Captioner", + name: "Qwen/Qwen3-Omni-30B-A3B-Captioner", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 66000, output: 66000 }, + }, + "Qwen/Qwen3-VL-8B-Thinking": { + id: "Qwen/Qwen3-VL-8B-Thinking", + name: "Qwen/Qwen3-VL-8B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + 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: false, + cost: { input: 0.18, output: 2 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-VL-7B-Instruct": { + id: "Qwen/Qwen2.5-VL-7B-Instruct", + name: "Qwen/Qwen2.5-VL-7B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-28", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.05 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + id: "Qwen/Qwen3-Next-80B-A3B-Instruct", + name: "Qwen/Qwen3-Next-80B-A3B-Instruct", + family: "qwen", + 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: false, + cost: { input: 0.14, output: 1.4 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-8B": { + id: "Qwen/Qwen3-8B", + name: "Qwen/Qwen3-8B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.06, output: 0.06 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen/Qwen3-30B-A3B-Instruct-2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-30", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.3 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen/Qwen3-235B-A22B-Instruct-2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-23", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.09, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-32B": { + id: "Qwen/Qwen3-32B", + name: "Qwen/Qwen3-32B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-Coder-30B-A3B-Instruct": { + id: "Qwen/Qwen3-Coder-30B-A3B-Instruct", + name: "Qwen/Qwen3-Coder-30B-A3B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-01", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-Omni-30B-A3B-Instruct": { + id: "Qwen/Qwen3-Omni-30B-A3B-Instruct", + name: "Qwen/Qwen3-Omni-30B-A3B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 66000, output: 66000 }, + }, + "Qwen/Qwen3-14B": { + id: "Qwen/Qwen3-14B", + name: "Qwen/Qwen3-14B", + family: "qwen", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen2.5-72B-Instruct-128K": { + id: "Qwen/Qwen2.5-72B-Instruct-128K", + name: "Qwen/Qwen2.5-72B-Instruct-128K", + 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: false, + cost: { input: 0.59, output: 0.59 }, + limit: { context: 131000, output: 4000 }, + }, + "Qwen/Qwen2.5-32B-Instruct": { + id: "Qwen/Qwen2.5-32B-Instruct", + name: "Qwen/Qwen2.5-32B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-09-19", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen/Qwen3-235B-A22B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.13, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-Omni-30B-A3B-Thinking": { + id: "Qwen/Qwen3-Omni-30B-A3B-Thinking", + name: "Qwen/Qwen3-Omni-30B-A3B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4 }, + limit: { context: 66000, output: 66000 }, + }, + "Qwen/Qwen2.5-VL-32B-Instruct": { + id: "Qwen/Qwen2.5-VL-32B-Instruct", + name: "Qwen/Qwen2.5-VL-32B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-24", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.27 }, + limit: { context: 131000, output: 131000 }, + }, + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + id: "Qwen/Qwen3-Next-80B-A3B-Thinking", + name: "Qwen/Qwen3-Next-80B-A3B-Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-25", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-235B-A22B-Instruct": { + id: "Qwen/Qwen3-VL-235B-A22B-Instruct", + name: "Qwen/Qwen3-VL-235B-A22B-Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-14B-Instruct": { + id: "Qwen/Qwen2.5-14B-Instruct", + name: "Qwen/Qwen2.5-14B-Instruct", + 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: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 33000, output: 4000 }, + }, + "Qwen/Qwen3-VL-30B-A3B-Thinking": { + id: "Qwen/Qwen3-VL-30B-A3B-Thinking", + name: "Qwen/Qwen3-VL-30B-A3B-Thinking", + family: "qwen", + attachment: true, + reasoning: true, + 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: false, + cost: { input: 0.29, output: 1 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-32B-Instruct": { + id: "Qwen/Qwen3-VL-32B-Instruct", + name: "Qwen/Qwen3-VL-32B-Instruct", + 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: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-VL-8B-Instruct": { + id: "Qwen/Qwen3-VL-8B-Instruct", + name: "Qwen/Qwen3-VL-8B-Instruct", + 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: false, + cost: { input: 0.18, output: 0.68 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + name: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-31", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1 }, + limit: { context: 262000, output: 262000 }, + }, + "Qwen/Qwen2.5-72B-Instruct": { + id: "Qwen/Qwen2.5-72B-Instruct", + name: "Qwen/Qwen2.5-72B-Instruct", + 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: false, + cost: { input: 0.59, output: 0.59 }, + limit: { context: 33000, output: 4000 }, + }, + "stepfun-ai/Step-3.5-Flash": { + id: "stepfun-ai/Step-3.5-Flash", + name: "stepfun-ai/Step-3.5-Flash", + family: "step", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-11", + last_updated: "2026-02-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 262000, output: 262000 }, + }, + "zai-org/GLM-4.5": { + id: "zai-org/GLM-4.5", + name: "zai-org/GLM-4.5", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 131000, output: 131000 }, + }, + "zai-org/GLM-5V-Turbo": { + id: "zai-org/GLM-5V-Turbo", + name: "zai-org/GLM-5V-Turbo", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.2, output: 4, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "zai-org/GLM-4.7": { + id: "zai-org/GLM-4.7", + name: "zai-org/GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 205000, output: 205000 }, + }, + "zai-org/GLM-5.1": { + id: "zai-org/GLM-5.1", + name: "zai-org/GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 4.4, cache_write: 0 }, + limit: { context: 205000, output: 205000 }, + }, + "zai-org/GLM-4.5-Air": { + id: "zai-org/GLM-4.5-Air", + name: "zai-org/GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-28", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.86 }, + limit: { context: 131000, output: 131000 }, + }, + "zai-org/GLM-5": { + id: "zai-org/GLM-5", + name: "zai-org/GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3.2 }, + limit: { context: 205000, output: 205000 }, + }, + "zai-org/GLM-4.6V": { + id: "zai-org/GLM-4.6V", + name: "zai-org/GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-12-07", + last_updated: "2025-12-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 131000, output: 131000 }, + }, + "zai-org/GLM-4.6": { + id: "zai-org/GLM-4.6", + name: "zai-org/GLM-4.6", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-04", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.9 }, + limit: { context: 205000, output: 205000 }, + }, + "zai-org/GLM-4.5V": { + id: "zai-org/GLM-4.5V", + name: "zai-org/GLM-4.5V", + family: "glm", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-13", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.86 }, + limit: { context: 66000, output: 66000 }, + }, + "meta-llama/Meta-Llama-3.1-8B-Instruct": { + id: "meta-llama/Meta-Llama-3.1-8B-Instruct", + name: "meta-llama/Meta-Llama-3.1-8B-Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-23", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.06 }, + limit: { context: 33000, output: 4000 }, + }, + "inclusionAI/Ring-flash-2.0": { + id: "inclusionAI/Ring-flash-2.0", + name: "inclusionAI/Ring-flash-2.0", + family: "ring", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "inclusionAI/Ling-mini-2.0": { + id: "inclusionAI/Ling-mini-2.0", + name: "inclusionAI/Ling-mini-2.0", + family: "ling", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-10", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.28 }, + limit: { context: 131000, output: 131000 }, + }, + "inclusionAI/Ling-flash-2.0": { + id: "inclusionAI/Ling-flash-2.0", + name: "inclusionAI/Ling-flash-2.0", + 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: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "tencent/Hunyuan-A13B-Instruct": { + id: "tencent/Hunyuan-A13B-Instruct", + name: "tencent/Hunyuan-A13B-Instruct", + family: "hunyuan", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-06-30", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "tencent/Hunyuan-MT-7B": { + id: "tencent/Hunyuan-MT-7B", + name: "tencent/Hunyuan-MT-7B", + family: "hunyuan", + 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: false, + cost: { input: 0, output: 0 }, + limit: { context: 33000, output: 33000 }, + }, + "deepseek-ai/DeepSeek-V3.1": { + id: "deepseek-ai/DeepSeek-V3.1", + name: "deepseek-ai/DeepSeek-V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-25", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/deepseek-vl2": { + id: "deepseek-ai/deepseek-vl2", + name: "deepseek-ai/deepseek-vl2", + family: "deepseek", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-12-13", + last_updated: "2025-11-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 4000, output: 4000 }, + }, + "deepseek-ai/DeepSeek-V3": { + id: "deepseek-ai/DeepSeek-V3", + name: "deepseek-ai/DeepSeek-V3", + 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, + cost: { input: 0.25, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { + id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0.18 }, + limit: { context: 131000, output: 131000 }, + }, + "deepseek-ai/DeepSeek-R1": { + id: "deepseek-ai/DeepSeek-R1", + name: "deepseek-ai/DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.18 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { + id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-01-20", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131000, output: 131000 }, + }, + "deepseek-ai/DeepSeek-V3.2-Exp": { + id: "deepseek-ai/DeepSeek-V3.2-Exp", + name: "deepseek-ai/DeepSeek-V3.2-Exp", + family: "deepseek", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.27, output: 0.41 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-V3.2": { + id: "deepseek-ai/DeepSeek-V3.2", + name: "deepseek-ai/DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 0.42 }, + limit: { context: 164000, output: 164000 }, + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + id: "deepseek-ai/DeepSeek-V3.1-Terminus", + name: "deepseek-ai/DeepSeek-V3.1-Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.27, output: 1 }, + limit: { context: 164000, output: 164000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "openai/gpt-oss-20b", + family: "gpt-oss", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-13", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04, output: 0.18 }, + limit: { context: 131000, output: 8000 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "openai/gpt-oss-120b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-13", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.45 }, + limit: { context: 131000, output: 8000 }, + }, + "baidu/ERNIE-4.5-300B-A47B": { + id: "baidu/ERNIE-4.5-300B-A47B", + name: "baidu/ERNIE-4.5-300B-A47B", + family: "ernie", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-02", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.28, output: 1.1 }, + limit: { context: 131000, output: 131000 }, + }, + "THUDM/GLM-Z1-9B-0414": { + id: "THUDM/GLM-Z1-9B-0414", + name: "THUDM/GLM-Z1-9B-0414", + family: "glm-z", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.086, output: 0.086 }, + limit: { context: 131000, output: 131000 }, + }, + "THUDM/GLM-4-9B-0414": { + id: "THUDM/GLM-4-9B-0414", + name: "THUDM/GLM-4-9B-0414", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.086, output: 0.086 }, + limit: { context: 33000, output: 33000 }, + }, + "THUDM/GLM-4-32B-0414": { + id: "THUDM/GLM-4-32B-0414", + name: "THUDM/GLM-4-32B-0414", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.27 }, + limit: { context: 33000, output: 33000 }, + }, + "THUDM/GLM-Z1-32B-0414": { + id: "THUDM/GLM-Z1-32B-0414", + name: "THUDM/GLM-Z1-32B-0414", + family: "glm-z", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-04-18", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.57 }, + limit: { context: 131000, output: 131000 }, + }, + "moonshotai/Kimi-K2-Thinking": { + id: "moonshotai/Kimi-K2-Thinking", + name: "moonshotai/Kimi-K2-Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-11-07", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.55, output: 2.5 }, + limit: { context: 262000, output: 262000 }, + }, + "moonshotai/Kimi-K2.6": { + id: "moonshotai/Kimi-K2.6", + name: "moonshotai/Kimi-K2.6", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262000, output: 262000 }, + }, + "moonshotai/Kimi-K2-Instruct": { + id: "moonshotai/Kimi-K2-Instruct", + name: "moonshotai/Kimi-K2-Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-13", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.58, output: 2.29 }, + limit: { context: 131000, output: 131000 }, + }, + "moonshotai/Kimi-K2-Instruct-0905": { + id: "moonshotai/Kimi-K2-Instruct-0905", + name: "moonshotai/Kimi-K2-Instruct-0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-08", + last_updated: "2025-11-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 262000, output: 262000 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "moonshotai/Kimi-K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.45, output: 2.25 }, + limit: { context: 262000, output: 262000 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMaxAI/MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-02-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 197000, output: 131000 }, + }, + "MiniMaxAI/MiniMax-M2.1": { + id: "MiniMaxAI/MiniMax-M2.1", + name: "MiniMaxAI/MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 197000, output: 131000 }, + }, + "ByteDance-Seed/Seed-OSS-36B-Instruct": { + id: "ByteDance-Seed/Seed-OSS-36B-Instruct", + name: "ByteDance-Seed/Seed-OSS-36B-Instruct", + 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: false, + cost: { input: 0.21, output: 0.57 }, + limit: { context: 262000, output: 262000 }, + }, + }, + }, + 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: { + "alibaba/qwen3-coder-plus": { + id: "alibaba/qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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, + cost: { input: 1, output: 5 }, + limit: { context: 1000000, output: 1000000 }, + }, + "alibaba/qwen3.6-27b": { + id: "alibaba/qwen3.6-27b", + name: "Qwen 3.6 27B", + family: "qwen3.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-22", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 3.5999999999999996 }, + limit: { context: 256000, output: 256000 }, + }, + "alibaba/qwen3-embedding-8b": { + id: "alibaba/qwen3-embedding-8b", + name: "Qwen3 Embedding 8B", + 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: false, + cost: { input: 0.05, output: 0 }, + limit: { context: 32768, output: 32768 }, + }, + "alibaba/qwen-3-30b": { + id: "alibaba/qwen-3-30b", + name: "Qwen3-30B-A3B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.08, output: 0.29 }, + limit: { context: 40960, output: 16384 }, + }, + "alibaba/qwen-3-235b": { + id: "alibaba/qwen-3-235b", + name: "Qwen3 235B A22B Instruct 2507", + 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: false, + cost: { input: 0.13, output: 0.6 }, + limit: { context: 40960, output: 16384 }, + }, + "alibaba/qwen3.5-flash": { + id: "alibaba/qwen3.5-flash", + name: "Qwen 3.5 Flash", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-24", + last_updated: "2026-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.001, cache_write: 0.125 }, + limit: { context: 1000000, output: 64000 }, + }, + "alibaba/qwen3.6-plus": { + id: "alibaba/qwen3.6-plus", + name: "Qwen 3.6 Plus", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 3, cache_read: 0.09999999999999999, cache_write: 0.625 }, + limit: { context: 1000000, output: 64000 }, + }, + "alibaba/qwen3-max": { + id: "alibaba/qwen3-max", + name: "Qwen3 Max", + 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, + cost: { input: 1.2, output: 6 }, + limit: { context: 262144, output: 32768 }, + }, + "alibaba/qwen3-embedding-0.6b": { + id: "alibaba/qwen3-embedding-0.6b", + name: "Qwen3 Embedding 0.6B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-11-14", + last_updated: "2025-11-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.01, output: 0 }, + limit: { context: 32768, output: 32768 }, + }, + "alibaba/qwen-3-32b": { + id: "alibaba/qwen-3-32b", + name: "Qwen 3.32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 40960, output: 16384 }, + }, + "alibaba/qwen-3.6-max-preview": { + id: "alibaba/qwen-3.6-max-preview", + name: "Qwen 3.6 Max Preview", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: true, + cost: { input: 1.3, output: 7.8, cache_read: 0.26, cache_write: 1.625 }, + limit: { context: 240000, output: 64000 }, + }, + "alibaba/qwen3-next-80b-a3b-thinking": { + id: "alibaba/qwen3-next-80b-a3b-thinking", + name: "Qwen3 Next 80B A3B Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-12", + last_updated: "2025-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 1.5 }, + limit: { context: 131072, output: 65536 }, + }, + "alibaba/qwen3-vl-thinking": { + id: "alibaba/qwen3-vl-thinking", + name: "Qwen3 VL Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 8.4 }, + limit: { context: 131072, output: 129024 }, + }, + "alibaba/qwen3-235b-a22b-thinking": { + id: "alibaba/qwen3-235b-a22b-thinking", + name: "Qwen3 235B A22B Thinking 2507", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.9 }, + limit: { context: 262114, output: 262114 }, + }, + "alibaba/qwen3-next-80b-a3b-instruct": { + id: "alibaba/qwen3-next-80b-a3b-instruct", + name: "Qwen3 Next 80B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-12", + last_updated: "2025-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 1.1 }, + limit: { context: 262144, output: 32768 }, + }, + "alibaba/qwen3-coder-next": { + id: "alibaba/qwen3-coder-next", + name: "Qwen3 Coder Next", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-07-22", + last_updated: "2026-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.2 }, + limit: { context: 256000, output: 256000 }, + }, + "alibaba/qwen3-embedding-4b": { + id: "alibaba/qwen3-embedding-4b", + name: "Qwen3 Embedding 4B", + 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: false, + cost: { input: 0.02, output: 0 }, + limit: { context: 32768, output: 32768 }, + }, + "alibaba/qwen3-max-thinking": { + id: "alibaba/qwen3-max-thinking", + name: "Qwen 3 Max Thinking", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01", + last_updated: "2025-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.2, output: 6, cache_read: 0.24 }, + limit: { context: 256000, output: 65536 }, + }, + "alibaba/qwen3-vl-235b-a22b-instruct": { + id: "alibaba/qwen3-vl-235b-a22b-instruct", + name: "Qwen3 VL 235B A22B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-09-24", + last_updated: "2026-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.39999999999999997, output: 1.5999999999999999 }, + limit: { context: 131072, output: 129024 }, + }, + "alibaba/qwen3-coder": { + id: "alibaba/qwen3-coder", + name: "Qwen3 Coder 480B A35B Instruct", + 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: false, + cost: { input: 0.38, output: 1.53 }, + limit: { context: 262144, output: 66536 }, + }, + "alibaba/qwen3-max-preview": { + id: "alibaba/qwen3-max-preview", + name: "Qwen3 Max Preview", + 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, + cost: { input: 1.2, output: 6, cache_read: 0.24 }, + limit: { context: 262144, output: 32768 }, + }, + "alibaba/qwen3.5-plus": { + id: "alibaba/qwen3.5-plus", + name: "Qwen 3.5 Plus", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-16", + last_updated: "2026-02-19", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2.4, cache_read: 0.04, cache_write: 0.5 }, + limit: { context: 1000000, output: 64000 }, + }, + "alibaba/qwen-3-14b": { + id: "alibaba/qwen-3-14b", + name: "Qwen3-14B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.24 }, + limit: { context: 40960, output: 16384 }, + }, + "alibaba/qwen3-vl-instruct": { + id: "alibaba/qwen3-vl-instruct", + name: "Qwen3 VL Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09-24", + last_updated: "2025-09-24", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.8 }, + limit: { context: 131072, output: 129024 }, + }, + "alibaba/qwen3-coder-30b-a3b": { + id: "alibaba/qwen3-coder-30b-a3b", + name: "Qwen 3 Coder 30B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.27 }, + limit: { context: 160000, output: 32768 }, + }, + "perplexity/sonar-pro": { + id: "perplexity/sonar-pro", + name: "Sonar Pro", + family: "sonar-pro", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8000 }, + }, + "perplexity/sonar": { + id: "perplexity/sonar", + name: "Sonar", + 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, + cost: { input: 1, output: 1 }, + limit: { context: 127000, output: 8000 }, + }, + "perplexity/sonar-reasoning": { + id: "perplexity/sonar-reasoning", + name: "Sonar Reasoning", + family: "sonar-reasoning", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-09", + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5 }, + limit: { context: 127000, output: 8000 }, + }, + "perplexity/sonar-reasoning-pro": { + id: "perplexity/sonar-reasoning-pro", + name: "Sonar Reasoning Pro", + family: "sonar-reasoning", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-09", + release_date: "2025-02-19", + last_updated: "2025-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 8 }, + limit: { context: 127000, output: 8000 }, + }, + "deepseek/deepseek-v3.2-thinking": { + id: "deepseek/deepseek-v3.2-thinking", + name: "DeepSeek V3.2 Thinking", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 0.28, output: 0.42, cache_read: 0.03 }, + limit: { context: 128000, output: 64000 }, + }, + "deepseek/deepseek-v3.2-exp": { + id: "deepseek/deepseek-v3.2-exp", + name: "DeepSeek V3.2 Exp", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.27, output: 0.4 }, + limit: { context: 163840, output: 163840 }, + }, + "deepseek/deepseek-v3.1": { + id: "deepseek/deepseek-v3.1", + name: "DeepSeek-V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1 }, + limit: { context: 163840, output: 128000 }, + }, + "deepseek/deepseek-v4-flash": { + id: "deepseek/deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-23", + last_updated: "2026-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek/deepseek-v4-pro": { + id: "deepseek/deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-23", + last_updated: "2026-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1000000, output: 384000 }, + }, + "deepseek/deepseek-v3.2": { + id: "deepseek/deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: false, + 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: false, + cost: { input: 0.27, output: 0.4, cache_read: 0.22 }, + limit: { context: 163842, output: 8000 }, + }, + "deepseek/deepseek-v3": { + id: "deepseek/deepseek-v3", + name: "DeepSeek V3 0324", + 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: false, + cost: { input: 0.77, output: 0.77 }, + limit: { context: 163840, output: 16384 }, + }, + "deepseek/deepseek-v3.1-terminus": { + id: "deepseek/deepseek-v3.1-terminus", + name: "DeepSeek V3.1 Terminus", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-22", + last_updated: "2025-09-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1 }, + limit: { context: 131072, output: 65536 }, + }, + "deepseek/deepseek-r1": { + id: "deepseek/deepseek-r1", + name: "DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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: false, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 128000, output: 32768 }, + }, + "arcee-ai/trinity-mini": { + id: "arcee-ai/trinity-mini", + name: "Trinity Mini", + family: "trinity", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12", + last_updated: "2025-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.15 }, + limit: { context: 131072, output: 131072 }, + }, + "arcee-ai/trinity-large-thinking": { + id: "arcee-ai/trinity-large-thinking", + name: "Trinity Large Thinking", + family: "trinity", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 0.8999999999999999 }, + limit: { context: 262100, output: 80000 }, + }, + "arcee-ai/trinity-large-preview": { + id: "arcee-ai/trinity-large-preview", + name: "Trinity Large Preview", + family: "trinity", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-01", + last_updated: "2025-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1 }, + limit: { context: 131000, output: 131000 }, + }, + "recraft/recraft-v3": { + id: "recraft/recraft-v3", + name: "Recraft V3", + family: "recraft", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-10", + last_updated: "2024-10", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + "recraft/recraft-v2": { + id: "recraft/recraft-v2", + name: "Recraft V2", + family: "recraft", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-03", + last_updated: "2024-03", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + "voyage/voyage-3-large": { + id: "voyage/voyage-3-large", + name: "voyage-3-large", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "voyage/voyage-4-large": { + id: "voyage/voyage-4-large", + name: "voyage-4-large", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-06", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 32000, output: 0 }, + }, + "voyage/voyage-3.5-lite": { + id: "voyage/voyage-3.5-lite", + name: "voyage-3.5-lite", + 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, + cost: { input: 0.02, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "voyage/voyage-code-3": { + id: "voyage/voyage-code-3", + name: "voyage-code-3", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.18, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "voyage/voyage-finance-2": { + id: "voyage/voyage-finance-2", + name: "voyage-finance-2", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-03", + last_updated: "2024-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "voyage/voyage-4-lite": { + id: "voyage/voyage-4-lite", + name: "voyage-4-lite", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-06", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 32000, output: 0 }, + }, + "voyage/voyage-4": { + id: "voyage/voyage-4", + name: "voyage-4", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-06", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 32000, output: 0 }, + }, + "voyage/voyage-code-2": { + id: "voyage/voyage-code-2", + name: "voyage-code-2", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-01", + last_updated: "2024-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "voyage/voyage-law-2": { + id: "voyage/voyage-law-2", + name: "voyage-law-2", + family: "voyage", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-03", + last_updated: "2024-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.12, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "voyage/voyage-3.5": { + id: "voyage/voyage-3.5", + name: "voyage-3.5", + 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, + cost: { input: 0.06, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "morph/morph-v3-large": { + id: "morph/morph-v3-large", + name: "Morph v3 Large", + family: "morph", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-08-15", + last_updated: "2024-08-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.9, output: 1.9 }, + limit: { context: 32000, output: 32000 }, + }, + "morph/morph-v3-fast": { + id: "morph/morph-v3-fast", + name: "Morph v3 Fast", + family: "morph", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-08-15", + last_updated: "2024-08-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 1.2 }, + limit: { context: 16000, output: 16000 }, + }, + "zai/glm-5v-turbo": { + id: "zai/glm-5v-turbo", + name: "GLM 5V Turbo", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 4, cache_read: 0.24 }, + limit: { context: 200000, output: 128000 }, + }, + "zai/glm-4.7": { + id: "zai/glm-4.7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-22", + last_updated: "2025-12-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.43, output: 1.75, cache_read: 0.08 }, + limit: { context: 202752, output: 120000 }, + }, + "zai/glm-5": { + id: "zai/glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3.2, cache_read: 0.2 }, + limit: { context: 202800, output: 131072 }, + }, + "zai/glm-4.7-flashx": { + id: "zai/glm-4.7-flashx", + name: "GLM 4.7 FlashX", + family: "glm-flash", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-01", + last_updated: "2025-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.06, output: 0.4, cache_read: 0.01 }, + limit: { context: 200000, output: 128000 }, + }, + "zai/glm-5.1": { + id: "zai/glm-5.1", + name: "GLM 5.1", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-07", + last_updated: "2026-04-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.4, output: 4.4, cache_read: 0.26 }, + limit: { context: 202752, output: 202752 }, + }, + "zai/glm-4.6v-flash": { + id: "zai/glm-4.6v-flash", + name: "GLM-4.6V-Flash", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 24000 }, + }, + "zai/glm-4.5": { + id: "zai/glm-4.5", + name: "GLM 4.5", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-28", + last_updated: "2025-07-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 131072, output: 131072 }, + }, + "zai/glm-4.5-air": { + id: "zai/glm-4.5-air", + name: "GLM 4.5 Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 128000, output: 96000 }, + }, + "zai/glm-5-turbo": { + id: "zai/glm-5-turbo", + name: "GLM 5 Turbo", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.2, output: 4, cache_read: 0.24 }, + limit: { context: 202800, output: 131100 }, + }, + "zai/glm-4.5v": { + id: "zai/glm-4.5v", + name: "GLM 4.5V", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-11", + last_updated: "2025-08-11", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 66000, output: 66000 }, + }, + "zai/glm-4.6": { + id: "zai/glm-4.6", + name: "GLM 4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.45, output: 1.8 }, + limit: { context: 200000, output: 96000 }, + }, + "zai/glm-4.6v": { + id: "zai/glm-4.6v", + name: "GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-30", + last_updated: "2025-09-30", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.9, cache_read: 0.05 }, + limit: { context: 128000, output: 24000 }, + }, + "zai/glm-4.7-flash": { + id: "zai/glm-4.7-flash", + name: "GLM 4.7 Flash", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-13", + last_updated: "2026-03-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.07, output: 0.39999999999999997 }, + limit: { context: 200000, output: 131000 }, + }, + "cohere/command-a": { + id: "cohere/command-a", + name: "Command A", + family: "command", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, output: 8000 }, + }, + "cohere/embed-v4.0": { + id: "cohere/embed-v4.0", + name: "Embed v4.0", + 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, + cost: { input: 0.12, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "prime-intellect/intellect-3": { + id: "prime-intellect/intellect-3", + name: "INTELLECT 3", + family: "intellect", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-11-26", + last_updated: "2025-11-26", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 131072, output: 131072 }, + }, + "xai/grok-4.3": { + id: "xai/grok-4.3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-30", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 2.5, cache_read: 0.19999999999999998 }, + limit: { context: 1000000, output: 1000000 }, + }, + "xai/grok-4.20-non-reasoning": { + id: "xai/grok-4.20-non-reasoning", + name: "Grok 4.20 Non-Reasoning", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-09", + last_updated: "2026-03-23", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.19999999999999998 }, + limit: { context: 2000000, output: 2000000 }, + }, + "xai/grok-4.20-non-reasoning-beta": { + id: "xai/grok-4.20-non-reasoning-beta", + name: "Grok 4.20 Beta Non-Reasoning", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.19999999999999998 }, + limit: { context: 2000000, output: 2000000 }, + }, + "xai/grok-4.20-reasoning": { + id: "xai/grok-4.20-reasoning", + name: "Grok 4.20 Reasoning", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-09", + last_updated: "2026-03-23", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.19999999999999998 }, + limit: { context: 2000000, output: 2000000 }, + }, + "xai/grok-imagine-image": { + id: "xai/grok-imagine-image", + name: "Grok Imagine Image", + family: "grok", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-01-28", + last_updated: "2026-02-19", + modalities: { input: ["text"], output: ["text", "image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "xai/grok-4.20-multi-agent-beta": { + id: "xai/grok-4.20-multi-agent-beta", + name: "Grok 4.20 Multi Agent Beta", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.19999999999999998 }, + limit: { context: 2000000, output: 2000000 }, + }, + "xai/grok-imagine-image-pro": { + id: "xai/grok-imagine-image-pro", + name: "Grok Imagine Image Pro", + family: "grok", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-01-28", + last_updated: "2026-02-19", + modalities: { input: ["text"], output: ["text", "image"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "xai/grok-4-fast-reasoning": { + id: "xai/grok-4-fast-reasoning", + name: "Grok 4 Fast Reasoning", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 256000 }, + }, + "xai/grok-4.1-fast-non-reasoning": { + id: "xai/grok-4.1-fast-non-reasoning", + name: "Grok 4.1 Fast Non-Reasoning", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "xai/grok-4.20-reasoning-beta": { + id: "xai/grok-4.20-reasoning-beta", + name: "Grok 4.20 Beta Reasoning", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-13", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.19999999999999998 }, + limit: { context: 2000000, output: 2000000 }, + }, + "xai/grok-4.20-multi-agent": { + id: "xai/grok-4.20-multi-agent", + name: "Grok 4.20 Multi-Agent", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-09", + last_updated: "2026-03-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.19999999999999998 }, + limit: { context: 2000000, output: 2000000 }, + }, + "xai/grok-4.1-fast-reasoning": { + id: "xai/grok-4.1-fast-reasoning", + name: "Grok 4.1 Fast Reasoning", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "xai/grok-4-fast-non-reasoning": { + id: "xai/grok-4-fast-non-reasoning", + name: "Grok 4 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "xai/grok-3": { + id: "xai/grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "xai/grok-3-mini": { + id: "xai/grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, reasoning: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 8192 }, + }, + "xai/grok-2-vision": { + id: "xai/grok-2-vision", + name: "Grok 2 Vision", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 10, cache_read: 2 }, + limit: { context: 8192, output: 4096 }, + }, + "xai/grok-4": { + id: "xai/grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, reasoning: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 64000 }, + }, + "xai/grok-code-fast-1": { + id: "xai/grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "xai/grok-3-fast": { + id: "xai/grok-3-fast", + name: "Grok 3 Fast", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 1.25 }, + limit: { context: 131072, output: 8192 }, + }, + "xai/grok-3-mini-fast": { + id: "xai/grok-3-mini-fast", + name: "Grok 3 Mini Fast", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 4, reasoning: 4, cache_read: 0.15 }, + limit: { context: 131072, output: 8192 }, + }, + "nvidia/nemotron-3-super-120b-a12b": { + id: "nvidia/nemotron-3-super-120b-a12b", + name: "NVIDIA Nemotron 3 Super 120B A12B", + family: "nemotron", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.65 }, + limit: { context: 256000, output: 32000 }, + }, + "nvidia/nemotron-3-nano-30b-a3b": { + id: "nvidia/nemotron-3-nano-30b-a3b", + name: "Nemotron 3 Nano 30B A3B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12", + last_updated: "2024-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.24 }, + limit: { context: 262144, output: 262144 }, + }, + "nvidia/nemotron-nano-12b-v2-vl": { + id: "nvidia/nemotron-nano-12b-v2-vl", + name: "Nvidia Nemotron Nano 12B V2 VL", + family: "nemotron", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12", + last_updated: "2024-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 131072, output: 131072 }, + }, + "nvidia/nemotron-nano-9b-v2": { + id: "nvidia/nemotron-nano-9b-v2", + name: "Nvidia Nemotron Nano 9B V2", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-18", + last_updated: "2025-08-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04, output: 0.16 }, + limit: { context: 131072, output: 131072 }, + }, + "inception/mercury-edit-2": { + id: "inception/mercury-edit-2", + name: "Mercury Edit 2", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-30", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75, cache_read: 0.025 }, + limit: { context: 128000, output: 8192 }, + }, + "inception/mercury-2": { + id: "inception/mercury-2", + name: "Mercury 2", + family: "mercury", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-24", + last_updated: "2026-03-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 0.75, cache_read: 0.024999999999999998 }, + limit: { context: 128000, output: 128000 }, + }, + "inception/mercury-coder-small": { + id: "inception/mercury-coder-small", + name: "Mercury Coder Small Beta", + family: "mercury", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-02-26", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1 }, + limit: { context: 32000, output: 16384 }, + }, + "openai/gpt-5.1-codex-max": { + id: "openai/gpt-5.1-codex-max", + name: "GPT 5.1 Codex Max", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.2-chat": { + id: "openai/gpt-5.2-chat", + name: "GPT-5.2 Chat", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.18 }, + limit: { context: 128000, input: 111616, output: 16384 }, + }, + "openai/gpt-4o-mini-search-preview": { + id: "openai/gpt-4o-mini-search-preview", + name: "GPT 4o Mini Search Preview", + family: "gpt-mini", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + knowledge: "2023-09", + release_date: "2025-01", + last_updated: "2025-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, input: 111616, output: 16384 }, + }, + "openai/codex-mini": { + id: "openai/codex-mini", + name: "Codex Mini", + family: "gpt-codex-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-16", + last_updated: "2025-05-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 6, cache_read: 0.38 }, + limit: { context: 200000, input: 100000, output: 100000 }, + }, + "openai/gpt-5-chat": { + id: "openai/gpt-5-chat", + name: "GPT-5 Chat", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 128000, input: 111616, output: 16384 }, + }, + "openai/gpt-5.3-chat": { + id: "openai/gpt-5.3-chat", + name: "GPT-5.3 Chat", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-03", + last_updated: "2026-03-06", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, input: 111616, output: 16384 }, + }, + "openai/gpt-5.2-pro": { + id: "openai/gpt-5.2-pro", + name: "GPT 5.2 ", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 21, output: 168 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/text-embedding-3-large": { + id: "openai/text-embedding-3-large", + name: "text-embedding-3-large", + 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, + cost: { input: 0.13, output: 0 }, + limit: { context: 8192, input: 6656, output: 1536 }, + }, + "openai/gpt-5.5": { + id: "openai/gpt-5.5", + name: "GPT 5.5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 30, cache_read: 0.5 }, + limit: { context: 1000000, input: 872000, output: 128000 }, + }, + "openai/gpt-5.3-codex": { + id: "openai/gpt-5.3-codex", + name: "GPT 5.3 Codex", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-24", + last_updated: "2026-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/text-embedding-ada-002": { + id: "openai/text-embedding-ada-002", + name: "text-embedding-ada-002", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 8192, input: 6656, output: 1536 }, + }, + "openai/gpt-5.2": { + id: "openai/gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.18 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/o3-pro": { + id: "openai/o3-pro", + name: "o3 Pro", + family: "o-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-10", + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 20, output: 80 }, + limit: { context: 200000, input: 100000, output: 100000 }, + }, + "openai/gpt-5.4-mini": { + id: "openai/gpt-5.4-mini", + name: "GPT 5.4 Mini", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-17", + last_updated: "2026-03-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.4-nano": { + id: "openai/gpt-5.4-nano", + name: "GPT 5.4 Nano", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-17", + last_updated: "2026-03-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.19999999999999998, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.2-codex": { + id: "openai/gpt-5.2-codex", + name: "GPT-5.2-Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12", + last_updated: "2025-12", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.1-codex-mini": { + id: "openai/gpt-5.1-codex-mini", + name: "GPT-5.1 Codex mini", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-16", + last_updated: "2025-05-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.03 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.1-thinking": { + id: "openai/gpt-5.1-thinking", + name: "GPT 5.1 Thinking", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5.4-pro": { + id: "openai/gpt-5.4-pro", + name: "GPT 5.4 Pro", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-05", + last_updated: "2026-03-06", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 180 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-3.5-turbo": { + id: "openai/gpt-3.5-turbo", + name: "GPT-3.5 Turbo", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2021-09", + release_date: "2023-03-01", + last_updated: "2023-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 16385, input: 12289, output: 4096 }, + }, + "openai/o3-deep-research": { + id: "openai/o3-deep-research", + name: "o3-deep-research", + family: "o", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-10", + release_date: "2024-06-26", + last_updated: "2024-06-26", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 10, output: 40, cache_read: 2.5 }, + limit: { context: 200000, input: 100000, output: 100000 }, + }, + "openai/text-embedding-3-small": { + id: "openai/text-embedding-3-small", + name: "text-embedding-3-small", + 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, + cost: { input: 0.02, output: 0 }, + limit: { context: 8192, input: 6656, output: 1536 }, + }, + "openai/gpt-5.4": { + id: "openai/gpt-5.4", + name: "GPT 5.4", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-05", + last_updated: "2026-03-06", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.3 }, + limit: { context: 131072, input: 98304, output: 32768 }, + }, + "openai/gpt-5-pro": { + id: "openai/gpt-5-pro", + name: "GPT-5 pro", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 15, output: 120 }, + limit: { context: 400000, input: 128000, output: 272000 }, + }, + "openai/gpt-oss-safeguard-20b": { + id: "openai/gpt-oss-safeguard-20b", + name: "gpt-oss-safeguard-20b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.08, output: 0.3, cache_read: 0.04 }, + limit: { context: 131072, input: 65536, output: 65536 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 131072, output: 131072 }, + }, + "openai/gpt-5.5-pro": { + id: "openai/gpt-5.5-pro", + name: "GPT 5.5 Pro", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 180 }, + limit: { context: 1000000, input: 872000, output: 128000 }, + }, + "openai/gpt-3.5-turbo-instruct": { + id: "openai/gpt-3.5-turbo-instruct", + name: "GPT-3.5 Turbo Instruct", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2021-09", + release_date: "2023-03-01", + last_updated: "2023-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 2 }, + limit: { context: 8192, input: 4096, output: 4096 }, + }, + "openai/gpt-5.1-instant": { + id: "openai/gpt-5.1-instant", + name: "GPT-5.1 Instant", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 128000, input: 111616, output: 16384 }, + }, + "openai/gpt-5.1-codex": { + id: "openai/gpt-5.1-codex", + name: "GPT-5.1-Codex", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "GPT-4.1 mini", + 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, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-4o": { + id: "openai/gpt-4o", + name: "GPT-4o", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o3": { + id: "openai/o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4.1-nano": { + id: "openai/gpt-4.1-nano", + name: "GPT-4.1 nano", + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.03 }, + limit: { context: 1047576, output: 32768 }, + }, + "openai/gpt-5-codex": { + id: "openai/gpt-5-codex", + name: "GPT-5-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/o3-mini": { + id: "openai/o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o1": { + id: "openai/o1", + name: "o1", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o mini", + 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, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4-turbo": { + id: "openai/gpt-4-turbo", + name: "GPT-4 Turbo", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "amazon/titan-embed-text-v2": { + id: "amazon/titan-embed-text-v2", + name: "Titan Text Embeddings V2", + family: "titan-embed", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-04", + last_updated: "2024-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.02, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "amazon/nova-2-lite": { + id: "amazon/nova-2-lite", + name: "Nova 2 Lite", + family: "nova", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-01", + last_updated: "2024-12-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 1000000, output: 1000000 }, + }, + "amazon/nova-pro": { + id: "amazon/nova-pro", + name: "Nova Pro", + 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, + cost: { input: 0.8, output: 3.2, cache_read: 0.2 }, + limit: { context: 300000, output: 8192 }, + }, + "amazon/nova-lite": { + id: "amazon/nova-lite", + name: "Nova Lite", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.06, output: 0.24, cache_read: 0.015 }, + limit: { context: 300000, output: 8192 }, + }, + "amazon/nova-micro": { + id: "amazon/nova-micro", + name: "Nova Micro", + 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, + cost: { input: 0.035, output: 0.14, cache_read: 0.00875 }, + limit: { context: 128000, output: 8192 }, + }, + "mistral/mistral-nemo": { + id: "mistral/mistral-nemo", + name: "Mistral Nemo", + family: "mistral-nemo", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.04, output: 0.17 }, + limit: { context: 60288, output: 16000 }, + }, + "mistral/ministral-14b": { + id: "mistral/ministral-14b", + name: "Ministral 14B", + family: "ministral", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 256000, output: 256000 }, + }, + "mistral/codestral-embed": { + id: "mistral/codestral-embed", + name: "Codestral Embed", + 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, + cost: { input: 0.15, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "mistral/mistral-medium": { + id: "mistral/mistral-medium", + name: "Mistral Medium 3.1", + family: "mistral-medium", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2 }, + limit: { context: 128000, output: 64000 }, + }, + "mistral/mistral-embed": { + id: "mistral/mistral-embed", + name: "Mistral Embed", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "mistral/devstral-2": { + id: "mistral/devstral-2", + name: "Devstral 2", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-09", + last_updated: "2025-12-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 256000 }, + }, + "mistral/mistral-large-3": { + id: "mistral/mistral-large-3", + name: "Mistral Large 3", + family: "mistral-large", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-02", + last_updated: "2025-12-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 256000, output: 256000 }, + }, + "mistral/devstral-small-2": { + id: "mistral/devstral-small-2", + name: "Devstral Small 2", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 256000 }, + }, + "mistral/devstral-small": { + id: "mistral/devstral-small", + name: "Devstral Small 1.1", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-07", + last_updated: "2025-05-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 64000 }, + }, + "mistral/ministral-8b": { + id: "mistral/ministral-8b", + name: "Ministral 8B (latest)", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral/magistral-medium": { + id: "mistral/magistral-medium", + name: "Magistral Medium (latest)", + family: "magistral-medium", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 2, output: 5 }, + limit: { context: 128000, output: 16384 }, + }, + "mistral/mistral-small": { + id: "mistral/mistral-small", + name: "Mistral Small (latest)", + family: "mistral-small", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 256000, output: 256000 }, + }, + "mistral/magistral-small": { + id: "mistral/magistral-small", + name: "Magistral Small", + family: "magistral-small", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-06", + release_date: "2025-03-17", + last_updated: "2025-03-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral/pixtral-12b": { + id: "mistral/pixtral-12b", + name: "Pixtral 12B", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral/mixtral-8x22b-instruct": { + id: "mistral/mixtral-8x22b-instruct", + name: "Mixtral 8x22B", + family: "mixtral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-04-17", + last_updated: "2024-04-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2, output: 6 }, + limit: { context: 64000, output: 64000 }, + }, + "mistral/pixtral-large": { + id: "mistral/pixtral-large", + name: "Pixtral Large (latest)", + 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, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral/ministral-3b": { + id: "mistral/ministral-3b", + name: "Ministral 3B (latest)", + family: "ministral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 128000, output: 128000 }, + }, + "mistral/codestral": { + id: "mistral/codestral", + name: "Codestral (latest)", + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 4096 }, + }, + "meta/llama-3.2-1b": { + id: "meta/llama-3.2-1b", + name: "Llama 3.2 1B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/llama-3.1-8b": { + id: "meta/llama-3.1-8b", + name: "Llama 3.1 8B Instruct", + 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: false, + cost: { input: 0.03, output: 0.05 }, + limit: { context: 131072, output: 16384 }, + }, + "meta/llama-3.2-90b": { + id: "meta/llama-3.2-90b", + name: "Llama 3.2 90B Vision Instruct", + 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: false, + cost: { input: 0.72, output: 0.72 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/llama-3.2-3b": { + id: "meta/llama-3.2-3b", + name: "Llama 3.2 3B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/llama-3.2-11b": { + id: "meta/llama-3.2-11b", + name: "Llama 3.2 11B Vision Instruct", + 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: false, + cost: { input: 0.16, output: 0.16 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/llama-3.1-70b": { + id: "meta/llama-3.1-70b", + name: "Llama 3.1 70B Instruct", + 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: false, + cost: { input: 0.4, output: 0.4 }, + limit: { context: 131072, output: 16384 }, + }, + "meta/llama-3.3-70b": { + id: "meta/llama-3.3-70b", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-4-maverick": { + id: "meta/llama-4-maverick", + name: "Llama-4-Maverick-17B-128E-Instruct-FP8", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "meta/llama-4-scout": { + id: "meta/llama-4-scout", + name: "Llama-4-Scout-17B-16E-Instruct-FP8", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "vercel/v0-1.5-md": { + id: "vercel/v0-1.5-md", + name: "v0-1.5-md", + family: "v0", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-09", + last_updated: "2025-06-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, output: 32000 }, + }, + "vercel/v0-1.0-md": { + id: "vercel/v0-1.0-md", + name: "v0-1.0-md", + family: "v0", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-05-22", + last_updated: "2025-05-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 128000, output: 32000 }, + }, + "minimax/minimax-m2.7": { + id: "minimax/minimax-m2.7", + name: "Minimax M2.7", + family: "minimax", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131000 }, + }, + "minimax/minimax-m2.7-highspeed": { + id: "minimax/minimax-m2.7-highspeed", + name: "MiniMax M2.7 High Speed", + family: "minimax", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131100 }, + }, + "minimax/minimax-m2": { + id: "minimax/minimax-m2", + name: "MiniMax M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 1.15, cache_read: 0.03, cache_write: 0.38 }, + limit: { context: 262114, output: 262114 }, + }, + "minimax/minimax-m2.1": { + id: "minimax/minimax-m2.1", + name: "MiniMax M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.38 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2.1-lightning": { + id: "minimax/minimax-m2.1-lightning", + name: "MiniMax M2.1 Lightning", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.4, cache_read: 0.03, cache_write: 0.38 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 204800, output: 131000 }, + }, + "minimax/minimax-m2.5-highspeed": { + id: "minimax/minimax-m2.5-highspeed", + name: "MiniMax M2.5 High Speed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-03-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.4, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 0, output: 0 }, + }, + "kwaipilot/kat-coder-pro-v1": { + id: "kwaipilot/kat-coder-pro-v1", + name: "KAT-Coder-Pro V1", + family: "kat-coder", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-10-24", + last_updated: "2025-10-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 256000, output: 32000 }, + }, + "kwaipilot/kat-coder-pro-v2": { + id: "kwaipilot/kat-coder-pro-v2", + name: "Kat Coder Pro V2", + family: "kat-coder", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 256000, output: 256000 }, + }, + "google/gemini-2.5-flash-lite-preview-09-2025": { + id: "google/gemini-2.5-flash-lite-preview-09-2025", + name: "Gemini 2.5 Flash Lite Preview 09-25", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.01 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-3.1-flash-lite-preview": { + id: "google/gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-03", + last_updated: "2026-03-06", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1000000, output: 65000 }, + }, + "google/gemini-3-pro-image": { + id: "google/gemini-3-pro-image", + name: "Nano Banana Pro (Gemini 3 Pro Image)", + family: "gemini-pro", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-03", + release_date: "2025-09", + last_updated: "2025-09", + modalities: { input: ["text"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 2, output: 120 }, + limit: { context: 65536, output: 32768 }, + }, + "google/gemini-3.1-pro-preview": { + id: "google/gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-19", + last_updated: "2026-02-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 12, cache_read: 0.2 }, + limit: { context: 1000000, output: 64000 }, + }, + "google/gemini-3-pro-preview": { + id: "google/gemini-3-pro-preview", + name: "Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1000000, output: 64000 }, + }, + "google/imagen-4.0-ultra-generate-001": { + id: "google/imagen-4.0-ultra-generate-001", + name: "Imagen 4 Ultra", + family: "imagen", + attachment: false, + reasoning: false, + tool_call: false, + 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 }, + }, + "google/gemini-embedding-001": { + id: "google/gemini-embedding-001", + name: "Gemini Embedding 001", + family: "gemini-embedding", + 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, + cost: { input: 0.15, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "google/gemma-4-31b-it": { + id: "google/gemma-4-31b-it", + name: "Gemma 4 31B IT", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.39999999999999997 }, + limit: { context: 262144, output: 131072 }, + }, + "google/gemini-2.5-flash-image": { + id: "google/gemini-2.5-flash-image", + name: "Nano Banana (Gemini 2.5 Flash Image)", + family: "gemini-flash", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-03-20", + modalities: { input: ["text"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 32768, output: 32768 }, + }, + "google/text-embedding-005": { + id: "google/text-embedding-005", + name: "Text Embedding 005", + family: "text-embedding", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-08", + last_updated: "2024-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.03, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "google/text-multilingual-embedding-002": { + id: "google/text-multilingual-embedding-002", + name: "Text Multilingual Embedding 002", + family: "text-embedding", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-03", + last_updated: "2024-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.03, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "google/gemini-3.1-flash-image-preview": { + id: "google/gemini-3.1-flash-image-preview", + name: "Gemini 3.1 Flash Image Preview (Nano Banana 2)", + family: "gemini", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-02-26", + last_updated: "2026-03-06", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.5, output: 3 }, + limit: { context: 131072, output: 32768 }, + }, + "google/gemini-3.1-flash-lite": { + id: "google/gemini-3.1-flash-lite", + name: "Gemini 3.1 Flash Lite", + family: "gemini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-05-07", + last_updated: "2026-05-08", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 1.5, cache_read: 0.03 }, + limit: { context: 1000000, output: 65000 }, + }, + "google/gemini-3-flash": { + id: "google/gemini-3-flash", + name: "Gemini 3 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.5, output: 3, cache_read: 0.05 }, + limit: { context: 1000000, output: 64000 }, + }, + "google/imagen-4.0-generate-001": { + id: "google/imagen-4.0-generate-001", + name: "Imagen 4", + family: "imagen", + attachment: false, + reasoning: false, + tool_call: false, + 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-2.5-flash-preview-09-2025": { + id: "google/gemini-2.5-flash-preview-09-2025", + name: "Gemini 2.5 Flash Preview 09-25", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.03, cache_write: 0.383 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-embedding-2": { + id: "google/gemini-embedding-2", + name: "Gemini Embedding 2", + family: "gemini-embedding", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2026-03-10", + last_updated: "2026-03-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 0, output: 0 }, + }, + "google/gemma-4-26b-a4b-it": { + id: "google/gemma-4-26b-a4b-it", + name: "Gemma 4 26B A4B IT", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-02", + last_updated: "2026-04-03", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.13, output: 0.39999999999999997 }, + limit: { context: 262144, output: 131072 }, + }, + "google/imagen-4.0-fast-generate-001": { + id: "google/imagen-4.0-fast-generate-001", + name: "Imagen 4 Fast", + family: "imagen", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-06", + last_updated: "2025-06", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 480, output: 0 }, + }, + "google/gemini-2.5-flash-lite": { + id: "google/gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.01 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-flash-image-preview": { + id: "google/gemini-2.5-flash-image-preview", + name: "Nano Banana Preview (Gemini 2.5 Flash Image Preview)", + family: "gemini-flash", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-03-20", + modalities: { input: ["text"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5 }, + limit: { context: 32768, output: 32768 }, + }, + "google/gemini-2.0-flash-lite": { + id: "google/gemini-2.0-flash-lite", + name: "Gemini 2.0 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 1048576, output: 8192 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.03, input_audio: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.125, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.0-flash": { + id: "google/gemini-2.0-flash", + name: "Gemini 2.0 Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 8192 }, + }, + "moonshotai/kimi-k2-turbo": { + id: "moonshotai/kimi-k2-turbo", + name: "Kimi K2 Turbo", + family: "kimi", + 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: false, + cost: { input: 2.4, output: 10 }, + limit: { context: 256000, output: 16384 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-01-26", + last_updated: "2026-01-26", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.2 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/kimi-k2-thinking-turbo": { + id: "moonshotai/kimi-k2-thinking-turbo", + name: "Kimi K2 Thinking Turbo", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-08", + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.15, output: 8, cache_read: 0.15 }, + limit: { context: 262114, output: 262114 }, + }, + "moonshotai/kimi-k2-0905": { + id: "moonshotai/kimi-k2-0905", + name: "Kimi K2 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 131072, output: 16384 }, + }, + "moonshotai/kimi-k2.6": { + id: "moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-24", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262000, output: 262000 }, + }, + "moonshotai/kimi-k2-thinking": { + id: "moonshotai/kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-08", + release_date: "2025-11-06", + last_updated: "2025-11-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.47, output: 2, cache_read: 0.14 }, + limit: { context: 216144, output: 216144 }, + }, + "moonshotai/kimi-k2": { + id: "moonshotai/kimi-k2", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-14", + last_updated: "2025-07-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 131072, output: 16384 }, + status: "deprecated", + }, + "interfaze/interfaze-beta": { + id: "interfaze/interfaze-beta", + name: "Interfaze Beta", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2025-10-07", + last_updated: "2026-04-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 3.5 }, + limit: { context: 1000000, output: 32000 }, + }, + "anthropic/claude-3.5-sonnet-20240620": { + id: "anthropic/claude-3.5-sonnet-20240620", + name: "Claude 3.5 Sonnet (2024-06-20)", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-06-20", + last_updated: "2024-06-20", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-opus-4.6": { + id: "anthropic/claude-opus-4.6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02", + last_updated: "2026-02", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.7": { + id: "anthropic/claude-opus-4.7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + release_date: "2026-04-16", + last_updated: "2026-04-16", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-opus-4.5": { + id: "anthropic/claude-opus-4.5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 18.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-haiku-4.5": { + id: "anthropic/claude-haiku-4.5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4.6": { + id: "anthropic/claude-sonnet-4.6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 1000000, output: 128000 }, + }, + "anthropic/claude-3-opus": { + id: "anthropic/claude-3-opus", + name: "Claude Opus 3", + family: "claude-opus", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-02-29", + last_updated: "2024-02-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic/claude-3.5-haiku": { + id: "anthropic/claude-3.5-haiku", + name: "Claude Haiku 3.5", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-opus-4": { + id: "anthropic/claude-opus-4", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-3-haiku": { + id: "anthropic/claude-3-haiku", + name: "Claude Haiku 3", + 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, + cost: { input: 0.25, output: 1.25, cache_read: 0.03, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "anthropic/claude-sonnet-4.5": { + id: "anthropic/claude-sonnet-4.5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-3.5-sonnet": { + id: "anthropic/claude-3.5-sonnet", + name: "Claude Sonnet 3.5 v2", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "anthropic/claude-3.7-sonnet": { + id: "anthropic/claude-3.7-sonnet", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "anthropic/claude-opus-4.1": { + id: "anthropic/claude-opus-4.1", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "xiaomi/mimo-v2.5-pro": { + id: "xiaomi/mimo-v2.5-pro", + name: "MiMo V2.5 Pro", + family: "mimo-v2.5-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-22", + last_updated: "2026-05-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3, cache_read: 0.19999999999999998 }, + limit: { context: 1050000, output: 131000 }, + }, + "xiaomi/mimo-v2.5": { + id: "xiaomi/mimo-v2.5", + name: "MiMo M2.5", + family: "mimo-v2.5", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-22", + last_updated: "2026-05-01", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.39999999999999997, output: 2, cache_read: 0.08 }, + limit: { context: 1050000, output: 131100 }, + }, + "xiaomi/mimo-v2-pro": { + id: "xiaomi/mimo-v2-pro", + name: "MiMo V2 Pro", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 3, cache_read: 0.19999999999999998 }, + limit: { context: 1000000, output: 128000 }, + }, + "xiaomi/mimo-v2-flash": { + id: "xiaomi/mimo-v2-flash", + name: "MiMo V2 Flash", + family: "mimo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-17", + last_updated: "2025-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.29 }, + limit: { context: 262144, output: 32000 }, + }, + "bytedance/seed-1.6": { + id: "bytedance/seed-1.6", + name: "Seed 1.6", + family: "seed", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09", + last_updated: "2025-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.05 }, + limit: { context: 256000, output: 32000 }, + }, + "bytedance/seed-1.8": { + id: "bytedance/seed-1.8", + name: "Seed 1.8", + family: "seed", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-10", + last_updated: "2025-10", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.05 }, + limit: { context: 256000, output: 64000 }, + }, + "meituan/longcat-flash-chat": { + id: "meituan/longcat-flash-chat", + name: "LongCat Flash Chat", + family: "longcat", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-08-30", + last_updated: "2025-08-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 128000, output: 8192 }, + }, + "meituan/longcat-flash-thinking": { + id: "meituan/longcat-flash-thinking", + name: "LongCat Flash Thinking", + family: "longcat", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-23", + last_updated: "2025-09-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 1.5 }, + limit: { context: 128000, output: 8192 }, + }, + "meituan/longcat-flash-thinking-2601": { + id: "meituan/longcat-flash-thinking-2601", + name: "LongCat Flash Thinking 2601", + family: "longcat", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + release_date: "2026-03-13", + last_updated: "2026-03-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + limit: { context: 32768, output: 32768 }, + }, + "bfl/flux-pro-1.0-fill": { + id: "bfl/flux-pro-1.0-fill", + name: "FLUX.1 Fill [pro]", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-10", + last_updated: "2024-10", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + "bfl/flux-pro-1.1": { + id: "bfl/flux-pro-1.1", + name: "FLUX1.1 [pro]", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-10", + last_updated: "2024-10", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + "bfl/flux-kontext-pro": { + id: "bfl/flux-kontext-pro", + name: "FLUX.1 Kontext Pro", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-06", + last_updated: "2025-06", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + "bfl/flux-kontext-max": { + id: "bfl/flux-kontext-max", + name: "FLUX.1 Kontext Max", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2025-06", + last_updated: "2025-06", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + "bfl/flux-pro-1.1-ultra": { + id: "bfl/flux-pro-1.1-ultra", + name: "FLUX1.1 [pro] Ultra", + family: "flux", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + release_date: "2024-11", + last_updated: "2024-11", + modalities: { input: ["text"], output: ["image"] }, + open_weights: false, + limit: { context: 512, output: 0 }, + }, + }, + }, + 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": { + id: "MiniMax-M2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 196608, output: 128000 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7": { + id: "MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7-highspeed": { + id: "MiniMax-M2.7-highspeed", + name: "MiniMax-M2.7-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.1": { + id: "MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.5-highspeed": { + id: "MiniMax-M2.5-highspeed", + name: "MiniMax-M2.5-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-13", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + llmgateway: { + id: "llmgateway", + env: ["LLMGATEWAY_API_KEY"], + npm: "@ai-sdk/openai-compatible", + api: "https://api.llmgateway.io/v1", + name: "LLM Gateway", + doc: "https://llmgateway.io/docs", + models: { + "gpt-4o-mini-search-preview": { + id: "gpt-4o-mini-search-preview", + name: "GPT-4o Mini Search Preview", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 16384 }, + }, + "grok-4-1-fast-reasoning": { + id: "grok-4-1-fast-reasoning", + name: "Grok 4.1 Fast Reasoning", + family: "grok", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "qwen3-235b-a22b-instruct-2507": { + id: "qwen3-235b-a22b-instruct-2507", + name: "Qwen3 235B A22B Instruct (2507)", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-08", + last_updated: "2025-07-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 131072, output: 8192 }, + }, + "llama-4-scout": { + id: "llama-4-scout", + name: "Llama 4 Scout", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.18, output: 0.59 }, + limit: { context: 32768, output: 16384 }, + status: "beta", + }, + "hermes-2-pro-llama-3-8b": { + id: "hermes-2-pro-llama-3-8b", + name: "Hermes 2 Pro Llama 3 8B", + family: "hermes", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-05-27", + last_updated: "2024-05-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.14 }, + limit: { context: 8192, output: 8192 }, + }, + "qwen-coder-plus": { + id: "qwen-coder-plus", + name: "Qwen Coder Plus", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 1 }, + limit: { context: 131072, output: 8192 }, + }, + auto: { + id: "auto", + name: "Auto Route", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "glm-4.6v-flashx": { + id: "glm-4.6v-flashx", + name: "GLM-4.6V FlashX", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.04, output: 0.4, cache_read: 0 }, + limit: { context: 128000, output: 16000 }, + }, + "gemma-2-27b-it-together": { + id: "gemma-2-27b-it-together", + name: "Gemma 2 27B IT", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-06-27", + last_updated: "2024-06-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.08 }, + limit: { context: 8192, output: 16384 }, + }, + "codestral-2508": { + id: "codestral-2508", + name: "Codestral", + family: "mistral", + 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: true, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 16384 }, + }, + "gemma-3-1b-it": { + id: "gemma-3-1b-it", + name: "Gemma 3 1B IT", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.08, output: 0.3 }, + limit: { context: 1000000, output: 16384 }, + }, + "glm-4-32b-0414-128k": { + id: "glm-4-32b-0414-128k", + name: "GLM-4 32B (0414-128k)", + 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, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 128000, output: 16384 }, + }, + "seed-1-6-flash-250715": { + id: "seed-1-6-flash-250715", + name: "Seed 1.6 Flash (250715)", + family: "seed", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-26", + last_updated: "2025-07-26", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.3, cache_read: 0.01 }, + limit: { context: 256000, output: 8192 }, + }, + "seed-1-6-250615": { + id: "seed-1-6-250615", + name: "Seed 1.6 (250615)", + family: "seed", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-06-25", + last_updated: "2025-06-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 2, cache_read: 0.05 }, + limit: { context: 256000, output: 8192 }, + }, + "qwen3-vl-235b-a22b-thinking": { + id: "qwen3-vl-235b-a22b-thinking", + name: "Qwen3 VL 235B A22B Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-vl-30b-a3b-thinking": { + id: "qwen3-vl-30b-a3b-thinking", + name: "Qwen3 VL 30B A3B Thinking", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-02", + last_updated: "2025-10-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen2-5-vl-32b-instruct": { + id: "qwen2-5-vl-32b-instruct", + name: "Qwen2.5 VL 32B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-03-15", + last_updated: "2025-03-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.3 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen3-vl-8b-instruct": { + id: "qwen3-vl-8b-instruct", + name: "Qwen3 VL 8B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-08-19", + last_updated: "2025-08-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "claude-3-7-sonnet": { + id: "claude-3-7-sonnet", + name: "Claude 3.7 Sonnet", + family: "claude", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-02-24", + last_updated: "2025-02-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3 }, + limit: { context: 200000, output: 8192 }, + }, + "gemini-pro-latest": { + id: "gemini-pro-latest", + name: "Gemini Pro Latest", + family: "gemini", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-3-5-haiku": { + id: "claude-3-5-haiku", + name: "Claude 3.5 Haiku", + family: "claude", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4, cache_read: 0.08 }, + limit: { context: 200000, output: 8192 }, + status: "deprecated", + }, + "qwen-max-latest": { + id: "qwen-max-latest", + name: "Qwen Max Latest", + 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, + cost: { input: 1.6, output: 6.4 }, + limit: { context: 32768, output: 8192 }, + }, + "glm-4.6v-flash": { + id: "glm-4.6v-flash", + name: "GLM-4.6V Flash", + family: "glm", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16000 }, + status: "beta", + }, + "qwen3-30b-a3b-instruct-2507": { + id: "qwen3-30b-a3b-instruct-2507", + name: "Qwen3 30B A3B Instruct (2507)", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-08", + last_updated: "2025-07-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "minimax-text-01": { + id: "minimax-text-01", + name: "MiniMax Text 01", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.1 }, + limit: { context: 1000000, output: 131072 }, + }, + "qwen3-32b-fp8": { + id: "qwen3-32b-fp8", + name: "Qwen3 32B FP8", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "llama-4-scout-17b-instruct": { + id: "llama-4-scout-17b-instruct", + name: "Llama 4 Scout 17B Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.66 }, + limit: { context: 8192, output: 2048 }, + }, + "qwen3-4b-fp8": { + id: "qwen3-4b-fp8", + name: "Qwen3 4B FP8", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.03, output: 0.05 }, + limit: { context: 131072, output: 8192 }, + }, + "ministral-8b-2512": { + id: "ministral-8b-2512", + name: "Ministral 8B", + family: "mistral", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 262144, output: 8192 }, + }, + "gemma-3-27b": { + id: "gemma-3-27b", + name: "Gemma 3 27B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.27 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-vl-flash": { + id: "qwen3-vl-flash", + name: "Qwen3 VL Flash", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-09", + last_updated: "2025-10-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.4, cache_read: 0.01 }, + limit: { context: 1000000, output: 32000 }, + }, + "llama-3.1-70b-instruct": { + id: "llama-3.1-70b-instruct", + name: "Llama 3.1 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.72, output: 0.72 }, + limit: { context: 128000, output: 2048 }, + status: "beta", + }, + "seed-1-8-251228": { + id: "seed-1-8-251228", + name: "Seed 1.8 (251228)", + family: "seed", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 0.25, output: 2, cache_read: 0.05 }, + limit: { context: 256000, output: 8192 }, + }, + "qwen3-235b-a22b-thinking-2507": { + id: "qwen3-235b-a22b-thinking-2507", + name: "Qwen3 235B A22B Thinking (2507)", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-08", + last_updated: "2025-07-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 131072, output: 8192 }, + }, + "seed-1-6-250915": { + id: "seed-1-6-250915", + name: "Seed 1.6 (250915)", + family: "seed", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.25, output: 2, cache_read: 0.05 }, + limit: { context: 256000, output: 8192 }, + }, + "glm-4.5-x": { + id: "glm-4.5-x", + name: "GLM-4.5 X", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 2.2, output: 8.9, cache_read: 0.45 }, + limit: { context: 128000, output: 16384 }, + status: "beta", + }, + "qwen3-30b-a3b-thinking-2507": { + id: "qwen3-30b-a3b-thinking-2507", + name: "Qwen3 30B A3B Thinking (2507)", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-08", + last_updated: "2025-07-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-4-fast-reasoning": { + id: "grok-4-fast-reasoning", + name: "Grok 4 Fast Reasoning", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "deepseek-v3.1": { + id: "deepseek-v3.1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.56, output: 1.68, cache_read: 0.11 }, + limit: { context: 128000, output: 32768 }, + }, + "ministral-3b-2512": { + id: "ministral-3b-2512", + name: "Ministral 3B", + family: "mistral", + 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, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "qwen-plus-latest": { + id: "qwen-plus-latest", + name: "Qwen Plus Latest", + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 131072, output: 8192 }, + }, + "llama-3.1-nemotron-ultra-253b": { + id: "llama-3.1-nemotron-ultra-253b", + name: "Llama 3.1 Nemotron Ultra 253B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-04-07", + last_updated: "2025-04-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 128000, output: 8192 }, + }, + "llama-4-maverick-17b-instruct": { + id: "llama-4-maverick-17b-instruct", + name: "Llama 4 Maverick 17B Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.24, output: 0.97 }, + limit: { context: 8192, output: 2048 }, + }, + "grok-4-0709": { + id: "grok-4-0709", + name: "Grok 4 (0709)", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15 }, + limit: { context: 256000, output: 256000 }, + }, + "qwen3-30b-a3b-fp8": { + id: "qwen3-30b-a3b-fp8", + name: "Qwen3 30B A3B FP8", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "minimax-m2.1-lightning": { + id: "minimax-m2.1-lightning", + name: "MiniMax M2.1 Lightning", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.12, output: 0.48 }, + limit: { context: 196608, output: 131072 }, + }, + "qwen3-max-2026-01-23": { + id: "qwen3-max-2026-01-23", + name: "Qwen3 Max (2026-01-23)", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-01-23", + last_updated: "2026-01-23", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.6 }, + limit: { context: 256000, output: 32800 }, + }, + "llama-3.2-3b-instruct": { + id: "llama-3.2-3b-instruct", + name: "Llama 3.2 3B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-09-18", + last_updated: "2024-09-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.05 }, + limit: { context: 32768, output: 32000 }, + }, + "qwen3-coder-next": { + id: "qwen3-coder-next", + name: "Qwen3 Coder Next", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-15", + last_updated: "2025-10-15", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 4 }, + limit: { context: 262144, output: 65536 }, + }, + "gpt-4o-search-preview": { + id: "gpt-4o-search-preview", + name: "GPT-4o Search Preview", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 16384 }, + }, + custom: { + id: "custom", + name: "Custom Model", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-vl-30b-a3b-instruct": { + id: "qwen3-vl-30b-a3b-instruct", + name: "Qwen3 VL 30B A3B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-10-02", + last_updated: "2025-10-02", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 131072, output: 8192 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-29", + last_updated: "2025-09-29", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.28, output: 0.42, cache_read: 0.03 }, + limit: { context: 163840, output: 16384 }, + }, + "qwen3-235b-a22b-fp8": { + id: "qwen3-235b-a22b-fp8", + name: "Qwen3 235B A22B FP8", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.5, output: 2.5 }, + limit: { context: 131072, output: 8192 }, + }, + "gpt-oss-20b": { + id: "gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.5 }, + limit: { context: 131072, output: 32766 }, + }, + "kimi-k2": { + id: "kimi-k2", + name: "Kimi K2", + family: "kimi", + 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, + cost: { input: 1, output: 3, cache_read: 0.5 }, + limit: { context: 131072, output: 16384 }, + }, + "llama-3-8b-instruct": { + id: "llama-3-8b-instruct", + name: "Llama 3 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2025-04-03", + last_updated: "2025-04-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 8192, output: 8192 }, + }, + "qwen3-vl-235b-a22b-instruct": { + id: "qwen3-vl-235b-a22b-instruct", + name: "Qwen3 VL 235B A22B Instruct", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-09-15", + last_updated: "2025-09-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 131072, output: 8192 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.15, output: 0.75 }, + limit: { context: 131072, output: 32766 }, + }, + "qwen25-coder-7b": { + id: "qwen25-coder-7b", + name: "Qwen2.5 Coder 7B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-09-19", + last_updated: "2024-09-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.05 }, + limit: { context: 131072, output: 8192 }, + }, + "llama-3.1-8b-instruct": { + id: "llama-3.1-8b-instruct", + name: "Llama 3.1 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.22, output: 0.22 }, + limit: { context: 128000, output: 2048 }, + status: "beta", + }, + "llama-3-70b-instruct": { + id: "llama-3-70b-instruct", + name: "Llama 3 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.51, output: 0.74 }, + limit: { context: 8192, output: 8000 }, + }, + "deepseek-r1-0528": { + id: "deepseek-r1-0528", + name: "DeepSeek R1 (0528)", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-05-28", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 64000, output: 16384 }, + status: "beta", + }, + "glm-4.5-airx": { + id: "glm-4.5-airx", + name: "GLM-4.5 AirX", + 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, + cost: { input: 1.1, output: 4.5, cache_read: 0.22 }, + limit: { context: 128000, output: 16384 }, + }, + "ministral-14b-2512": { + id: "ministral-14b-2512", + name: "Ministral 14B", + family: "mistral", + 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, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 262144, output: 8192 }, + }, + "llama-3.2-11b-instruct": { + id: "llama-3.2-11b-instruct", + name: "Llama 3.2 11B Instruct", + 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, + cost: { input: 0.07, output: 0.33 }, + limit: { context: 128000, output: 8192 }, + }, + "claude-3-opus": { + id: "claude-3-opus", + name: "Claude 3 Opus", + family: "claude", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2024-03-04", + last_updated: "2024-03-04", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5 }, + limit: { context: 200000, output: 4096 }, + }, + "minimax-m2.7": { + id: "minimax-m2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "grok-4-20-beta-0309-non-reasoning": { + id: "grok-4-20-beta-0309-non-reasoning", + name: "Grok 4.20 (Non-Reasoning)", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12, cache_read: 0.4 } }, + limit: { context: 2000000, output: 30000 }, + }, + "qwen3-coder-plus": { + id: "qwen3-coder-plus", + name: "Qwen3 Coder Plus", + 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, + cost: { input: 1, output: 5 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5 (latest)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "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-25", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi-k2.5", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "mistral-large-2512": { + id: "mistral-large-2512", + name: "Mistral Large 3", + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 262144, output: 262144 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "minimax-m2.7-highspeed": { + id: "minimax-m2.7-highspeed", + name: "MiniMax-M2.7-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "mimo-v2.5-pro": { + id: "mimo-v2.5-pro", + name: "MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "gemma-3n-e4b-it": { + id: "gemma-3n-e4b-it", + name: "Gemma 3n 4B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2000 }, + }, + "claude-3-5-sonnet-20241022": { + id: "claude-3-5-sonnet-20241022", + name: "Claude Sonnet 3.5 v2", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "gpt-5.2-pro": { + id: "gpt-5.2-pro", + name: "GPT-5.2 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 21, output: 168 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "qwq-plus": { + id: "qwq-plus", + name: "QwQ Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.8, output: 2.4 }, + limit: { context: 131072, output: 8192 }, + }, + "gemini-3.1-flash-lite-preview": { + id: "gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "qwen-vl-plus": { + id: "qwen-vl-plus", + name: "Qwen-VL Plus", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.21, output: 0.63 }, + limit: { context: 131072, output: 8192 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1, output: 3.2, cache_read: 0.2, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "devstral-2512": { + id: "devstral-2512", + name: "Devstral 2", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen3-32b": { + id: "qwen3-32b", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.7, output: 2.8, reasoning: 8.4 }, + limit: { context: 131072, output: 16384 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "glm-4.7-flashx": { + id: "glm-4.7-flashx", + name: "GLM-4.7-FlashX", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.4, cache_read: 0.01, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "qwen35-397b-a17b": { + id: "qwen35-397b-a17b", + name: "Qwen3.5 397B-A17B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-02-15", + last_updated: "2026-02-15", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen-max": { + id: "qwen-max", + name: "Qwen Max", + 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, + cost: { input: 1.6, output: 6.4 }, + limit: { context: 32768, output: 8192 }, + }, + "gpt-5.3-chat-latest": { + id: "gpt-5.3-chat-latest", + name: "GPT-5.3 Chat (latest)", + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "gemini-2.0-flash": { + id: "gemini-2.0-flash", + name: "Gemini 2.0 Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 8192 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.5, + output: 3, + cache_read: 0.05, + context_over_200k: { input: 0.5, output: 3, cache_read: 0.05 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "qwen-plus": { + id: "qwen-plus", + name: "Qwen Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.4, output: 1.2, reasoning: 4 }, + limit: { context: 1000000, output: 32768 }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + 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" } }, + }, + }, + }, + }, + "qwen3.6-35b-a3b": { + id: "qwen3.6-35b-a3b", + name: "Qwen3.6 35B-A3B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2026-04-17", + last_updated: "2026-04-17", + modalities: { input: ["text", "image", "video", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0.248, output: 1.485 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen-omni-turbo": { + id: "qwen-omni-turbo", + name: "Qwen-Omni Turbo", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.07, output: 0.27, input_audio: 4.44, output_audio: 8.89 }, + limit: { context: 32768, output: 2048 }, + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "mimo-v2-omni": { + id: "mimo-v2-omni", + name: "MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + 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", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2, cache_read: 0.08 }, + limit: { context: 262144, output: 131072 }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "minimax-m2": { + id: "minimax-m2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 196608, output: 128000 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen-flash": { + id: "qwen-flash", + name: "Qwen Flash", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4 }, + limit: { context: 1000000, output: 32768 }, + }, + "gpt-4-turbo": { + id: "gpt-4-turbo", + name: "GPT-4 Turbo", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.125, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "mimo-v2.5": { + id: "mimo-v2.5", + name: "MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.4, + output: 2, + cache_read: 0.08, + context_over_200k: { input: 0.8, output: 4, cache_read: 0.16 }, + }, + limit: { context: 1048576, output: 131072 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "Grok 4.1 Fast (Non-Reasoning)", + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "sonar-pro": { + id: "sonar-pro", + name: "Sonar Pro", + 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, + cost: { input: 3, output: 15 }, + limit: { context: 200000, output: 8192 }, + }, + "pixtral-large-latest": { + id: "pixtral-large-latest", + name: "Pixtral Large (latest)", + 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, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 128000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "grok-4-20-beta-0309-reasoning": { + id: "grok-4-20-beta-0309-reasoning", + name: "Grok 4.20 (Reasoning)", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-09", + last_updated: "2026-03-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6, cache_read: 0.2, context_over_200k: { input: 4, output: 12, cache_read: 0.4 } }, + limit: { context: 2000000, output: 30000 }, + }, + "gpt-4o-mini": { + id: "gpt-4o-mini", + name: "GPT-4o mini", + 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, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3.6-plus": { + id: "qwen3.6-plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.276, output: 1.651, cache_read: 0.028, cache_write: 0.344 }, + limit: { context: 1000000, output: 65536 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "qwen3-max": { + id: "qwen3-max", + name: "Qwen3 Max", + 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, + cost: { input: 1.2, output: 6 }, + limit: { context: 262144, output: 65536 }, + }, + "minimax-m2.1": { + id: "minimax-m2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 6, output: 24, cache_read: 1.3, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "GPT-5.4 nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "glm-4.5": { + id: "glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "mistral-large-latest": { + id: "mistral-large-latest", + name: "Mistral Large (latest)", + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 262144, output: 262144 }, + }, + "mistral-small-2506": { + id: "mistral-small-2506", + name: "Mistral Small 3.2", + family: "mistral-small", + attachment: false, + 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, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + }, + "gemma-3-12b-it": { + id: "gemma-3-12b-it", + name: "Gemma 3 12B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.03, input_audio: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5.2-chat-latest": { + id: "gpt-5.2-chat-latest", + name: "GPT-5.2 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "gemma-3n-e2b-it": { + id: "gemma-3n-e2b-it", + name: "Gemma 3n 2B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2000 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1 Codex mini", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "grok-4-fast": { + id: "grok-4-fast", + name: "Grok 4 Fast", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "gemini-3.1-flash-lite": { + id: "gemini-3.1-flash-lite", + name: "Gemini 3.1 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "qwen3-next-80b-a3b-thinking": { + id: "qwen3-next-80b-a3b-thinking", + name: "Qwen3-Next 80B-A3B (Thinking)", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-09", + last_updated: "2025-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 6 }, + limit: { context: 131072, output: 32768 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemma-3-4b-it": { + id: "gemma-3-4b-it", + name: "Gemma 3 4B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "kimi-k2-thinking-turbo": { + id: "kimi-k2-thinking-turbo", + name: "Kimi K2 Thinking Turbo", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.15, output: 8, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + o1: { + id: "o1", + name: "o1", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.1, cache_read: 0.03, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "gpt-5.4-pro": { + id: "gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-3.5-turbo": { + id: "gpt-3.5-turbo", + name: "GPT-3.5-turbo", + 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, + cost: { input: 0.5, output: 1.5, cache_read: 1.25 }, + limit: { context: 16385, output: 4096 }, + }, + "o3-mini": { + id: "o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "qwen-vl-max": { + id: "qwen-vl-max", + name: "Qwen-VL Max", + family: "qwen", + attachment: false, + 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, + cost: { input: 0.8, output: 3.2 }, + limit: { context: 131072, output: 8192 }, + }, + sonar: { + id: "sonar", + name: "Sonar", + 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, + cost: { input: 1, output: 1 }, + limit: { context: 128000, output: 4096 }, + }, + "qwen3-coder-flash": { + id: "qwen3-coder-flash", + name: "Qwen3 Coder Flash", + 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, + cost: { input: 0.3, output: 1.5 }, + limit: { context: 1000000, output: 65536 }, + }, + "grok-4-3": { + id: "grok-4-3", + name: "Grok 4.3", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-05-01", + last_updated: "2026-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 2.5, + cache_read: 0.2, + context_over_200k: { input: 2.5, output: 5, cache_read: 0.4 }, + }, + limit: { context: 1000000, output: 30000 }, + }, + "glm-4.5v": { + id: "glm-4.5v", + name: "GLM-4.5V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 64000, output: 16384 }, + }, + "deepseek-v4-flash": { + id: "deepseek-v4-flash", + name: "DeepSeek V4 Flash", + family: "deepseek-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.14, output: 0.28, cache_read: 0.028 }, + limit: { context: 1000000, output: 384000 }, + }, + "grok-4": { + id: "grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, reasoning: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 64000 }, + }, + "qwen3-next-80b-a3b-instruct": { + id: "qwen3-next-80b-a3b-instruct", + name: "Qwen3-Next 80B-A3B Instruct", + 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, + cost: { input: 0.5, output: 2 }, + limit: { context: 131072, output: 32768 }, + }, + "gpt-4": { + id: "gpt-4", + name: "GPT-4", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 30, output: 60 }, + limit: { context: 8192, output: 8192 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "glm-4.6v": { + id: "glm-4.6v", + name: "GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 128000, output: 32768 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 15, cache_read: 0.25 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "glm-4.5-flash": { + id: "glm-4.5-flash", + name: "GLM-4.5-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "qwen3-vl-plus": { + id: "qwen3-vl-plus", + name: "Qwen3-VL Plus", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.6, reasoning: 4.8 }, + limit: { context: 262144, output: 32768 }, + }, + "grok-4-1-fast": { + id: "grok-4-1-fast", + name: "Grok 4.1 Fast", + family: "grok", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "claude-sonnet-4-20250514": { + id: "claude-sonnet-4-20250514", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen3-coder-480b-a35b-instruct": { + id: "qwen3-coder-480b-a35b-instruct", + name: "Qwen3-Coder 480B-A35B Instruct", + 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, + cost: { input: 1.5, output: 7.5 }, + limit: { context: 262144, output: 65536 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "deepseek-v4-pro": { + id: "deepseek-v4-pro", + name: "DeepSeek V4 Pro", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.74, output: 3.48, cache_read: 0.145 }, + limit: { context: 1000000, output: 384000 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "GPT-4.1 nano", + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.03 }, + limit: { context: 1047576, output: 32768 }, + }, + "claude-3-7-sonnet-20250219": { + id: "claude-3-7-sonnet-20250219", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "qwen3-coder-30b-a3b-instruct": { + id: "qwen3-coder-30b-a3b-instruct", + name: "Qwen3-Coder 30B-A3B Instruct", + 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, + cost: { input: 0.45, output: 2.25 }, + limit: { context: 262144, output: 65536 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "mimo-v2-pro": { + id: "mimo-v2-pro", + name: "MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + o3: { + id: "o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "GPT-5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 400000, input: 272000, output: 272000 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "GPT-4o", + 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, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "minimax-m2.5-highspeed": { + id: "minimax-m2.5-highspeed", + name: "MiniMax-M2.5-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-13", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen-turbo": { + id: "qwen-turbo", + name: "Qwen Turbo", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.2, reasoning: 0.5 }, + limit: { context: 1000000, output: 16384 }, + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "Claude Sonnet 4.5 (latest)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "glm-4.7-flash": { + id: "glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "mimo-v2-flash": { + id: "mimo-v2-flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.3, cache_read: 0.01 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen3.6-max-preview": { + id: "qwen3.6-max-preview", + name: "Qwen3.6 Max Preview", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.3, output: 7.8, cache_read: 0.13, cache_write: 1.625 }, + limit: { context: 262144, output: 65536 }, + }, + "gpt-5-chat-latest": { + id: "gpt-5-chat-latest", + name: "GPT-5 Chat (latest)", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-09-30", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "claude-opus-4-20250514": { + id: "claude-opus-4-20250514", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "qwen2-5-vl-72b-instruct": { + id: "qwen2-5-vl-72b-instruct", + name: "Qwen2.5-VL 72B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 2.8, output: 8.4 }, + limit: { context: 131072, output: 8192 }, + }, + "gpt-5.5-pro": { + id: "gpt-5.5-pro", + name: "GPT-5.5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "devstral-small-2507": { + id: "devstral-small-2507", + name: "Devstral Small", + family: "devstral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-05", + release_date: "2025-07-10", + last_updated: "2025-07-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 128000 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "gemini-2.0-flash-lite": { + id: "gemini-2.0-flash-lite", + name: "Gemini 2.0 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 1048576, output: 8192 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "GPT-4.1 mini", + 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, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "grok-3": { + id: "grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "Grok 4 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + "sonar-reasoning-pro": { + id: "sonar-reasoning-pro", + name: "Sonar Reasoning Pro", + family: "sonar-reasoning", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8 }, + limit: { context: 128000, output: 4096 }, + }, + }, + }, + "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.0-flash": { + id: "gemini-2.0-flash", + name: "Gemini 2.0 Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.025 }, + limit: { context: 1048576, output: 8192 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-flash-latest": { + id: "gemini-flash-latest", + name: "Gemini Flash Latest", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, cache_write: 0.383 }, + limit: { context: 1048576, output: 65536 }, + }, + "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", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 65536, output: 65536 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, cache_write: 0.383 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-flash-preview-09-2025": { + id: "gemini-2.5-flash-preview-09-2025", + name: "Gemini 2.5 Flash Preview 09-25", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, cache_write: 0.383 }, + limit: { context: 1048576, output: 65536 }, + }, + "zai-org/glm-5-maas": { + id: "zai-org/glm-5-maas", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1, output: 3.2, cache_read: 0.1 }, + limit: { context: 202752, output: 131072 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "zai-org/glm-4.7-maas": { + id: "zai-org/glm-4.7-maas", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.2 }, + limit: { context: 200000, output: 128000 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "deepseek-ai/deepseek-v3.2-maas": { + id: "deepseek-ai/deepseek-v3.2-maas", + name: "DeepSeek V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-12-17", + last_updated: "2026-04-04", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: true, + cost: { input: 0.56, output: 1.68, cache_read: 0.056 }, + limit: { context: 163840, output: 65536 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "deepseek-ai/deepseek-v3.1-maas": { + id: "deepseek-ai/deepseek-v3.1-maas", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text", "pdf"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.7 }, + limit: { context: 163840, output: 32768 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "openai/gpt-oss-120b-maas": { + id: "openai/gpt-oss-120b-maas", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.36 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-oss-20b-maas": { + id: "openai/gpt-oss-20b-maas", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.07, output: 0.25 }, + limit: { context: 131072, output: 32768 }, + }, + "meta/llama-3.3-70b-instruct-maas": { + id: "meta/llama-3.3-70b-instruct-maas", + name: "Llama 3.3 70B Instruct", + 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, + cost: { input: 0.72, output: 0.72 }, + limit: { context: 128000, output: 8192 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "meta/llama-4-maverick-17b-128e-instruct-maas": { + id: "meta/llama-4-maverick-17b-128e-instruct-maas", + name: "Llama 4 Maverick 17B 128E Instruct", + 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, + cost: { input: 0.35, output: 1.15 }, + 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", + }, + }, + "qwen/qwen3-235b-a22b-instruct-2507-maas": { + id: "qwen/qwen3-235b-a22b-instruct-2507-maas", + name: "Qwen3 235B A22B Instruct", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.22, output: 0.88 }, + limit: { context: 262144, output: 16384 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "moonshotai/kimi-k2-thinking-maas": { + id: "moonshotai/kimi-k2-thinking-maas", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.5 }, + limit: { context: 262144, output: 262144 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi", + }, + }, + "gemini-flash-lite-latest": { + id: "gemini-flash-lite-latest", + name: "Gemini Flash-Lite Latest", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-pro-preview-05-06": { + id: "gemini-2.5-pro-preview-05-06", + name: "Gemini 2.5 Pro Preview 05-06", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-05-06", + last_updated: "2025-05-06", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-haiku-4-5@20251001": { + id: "claude-haiku-4-5@20251001", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-3.1-pro-preview-customtools": { + id: "gemini-3.1-pro-preview-customtools", + name: "Gemini 3.1 Pro Preview Custom Tools", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-sonnet-4-6@default": { + id: "claude-sonnet-4-6@default", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { + input: 3, + output: 15, + cache_read: 0.3, + cache_write: 3.75, + context_over_200k: { input: 6, output: 22.5, cache_read: 0.6, cache_write: 7.5 }, + }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "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-25", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-25", + last_updated: "2025-09-25", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-3-5-haiku@20241022": { + id: "claude-3-5-haiku@20241022", + name: "Claude Haiku 3.5", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-3.1-flash-lite-preview": { + id: "gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-3-5-sonnet@20241022": { + id: "claude-3-5-sonnet@20241022", + name: "Claude Sonnet 3.5 v2", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-opus-4-1@20250805": { + id: "claude-opus-4-1@20250805", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.5, + output: 3, + cache_read: 0.05, + context_over_200k: { input: 0.5, output: 3, cache_read: 0.05 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-flash-preview-05-20": { + id: "gemini-2.5-flash-preview-05-20", + name: "Gemini 2.5 Flash Preview 05-20", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.0375 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-embedding-001": { + id: "gemini-embedding-001", + name: "Gemini Embedding 001", + 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, + cost: { input: 0.15, output: 0 }, + limit: { context: 2048, output: 3072 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.125, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-pro-preview-06-05": { + id: "gemini-2.5-pro-preview-06-05", + name: "Gemini 2.5 Pro Preview 06-05", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-sonnet-4@20250514": { + id: "claude-sonnet-4@20250514", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-3.1-flash-lite": { + id: "gemini-3.1-flash-lite", + name: "Gemini 3.1 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-3-7-sonnet@20250219": { + id: "claude-3-7-sonnet@20250219", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "claude-opus-4@20250514": { + id: "claude-opus-4@20250514", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "claude-opus-4-5@20251101": { + id: "claude-opus-4-5@20251101", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-2.5-flash-preview-04-17": { + id: "gemini-2.5-flash-preview-04-17", + name: "Gemini 2.5 Flash Preview 04-17", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-04-17", + last_updated: "2025-04-17", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.0375 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-sonnet-4-5@20250929": { + id: "claude-sonnet-4-5@20250929", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-opus-4-6@default": { + id: "claude-opus-4-6@default", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + "gemini-2.0-flash-lite": { + id: "gemini-2.0-flash-lite", + name: "Gemini 2.0 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 1048576, output: 8192 }, + }, + "claude-opus-4-7@default": { + id: "claude-opus-4-7@default", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 1000000, output: 128000 }, + provider: { npm: "@ai-sdk/google-vertex/anthropic" }, + }, + }, + }, + "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/zai-org/glm-4.7-flash": { + id: "@cf/zai-org/glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.06, output: 0.4 }, + limit: { context: 131072, output: 131072 }, + }, + "@cf/nvidia/nemotron-3-120b-a12b": { + id: "@cf/nvidia/nemotron-3-120b-a12b", + name: "Nemotron 3 Super 120B", + family: "nemotron", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-03-11", + last_updated: "2026-03-11", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 256000, output: 256000 }, + }, + "@cf/openai/gpt-oss-20b": { + id: "@cf/openai/gpt-oss-20b", + name: "GPT OSS 20B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.3 }, + limit: { context: 128000, output: 16384 }, + }, + "@cf/openai/gpt-oss-120b": { + id: "@cf/openai/gpt-oss-120b", + name: "GPT OSS 120B", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.35, output: 0.75 }, + limit: { context: 128000, output: 16384 }, + }, + "@cf/meta/llama-4-scout-17b-16e-instruct": { + id: "@cf/meta/llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17B 16E Instruct", + family: "llama", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-16", + last_updated: "2025-04-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.27, output: 0.85 }, + limit: { context: 128000, output: 16384 }, + }, + "@cf/google/gemma-4-26b-a4b-it": { + id: "@cf/google/gemma-4-26b-a4b-it", + name: "Gemma 4 26B A4B IT", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-15", + last_updated: "2025-12-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 256000, output: 16384 }, + }, + "@cf/moonshotai/kimi-k2.5": { + id: "@cf/moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 256000, output: 256000 }, + }, + "@cf/moonshotai/kimi-k2.6": { + id: "@cf/moonshotai/kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 256000, output: 256000 }, + }, + }, + }, + groq: { + id: "groq", + env: ["GROQ_API_KEY"], + npm: "@ai-sdk/groq", + name: "Groq", + doc: "https://console.groq.com/docs/models", + models: { + "gemma2-9b-it": { + id: "gemma2-9b-it", + name: "Gemma 2 9B", + family: "gemma", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-06-27", + last_updated: "2024-06-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 8192, output: 8192 }, + status: "deprecated", + }, + "mistral-saba-24b": { + id: "mistral-saba-24b", + name: "Mistral Saba 24B", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-08", + release_date: "2025-02-06", + last_updated: "2025-02-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.79, output: 0.79 }, + limit: { context: 32768, output: 32768 }, + status: "deprecated", + }, + "deepseek-r1-distill-llama-70b": { + id: "deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.75, output: 0.99 }, + limit: { context: 131072, output: 8192 }, + status: "deprecated", + }, + "llama-guard-3-8b": { + id: "llama-guard-3-8b", + name: "Llama Guard 3 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 8192, output: 8192 }, + status: "deprecated", + }, + "llama-3.3-70b-versatile": { + id: "llama-3.3-70b-versatile", + name: "Llama 3.3 70B Versatile", + 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, + cost: { input: 0.59, output: 0.79 }, + limit: { context: 131072, output: 32768 }, + }, + "allam-2-7b": { + id: "allam-2-7b", + name: "ALLaM-2-7b", + family: "allam", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-09", + release_date: "2024-09", + last_updated: "2024-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 4096, output: 4096 }, + }, + "whisper-large-v3": { + id: "whisper-large-v3", + name: "Whisper Large V3", + family: "whisper", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-09", + release_date: "2023-09-01", + last_updated: "2025-09-05", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 448, output: 448 }, + }, + "llama-3.1-8b-instant": { + id: "llama-3.1-8b-instant", + name: "Llama 3.1 8B Instant", + 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, + cost: { input: 0.05, output: 0.08 }, + limit: { context: 131072, output: 131072 }, + }, + "llama3-70b-8192": { + id: "llama3-70b-8192", + name: "Llama 3 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-03", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.59, output: 0.79 }, + limit: { context: 8192, output: 8192 }, + status: "deprecated", + }, + "qwen-qwq-32b": { + id: "qwen-qwq-32b", + name: "Qwen QwQ 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2024-11-27", + last_updated: "2024-11-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 0.39 }, + limit: { context: 131072, output: 16384 }, + status: "deprecated", + }, + "whisper-large-v3-turbo": { + id: "whisper-large-v3-turbo", + name: "Whisper Large v3 Turbo", + family: "whisper", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 448, output: 448 }, + }, + "llama3-8b-8192": { + id: "llama3-8b-8192", + name: "Llama 3 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-03", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.08 }, + limit: { context: 8192, output: 8192 }, + status: "deprecated", + }, + "canopylabs/orpheus-arabic-saudi": { + id: "canopylabs/orpheus-arabic-saudi", + name: "Orpheus Arabic Saudi", + family: "canopylabs", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-12-16", + release_date: "2025-12-16", + last_updated: "2025-12-16", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + cost: { input: 40, output: 0 }, + limit: { context: 4000, output: 50000 }, + }, + "canopylabs/orpheus-v1-english": { + id: "canopylabs/orpheus-v1-english", + name: "Orpheus V1 English", + family: "canopylabs", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2025-12-19", + release_date: "2025-12-19", + last_updated: "2025-12-19", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 4000, output: 50000 }, + }, + "meta-llama/llama-4-scout-17b-16e-instruct": { + id: "meta-llama/llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17B", + family: "llama", + attachment: false, + 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, + cost: { input: 0.11, output: 0.34 }, + limit: { context: 131072, output: 8192 }, + }, + "meta-llama/llama-prompt-guard-2-22m": { + id: "meta-llama/llama-prompt-guard-2-22m", + name: "Llama Prompt Guard 2 22M", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.03 }, + limit: { context: 512, output: 512 }, + }, + "meta-llama/llama-guard-4-12b": { + id: "meta-llama/llama-guard-4-12b", + name: "Llama Guard 4 12B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + release_date: "2025-04-05", + last_updated: "2025-04-05", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.2 }, + limit: { context: 131072, output: 1024 }, + status: "deprecated", + }, + "meta-llama/llama-4-maverick-17b-128e-instruct": { + id: "meta-llama/llama-4-maverick-17b-128e-instruct", + name: "Llama 4 Maverick 17B", + family: "llama", + attachment: false, + 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, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 131072, output: 8192 }, + status: "deprecated", + }, + "meta-llama/llama-prompt-guard-2-86m": { + id: "meta-llama/llama-prompt-guard-2-86m", + name: "Llama Prompt Guard 2 86M", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2024-10-01", + last_updated: "2024-10-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 512, output: 512 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 131072, output: 65536 }, + }, + "openai/gpt-oss-safeguard-20b": { + id: "openai/gpt-oss-safeguard-20b", + name: "Safety GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-03-05", + last_updated: "2025-03-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.075, output: 0.3, cache_read: 0.037 }, + limit: { context: 131072, output: 65536 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 65536 }, + }, + "qwen/qwen3-32b": { + id: "qwen/qwen3-32b", + name: "Qwen3 32B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11-08", + release_date: "2024-12-23", + last_updated: "2024-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.29, output: 0.59 }, + limit: { context: 131072, output: 40960 }, + }, + "groq/compound": { + id: "groq/compound", + name: "Compound", + family: "groq", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-09-04", + release_date: "2025-09-04", + last_updated: "2025-09-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "groq/compound-mini": { + id: "groq/compound-mini", + name: "Compound Mini", + family: "groq", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-09-04", + release_date: "2025-09-04", + last_updated: "2025-09-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "moonshotai/kimi-k2-instruct": { + id: "moonshotai/kimi-k2-instruct", + name: "Kimi K2 Instruct", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-14", + last_updated: "2025-07-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 131072, output: 16384 }, + status: "deprecated", + }, + "moonshotai/kimi-k2-instruct-0905": { + id: "moonshotai/kimi-k2-instruct-0905", + name: "Kimi K2 Instruct 0905", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-09-05", + last_updated: "2025-09-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1, output: 3 }, + limit: { context: 262144, output: 16384 }, + }, + }, + }, + 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: { + "mistral-nemo": { + id: "mistral-nemo", + name: "Mistral Nemo", + 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, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 128000, output: 128000 }, + }, + "gpt-5.2-chat": { + id: "gpt-5.2-chat", + name: "GPT-5.2 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "codex-mini": { + id: "codex-mini", + name: "Codex Mini", + family: "gpt-codex-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2024-04", + release_date: "2025-05-16", + last_updated: "2025-05-16", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 6, cache_read: 0.375 }, + limit: { context: 200000, output: 100000 }, + }, + "phi-4-multimodal": { + id: "phi-4-multimodal", + name: "Phi-4-multimodal", + 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, + cost: { input: 0.08, output: 0.32, input_audio: 4 }, + limit: { context: 128000, output: 4096 }, + }, + "phi-3.5-mini-instruct": { + id: "phi-3.5-mini-instruct", + name: "Phi-3.5-mini-instruct", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 128000, output: 4096 }, + }, + "llama-4-scout-17b-16e-instruct": { + id: "llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17B 16E Instruct", + 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, + cost: { input: 0.2, output: 0.78 }, + limit: { context: 128000, output: 8192 }, + }, + "grok-4-1-fast-reasoning": { + id: "grok-4-1-fast-reasoning", + name: "Grok 4.1 Fast (Reasoning)", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-06-27", + last_updated: "2025-06-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 128000, input: 128000, output: 8192 }, + status: "beta", + }, + "phi-3-medium-4k-instruct": { + id: "phi-3-medium-4k-instruct", + name: "Phi-3-medium-instruct (4k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 4096, output: 1024 }, + }, + "ministral-3b": { + id: "ministral-3b", + name: "Ministral 3B", + 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, + cost: { input: 0.04, output: 0.04 }, + limit: { context: 128000, output: 8192 }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-02-31", + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "meta-llama-3.1-8b-instruct": { + id: "meta-llama-3.1-8b-instruct", + name: "Meta-Llama-3.1-8B-Instruct", + 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, + cost: { input: 0.3, output: 0.61 }, + limit: { context: 128000, output: 32768 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-02-06", + last_updated: "2026-02-06", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3 }, + limit: { context: 262144, output: 262144 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", + shape: "completions", + }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama-3.3-70B-Instruct", + 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, + cost: { input: 0.71, output: 0.71 }, + limit: { context: 128000, output: 32768 }, + }, + "deepseek-v3-0324": { + id: "deepseek-v3-0324", + name: "DeepSeek-V3-0324", + family: "deepseek", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.14, output: 4.56 }, + limit: { context: 131072, output: 131072 }, + }, + "gpt-5-chat": { + id: "gpt-5-chat", + name: "GPT-5 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2024-10-24", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 128000, output: 16384 }, + }, + "phi-3.5-moe-instruct": { + id: "phi-3.5-moe-instruct", + name: "Phi-3.5-MoE-instruct", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.16, output: 0.64 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5.3-chat": { + id: "gpt-5.3-chat", + name: "GPT-5.3 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: 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, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 128000, output: 16384 }, + }, + "o1-mini": { + id: "o1-mini", + name: "o1-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2023-09", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 128000, output: 65536 }, + }, + "text-embedding-3-large": { + id: "text-embedding-3-large", + name: "text-embedding-3-large", + 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, + cost: { input: 0.13, output: 0 }, + limit: { context: 8191, output: 3072 }, + }, + "phi-3-mini-128k-instruct": { + id: "phi-3-mini-128k-instruct", + name: "Phi-3-mini-instruct (128k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 128000, output: 4096 }, + }, + "phi-4-reasoning": { + id: "phi-4-reasoning", + name: "Phi-4-reasoning", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 32000, output: 4096 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2, cache_read: 0.03 }, + limit: { context: 272000, output: 128000 }, + }, + "gpt-5-nano": { + id: "gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.05, output: 0.4, cache_read: 0.01 }, + limit: { context: 272000, output: 128000 }, + }, + "meta-llama-3-70b-instruct": { + id: "meta-llama-3-70b-instruct", + name: "Meta-Llama-3-70B-Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.68, output: 3.54 }, + limit: { context: 8192, output: 2048 }, + }, + "phi-3-small-8k-instruct": { + id: "phi-3-small-8k-instruct", + name: "Phi-3-small-instruct (8k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 8192, output: 2048 }, + }, + "gpt-5.3-codex": { + id: "gpt-5.3-codex", + name: "GPT-5.3 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "text-embedding-ada-002": { + id: "text-embedding-ada-002", + name: "text-embedding-ada-002", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 8192, output: 1536 }, + }, + "llama-3.2-90b-vision-instruct": { + id: "llama-3.2-90b-vision-instruct", + name: "Llama-3.2-90B-Vision-Instruct", + 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, + cost: { input: 2.04, output: 2.04 }, + limit: { context: 128000, output: 8192 }, + }, + "deepseek-r1": { + id: "deepseek-r1", + name: "DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-07", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 163840, output: 163840 }, + }, + "grok-4-1-fast-non-reasoning": { + id: "grok-4-1-fast-non-reasoning", + name: "Grok 4.1 Fast (Non-Reasoning)", + 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, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 128000, input: 128000, output: 8192 }, + status: "beta", + }, + "deepseek-v3.2-speciale": { + id: "deepseek-v3.2-speciale", + name: "DeepSeek-V3.2-Speciale", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.58, output: 1.68 }, + limit: { context: 128000, output: 128000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.75, output: 14, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "mistral-large-2411": { + id: "mistral-large-2411", + name: "Mistral Large 24.11", + family: "mistral-large", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 2, output: 6 }, + limit: { context: 128000, output: 32768 }, + }, + "claude-opus-4-1": { + id: "claude-opus-4-1", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-18", + last_updated: "2025-11-18", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "cohere-command-a": { + id: "cohere-command-a", + name: "Command A", + family: "command-a", + attachment: false, + reasoning: true, + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 256000, output: 8000 }, + }, + "llama-3.2-11b-vision-instruct": { + id: "llama-3.2-11b-vision-instruct", + name: "Llama-3.2-11B-Vision-Instruct", + 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, + cost: { input: 0.37, output: 0.37 }, + limit: { context: 128000, output: 8192 }, + }, + "meta-llama-3.1-405b-instruct": { + id: "meta-llama-3.1-405b-instruct", + name: "Meta-Llama-3.1-405B-Instruct", + 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, + cost: { input: 5.33, output: 16 }, + limit: { context: 128000, output: 32768 }, + }, + "gpt-5.1-chat": { + id: "gpt-5.1-chat", + name: "GPT-5.1 Chat", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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", "audio"], output: ["text", "image", "audio"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-4-turbo-vision": { + id: "gpt-4-turbo-vision", + name: "GPT-4 Turbo Vision", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 1.75, output: 14, cache_read: 0.175 }, + limit: { context: 400000, output: 128000 }, + }, + "cohere-embed-v-4-0": { + id: "cohere-embed-v-4-0", + name: "Embed v4", + 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, + cost: { input: 0.12, output: 0 }, + limit: { context: 128000, output: 1536 }, + }, + "gpt-5.1-codex-mini": { + id: "gpt-5.1-codex-mini", + name: "GPT-5.1 Codex Mini", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 128000 }, + }, + "gpt-3.5-turbo-0125": { + id: "gpt-3.5-turbo-0125", + name: "GPT-3.5 Turbo 0125", + 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, + cost: { input: 0.5, output: 1.5 }, + limit: { context: 16384, output: 16384 }, + }, + "o1-preview": { + id: "o1-preview", + name: "o1-preview", + family: "o", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2023-09", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 16.5, output: 66, cache_read: 8.25 }, + limit: { context: 128000, output: 32768 }, + }, + "cohere-embed-v3-multilingual": { + id: "cohere-embed-v3-multilingual", + name: "Embed v3 Multilingual", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 512, output: 1024 }, + }, + "grok-4-20-non-reasoning": { + id: "grok-4-20-non-reasoning", + name: "Grok 4.20 (Non-Reasoning)", + 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, + cost: { input: 2, output: 6 }, + limit: { context: 262000, output: 8192 }, + status: "beta", + }, + "gpt-5.1": { + id: "gpt-5.1", + name: "GPT-5.1", + family: "gpt", + attachment: true, + reasoning: true, + 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", "audio"], output: ["text", "image", "audio"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 272000, output: 128000 }, + }, + "grok-4-fast-reasoning": { + id: "grok-4-fast-reasoning", + name: "Grok 4 Fast (Reasoning)", + family: "grok", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + o1: { + id: "o1", + name: "o1", + family: "o", + attachment: false, + reasoning: true, + 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, + cost: { input: 15, output: 60, cache_read: 7.5 }, + limit: { context: 200000, output: 100000 }, + }, + "mistral-small-2503": { + id: "mistral-small-2503", + name: "Mistral Small 3.1", + 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, + cost: { input: 0.1, output: 0.3 }, + limit: { context: 128000, output: 32768 }, + }, + "model-router": { + id: "model-router", + name: "Model Router", + 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, + cost: { input: 0.14, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-3.5-turbo-1106": { + id: "gpt-3.5-turbo-1106", + name: "GPT-3.5 Turbo 1106", + 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, + cost: { input: 1, output: 2 }, + limit: { context: 16384, output: 16384 }, + }, + "text-embedding-3-small": { + id: "text-embedding-3-small", + name: "text-embedding-3-small", + 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, + cost: { input: 0.02, output: 0 }, + limit: { context: 8191, output: 1536 }, + }, + "deepseek-v3.1": { + id: "deepseek-v3.1", + name: "DeepSeek-V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-07", + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.56, output: 1.68 }, + limit: { context: 131072, output: 131072 }, + }, + "claude-opus-4-5": { + id: "claude-opus-4-5", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "phi-3-mini-4k-instruct": { + id: "phi-3-mini-4k-instruct", + name: "Phi-3-mini-instruct (4k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.13, output: 0.52 }, + limit: { context: 4096, output: 1024 }, + }, + "meta-llama-3.1-70b-instruct": { + id: "meta-llama-3.1-70b-instruct", + name: "Meta-Llama-3.1-70B-Instruct", + 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, + cost: { input: 2.68, output: 3.54 }, + limit: { context: 128000, output: 32768 }, + }, + "phi-4-mini-reasoning": { + id: "phi-4-mini-reasoning", + name: "Phi-4-mini-reasoning", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-4": { + id: "gpt-4", + name: "GPT-4", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-11", + release_date: "2023-03-14", + last_updated: "2023-03-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 60, output: 120 }, + limit: { context: 8192, output: 8192 }, + }, + "meta-llama-3-8b-instruct": { + id: "meta-llama-3-8b-instruct", + name: "Meta-Llama-3-8B-Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-12", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.61 }, + limit: { context: 8192, output: 2048 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-22", + last_updated: "2026-04-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4 }, + limit: { context: 262144, output: 262144 }, + provider: { + npm: "@ai-sdk/openai-compatible", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", + shape: "completions", + }, + }, + "gpt-5-codex": { + id: "gpt-5-codex", + name: "GPT-5-Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 400000, output: 128000 }, + }, + "phi-4-mini": { + id: "phi-4-mini", + name: "Phi-4-mini", + 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, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 128000, output: 4096 }, + }, + "grok-4-20-reasoning": { + id: "grok-4-20-reasoning", + name: "Grok 4.20 (Reasoning)", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 2, output: 6 }, + limit: { context: 262000, output: 8192 }, + status: "beta", + }, + "gpt-3.5-turbo-0301": { + id: "gpt-3.5-turbo-0301", + name: "GPT-3.5 Turbo 0301", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2021-08", + release_date: "2023-03-01", + last_updated: "2023-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.5, output: 2 }, + limit: { context: 4096, output: 4096 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 5, + output: 25, + cache_read: 0.5, + cache_write: 6.25, + context_over_200k: { input: 10, output: 37.5, cache_read: 1, cache_write: 12.5 }, + }, + limit: { context: 200000, output: 128000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "phi-3-small-128k-instruct": { + id: "phi-3-small-128k-instruct", + name: "Phi-3-small-instruct (128k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4096 }, + }, + "deepseek-v3.2": { + id: "deepseek-v3.2", + name: "DeepSeek-V3.2", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.58, output: 1.68 }, + limit: { context: 128000, output: 128000 }, + }, + "phi-3-medium-128k-instruct": { + id: "phi-3-medium-128k-instruct", + name: "Phi-3-medium-instruct (128k)", + family: "phi", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.17, output: 0.68 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-3.5-turbo-0613": { + id: "gpt-3.5-turbo-0613", + name: "GPT-3.5 Turbo 0613", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2021-08", + release_date: "2023-06-13", + last_updated: "2023-06-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 4 }, + limit: { context: 16384, output: 16384 }, + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "phi-4": { + id: "phi-4", + name: "Phi-4", + 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, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-5": { + id: "gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.13 }, + limit: { context: 272000, output: 128000 }, + }, + "gpt-4-32k": { + id: "gpt-4-32k", + name: "GPT-4 32K", + family: "gpt", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-11", + release_date: "2023-03-14", + last_updated: "2023-03-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 60, output: 120 }, + limit: { context: 32768, output: 32768 }, + }, + "cohere-embed-v3-english": { + id: "cohere-embed-v3-english", + name: "Embed v3 English", + 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, + cost: { input: 0.1, output: 0 }, + limit: { context: 512, output: 1024 }, + }, + "phi-4-reasoning-plus": { + id: "phi-4-reasoning-plus", + name: "Phi-4-reasoning-plus", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.125, output: 0.5 }, + limit: { context: 32000, output: 4096 }, + }, + "mistral-medium-2505": { + id: "mistral-medium-2505", + name: "Mistral Medium 3", + 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, + cost: { input: 0.4, output: 2 }, + limit: { context: 128000, output: 128000 }, + }, + "gpt-3.5-turbo-instruct": { + id: "gpt-3.5-turbo-instruct", + name: "GPT-3.5 Turbo Instruct", + 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, + cost: { input: 1.5, output: 2 }, + limit: { context: 4096, output: 4096 }, + }, + "deepseek-r1-0528": { + id: "deepseek-r1-0528", + name: "DeepSeek-R1-0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 163840, output: 163840 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2024-08", + release_date: "2025-11-06", + last_updated: "2025-12-02", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "gpt-5.1-codex": { + id: "gpt-5.1-codex", + name: "GPT-5.1 Codex", + family: "gpt-codex", + attachment: false, + reasoning: true, + 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", "audio"], output: ["text", "image", "audio"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "codestral-2501": { + id: "codestral-2501", + name: "Codestral 25.01", + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 256000, output: 256000 }, + }, + "llama-4-maverick-17b-128e-instruct-fp8": { + id: "llama-4-maverick-17b-128e-instruct-fp8", + name: "Llama 4 Maverick 17B 128E Instruct FP8", + 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, + cost: { input: 0.25, output: 1 }, + limit: { context: 128000, output: 8192 }, + }, + "mai-ds-r1": { + id: "mai-ds-r1", + name: "MAI-DS-R1", + family: "mai", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-06", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1.35, output: 5.4 }, + limit: { context: 128000, output: 8192 }, + }, + "gpt-5.1-codex-max": { + id: "gpt-5.1-codex-max", + name: "GPT-5.1 Codex Max", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + provider: { + npm: "@ai-sdk/anthropic", + api: "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1", + }, + }, + "gpt-5.5": { + id: "gpt-5.5", + name: "GPT-5.5", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 30, cache_read: 0.5, context_over_200k: { input: 10, output: 45, cache_read: 1 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-4-turbo": { + id: "gpt-4-turbo", + name: "GPT-4 Turbo", + 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, + cost: { input: 10, output: 30 }, + limit: { context: 128000, output: 4096 }, + }, + "gpt-4o-mini": { + id: "gpt-4o-mini", + name: "GPT-4o mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.08 }, + limit: { context: 128000, output: 16384 }, + }, + "gpt-5.4-mini": { + id: "gpt-5.4-mini", + name: "GPT-5.4 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.75, output: 4.5, cache_read: 0.075 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "cohere-command-r-08-2024": { + id: "cohere-command-r-08-2024", + name: "Command R", + 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, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 128000, output: 4000 }, + }, + "o4-mini": { + id: "o4-mini", + name: "o4-mini", + family: "o-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.28 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5.4-nano": { + id: "gpt-5.4-nano", + name: "GPT-5.4 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.25, cache_read: 0.02 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "grok-code-fast-1": { + id: "grok-code-fast-1", + name: "Grok Code Fast 1", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2025-08-28", + last_updated: "2025-08-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 1.5, cache_read: 0.02 }, + limit: { context: 256000, output: 10000 }, + }, + "gpt-5.4-pro": { + id: "gpt-5.4-pro", + name: "GPT-5.4 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 30, output: 180, context_over_200k: { input: 60, output: 270 } }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "o3-mini": { + id: "o3-mini", + name: "o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 4.4, cache_read: 0.55 }, + limit: { context: 200000, output: 100000 }, + }, + "grok-4": { + id: "grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, reasoning: 15, cache_read: 0.75 }, + limit: { context: 256000, output: 64000 }, + }, + "gpt-5.4": { + id: "gpt-5.4", + name: "GPT-5.4", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { + input: 2.5, + output: 15, + cache_read: 0.25, + context_over_200k: { input: 5, output: 22.5, cache_read: 0.5 }, + }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "gpt-4.1-nano": { + id: "gpt-4.1-nano", + name: "GPT-4.1 nano", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.03 }, + limit: { context: 1047576, output: 32768 }, + }, + "grok-3-mini": { + id: "grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 0.5, reasoning: 0.5, cache_read: 0.075 }, + limit: { context: 131072, output: 8192 }, + }, + o3: { + id: "o3", + name: "o3", + family: "o", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 200000, output: 100000 }, + }, + "gpt-5-pro": { + id: "gpt-5-pro", + name: "GPT-5 Pro", + family: "gpt-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 120 }, + limit: { context: 400000, output: 272000 }, + }, + "gpt-4o": { + id: "gpt-4o", + name: "GPT-4o", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 2.5, output: 10, cache_read: 1.25 }, + limit: { context: 128000, output: 16384 }, + }, + "cohere-command-r-plus-08-2024": { + id: "cohere-command-r-plus-08-2024", + name: "Command R+", + 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, + cost: { input: 2.5, output: 10 }, + limit: { context: 128000, output: 4000 }, + }, + "gpt-4.1": { + id: "gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "gpt-4.1-mini": { + id: "gpt-4.1-mini", + name: "GPT-4.1 mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 1.6, cache_read: 0.1 }, + limit: { context: 1047576, output: 32768 }, + }, + "grok-3": { + id: "grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-11", + release_date: "2025-02-17", + last_updated: "2025-02-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.75 }, + limit: { context: 131072, output: 8192 }, + }, + "grok-4-fast-non-reasoning": { + id: "grok-4-fast-non-reasoning", + name: "Grok 4 Fast (Non-Reasoning)", + family: "grok", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-09-19", + last_updated: "2025-09-19", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.2, output: 0.5, cache_read: 0.05 }, + limit: { context: 2000000, output: 30000 }, + }, + }, + }, + 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: { + "x-ai/grok-4": { + id: "x-ai/grok-4", + name: "Grok 4", + family: "grok", + attachment: false, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.75, cache_write: 15 }, + limit: { context: 256000, output: 64000 }, + }, + "deepseek-ai/deepseek-r1-distill-llama-70b": { + id: "deepseek-ai/deepseek-r1-distill-llama-70b", + name: "DeepSeek R1 Distill Llama 70B", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-01-23", + last_updated: "2025-01-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.14 }, + limit: { context: 131072, output: 131072 }, + }, + "openai/gpt-5-mini": { + id: "openai/gpt-5-mini", + name: "GPT-5 Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.25, output: 2, cache_read: 0.025 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-5-nano": { + id: "openai/gpt-5-nano", + name: "GPT-5 Nano", + family: "gpt-nano", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.4, cache_read: 0.005 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.2 }, + limit: { context: 131072, output: 65536 }, + }, + "openai/gpt-5": { + id: "openai/gpt-5", + name: "GPT-5", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10-01", + release_date: "2025-08-07", + last_updated: "2025-08-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.125 }, + limit: { context: 400000, output: 128000 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 32768 }, + }, + "z-ai/glm-5": { + id: "z-ai/glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 0.95, output: 3.15 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen/qwen3-coder": { + id: "qwen/qwen3-coder", + name: "Qwen3 Coder", + 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, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 262144, output: 66536 }, + }, + "google/gemini-2.5-pro": { + id: "google/gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "google/gemini-2.5-flash": { + id: "google/gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.3, output: 2.5, cache_read: 0.0375 }, + limit: { context: 1048576, output: 65536 }, + }, + "moonshotai/kimi-k2": { + id: "moonshotai/kimi-k2", + name: "Kimi K2", + family: "kimi", + 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, + cost: { input: 0.55, output: 2.2 }, + limit: { context: 131072, output: 32768 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 2, output: 8, cache_read: 0.5 }, + limit: { context: 1047576, output: 32768 }, + }, + "anthropic/claude-opus-4.1": { + id: "anthropic/claude-opus-4.1", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "anthropic/claude-sonnet-4": { + id: "anthropic/claude-sonnet-4", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + }, + }, + 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: { + "Qwen/Qwen3-VL-Embedding-8B": { + id: "Qwen/Qwen3-VL-Embedding-8B", + name: "Qwen3-VL Embedding 8B", + 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, + cost: { input: 0.09, output: 0.09 }, + limit: { context: 32000, output: 4096 }, + }, + "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8": { + id: "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8", + name: "Qwen3-VL 235B", + family: "qwen", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 1.64, output: 1.91 }, + limit: { context: 218000, output: 8192 }, + }, + "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8": { + id: "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8", + name: "Llama 3.1 8B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2024-07-23", + last_updated: "2024-07-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.16, output: 0.27 }, + limit: { context: 128000, output: 8192 }, + }, + "neuralmagic/Mistral-Nemo-Instruct-2407-FP8": { + id: "neuralmagic/Mistral-Nemo-Instruct-2407-FP8", + name: "Mistral Nemo", + family: "mistral", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2024-07-01", + last_updated: "2024-07-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.49, output: 0.71 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT-OSS 120B", + family: "gpt", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.49, output: 0.71 }, + limit: { context: 131000, output: 8192 }, + }, + "cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic": { + id: "cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic", + name: "Llama 3.3 70B", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2024-12-05", + last_updated: "2024-12-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.49, output: 0.71 }, + limit: { context: 128000, output: 8192 }, + }, + "google/gemma-3-27b-it": { + id: "google/gemma-3-27b-it", + name: "Gemma 3 27B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + release_date: "2025-05-17", + last_updated: "2025-05-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.49, output: 0.71 }, + limit: { context: 37000, output: 8192 }, + }, + "intfloat/e5-mistral-7b-instruct": { + id: "intfloat/e5-mistral-7b-instruct", + name: "E5 Mistral 7B", + 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, + cost: { input: 0.02, output: 0.02 }, + limit: { context: 4096, output: 4096 }, + }, + }, + }, + "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: { + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi-K2.5", + family: "kimi", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 202752, output: 16384 }, + }, + "hunyuan-turbos": { + id: "hunyuan-turbos", + name: "Hunyuan-TurboS", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 16384 }, + }, + "hunyuan-t1": { + id: "hunyuan-t1", + name: "Hunyuan-T1", + family: "hunyuan", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 16384 }, + }, + "hunyuan-2.0-instruct": { + id: "hunyuan-2.0-instruct", + name: "Tencent HY 2.0 Instruct", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 16384 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 204800, output: 32768 }, + }, + "tc-code-latest": { + id: "tc-code-latest", + name: "Auto", + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 16384 }, + }, + "hunyuan-2.0-thinking": { + id: "hunyuan-2.0-thinking", + name: "Tencent HY 2.0 Think", + family: "hunyuan", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 16384 }, + }, + }, + }, + "privatemode-ai": { + id: "privatemode-ai", + env: ["PRIVATEMODE_API_KEY", "PRIVATEMODE_ENDPOINT"], + npm: "@ai-sdk/openai-compatible", + api: "http://localhost:8080/v1", + name: "Privatemode AI", + doc: "https://docs.privatemode.ai/api/overview", + models: { + "gemma-3-27b": { + id: "gemma-3-27b", + name: "Gemma 3 27B", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "whisper-large-v3": { + id: "whisper-large-v3", + name: "Whisper large-v3", + family: "whisper", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + knowledge: "2023-09", + release_date: "2023-09-01", + last_updated: "2023-09-01", + modalities: { input: ["audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 0, output: 4096 }, + }, + "qwen3-embedding-4b": { + id: "qwen3-embedding-4b", + name: "Qwen3-Embedding 4B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: false, + structured_output: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-06-06", + last_updated: "2025-06-06", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32000, output: 2560 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "gpt-oss-120b", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-04", + last_updated: "2025-08-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 128000 }, + }, + "qwen3-coder-30b-a3b": { + id: "qwen3-coder-30b-a3b", + name: "Qwen3-Coder 30B-A3B", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04", + last_updated: "2025-04", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + }, + }, + google: { + id: "google", + env: ["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-flash-lite-latest": { + id: "gemini-flash-lite-latest", + name: "Gemini Flash-Lite Latest", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-pro-preview-05-06": { + id: "gemini-2.5-pro-preview-05-06", + name: "Gemini 2.5 Pro Preview 05-06", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-05-06", + last_updated: "2025-05-06", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-live-2.5-flash-preview-native-audio": { + id: "gemini-live-2.5-flash-preview-native-audio", + name: "Gemini Live 2.5 Flash Preview Native Audio", + family: "gemini-flash", + attachment: false, + reasoning: true, + tool_call: true, + temperature: false, + knowledge: "2025-01", + release_date: "2025-06-17", + last_updated: "2025-09-18", + modalities: { input: ["text", "audio", "video"], output: ["text", "audio"] }, + open_weights: false, + cost: { input: 0.5, output: 2, input_audio: 3, output_audio: 12 }, + limit: { context: 131072, output: 65536 }, + }, + "gemini-3.1-pro-preview-customtools": { + id: "gemini-3.1-pro-preview-customtools", + name: "Gemini 3.1 Pro Preview Custom Tools", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "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-25", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-1.5-flash": { + id: "gemini-1.5-flash", + name: "Gemini 1.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-05-14", + last_updated: "2024-05-14", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3, cache_read: 0.01875 }, + limit: { context: 1000000, output: 8192 }, + }, + "gemini-1.5-pro": { + id: "gemini-1.5-pro", + name: "Gemini 1.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-02-15", + last_updated: "2024-02-15", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 5, cache_read: 0.3125 }, + limit: { context: 1000000, output: 8192 }, + }, + "gemma-3n-e4b-it": { + id: "gemma-3n-e4b-it", + name: "Gemma 3n 4B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-05-20", + last_updated: "2025-05-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2000 }, + }, + "gemini-3.1-flash-lite-preview": { + id: "gemini-3.1-flash-lite-preview", + name: "Gemini 3.1 Flash Lite Preview", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-3.1-pro-preview": { + id: "gemini-3.1-pro-preview", + name: "Gemini 3.1 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.0-flash": { + id: "gemini-2.0-flash", + name: "Gemini 2.0 Flash", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 8192 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.5, + output: 3, + cache_read: 0.05, + context_over_200k: { input: 0.5, output: 3, cache_read: 0.05 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-flash-preview-tts": { + id: "gemini-2.5-flash-preview-tts", + name: "Gemini 2.5 Flash Preview TTS", + family: "gemini-flash", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2025-01", + release_date: "2025-05-01", + last_updated: "2025-05-01", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + cost: { input: 0.5, output: 10 }, + limit: { context: 8000, output: 16000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 2, output: 12, cache_read: 0.2, context_over_200k: { input: 4, output: 18, cache_read: 0.4 } }, + limit: { context: 1000000, output: 64000 }, + }, + "gemini-2.5-flash-preview-05-20": { + id: "gemini-2.5-flash-preview-05-20", + name: "Gemini 2.5 Flash Preview 05-20", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.0375 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-embedding-001": { + id: "gemini-embedding-001", + name: "Gemini Embedding 001", + 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, + cost: { input: 0.15, output: 0 }, + limit: { context: 2048, output: 3072 }, + }, + "gemini-2.5-pro": { + id: "gemini-2.5-pro", + name: "Gemini 2.5 Pro", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { + input: 1.25, + output: 10, + cache_read: 0.125, + context_over_200k: { input: 2.5, output: 15, cache_read: 0.25 }, + }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-flash-latest": { + id: "gemini-flash-latest", + name: "Gemini Flash Latest", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, input_audio: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemma-4-31b-it": { + id: "gemma-4-31b-it", + name: "Gemma 4 31B", + family: "gemma", + attachment: false, + reasoning: true, + 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: 256000, output: 8192 }, + }, + "gemini-2.5-pro-preview-06-05": { + id: "gemini-2.5-pro-preview-06-05", + name: "Gemini 2.5 Pro Preview 06-05", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-06-05", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 1.25, output: 10, cache_read: 0.31 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-flash-image": { + id: "gemini-2.5-flash-image", + name: "Gemini 2.5 Flash Image", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.3, output: 30, cache_read: 0.075 }, + limit: { context: 32768, output: 32768 }, + }, + "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", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025, input_audio: 0.3 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemma-3-12b-it": { + id: "gemma-3-12b-it", + name: "Gemma 3 12B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-03-20", + last_updated: "2025-06-05", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.03, input_audio: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemma-3n-e2b-it": { + id: "gemma-3n-e2b-it", + name: "Gemma 3n 2B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-09", + last_updated: "2025-07-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2000 }, + }, + "gemini-3.1-flash-image-preview": { + id: "gemini-3.1-flash-image-preview", + name: "Gemini 3.1 Flash Image (Preview)", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 60 }, + limit: { context: 131072, output: 32768 }, + }, + "gemini-3.1-flash-lite": { + id: "gemini-3.1-flash-lite", + name: "Gemini 3.1 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 1.5, cache_read: 0.025, cache_write: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemma-3-4b-it": { + id: "gemma-3-4b-it", + name: "Gemma 3 4B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: false, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-13", + last_updated: "2025-03-13", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 32768, output: 8192 }, + }, + "gemini-2.5-flash-preview-04-17": { + id: "gemini-2.5-flash-preview-04-17", + name: "Gemini 2.5 Flash Preview 04-17", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-04-17", + last_updated: "2025-04-17", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.15, output: 0.6, cache_read: 0.0375 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-pro-preview-tts": { + id: "gemini-2.5-pro-preview-tts", + name: "Gemini 2.5 Pro Preview TTS", + family: "gemini-flash", + attachment: false, + reasoning: false, + tool_call: false, + temperature: false, + knowledge: "2025-01", + release_date: "2025-05-01", + last_updated: "2025-05-01", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: false, + cost: { input: 1, output: 20 }, + limit: { context: 8000, output: 16000 }, + }, + "gemini-2.5-flash-preview-09-2025": { + id: "gemini-2.5-flash-preview-09-2025", + name: "Gemini 2.5 Flash Preview 09-25", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.3, output: 2.5, cache_read: 0.075, input_audio: 1 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemma-3-27b-it": { + id: "gemma-3-27b-it", + name: "Gemma 3 27B", + family: "gemma", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-03-12", + last_updated: "2025-03-12", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 8192 }, + }, + "gemma-4-26b-a4b-it": { + id: "gemma-4-26b-a4b-it", + name: "Gemma 4 26B", + family: "gemma", + attachment: false, + reasoning: true, + 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: 256000, output: 8192 }, + }, + "gemini-2.5-flash-lite": { + id: "gemini-2.5-flash-lite", + name: "Gemini 2.5 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.4, cache_read: 0.025 }, + limit: { context: 1048576, output: 65536 }, + }, + "gemini-2.5-flash-image-preview": { + id: "gemini-2.5-flash-image-preview", + name: "Gemini 2.5 Flash Image (Preview)", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2025-06", + release_date: "2025-08-26", + last_updated: "2025-08-26", + modalities: { input: ["text", "image"], output: ["text", "image"] }, + open_weights: false, + cost: { input: 0.3, output: 30, cache_read: 0.075 }, + limit: { context: 32768, output: 32768 }, + }, + "gemini-1.5-flash-8b": { + id: "gemini-1.5-flash-8b", + name: "Gemini 1.5 Flash-8B", + family: "gemini-flash", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04", + release_date: "2024-10-03", + last_updated: "2024-10-03", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.0375, output: 0.15, cache_read: 0.01 }, + limit: { context: 1000000, output: 8192 }, + }, + "gemini-live-2.5-flash": { + id: "gemini-live-2.5-flash", + name: "Gemini Live 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2025-09-01", + last_updated: "2025-09-01", + modalities: { input: ["text", "image", "audio", "video"], output: ["text", "audio"] }, + open_weights: false, + cost: { input: 0.5, output: 2, input_audio: 3, output_audio: 12 }, + limit: { context: 128000, output: 8000 }, + }, + "gemini-2.0-flash-lite": { + id: "gemini-2.0-flash-lite", + name: "Gemini 2.0 Flash Lite", + family: "gemini-flash-lite", + attachment: true, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2024-06", + release_date: "2024-12-11", + last_updated: "2024-12-11", + modalities: { input: ["text", "image", "audio", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.075, output: 0.3 }, + limit: { context: 1048576, output: 8192 }, + }, + }, + }, + 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", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.55, output: 2.2 }, + limit: { context: 131072, output: 32000 }, + }, + "public/minimax-m25": { + id: "public/minimax-m25", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_details" }, + temperature: true, + release_date: "2025-03-01", + last_updated: "2025-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.29, output: 1.16 }, + limit: { context: 204800, output: 131072 }, + }, + "public/deepseek-v3": { + id: "public/deepseek-v3", + name: "DeepSeek V3", + 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, + cost: { input: 0.28, output: 1.1 }, + limit: { context: 131072, output: 8192 }, + }, + }, + }, + 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-k2-0905-preview": { + id: "kimi-k2-0905-preview", + name: "Kimi K2 0905", + family: "kimi", + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2.5": { + id: "kimi-k2.5", + name: "Kimi K2.5", + family: "kimi-k2.5", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01", + release_date: "2026-01", + last_updated: "2026-01", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3, cache_read: 0.1 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2-thinking-turbo": { + id: "kimi-k2-thinking-turbo", + name: "Kimi K2 Thinking Turbo", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.15, output: 8, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2.6": { + id: "kimi-k2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + 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, + cost: { input: 0.95, output: 4, cache_read: 0.16 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2-turbo-preview": { + id: "kimi-k2-turbo-preview", + name: "Kimi K2 Turbo", + family: "kimi", + 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, + cost: { input: 2.4, output: 10, cache_read: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "kimi-k2-0711-preview": { + id: "kimi-k2-0711-preview", + name: "Kimi K2 0711", + family: "kimi", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-07-14", + last_updated: "2025-07-14", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 131072, output: 16384 }, + }, + "kimi-k2-thinking": { + id: "kimi-k2-thinking", + name: "Kimi K2 Thinking", + family: "kimi-thinking", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.5, cache_read: 0.15 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + 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: { + "zai-org/GLM-4.7": { + id: "zai-org/GLM-4.7", + name: "GLM 4.7", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-12", + release_date: "2026-01-19", + last_updated: "2026-01-19", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.77, output: 2.75 }, + limit: { context: 128000, output: 8192 }, + }, + "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", + family: "mistral-small", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-09", + release_date: "2025-10-01", + last_updated: "2025-10-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.33, output: 0.33 }, + limit: { context: 32000, output: 8192 }, + }, + "mistralai/Mistral-Medium-3.5-128B": { + id: "mistralai/Mistral-Medium-3.5-128B", + name: "Mistral Medium 3.5 128B", + family: "mistral-medium", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2026-04", + release_date: "2026-04-29", + last_updated: "2026-04-29", + modalities: { input: ["image", "text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.65, output: 5.5 }, + limit: { context: 262144, output: 131072 }, + }, + "meta-llama/Llama-3.3-70B-Instruct": { + id: "meta-llama/Llama-3.3-70B-Instruct", + name: "Llama 3.3 70B Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2023-12", + release_date: "2025-04-27", + last_updated: "2025-04-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.99, output: 0.99 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT-OSS-120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.44, output: 0.99 }, + limit: { context: 128000, output: 8192 }, + }, + "google/gemma-4-31B-it": { + id: "google/gemma-4-31B-it", + name: "Gemma 4 31B Instruct", + family: "gemma", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.275, output: 0.55 }, + limit: { context: 128000, output: 8192 }, + }, + }, + }, + "github-models": { + id: "github-models", + env: ["GITHUB_TOKEN"], + npm: "@ai-sdk/openai-compatible", + api: "https://models.github.ai/inference", + name: "GitHub Models", + doc: "https://docs.github.com/en/github-models", + models: { + "deepseek/deepseek-v3-0324": { + id: "deepseek/deepseek-v3-0324", + name: "DeepSeek-V3-0324", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-03-24", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "deepseek/deepseek-r1": { + id: "deepseek/deepseek-r1", + name: "DeepSeek-R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 65536, output: 8192 }, + }, + "deepseek/deepseek-r1-0528": { + id: "deepseek/deepseek-r1-0528", + name: "DeepSeek-R1-0528", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-05-28", + last_updated: "2025-05-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 65536, output: 8192 }, + }, + "ai21-labs/ai21-jamba-1.5-mini": { + id: "ai21-labs/ai21-jamba-1.5-mini", + name: "AI21 Jamba 1.5 Mini", + family: "jamba", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-08-29", + last_updated: "2024-08-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 4096 }, + }, + "ai21-labs/ai21-jamba-1.5-large": { + id: "ai21-labs/ai21-jamba-1.5-large", + name: "AI21 Jamba 1.5 Large", + family: "jamba", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-08-29", + last_updated: "2024-08-29", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 256000, output: 4096 }, + }, + "microsoft/phi-3.5-mini-instruct": { + id: "microsoft/phi-3.5-mini-instruct", + name: "Phi-3.5-mini instruct (128k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-medium-4k-instruct": { + id: "microsoft/phi-3-medium-4k-instruct", + name: "Phi-3-medium instruct (4k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 4096, output: 1024 }, + }, + "microsoft/phi-3.5-moe-instruct": { + id: "microsoft/phi-3.5-moe-instruct", + name: "Phi-3.5-MoE instruct (128k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-mini-128k-instruct": { + id: "microsoft/phi-3-mini-128k-instruct", + name: "Phi-3-mini instruct (128k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-4-mini-instruct": { + id: "microsoft/phi-4-mini-instruct", + name: "Phi-4-mini-instruct", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-4-reasoning": { + id: "microsoft/phi-4-reasoning", + name: "Phi-4-Reasoning", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-small-8k-instruct": { + id: "microsoft/phi-3-small-8k-instruct", + name: "Phi-3-small instruct (8k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2048 }, + }, + "microsoft/phi-3.5-vision-instruct": { + id: "microsoft/phi-3.5-vision-instruct", + name: "Phi-3.5-vision instruct (128k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-08-20", + last_updated: "2024-08-20", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-mini-4k-instruct": { + id: "microsoft/phi-3-mini-4k-instruct", + name: "Phi-3-mini instruct (4k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 4096, output: 1024 }, + }, + "microsoft/phi-4-mini-reasoning": { + id: "microsoft/phi-4-mini-reasoning", + name: "Phi-4-mini-reasoning", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-small-128k-instruct": { + id: "microsoft/phi-3-small-128k-instruct", + name: "Phi-3-small instruct (128k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-3-medium-128k-instruct": { + id: "microsoft/phi-3-medium-128k-instruct", + name: "Phi-3-medium instruct (128k)", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-04-23", + last_updated: "2024-04-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/phi-4": { + id: "microsoft/phi-4", + name: "Phi-4", + family: "phi", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 16000, output: 4096 }, + }, + "microsoft/phi-4-multimodal-instruct": { + id: "microsoft/phi-4-multimodal-instruct", + name: "Phi-4-multimodal-instruct", + family: "phi", + attachment: false, + reasoning: true, + tool_call: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "microsoft/mai-ds-r1": { + id: "microsoft/mai-ds-r1", + name: "MAI-DS-R1", + family: "mai", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-06", + release_date: "2025-01-20", + last_updated: "2025-01-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 65536, output: 8192 }, + }, + "cohere/cohere-command-r-08-2024": { + id: "cohere/cohere-command-r-08-2024", + name: "Cohere Command R 08-2024", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-08-01", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "cohere/cohere-command-a": { + id: "cohere/cohere-command-a", + name: "Cohere Command A", + family: "command-a", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "cohere/cohere-command-r-plus": { + id: "cohere/cohere-command-r-plus", + name: "Cohere Command R+", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-04-04", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "cohere/cohere-command-r": { + id: "cohere/cohere-command-r", + name: "Cohere Command R", + family: "command-r", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-03-11", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "cohere/cohere-command-r-plus-08-2024": { + id: "cohere/cohere-command-r-plus-08-2024", + name: "Cohere Command R+ 08-2024", + family: "command-r", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-08-01", + last_updated: "2024-08-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + }, + "xai/grok-3-mini": { + id: "xai/grok-3-mini", + name: "Grok 3 Mini", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-09", + last_updated: "2024-12-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "xai/grok-3": { + id: "xai/grok-3", + name: "Grok 3", + family: "grok", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2024-12-09", + last_updated: "2024-12-09", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "openai/o1-mini": { + id: "openai/o1-mini", + name: "OpenAI o1-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2023-10", + release_date: "2024-09-12", + last_updated: "2024-12-17", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 65536 }, + }, + "openai/gpt-4o-mini": { + id: "openai/gpt-4o-mini", + name: "GPT-4o mini", + family: "gpt-mini", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o4-mini": { + id: "openai/o4-mini", + name: "OpenAI o4-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2024-04", + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o1-preview": { + id: "openai/o1-preview", + name: "OpenAI o1-preview", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2023-10", + release_date: "2024-09-12", + last_updated: "2024-09-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "openai/o1": { + id: "openai/o1", + name: "OpenAI o1", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2023-10", + release_date: "2024-09-12", + last_updated: "2024-12-17", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/o3-mini": { + id: "openai/o3-mini", + name: "OpenAI o3-mini", + family: "o-mini", + attachment: false, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2024-04", + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4.1-nano": { + id: "openai/gpt-4.1-nano", + name: "GPT-4.1-nano", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/o3": { + id: "openai/o3", + name: "OpenAI o3", + family: "o", + attachment: false, + reasoning: true, + tool_call: false, + temperature: false, + knowledge: "2024-04", + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 200000, output: 100000 }, + }, + "openai/gpt-4o": { + id: "openai/gpt-4o", + name: "GPT-4o", + family: "gpt", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-10", + release_date: "2024-05-13", + last_updated: "2024-05-13", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4.1": { + id: "openai/gpt-4.1", + name: "GPT-4.1", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "openai/gpt-4.1-mini": { + id: "openai/gpt-4.1-mini", + name: "GPT-4.1-mini", + 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"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 16384 }, + }, + "meta/llama-4-scout-17b-16e-instruct": { + id: "meta/llama-4-scout-17b-16e-instruct", + name: "Llama 4 Scout 17B 16E Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/meta-llama-3.1-8b-instruct": { + id: "meta/meta-llama-3.1-8b-instruct", + name: "Meta-Llama-3.1-8B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "meta/llama-3.3-70b-instruct": { + id: "meta/llama-3.3-70b-instruct", + name: "Llama-3.3-70B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "meta/meta-llama-3-70b-instruct": { + id: "meta/meta-llama-3-70b-instruct", + name: "Meta-Llama-3-70B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2048 }, + }, + "meta/llama-3.2-90b-vision-instruct": { + id: "meta/llama-3.2-90b-vision-instruct", + name: "Llama-3.2-90B-Vision-Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-09-25", + last_updated: "2024-09-25", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/llama-3.2-11b-vision-instruct": { + id: "meta/llama-3.2-11b-vision-instruct", + name: "Llama-3.2-11B-Vision-Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-09-25", + last_updated: "2024-09-25", + modalities: { input: ["text", "image", "audio"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "meta/meta-llama-3.1-405b-instruct": { + id: "meta/meta-llama-3.1-405b-instruct", + name: "Meta-Llama-3.1-405B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "meta/meta-llama-3.1-70b-instruct": { + id: "meta/meta-llama-3.1-70b-instruct", + name: "Meta-Llama-3.1-70B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "meta/meta-llama-3-8b-instruct": { + id: "meta/meta-llama-3-8b-instruct", + name: "Meta-Llama-3-8B-Instruct", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-12", + release_date: "2024-04-18", + last_updated: "2024-04-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2048 }, + }, + "meta/llama-4-maverick-17b-128e-instruct-fp8": { + id: "meta/llama-4-maverick-17b-128e-instruct-fp8", + name: "Llama 4 Maverick 17B 128E Instruct FP8", + family: "llama", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-12", + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "core42/jais-30b-chat": { + id: "core42/jais-30b-chat", + name: "JAIS 30b Chat", + family: "jais", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2023-03", + release_date: "2023-08-30", + last_updated: "2023-08-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 2048 }, + }, + "mistral-ai/mistral-nemo": { + id: "mistral-ai/mistral-nemo", + name: "Mistral Nemo", + family: "mistral-nemo", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-03", + release_date: "2024-07-18", + last_updated: "2024-07-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "mistral-ai/ministral-3b": { + id: "mistral-ai/ministral-3b", + name: "Ministral 3B", + family: "ministral", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 8192 }, + }, + "mistral-ai/mistral-large-2411": { + id: "mistral-ai/mistral-large-2411", + name: "Mistral Large 24.11", + family: "mistral-large", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2024-11-01", + last_updated: "2024-11-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "mistral-ai/mistral-small-2503": { + id: "mistral-ai/mistral-small-2503", + name: "Mistral Small 3.1", + family: "mistral-small", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "mistral-ai/mistral-medium-2505": { + id: "mistral-ai/mistral-medium-2505", + name: "Mistral Medium 3 (25.05)", + family: "mistral-medium", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-09", + release_date: "2025-05-01", + last_updated: "2025-05-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 32768 }, + }, + "mistral-ai/codestral-2501": { + id: "mistral-ai/codestral-2501", + name: "Codestral 25.01", + family: "codestral", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 32000, output: 8192 }, + }, + }, + }, + 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-fast": { + id: "glm-5-fast", + name: "GLM 5 Fast", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-07", + last_updated: "2026-04-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.1, output: 3.6 }, + limit: { context: 200000, output: 200000 }, + }, + "kimi-k2.6-fast": { + id: "kimi-k2.6-fast", + name: "Kimi K2.6 Fast", + family: "kimi", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.69, output: 3.22 }, + limit: { context: 262144, output: 262144 }, + }, + "qwen3.5-397b-fast": { + id: "qwen3.5-397b-fast", + name: "Qwen3.5 397B Fast", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-02-01", + last_updated: "2026-02-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.69, output: 4.14 }, + limit: { context: 262144, output: 262144 }, + }, + "glm-5.1-fast": { + id: "glm-5.1-fast", + name: "GLM 5.1 Fast", + family: "glm", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-07", + last_updated: "2026-04-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.1, output: 3.6 }, + limit: { context: 200000, output: 200000 }, + }, + "qwen3.6-35b-fast": { + id: "qwen3.6-35b-fast", + name: "Qwen3.6 35B Fast", + family: "qwen3.6", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-04-01", + last_updated: "2026-04-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.05, output: 0.1 }, + limit: { context: 131072, output: 131072 }, + }, + "kimi-k2.5-fast": { + id: "kimi-k2.5-fast", + name: "Kimi K2.5 Fast", + family: "kimi", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.52, output: 2.59 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3.5-397B-A17B-FP8": { + id: "Qwen/Qwen3.5-397B-A17B-FP8", + name: "Qwen3.5 397B A17B FP8", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-02-01", + last_updated: "2026-02-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.69, output: 4.14 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3.6-35B-A3B": { + id: "Qwen/Qwen3.6-35B-A3B", + name: "Qwen3.6 35B A3B", + family: "qwen3.6", + attachment: true, + reasoning: true, + 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: true, + cost: { input: 0.05, output: 0.1 }, + limit: { context: 131072, output: 131072 }, + }, + "zai-org/GLM-5.1-FP8": { + id: "zai-org/GLM-5.1-FP8", + name: "GLM 5.1 FP8", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.1, output: 3.6 }, + limit: { context: 200000, output: 200000 }, + }, + "mistralai/Devstral-Small-2-24B-Instruct-2512": { + id: "mistralai/Devstral-Small-2-24B-Instruct-2512", + name: "Devstral Small 2 24B Instruct 2512", + family: "devstral", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-12-09", + last_updated: "2025-12-09", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.12, output: 0.35 }, + limit: { context: 262144, output: 262144 }, + }, + "openai/gpt-oss-20b": { + id: "openai/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.03, output: 0.16 }, + limit: { context: 16384, output: 16384 }, + }, + "moonshotai/Kimi-K2.6": { + id: "moonshotai/Kimi-K2.6", + name: "Kimi K2.6", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.69, output: 3.22 }, + limit: { context: 262144, output: 262144 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + temperature: true, + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.52, output: 2.59 }, + limit: { context: 262144, output: 262144 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax M2.5", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.35, output: 1.38 }, + limit: { context: 196608, output: 196608 }, + }, + }, + }, + togetherai: { + id: "togetherai", + env: ["TOGETHER_API_KEY"], + npm: "@ai-sdk/togetherai", + name: "Together AI", + doc: "https://docs.together.ai/docs/serverless-models", + models: { + "essentialai/Rnj-1-Instruct": { + id: "essentialai/Rnj-1-Instruct", + name: "Rnj-1 Instruct", + family: "rnj", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12-05", + last_updated: "2025-12-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.15 }, + limit: { context: 32768, output: 32768 }, + }, + "Qwen/Qwen3.5-397B-A17B": { + id: "Qwen/Qwen3.5-397B-A17B", + name: "Qwen3.5 397B A17B", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-16", + last_updated: "2026-02-16", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 3.6 }, + limit: { context: 262144, output: 130000 }, + }, + "Qwen/Qwen3.6-Plus": { + id: "Qwen/Qwen3.6-Plus", + name: "Qwen3.6 Plus", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-30", + last_updated: "2026-04-30", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 3 }, + limit: { context: 1000000, output: 500000 }, + }, + "Qwen/Qwen3-Coder-Next-FP8": { + id: "Qwen/Qwen3-Coder-Next-FP8", + name: "Qwen3 Coder Next FP8", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2026-02-03", + release_date: "2026-02-03", + last_updated: "2026-02-03", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 1.2 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507-tput": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507-tput", + name: "Qwen3 235B A22B Instruct 2507 FP8", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07", + release_date: "2025-07-25", + last_updated: "2025-07-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.6 }, + limit: { context: 262144, output: 262144 }, + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": { + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", + name: "Qwen3 Coder 480B A35B Instruct", + 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, + cost: { input: 2, output: 2 }, + limit: { context: 262144, output: 262144 }, + }, + "zai-org/GLM-5.1": { + id: "zai-org/GLM-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: true, + knowledge: "2025-11", + release_date: "2026-04-07", + last_updated: "2026-04-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 1.4, output: 4.4 }, + limit: { context: 202752, output: 131072 }, + }, + "meta-llama/Llama-3.3-70B-Instruct-Turbo": { + id: "meta-llama/Llama-3.3-70B-Instruct-Turbo", + name: "Llama 3.3 70B", + 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, + cost: { input: 0.88, output: 0.88 }, + limit: { context: 131072, output: 131072 }, + }, + "deepseek-ai/DeepSeek-V3": { + id: "deepseek-ai/DeepSeek-V3", + name: "DeepSeek V3", + family: "deepseek", + attachment: false, + reasoning: true, + 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, + cost: { input: 1.25, output: 1.25 }, + limit: { context: 131072, output: 131072 }, + }, + "deepseek-ai/DeepSeek-R1": { + id: "deepseek-ai/DeepSeek-R1", + name: "DeepSeek R1", + family: "deepseek-thinking", + attachment: false, + reasoning: true, + tool_call: false, + temperature: true, + knowledge: "2024-07", + release_date: "2024-12-26", + last_updated: "2025-03-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 3, output: 7 }, + limit: { context: 163839, output: 163839 }, + }, + "deepseek-ai/DeepSeek-V3-1": { + id: "deepseek-ai/DeepSeek-V3-1", + name: "DeepSeek V3.1", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-21", + last_updated: "2025-08-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 1.7 }, + limit: { context: 131072, output: 131072 }, + }, + "deepseek-ai/DeepSeek-V4-Pro": { + id: "deepseek-ai/DeepSeek-V4-Pro", + name: "DeepSeek V4 Pro", + family: "deepseek", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-24", + last_updated: "2026-04-24", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 2.1, output: 4.4, cache_read: 0.2 }, + limit: { context: 512000, output: 384000 }, + }, + "openai/gpt-oss-120b": { + id: "openai/gpt-oss-120b", + name: "GPT OSS 120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08", + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 131072, output: 131072 }, + }, + "google/gemma-4-31B-it": { + id: "google/gemma-4-31B-it", + name: "Gemma 4 31B Instruct", + family: "gemma", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-07", + last_updated: "2026-04-07", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.2, output: 0.5 }, + limit: { context: 262144, output: 131072 }, + }, + "moonshotai/Kimi-K2.6": { + id: "moonshotai/Kimi-K2.6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + 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, + cost: { input: 1.2, output: 4.5, cache_read: 0.2 }, + limit: { context: 262144, output: 131000 }, + }, + "moonshotai/Kimi-K2.5": { + id: "moonshotai/Kimi-K2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: true, + temperature: true, + knowledge: "2026-01", + release_date: "2026-01-27", + last_updated: "2026-01-27", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.5, output: 2.8 }, + limit: { context: 262144, output: 262144 }, + }, + "MiniMaxAI/MiniMax-M2.5": { + id: "MiniMaxAI/MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMaxAI/MiniMax-M2.7": { + id: "MiniMaxAI/MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.3, output: 1.2, cache_read: 0.06 }, + limit: { context: 202752, output: 131072 }, + }, + }, + }, + "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: { + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03", + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.71, output: 3.57 }, + limit: { context: 200000, output: 32000 }, + }, + "gemini-3-flash-preview": { + id: "gemini-3-flash-preview", + name: "Gemini 3 Flash Preview", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.43, context_over_200k: { input: 0.07, output: 0.43 } }, + limit: { context: 1048576, output: 65536 }, + }, + "gpt-5-mini": { + id: "gpt-5-mini", + name: "GPT-5-Mini", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.04, output: 0.29 }, + limit: { context: 200000, output: 64000 }, + }, + "gemini-3-pro-preview": { + id: "gemini-3-pro-preview", + name: "Gemini 3 Pro Preview", + family: "gemini-pro", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-11", + release_date: "2025-11-19", + last_updated: "2025-11-19", + modalities: { input: ["text", "image", "audio", "video"], output: ["text"] }, + open_weights: false, + cost: { input: 0.57, output: 3.43 }, + limit: { context: 1000000, output: 65000 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.43, output: 2.14 }, + limit: { context: 200000, output: 64000 }, + }, + "gpt-5.2": { + id: "gpt-5.2", + name: "GPT-5.2", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.25, output: 2 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gpt-5.2-codex": { + id: "gpt-5.2-codex", + name: "GPT-5.2 Codex", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.14, output: 1.14 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "gemini-2.5-flash": { + id: "gemini-2.5-flash", + name: "Gemini 2.5 Flash", + family: "gemini-flash", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.09, output: 0.71, context_over_200k: { input: 0.09, output: 0.71 } }, + limit: { context: 1048576, output: 65536 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07-31", + release_date: "2025-10-01", + last_updated: "2025-10-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.14, output: 0.71 }, + limit: { context: 200000, output: 64000 }, + }, + }, + }, + "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: { + "hy3-preview": { + id: "hy3-preview", + name: "Hy3 preview", + family: "Hy", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-04-20", + last_updated: "2026-04-20", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 256000, output: 64000 }, + }, + }, + }, + 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-3-sonnet-20240229": { + id: "claude-3-sonnet-20240229", + name: "Claude Sonnet 3", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-03-04", + last_updated: "2024-03-04", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "claude-haiku-4-5": { + id: "claude-haiku-4-5", + name: "Claude Haiku 4.5 (latest)", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-5-20251101": { + id: "claude-opus-4-5-20251101", + name: "Claude Opus 4.5", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2025-11-01", + last_updated: "2025-11-01", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-3-opus-20240229": { + id: "claude-3-opus-20240229", + name: "Claude Opus 3", + family: "claude-opus", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2023-08-31", + release_date: "2024-02-29", + last_updated: "2024-02-29", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 4096 }, + }, + "claude-3-5-haiku-20241022": { + id: "claude-3-5-haiku-20241022", + name: "Claude Haiku 3.5", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-3-5-sonnet-20241022": { + id: "claude-3-5-sonnet-20241022", + name: "Claude Sonnet 3.5 v2", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-10-22", + last_updated: "2024-10-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-sonnet-4-6": { + id: "claude-sonnet-4-6", + name: "Claude Sonnet 4.6", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 1000000, output: 64000 }, + }, + "claude-opus-4-0": { + id: "claude-opus-4-0", + name: "Claude Opus 4 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "claude-opus-4-7": { + id: "claude-opus-4-7", + name: "Claude Opus 4.7", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 1000000, output: 128000 }, + }, + "claude-3-haiku-20240307": { + id: "claude-3-haiku-20240307", + name: "Claude Haiku 3", + 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, + cost: { input: 0.25, output: 1.25, cache_read: 0.03, cache_write: 0.3 }, + limit: { context: 200000, output: 4096 }, + }, + "claude-sonnet-4-5-20250929": { + id: "claude-sonnet-4-5-20250929", + name: "Claude Sonnet 4.5", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-3-5-haiku-latest": { + id: "claude-3-5-haiku-latest", + name: "Claude Haiku 3.5 (latest)", + 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, + cost: { input: 0.8, output: 4, cache_read: 0.08, cache_write: 1 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-opus-4-1": { + id: "claude-opus-4-1", + name: "Claude Opus 4.1 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "claude-sonnet-4-0": { + id: "claude-sonnet-4-0", + name: "Claude Sonnet 4 (latest)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-3-5-sonnet-20240620": { + id: "claude-3-5-sonnet-20240620", + name: "Claude Sonnet 3.5", + family: "claude-sonnet", + attachment: true, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2024-04-30", + release_date: "2024-06-20", + last_updated: "2024-06-20", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 8192 }, + }, + "claude-opus-4-5": { + id: "claude-opus-4-5", + name: "Claude Opus 4.5 (latest)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-1-20250805": { + id: "claude-opus-4-1-20250805", + name: "Claude Opus 4.1", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + "claude-haiku-4-5-20251001": { + id: "claude-haiku-4-5-20251001", + name: "Claude Haiku 4.5", + family: "claude-haiku", + attachment: true, + reasoning: true, + 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, + cost: { input: 1, output: 5, cache_read: 0.1, cache_write: 1.25 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-sonnet-4-20250514": { + id: "claude-sonnet-4-20250514", + name: "Claude Sonnet 4", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-6": { + id: "claude-opus-4-6", + name: "Claude Opus 4.6", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 25, cache_read: 0.5, cache_write: 6.25 }, + 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" } }, + }, + }, + }, + }, + "claude-3-7-sonnet-20250219": { + id: "claude-3-7-sonnet-20250219", + name: "Claude Sonnet 3.7", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-sonnet-4-5": { + id: "claude-sonnet-4-5", + name: "Claude Sonnet 4.5 (latest)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + 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, + cost: { input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }, + limit: { context: 200000, output: 64000 }, + }, + "claude-opus-4-20250514": { + id: "claude-opus-4-20250514", + name: "Claude Opus 4", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 15, output: 75, cache_read: 1.5, cache_write: 18.75 }, + limit: { context: 200000, output: 32000 }, + }, + }, + }, + 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: { + "Qwen/Qwen3-30B-A3B-Thinking-2507": { + id: "Qwen/Qwen3-30B-A3B-Thinking-2507", + name: "Qwen3 30B A3B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 32768 }, + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + id: "Qwen/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen3 30B A3B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 16384 }, + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + id: "Qwen/Qwen3-235B-A22B-Instruct-2507", + name: "Qwen3 235B A22B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-04-28", + last_updated: "2025-07-21", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 131072 }, + }, + "Qwen/Qwen3-Coder-30B-A3B-Instruct": { + id: "Qwen/Qwen3-Coder-30B-A3B-Instruct", + name: "Qwen3 Coder 30B A3B Instruct", + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + id: "Qwen/Qwen3-235B-A22B-Thinking-2507", + name: "Qwen3-235B-A22B-Thinking-2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 262144, output: 131072 }, + }, + "ZhipuAI/GLM-4.5": { + id: "ZhipuAI/GLM-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "ZhipuAI/GLM-4.6": { + id: "ZhipuAI/GLM-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 202752, output: 98304 }, + }, + }, + }, + "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: { + "zai-org/glm-5.1": { + id: "zai-org/glm-5.1", + name: "GLM 5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-04-08", + last_updated: "2026-04-08", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.66, output: 2, cache_read: 0.12 }, + limit: { context: 202000, output: 202000 }, + }, + "minimax/minimax-m2.5": { + id: "minimax/minimax-m2.5", + name: "MiniMax M2.5", + family: "minimax-m2.5", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: false, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-03-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.14, output: 0.56, cache_read: 0.014 }, + limit: { context: 1000000, output: 131072 }, + }, + "moonshotai/kimi-k2.5": { + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + family: "kimi", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: false, + knowledge: "2025-01-01", + release_date: "2026-01-01", + last_updated: "2026-03-25", + modalities: { input: ["text", "image", "video"], output: ["text"] }, + open_weights: true, + cost: { input: 0.21, output: 1, cache_read: 0.03 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + 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-gpt-5-4-nano": { + id: "duo-chat-gpt-5-4-nano", + name: "Agentic Chat (GPT-5.4 Nano)", + family: "gpt-nano", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-gpt-5-mini": { + id: "duo-chat-gpt-5-mini", + name: "Agentic Chat (GPT-5 Mini)", + family: "gpt-mini", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2024-05-30", + release_date: "2026-01-22", + last_updated: "2026-01-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-sonnet-4-6": { + id: "duo-chat-sonnet-4-6", + name: "Agentic Chat (Claude Sonnet 4.6)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-08-31", + release_date: "2026-02-17", + last_updated: "2026-02-17", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 64000 }, + }, + "duo-chat-gpt-5-2": { + id: "duo-chat-gpt-5-2", + name: "Agentic Chat (GPT-5.2)", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-01-23", + last_updated: "2026-01-23", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-gpt-5-codex": { + id: "duo-chat-gpt-5-codex", + name: "Agentic Chat (GPT-5 Codex)", + family: "gpt-codex", + attachment: false, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2024-09-30", + release_date: "2026-01-22", + last_updated: "2026-01-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-gpt-5-1": { + id: "duo-chat-gpt-5-1", + name: "Agentic Chat (GPT-5.1)", + family: "gpt", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2024-09-30", + release_date: "2026-01-22", + last_updated: "2026-01-22", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-gpt-5-2-codex": { + id: "duo-chat-gpt-5-2-codex", + name: "Agentic Chat (GPT-5.2 Codex)", + family: "gpt-codex", + attachment: true, + reasoning: true, + tool_call: true, + structured_output: true, + temperature: false, + knowledge: "2025-08-31", + release_date: "2026-01-22", + last_updated: "2026-01-22", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-sonnet-4-5": { + id: "duo-chat-sonnet-4-5", + name: "Agentic Chat (Claude Sonnet 4.5)", + family: "claude-sonnet", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-07-31", + release_date: "2026-01-08", + last_updated: "2026-01-08", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 64000 }, + }, + "duo-chat-gpt-5-4": { + id: "duo-chat-gpt-5-4", + name: "Agentic Chat (GPT-5.4)", + family: "gpt", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 1050000, input: 922000, output: 128000 }, + }, + "duo-chat-haiku-4-5": { + id: "duo-chat-haiku-4-5", + name: "Agentic Chat (Claude Haiku 4.5)", + family: "claude-haiku", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-02-28", + release_date: "2026-01-08", + last_updated: "2026-01-08", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 64000 }, + }, + "duo-chat-gpt-5-3-codex": { + id: "duo-chat-gpt-5-3-codex", + name: "Agentic Chat (GPT-5.3 Codex)", + family: "gpt-codex", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-gpt-5-4-mini": { + id: "duo-chat-gpt-5-4-mini", + name: "Agentic Chat (GPT-5.4 Mini)", + family: "gpt-mini", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0 }, + limit: { context: 400000, input: 272000, output: 128000 }, + }, + "duo-chat-opus-4-7": { + id: "duo-chat-opus-4-7", + name: "Agentic Chat (Claude Opus 4.7)", + family: "claude-opus", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 64000 }, + }, + "duo-chat-opus-4-5": { + id: "duo-chat-opus-4-5", + name: "Agentic Chat (Claude Opus 4.5)", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-03-31", + release_date: "2026-01-08", + last_updated: "2026-01-08", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 64000 }, + }, + "duo-chat-opus-4-6": { + id: "duo-chat-opus-4-6", + name: "Agentic Chat (Claude Opus 4.6)", + family: "claude-opus", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2025-05-31", + release_date: "2026-02-05", + last_updated: "2026-02-05", + modalities: { input: ["text", "image", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 1000000, output: 64000 }, + }, + }, + }, + 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.5-pro": { + id: "mimo-v2.5-pro", + name: "MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-omni": { + id: "mimo-v2-omni", + name: "MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + 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", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0.4, output: 2, cache_read: 0.08 }, + limit: { context: 262144, output: 131072 }, + }, + "mimo-v2.5": { + id: "mimo-v2.5", + name: "MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { + input: 0.4, + output: 2, + cache_read: 0.08, + context_over_200k: { input: 0.8, output: 4, cache_read: 0.16 }, + }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-pro": { + id: "mimo-v2-pro", + name: "MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 1, output: 3, cache_read: 0.2, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-flash": { + id: "mimo-v2-flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.1, output: 0.3, cache_read: 0.01 }, + limit: { context: 262144, output: 65536 }, + }, + }, + }, + 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", + family: "trinity-mini", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + knowledge: "2024-10", + release_date: "2025-12", + last_updated: "2026-02-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.045, output: 0.15 }, + limit: { context: 131072, output: 131072 }, + }, + "mistralai/completion/models/Ministral-3-14B-Reasoning-2512": { + id: "mistralai/completion/models/Ministral-3-14B-Reasoning-2512", + name: "Ministral 3 14B Reasoning 2512", + family: "ministral", + attachment: true, + reasoning: true, + 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, + cost: { input: 2.5, output: 1.7 }, + limit: { context: 262144, output: 262144 }, + }, + "mistralai/completion/models/Ministral-3-3B-Reasoning-2512": { + id: "mistralai/completion/models/Ministral-3-3B-Reasoning-2512", + name: "Ministral 3 3B Reasoning 2512", + family: "ministral", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12", + last_updated: "2026-02-25", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 1.039, output: 0.54825 }, + limit: { context: 262144, output: 262144 }, + }, + "deepseek-ai/deepseek-ocr/models/DeepSeek-OCR": { + id: "deepseek-ai/deepseek-ocr/models/DeepSeek-OCR", + name: "DeepSeek OCR", + 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, + cost: { input: 0.2, output: 0.7 }, + limit: { context: 8192, output: 8192 }, + }, + "openai/chat-completion/models/gpt-oss-20b": { + id: "openai/chat-completion/models/gpt-oss-20b", + name: "GPT OSS 20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-12-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.045, output: 0.18 }, + limit: { context: 131072, output: 16384 }, + }, + "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", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2026-02-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.09, output: 0.36 }, + limit: { context: 131072, output: 16384 }, + }, + "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", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct": { + id: "qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct", + name: "Qwen3 Coder 30B A3B Instruct", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + knowledge: "2025-04", + release_date: "2025-07-31", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.11458, output: 0.74812 }, + limit: { context: 262144, output: 65536 }, + }, + "qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507": { + id: "qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507", + name: "Qwen3 30B A3B Thinking 2507", + family: "qwen", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.36, output: 1.3 }, + limit: { context: 262144, output: 131072 }, + }, + "qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507": { + id: "qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507", + name: "Qwen3 30B A3B Instruct 2507", + family: "qwen", + attachment: false, + reasoning: false, + tool_call: true, + structured_output: true, + temperature: true, + release_date: "2025-07-30", + last_updated: "2026-02-25", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 0.5 }, + limit: { context: 262144, output: 262144 }, + }, + "clarifai/main/models/mm-poly-8b": { + id: "clarifai/main/models/mm-poly-8b", + name: "MM Poly 8B", + 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, + cost: { input: 0.658, output: 1.11 }, + limit: { context: 32768, output: 4096 }, + }, + "moonshotai/chat-completion/models/Kimi-K2_6": { + id: "moonshotai/chat-completion/models/Kimi-K2_6", + name: "Kimi K2.6", + family: "kimi-k2.6", + attachment: true, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + knowledge: "2025-01", + release_date: "2026-04-21", + last_updated: "2026-04-21", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.95, output: 4 }, + limit: { context: 262144, output: 262144 }, + }, + }, + }, + "minimax-cn": { + id: "minimax-cn", + env: ["MINIMAX_API_KEY"], + npm: "@ai-sdk/anthropic", + api: "https://api.minimaxi.com/anthropic/v1", + name: "MiniMax (minimaxi.com)", + doc: "https://platform.minimaxi.com/docs/guides/quickstart", + models: { + "MiniMax-M2": { + id: "MiniMax-M2", + name: "MiniMax-M2", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-10-27", + last_updated: "2025-10-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 196608, output: 128000 }, + }, + "MiniMax-M2.5": { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-12", + last_updated: "2026-02-12", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.03, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7": { + id: "MiniMax-M2.7", + name: "MiniMax-M2.7", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.7-highspeed": { + id: "MiniMax-M2.7-highspeed", + name: "MiniMax-M2.7-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.1": { + id: "MiniMax-M2.1", + name: "MiniMax-M2.1", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-23", + last_updated: "2025-12-23", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 204800, output: 131072 }, + }, + "MiniMax-M2.5-highspeed": { + id: "MiniMax-M2.5-highspeed", + name: "MiniMax-M2.5-highspeed", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-13", + last_updated: "2026-02-13", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.6, output: 2.4, cache_read: 0.06, cache_write: 0.375 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + "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: { + "mistral-small3.2": { + id: "mistral-small3.2", + name: "Mistral Small 3.2", + family: "mistral-small", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-01-31", + last_updated: "2025-01-31", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.5, output: 2.2 }, + limit: { context: 120000, output: 120000 }, + }, + "qwen3-embedding-8b": { + id: "qwen3-embedding-8b", + name: "Qwen3-Embedding-8B", + 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, + cost: { input: 0.1, output: 0.1 }, + limit: { context: 32768, output: 8192 }, + }, + "llama-3.3-70b-instruct": { + id: "llama-3.3-70b-instruct", + name: "Llama 3.3 70B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-28", + last_updated: "2025-04-28", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.6, output: 2.7 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3-reranker-4b": { + id: "qwen3-reranker-4b", + name: "Qwen3-Reranker-4B", + 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, + cost: { input: 0.12, output: 0.12 }, + limit: { context: 32768, output: 8192 }, + }, + "mistral-small-4-119b": { + id: "mistral-small-4-119b", + name: "Mistral Small 4 119B", + family: "mistral-small", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-15", + last_updated: "2026-03-15", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: false, + cost: { input: 0.75, output: 3 }, + limit: { context: 256000, output: 16384 }, + }, + "qwen3.5-122b": { + id: "qwen3.5-122b", + name: "Qwen3.5-122B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-01", + last_updated: "2026-02-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.9, output: 3.6 }, + limit: { context: 262144, output: 16384 }, + }, + "qwen-image": { + id: "qwen-image", + name: "Qwen-Image", + 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, + cost: { input: 0.5, output: 2 }, + limit: { context: 8192, output: 4096 }, + }, + "qwen3-coder-next": { + id: "qwen3-coder-next", + name: "Qwen3-Coder-Next", + family: "qwen", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-01", + last_updated: "2026-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.3, output: 1.2 }, + limit: { context: 262144, output: 16384 }, + }, + "minimax-m2.5": { + id: "minimax-m2.5", + name: "MiniMax 2.5", + family: "minimax", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-10", + last_updated: "2026-03-10", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.8, output: 3.5 }, + limit: { context: 190000, output: 64000 }, + }, + "gpt-oss-20b": { + id: "gpt-oss-20b", + name: "GPT-OSS-20B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-03-01", + last_updated: "2026-03-01", + modalities: { input: ["text"], output: ["text"] }, + open_weights: true, + cost: { input: 0.4, output: 1.8 }, + limit: { context: 128000, output: 16384 }, + }, + "qwen3.5-9b": { + id: "qwen3.5-9b", + name: "Qwen3.5-9B", + family: "qwen", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2026-02-01", + last_updated: "2026-02-01", + modalities: { input: ["text", "image"], output: ["text"] }, + open_weights: true, + cost: { input: 0.15, output: 0.6 }, + limit: { context: 262144, output: 8192 }, + }, + "gpt-oss-120b": { + id: "gpt-oss-120b", + name: "GPT-OSS-120B", + family: "gpt-oss", + attachment: false, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-08-05", + last_updated: "2025-08-05", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 1, output: 4.2 }, + limit: { context: 128000, output: 16384 }, + }, + "llama-3.1-8b-instruct": { + id: "llama-3.1-8b-instruct", + name: "Llama 3.1 8B Instruct", + family: "llama", + attachment: false, + reasoning: false, + tool_call: true, + temperature: true, + release_date: "2025-04-07", + last_updated: "2025-04-07", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 0.05, output: 0.25 }, + limit: { context: 120000, output: 120000 }, + }, + }, + }, + "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-tts": { + id: "mimo-v2-tts", + name: "MiMo-V2-TTS", + family: "mimo", + attachment: false, + reasoning: false, + tool_call: false, + release_date: "2026-03-18", + last_updated: "2026-03-18", + modalities: { input: ["text"], output: ["audio"] }, + open_weights: true, + cost: { input: 0, output: 0 }, + limit: { context: 8192, output: 16384 }, + }, + "mimo-v2-flash": { + id: "mimo-v2-flash", + name: "MiMo-V2-Flash", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 65536 }, + }, + "mimo-v2-pro": { + id: "mimo-v2-pro", + name: "MiMo-V2-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 2, output: 6, cache_read: 0.4 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2.5": { + id: "mimo-v2.5", + name: "MiMo-V2.5", + family: "mimo", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 0, output: 0, cache_read: 0 } }, + limit: { context: 1048576, output: 131072 }, + }, + "mimo-v2-omni": { + id: "mimo-v2-omni", + name: "MiMo-V2-Omni", + family: "mimo", + attachment: true, + reasoning: true, + 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", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, cache_read: 0 }, + limit: { context: 262144, output: 131072 }, + }, + "mimo-v2.5-pro": { + id: "mimo-v2.5-pro", + name: "MiMo-V2.5-Pro", + family: "mimo", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, context_over_200k: { input: 0, output: 0, cache_read: 0 } }, + limit: { context: 1048576, output: 131072 }, + }, + }, + }, + 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.z.ai/guides/overview/pricing", + models: { + "glm-5v-turbo": { + id: "glm-5v-turbo", + name: "GLM-5V-Turbo", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 5, output: 22, cache_read: 1.2, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-5": { + id: "glm-5", + name: "GLM-5", + family: "glm", + attachment: false, + reasoning: true, + 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: true, + cost: { input: 1, output: 3.2, cache_read: 0.2, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-5.1": { + id: "glm-5.1", + name: "GLM-5.1", + family: "glm", + attachment: false, + reasoning: true, + tool_call: true, + interleaved: { field: "reasoning_content" }, + structured_output: true, + temperature: true, + release_date: "2026-03-27", + last_updated: "2026-03-27", + modalities: { input: ["text"], output: ["text"] }, + open_weights: false, + cost: { input: 6, output: 24, cache_read: 1.3, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.7-flash": { + id: "glm-4.7-flash", + name: "GLM-4.7-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.5-flash": { + id: "glm-4.5-flash", + name: "GLM-4.5-Flash", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0, output: 0, cache_read: 0, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-4.6v": { + id: "glm-4.6v", + name: "GLM-4.6V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.3, output: 0.9 }, + limit: { context: 128000, output: 32768 }, + }, + "glm-4.6": { + id: "glm-4.6", + name: "GLM-4.6", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + "glm-4.5v": { + id: "glm-4.5v", + name: "GLM-4.5V", + family: "glm", + attachment: true, + reasoning: true, + 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, + cost: { input: 0.6, output: 1.8 }, + limit: { context: 64000, output: 16384 }, + }, + "glm-4.5-air": { + id: "glm-4.5-air", + name: "GLM-4.5-Air", + family: "glm-air", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.2, output: 1.1, cache_read: 0.03, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-4.5": { + id: "glm-4.5", + name: "GLM-4.5", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 131072, output: 98304 }, + }, + "glm-4.7-flashx": { + id: "glm-4.7-flashx", + name: "GLM-4.7-FlashX", + family: "glm-flash", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.07, output: 0.4, cache_read: 0.01, cache_write: 0 }, + limit: { context: 200000, output: 131072 }, + }, + "glm-4.7": { + id: "glm-4.7", + name: "GLM-4.7", + family: "glm", + attachment: false, + reasoning: true, + 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, + cost: { input: 0.6, output: 2.2, cache_read: 0.11, cache_write: 0 }, + limit: { context: 204800, output: 131072 }, + }, + }, + }, + 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-lite-v1": { + id: "nova-2-lite-v1", + name: "Nova 2 Lite", + family: "nova-lite", + attachment: true, + reasoning: true, + tool_call: true, + temperature: true, + release_date: "2025-12-01", + last_updated: "2025-12-01", + modalities: { input: ["text", "image", "video", "pdf"], output: ["text"] }, + open_weights: false, + cost: { input: 0, output: 0, reasoning: 0 }, + limit: { context: 1000000, output: 64000 }, + }, + "nova-2-pro-v1": { + id: "nova-2-pro-v1", + name: "Nova 2 Pro", + family: "nova-pro", + attachment: true, + reasoning: true, + 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, + cost: { input: 0, output: 0, reasoning: 0 }, + limit: { context: 1000000, output: 64000 }, + }, + }, + }, +} diff --git a/packages/opencode/src/provider/models.ts b/packages/core/src/models.ts similarity index 81% rename from packages/opencode/src/provider/models.ts rename to packages/core/src/models.ts index fb240e4cf17c..4ee17b8e25eb 100644 --- a/packages/opencode/src/provider/models.ts +++ b/packages/core/src/models.ts @@ -1,20 +1,35 @@ -import { Global } from "@opencode-ai/core/global" import path from "path" import { Context, Duration, Effect, Layer, Option, Schedule, Schema } from "effect" import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http" -import { Installation } from "../installation" -import { Flag } from "@opencode-ai/core/flag/flag" -import { Flock } from "@opencode-ai/core/util/flock" -import { Hash } from "@opencode-ai/core/util/hash" -import { AppFileSystem } from "@opencode-ai/core/filesystem" -import { withTransientReadRetry } from "@/util/effect-http-client" -import { CatalogModelStatus } from "./model-status" +import { Global } from "./global" +import { Flag } from "./flag/flag" +import { Flock } from "./util/flock" +import { Hash } from "./util/hash" +import { AppFileSystem } from "./filesystem" +import { InstallationChannel, InstallationVersion } from "./installation/version" + +export const CatalogModelStatus = Schema.Literals(["alpha", "beta", "deprecated"]) +export type CatalogModelStatus = typeof CatalogModelStatus.Type + +const USER_AGENT = `opencode/${InstallationChannel}/${InstallationVersion}/${Flag.OPENCODE_CLIENT}` + +const CostTier = Schema.Struct({ + input: Schema.Finite, + output: Schema.Finite, + cache_read: Schema.optional(Schema.Finite), + cache_write: Schema.optional(Schema.Finite), + tier: Schema.Struct({ + type: Schema.Literal("context"), + size: Schema.Finite, + }), +}) const Cost = Schema.Struct({ input: Schema.Finite, output: Schema.Finite, cache_read: Schema.optional(Schema.Finite), cache_write: Schema.optional(Schema.Finite), + tiers: Schema.optional(Schema.Array(CostTier)), context_over_200k: Schema.optional( Schema.Struct({ input: Schema.Finite, @@ -97,11 +112,21 @@ export interface Interface { export class Service extends Context.Service()("@opencode/ModelsDev") {} -export const layer: Layer.Layer = Layer.effect( +type Requirements = AppFileSystem.Service | HttpClient.HttpClient + +export const layer: Layer.Layer = Layer.effect( Service, Effect.gen(function* () { const fs = yield* AppFileSystem.Service - const http = HttpClient.filterStatusOk(withTransientReadRetry(yield* HttpClient.HttpClient)) + const http = HttpClient.filterStatusOk( + (yield* HttpClient.HttpClient).pipe( + HttpClient.retryTransient({ + retryOn: "errors-and-responses", + times: 2, + schedule: Schedule.exponential(200).pipe(Schedule.jittered), + }), + ), + ) const source = Flag.OPENCODE_MODELS_URL || "https://models.dev" const filepath = path.join( @@ -120,7 +145,7 @@ export const layer: Layer.Layer res.text), Effect.timeout("10 seconds"), @@ -177,7 +202,9 @@ export const layer: Layer.Layer Effect.logError("Failed to fetch models.dev", { cause })), + Effect.tapCause((cause) => + Effect.logError("Failed to fetch models.dev").pipe(Effect.annotateLogs("cause", cause)), + ), Effect.ignore, ) }) diff --git a/packages/core/src/plugin.ts b/packages/core/src/plugin.ts new file mode 100644 index 000000000000..dfcae9468596 --- /dev/null +++ b/packages/core/src/plugin.ts @@ -0,0 +1,146 @@ +export * as PluginV2 from "./plugin" + +import { createDraft, finishDraft, type Draft } from "immer" +import type { LanguageModelV3 } from "@ai-sdk/provider" +import { type ProviderV2 } from "./provider" +import { Context, Effect, Layer, Schema } from "effect" +import type { ModelV2 } from "./model" + +export const ID = Schema.String.pipe(Schema.brand("Plugin.ID")) +export type ID = typeof ID.Type + +type HookSpec = { + "provider.update": { + input: {} + output: { + provider: ProviderV2.Info + cancel: boolean + } + } + "model.update": { + input: {} + output: { + model: ModelV2.Info + cancel: boolean + } + } + "aisdk.language": { + input: { + model: ModelV2.Info + sdk: any + options: Record + } + output: { + language?: LanguageModelV3 + } + } + "aisdk.sdk": { + input: { + model: ModelV2.Info + package: string + options: Record + } + output: { + sdk?: any + } + } +} + +export type Hooks = { + [Name in keyof HookSpec]: Readonly & { + -readonly [Field in keyof HookSpec[Name]["output"]]: HookSpec[Name]["output"][Field] extends object + ? Draft + : HookSpec[Name]["output"][Field] + } +} + +export type HookFunctions = { + [key in keyof Hooks]?: (input: Hooks[key]) => Effect.Effect +} + +export type HookInput = HookSpec[Name]["input"] +export type HookOutput = HookSpec[Name]["output"] + +export type Effect = Effect.Effect + +export function define(input: { id: ID; effect: Effect.Effect }) { + return input +} + +export interface Interface { + readonly add: (input: { id: ID; effect: Effect }) => Effect.Effect + readonly remove: (id: ID) => Effect.Effect + readonly trigger: ( + name: Name, + input: HookInput, + output: HookOutput, + ) => Effect.Effect & HookOutput> +} + +export class Service extends Context.Service()("@opencode/v2/Plugin") {} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + let hooks: { + id: ID + hooks: HookFunctions + }[] = [] + + const svc = Service.of({ + add: Effect.fn("Plugin.add")(function* (input) { + const result = yield* input.effect + if (!result) return + hooks = [ + ...hooks.filter((item) => item.id !== input.id), + { + id: input.id, + hooks: result, + }, + ] + }), + trigger: Effect.fn("Plugin.trigger")(function* (name, input, output) { + const draftEntries = new Map>() + const event = { + ...input, + ...output, + } as Record + + for (const [field, value] of Object.entries(output)) { + if (value && typeof value === "object") { + draftEntries.set(field, createDraft(value)) + event[field] = draftEntries.get(field) + } + } + + for (const item of hooks) { + const match = item.hooks[name] + if (!match) continue + yield* match(event as any).pipe( + Effect.withSpan(`Plugin.hook.${name}`, { + attributes: { + plugin: item.id, + hook: name, + }, + }), + ) + } + + for (const [field, draft] of draftEntries) { + event[field] = finishDraft(draft) + } + + return event as any + }), + remove: Effect.fn("Plugin.remove")(function* (id) { + hooks = hooks.filter((item) => item.id !== id) + }), + }) + return svc + }), +) + +export const defaultLayer = layer + +// opencode +// sdcok diff --git a/packages/core/src/plugin/auth.ts b/packages/core/src/plugin/auth.ts new file mode 100644 index 000000000000..81cbfbe3f7ad --- /dev/null +++ b/packages/core/src/plugin/auth.ts @@ -0,0 +1,27 @@ +import { Effect } from "effect" +import { AuthV2 } from "../auth" +import { PluginV2 } from "../plugin" + +export const AuthPlugin = PluginV2.define({ + id: PluginV2.ID.make("auth"), + effect: Effect.gen(function* () { + const auth = yield* AuthV2.Service + return { + "provider.update": Effect.fn(function* (evt) { + const account = yield* auth.active(AuthV2.ServiceID.make(evt.provider.id)).pipe(Effect.orDie) + if (!account) return + evt.provider.enabled = { + via: "auth", + service: account.serviceID, + } + if (account.credential.type === "api") { + evt.provider.options.aisdk.provider.apiKey = account.credential.key + Object.assign(evt.provider.options.aisdk.provider, account.credential.metadata ?? {}) + } + if (account.credential.type === "oauth") { + evt.provider.options.aisdk.provider.apiKey = account.credential.access + } + }), + } + }), +}) diff --git a/packages/core/src/plugin/boot.ts b/packages/core/src/plugin/boot.ts new file mode 100644 index 000000000000..74560ac85b77 --- /dev/null +++ b/packages/core/src/plugin/boot.ts @@ -0,0 +1,71 @@ +export * as PluginBoot from "./boot" + +import { Context, Deferred, Effect, Layer } from "effect" +import { AuthV2 } from "../auth" +import { Catalog } from "../catalog" +import { Npm } from "../npm" +import { PluginV2 } from "../plugin" +import { AuthPlugin } from "./auth" +import { EnvPlugin } from "./env" +import { ModelsDevPlugin } from "./models-dev" +import { ProviderPlugins } from "./provider" + +type Plugin = { + id: PluginV2.ID + effect: Effect.Effect +} + +export interface Interface { + readonly wait: () => Effect.Effect +} + +export class Service extends Context.Service()("@opencode/v2/PluginBoot") {} + +export const layer: Layer.Layer = + Layer.effect( + Service, + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const plugin = yield* PluginV2.Service + const auth = yield* AuthV2.Service + const npm = yield* Npm.Service + const done = yield* Deferred.make() + + const add = Effect.fn("PluginBoot.add")(function* (input: Plugin) { + yield* plugin.add({ + id: input.id, + effect: input.effect.pipe( + Effect.provideService(Catalog.Service, catalog), + Effect.provideService(AuthV2.Service, auth), + Effect.provideService(Npm.Service, npm), + ), + }) + }) + + const boot = Effect.gen(function* () { + yield* add(EnvPlugin) + yield* add(AuthPlugin) + for (const item of ProviderPlugins) { + yield* add(item) + } + yield* add(ModelsDevPlugin) + }).pipe(Effect.withSpan("PluginBoot.boot")) + + yield* boot.pipe( + Effect.exit, + Effect.flatMap((exit) => Deferred.done(done, exit)), + Effect.forkScoped, + ) + + return Service.of({ + wait: () => Deferred.await(done), + }) + }), + ) + +export const defaultLayer = layer.pipe( + Layer.provide(Catalog.defaultLayer), + Layer.provide(PluginV2.defaultLayer), + Layer.provide(Layer.orDie(AuthV2.defaultLayer)), + Layer.provide(Npm.defaultLayer), +) diff --git a/packages/core/src/plugin/env.ts b/packages/core/src/plugin/env.ts new file mode 100644 index 000000000000..d63936fa13d4 --- /dev/null +++ b/packages/core/src/plugin/env.ts @@ -0,0 +1,18 @@ +import { Effect } from "effect" +import { PluginV2 } from "../plugin" + +export const EnvPlugin = PluginV2.define({ + id: PluginV2.ID.make("env"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + const key = evt.provider.env.find((item) => process.env[item]) + if (!key) return + evt.provider.enabled = { + via: "env", + name: key, + } + }), + } + }), +}) diff --git a/packages/core/src/plugin/layer-map.example.ts b/packages/core/src/plugin/layer-map.example.ts new file mode 100644 index 000000000000..63e33d3f0c46 --- /dev/null +++ b/packages/core/src/plugin/layer-map.example.ts @@ -0,0 +1,94 @@ +export * as LayerMapExample from "./layer-map.example" + +import { Context, Effect, Layer, LayerMap } from "effect" +import { Npm } from "../npm" + +/** + * Tutorial: split global services from context-specific services. + * + * Use this pattern when part of the app should be constructed once at the app edge, + * while another part should be cached per request/project/workspace key. + * + * In this example: + * - Npm.Service is the global service. It is not keyed by request context and should + * be provided once by the application runtime. + * - ConfigService is context-specific. It is built from a RequestContext key and is + * cached by LayerMap for that key. + * - ConfigServiceMap.layer owns the cache. Provide it once globally, then each + * request can provide ConfigServiceMap.get(context) to select the right instance. + * + * Lifetime model: + * - ConfigServiceMap.layer has the app/global lifetime and depends on Npm.Service. + * - ConfigServiceMap.get(context) has the request/context lifetime and provides + * ConfigService for exactly that context key. + * - The cached ConfigService entry stays alive while something is using it. Once idle, + * it remains cached for idleTimeToLive, then its scope is finalized. + * - invalidate(context) removes the cache entry for future lookups. Active users keep + * running on the old instance; the next lookup can create a fresh instance. + * + * Key model: + * - Keys can be strings, structs, classes, arrays, etc. + * - Prefer primitive or immutable keys. Effect uses Hash / Equal semantics for cache + * lookup, so mutating an object after it has been used as a key is a bug. + */ + +export type RequestContext = { + readonly directory: string + readonly workspace: string +} + +export class RequestContextRef extends Context.Service()( + "@opencode/example/RequestContextRef", +) {} + +export interface ConfigServiceShape { + readonly directory: string + readonly workspace: string + readonly nextUse: () => Effect.Effect + readonly which: Npm.Interface["which"] +} + +export class ConfigService extends Context.Service()( + "@opencode/example/ConfigService", +) {} + +const configServiceLayer = Layer.effect( + ConfigService, + Effect.gen(function* () { + const context = yield* RequestContextRef + const npm = yield* Npm.Service + + let useCount = 0 + + return ConfigService.of({ + directory: context.directory, + workspace: context.workspace, + nextUse: () => Effect.succeed(++useCount), + which: npm.which, + }) + }), +) + +export class ConfigServiceMap extends LayerMap.Service()("@opencode/example/ConfigServiceMap", { + lookup: (context: RequestContext) => + configServiceLayer.pipe(Layer.provide(Layer.succeed(RequestContextRef, RequestContextRef.of(context)))), + idleTimeToLive: "5 minutes", +}) {} + +export const appLayer = ConfigServiceMap.layer + +export const readConfig = Effect.fn("LayerMapExample.readConfig")(function* () { + const config = yield* ConfigService + + return { + directory: config.directory, + workspace: config.workspace, + useCount: yield* config.nextUse(), + } +}) + +export const handleRequest = Effect.fn("LayerMapExample.handleRequest")(function* (context: RequestContext) { + return yield* readConfig().pipe(Effect.provide(ConfigServiceMap.get(context))) +}) + +export const invalidateContext = (context: RequestContext) => ConfigServiceMap.invalidate(context) diff --git a/packages/core/src/plugin/models-dev.ts b/packages/core/src/plugin/models-dev.ts new file mode 100644 index 000000000000..e67c2e75a98c --- /dev/null +++ b/packages/core/src/plugin/models-dev.ts @@ -0,0 +1,108 @@ +import { DateTime, Effect } from "effect" +import { Catalog } from "../catalog" +import { ModelV2 } from "../model" +import { ModelsDev } from "../models" +import { PluginV2 } from "../plugin" +import { ProviderV2 } from "../provider" + +function released(date: string) { + const time = Date.parse(date) + return DateTime.makeUnsafe(Number.isFinite(time) ? time : 0) +} + +function cost(input: ModelsDev.Model["cost"]) { + const base = { + input: input?.input ?? 0, + output: input?.output ?? 0, + cache: { + read: input?.cache_read ?? 0, + write: input?.cache_write ?? 0, + }, + } + if (!input?.context_over_200k) return [base] + return [ + base, + { + tier: { + type: "context" as const, + size: 200_000, + }, + input: input.context_over_200k.input, + output: input.context_over_200k.output, + cache: { + read: input.context_over_200k.cache_read ?? 0, + write: input.context_over_200k.cache_write ?? 0, + }, + }, + ] +} + +function variants(model: ModelsDev.Model) { + return Object.entries(model.experimental?.modes ?? {}).map(([id, item]) => ({ + id: ModelV2.VariantID.make(id), + headers: { ...(item.provider?.headers ?? {}) }, + body: { ...(item.provider?.body ?? {}) }, + aisdk: { + provider: {}, + request: {}, + }, + })) +} + +export const ModelsDevPlugin = PluginV2.define({ + id: PluginV2.ID.make("models-dev"), + effect: Effect.gen(function* () { + const catalog = yield* Catalog.Service + const modelsDev = yield* ModelsDev.Service + for (const item of Object.values(yield* modelsDev.get())) { + const providerID = ProviderV2.ID.make(item.id) + yield* catalog.provider.update(providerID, (provider) => { + provider.name = item.name + provider.env = [...item.env] + provider.endpoint = item.npm + ? { + type: "aisdk", + package: item.npm, + url: item.api, + } + : { + type: "unknown", + } + }) + + for (const model of Object.values(item.models)) { + const modelID = ModelV2.ID.make(model.id) + yield* catalog.model + .update(providerID, modelID, (draft) => { + draft.name = model.name + draft.family = model.family ? ModelV2.Family.make(model.family) : undefined + draft.endpoint = model.provider?.npm + ? { + type: "aisdk", + package: model.provider?.npm, + url: model.provider.api, + } + : { + type: "unknown", + } + draft.capabilities = { + tools: model.tool_call, + input: [...(model.modalities?.input ?? [])], + output: [...(model.modalities?.output ?? [])], + } + draft.variants = variants(model) + draft.time.released = released(model.release_date) + draft.cost = cost(model.cost) + draft.status = model.status ?? "active" + draft.enabled = true + draft.limit = { + context: model.limit.context, + input: model.limit.input, + output: model.limit.output, + } + }) + .pipe(Effect.orDie) + } + } + }).pipe(Effect.provide(ModelsDev.defaultLayer)), +}) diff --git a/packages/core/src/plugin/provider.ts b/packages/core/src/plugin/provider.ts new file mode 100644 index 000000000000..1880787495fd --- /dev/null +++ b/packages/core/src/plugin/provider.ts @@ -0,0 +1 @@ +export { ProviderPlugins } from "./provider/index" diff --git a/packages/core/src/plugin/provider/alibaba.ts b/packages/core/src/plugin/provider/alibaba.ts new file mode 100644 index 000000000000..fa5c0a91cfb6 --- /dev/null +++ b/packages/core/src/plugin/provider/alibaba.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const AlibabaPlugin = PluginV2.define({ + id: PluginV2.ID.make("alibaba"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/alibaba") return + const mod = yield* Effect.promise(() => import("@ai-sdk/alibaba")) + evt.sdk = mod.createAlibaba(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/amazon-bedrock.ts b/packages/core/src/plugin/provider/amazon-bedrock.ts new file mode 100644 index 000000000000..366548a0a32c --- /dev/null +++ b/packages/core/src/plugin/provider/amazon-bedrock.ts @@ -0,0 +1,94 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +// Bedrock cross-region inference profiles require regional prefixes only for +// specific model/region combinations. Keep the mapping narrow and avoid +// double-prefixing model IDs that models.dev already marks as global/us/eu/etc. +function resolveModelID(modelID: string, region: string | undefined) { + const crossRegionPrefixes = ["global.", "us.", "eu.", "jp.", "apac.", "au."] + if (crossRegionPrefixes.some((prefix) => modelID.startsWith(prefix))) return modelID + + const resolvedRegion = region ?? "us-east-1" + const regionPrefix = resolvedRegion.split("-")[0] + if (regionPrefix === "us") { + const requiresPrefix = ["nova-micro", "nova-lite", "nova-pro", "nova-premier", "nova-2", "claude", "deepseek"].some( + (item) => modelID.includes(item), + ) + if (requiresPrefix && !resolvedRegion.startsWith("us-gov")) return `${regionPrefix}.${modelID}` + return modelID + } + if (regionPrefix === "eu") { + const regionRequiresPrefix = [ + "eu-west-1", + "eu-west-2", + "eu-west-3", + "eu-north-1", + "eu-central-1", + "eu-south-1", + "eu-south-2", + ].some((item) => resolvedRegion.includes(item)) + const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "llama3", "pixtral"].some((item) => + modelID.includes(item), + ) + return regionRequiresPrefix && modelRequiresPrefix ? `${regionPrefix}.${modelID}` : modelID + } + if (regionPrefix !== "ap") return modelID + + const australia = ["ap-southeast-2", "ap-southeast-4"].includes(resolvedRegion) + if (australia && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((item) => modelID.includes(item))) { + return `au.${modelID}` + } + + const prefix = resolvedRegion === "ap-northeast-1" ? "jp" : "apac" + return ["claude", "nova-lite", "nova-micro", "nova-pro"].some((item) => modelID.includes(item)) + ? `${prefix}.${modelID}` + : modelID +} + +export const AmazonBedrockPlugin = PluginV2.define({ + id: PluginV2.ID.make("amazon-bedrock"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.amazonBedrock) return + if (evt.provider.endpoint.type !== "aisdk") return + if (typeof evt.provider.options.aisdk.provider.endpoint !== "string") return + // The AI SDK expects a base URL, but users configure Bedrock private/VPC + // endpoints as `endpoint`; move it into the catalog endpoint URL once. + evt.provider.endpoint.url = evt.provider.options.aisdk.provider.endpoint + delete evt.provider.options.aisdk.provider.endpoint + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/amazon-bedrock") return + const options = { ...evt.options } + const profile = typeof options.profile === "string" ? options.profile : process.env.AWS_PROFILE + const region = typeof options.region === "string" ? options.region : (process.env.AWS_REGION ?? "us-east-1") + const bearerToken = + process.env.AWS_BEARER_TOKEN_BEDROCK ?? + (typeof options.bearerToken === "string" ? options.bearerToken : undefined) + if (bearerToken && !process.env.AWS_BEARER_TOKEN_BEDROCK) process.env.AWS_BEARER_TOKEN_BEDROCK = bearerToken + const containerCreds = Boolean( + process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI || process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI, + ) + + options.region = region + if (typeof options.endpoint === "string") options.baseURL = options.endpoint + if (!bearerToken && options.credentialProvider === undefined) { + // Do not gate SDK creation on explicit AWS env vars. The default chain + // also handles ~/.aws/credentials, SSO, process creds, and instance roles. + const { fromNodeProviderChain } = yield* Effect.promise(() => import("@aws-sdk/credential-providers")) + options.credentialProvider = fromNodeProviderChain(profile ? { profile } : {}) + } + + const mod = yield* Effect.promise(() => import("@ai-sdk/amazon-bedrock")) + evt.sdk = mod.createAmazonBedrock(options) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.amazonBedrock) return + const region = typeof evt.options.region === "string" ? evt.options.region : process.env.AWS_REGION + evt.language = evt.sdk.languageModel(resolveModelID(evt.model.apiID, region)) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/anthropic.ts b/packages/core/src/plugin/provider/anthropic.ts new file mode 100644 index 000000000000..14851c4a3193 --- /dev/null +++ b/packages/core/src/plugin/provider/anthropic.ts @@ -0,0 +1,21 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const AnthropicPlugin = PluginV2.define({ + id: PluginV2.ID.make("anthropic"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.anthropic) return + evt.provider.options.headers["anthropic-beta"] = + "interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14" + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/anthropic") return + const mod = yield* Effect.promise(() => import("@ai-sdk/anthropic")) + evt.sdk = mod.createAnthropic(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/azure.ts b/packages/core/src/plugin/provider/azure.ts new file mode 100644 index 000000000000..6c29a161034f --- /dev/null +++ b/packages/core/src/plugin/provider/azure.ts @@ -0,0 +1,64 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +function selectLanguage(sdk: any, modelID: string, useChat: boolean) { + if (useChat && sdk.chat) return sdk.chat(modelID) + if (sdk.responses) return sdk.responses(modelID) + if (sdk.messages) return sdk.messages(modelID) + if (sdk.chat) return sdk.chat(modelID) + return sdk.languageModel(modelID) +} + +export const AzurePlugin = PluginV2.define({ + id: PluginV2.ID.make("azure"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.azure) return + const configured = evt.provider.options.aisdk.provider.resourceName + const resourceName = + typeof configured === "string" && configured.trim() !== "" ? configured : process.env.AZURE_RESOURCE_NAME + if (resourceName) evt.provider.options.aisdk.provider.resourceName = resourceName + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/azure") return + if (evt.model.providerID === ProviderV2.ID.azure) { + if ( + !evt.options.resourceName && + !evt.options.baseURL && + (evt.model.endpoint.type !== "aisdk" || !evt.model.endpoint.url) + ) { + throw new Error( + "AZURE_RESOURCE_NAME is missing, set it using env var or reconnecting the azure provider and setting it", + ) + } + } + const mod = yield* Effect.promise(() => import("@ai-sdk/azure")) + evt.sdk = mod.createAzure(evt.options) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.azure) return + evt.language = selectLanguage(evt.sdk, evt.model.apiID, Boolean(evt.options.useCompletionUrls)) + }), + } + }), +}) + +export const AzureCognitiveServicesPlugin = PluginV2.define({ + id: PluginV2.ID.make("azure-cognitive-services"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("azure-cognitive-services")) return + const resourceName = process.env.AZURE_COGNITIVE_SERVICES_RESOURCE_NAME + if (resourceName) + evt.provider.options.aisdk.provider.baseURL = `https://${resourceName}.cognitiveservices.azure.com/openai` + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.make("azure-cognitive-services")) return + evt.language = selectLanguage(evt.sdk, evt.model.apiID, Boolean(evt.options.useCompletionUrls)) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/cerebras.ts b/packages/core/src/plugin/provider/cerebras.ts new file mode 100644 index 000000000000..b2fadd8bf114 --- /dev/null +++ b/packages/core/src/plugin/provider/cerebras.ts @@ -0,0 +1,20 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const CerebrasPlugin = PluginV2.define({ + id: PluginV2.ID.make("cerebras"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("cerebras")) return + evt.provider.options.headers["X-Cerebras-3rd-Party-Integration"] = "opencode" + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/cerebras") return + const mod = yield* Effect.promise(() => import("@ai-sdk/cerebras")) + evt.sdk = mod.createCerebras(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/cloudflare-ai-gateway.ts b/packages/core/src/plugin/provider/cloudflare-ai-gateway.ts new file mode 100644 index 000000000000..ffcd4adcf46c --- /dev/null +++ b/packages/core/src/plugin/provider/cloudflare-ai-gateway.ts @@ -0,0 +1,81 @@ +import os from "os" +import { InstallationVersion } from "../../installation/version" +import { Effect, Option, Schema } from "effect" +import { PluginV2 } from "../../plugin" + +export const CloudflareAIGatewayPlugin = PluginV2.define({ + id: PluginV2.ID.make("cloudflare-ai-gateway"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "ai-gateway-provider") return + if (evt.options.baseURL) return + + const config = gatewayConfig(evt.options) + if (!config) return + const metadata = gatewayMetadata(evt.options) + const { createAiGateway } = yield* Effect.promise(() => import("ai-gateway-provider")).pipe(Effect.orDie) + const { createUnified } = yield* Effect.promise(() => import("ai-gateway-provider/providers/unified")).pipe( + Effect.orDie, + ) + const gateway = createAiGateway({ + accountId: config.accountId, + gateway: config.gatewayId, + apiKey: config.apiKey, + options: gatewayOptions(evt.options, metadata), + } as any) + const unified = createUnified() + evt.sdk = { + languageModel(modelID: string) { + return gateway(unified(modelID)) + }, + } + }), + } + }), +}) + +type GatewayConfig = { + accountId: string + gatewayId: string + apiKey: string +} + +const decodeJson = Schema.decodeUnknownOption(Schema.UnknownFromJsonString) + +function gatewayConfig(options: Record): GatewayConfig | undefined { + const accountId = process.env.CLOUDFLARE_ACCOUNT_ID ?? stringOption(options, "accountId") + // AuthPlugin copies CLI prompt metadata into options. The prompt stores the + // gateway as gatewayId, while older config examples may use gateway. + const gatewayId = + process.env.CLOUDFLARE_GATEWAY_ID ?? stringOption(options, "gatewayId") ?? stringOption(options, "gateway") + const apiKey = process.env.CLOUDFLARE_API_TOKEN ?? process.env.CF_AIG_TOKEN ?? stringOption(options, "apiKey") + if (!accountId || !gatewayId || !apiKey) return undefined + + return { accountId, gatewayId, apiKey } +} + +function gatewayMetadata(options: Record) { + // Preserve the legacy cf-aig-metadata header escape hatch for gateway logging + // metadata, but prefer the typed metadata option when present. + if (options.metadata !== undefined) return options.metadata + const raw = (options.headers as Record | undefined)?.["cf-aig-metadata"] + return raw ? Option.getOrUndefined(decodeJson(raw)) : undefined +} + +function gatewayOptions(options: Record, metadata: unknown) { + return { + metadata, + cacheTtl: options.cacheTtl, + cacheKey: options.cacheKey, + skipCache: options.skipCache, + collectLog: options.collectLog, + headers: { + "User-Agent": `opencode/${InstallationVersion} cloudflare-ai-gateway (${os.platform()} ${os.release()}; ${os.arch()})`, + }, + } +} + +function stringOption(options: Record, key: string) { + return typeof options[key] === "string" ? options[key] : undefined +} diff --git a/packages/core/src/plugin/provider/cloudflare-workers-ai.ts b/packages/core/src/plugin/provider/cloudflare-workers-ai.ts new file mode 100644 index 000000000000..f39869b57d7d --- /dev/null +++ b/packages/core/src/plugin/provider/cloudflare-workers-ai.ts @@ -0,0 +1,69 @@ +import os from "os" +import { InstallationVersion } from "../../installation/version" +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +const providerID = ProviderV2.ID.make("cloudflare-workers-ai") + +export const CloudflareWorkersAIPlugin = PluginV2.define({ + id: PluginV2.ID.make("cloudflare-workers-ai"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== providerID) return + if (evt.provider.endpoint.type !== "aisdk") return + if (evt.provider.endpoint.url) return + + const accountId = resolveAccountId(evt.provider.options.aisdk.provider) + if (accountId) evt.provider.endpoint.url = workersEndpoint(accountId) + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.model.providerID !== providerID) return + if (evt.package !== "@ai-sdk/openai-compatible") return + + if (!hasWorkersEndpoint(evt.model.endpoint)) return + const mod = yield* Effect.promise(() => import("@ai-sdk/openai-compatible")) + evt.sdk = mod.createOpenAICompatible(sdkOptions(evt.options) as any) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== providerID) return + evt.language = evt.sdk.languageModel(evt.model.apiID) + }), + } + }), +}) + +function resolveAccountId(options: Record) { + return process.env.CLOUDFLARE_ACCOUNT_ID ?? stringOption(options, "accountId") +} + +function workersEndpoint(accountId: string) { + return `https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/v1` +} + +function hasWorkersEndpoint(endpoint: ProviderV2.Endpoint) { + return endpoint.type === "aisdk" && Boolean(endpoint.url) +} + +function sdkOptions(options: Record) { + return { + ...options, + baseURL: expandAccountId(options.baseURL), + apiKey: process.env.CLOUDFLARE_API_KEY ?? options.apiKey, + headers: { + "User-Agent": `opencode/${InstallationVersion} cloudflare-workers-ai (${os.platform()} ${os.release()}; ${os.arch()})`, + ...options.headers, + }, + name: providerID, + } +} + +function expandAccountId(baseURL: unknown) { + if (typeof baseURL !== "string") return baseURL + return baseURL.replaceAll("${CLOUDFLARE_ACCOUNT_ID}", process.env.CLOUDFLARE_ACCOUNT_ID ?? "${CLOUDFLARE_ACCOUNT_ID}") +} + +function stringOption(options: Record, key: string) { + return typeof options[key] === "string" ? options[key] : undefined +} diff --git a/packages/core/src/plugin/provider/cohere.ts b/packages/core/src/plugin/provider/cohere.ts new file mode 100644 index 000000000000..991c370d1751 --- /dev/null +++ b/packages/core/src/plugin/provider/cohere.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const CoherePlugin = PluginV2.define({ + id: PluginV2.ID.make("cohere"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/cohere") return + const mod = yield* Effect.promise(() => import("@ai-sdk/cohere")) + evt.sdk = mod.createCohere(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/deepinfra.ts b/packages/core/src/plugin/provider/deepinfra.ts new file mode 100644 index 000000000000..bbd42f6e283b --- /dev/null +++ b/packages/core/src/plugin/provider/deepinfra.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const DeepInfraPlugin = PluginV2.define({ + id: PluginV2.ID.make("deepinfra"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/deepinfra") return + const mod = yield* Effect.promise(() => import("@ai-sdk/deepinfra")) + evt.sdk = mod.createDeepInfra(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/dynamic.ts b/packages/core/src/plugin/provider/dynamic.ts new file mode 100644 index 000000000000..e5abc7009e30 --- /dev/null +++ b/packages/core/src/plugin/provider/dynamic.ts @@ -0,0 +1,31 @@ +import { Npm } from "../../npm" +import { Effect, Option } from "effect" +import { pathToFileURL } from "url" +import { PluginV2 } from "../../plugin" + +export const DynamicProviderPlugin = PluginV2.define({ + id: PluginV2.ID.make("dynamic-provider"), + effect: Effect.gen(function* () { + const npm = yield* Npm.Service + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.sdk) return + + const installedPath = evt.package.startsWith("file://") + ? evt.package + : Option.getOrUndefined((yield* npm.add(evt.package).pipe(Effect.orDie)).entrypoint) + if (!installedPath) throw new Error(`Package ${evt.package} has no import entrypoint`) + + const mod = yield* Effect.promise(async () => { + return (await import( + installedPath.startsWith("file://") ? installedPath : pathToFileURL(installedPath).href + )) as Record any> + }).pipe(Effect.orDie) + const match = Object.keys(mod).find((name) => name.startsWith("create")) + if (!match) throw new Error(`Package ${evt.package} has no provider factory export`) + + evt.sdk = mod[match](evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/gateway.ts b/packages/core/src/plugin/provider/gateway.ts new file mode 100644 index 000000000000..5b08ad9ef5e2 --- /dev/null +++ b/packages/core/src/plugin/provider/gateway.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const GatewayPlugin = PluginV2.define({ + id: PluginV2.ID.make("gateway"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/gateway") return + const mod = yield* Effect.promise(() => import("@ai-sdk/gateway")) + evt.sdk = mod.createGateway(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/github-copilot.ts b/packages/core/src/plugin/provider/github-copilot.ts new file mode 100644 index 000000000000..31e57ba12ab6 --- /dev/null +++ b/packages/core/src/plugin/provider/github-copilot.ts @@ -0,0 +1,44 @@ +import { Effect } from "effect" +import { ModelV2 } from "../../model" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +function shouldUseResponses(modelID: string) { + // Copilot supports Responses for GPT-5 class models, except mini variants + // which still need the chat-completions endpoint. + const match = /^gpt-(\d+)/.exec(modelID) + if (!match) return false + return Number(match[1]) >= 5 && !modelID.startsWith("gpt-5-mini") +} + +export const GithubCopilotPlugin = PluginV2.define({ + id: PluginV2.ID.make("github-copilot"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.githubCopilot) return + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/github-copilot") return + const mod = yield* Effect.promise(() => import("../../github-copilot/copilot-provider")) + evt.sdk = mod.createOpenaiCompatible(evt.options) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.githubCopilot) return + if (evt.sdk.responses === undefined && evt.sdk.chat === undefined) { + evt.language = evt.sdk.languageModel(evt.model.apiID) + return + } + evt.language = shouldUseResponses(evt.model.apiID) + ? evt.sdk.responses(evt.model.apiID) + : evt.sdk.chat(evt.model.apiID) + }), + "model.update": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.githubCopilot) return + // This chat-only alias conflicts with the Copilot GPT-5 Responses route, + // so hide it only for Copilot rather than for every provider catalog. + if (evt.model.id === ModelV2.ID.make("gpt-5-chat-latest")) evt.cancel = true + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/gitlab.ts b/packages/core/src/plugin/provider/gitlab.ts new file mode 100644 index 000000000000..226f5a45eb4c --- /dev/null +++ b/packages/core/src/plugin/provider/gitlab.ts @@ -0,0 +1,65 @@ +import os from "os" +import { InstallationVersion } from "../../installation/version" +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const GitLabPlugin = PluginV2.define({ + id: PluginV2.ID.make("gitlab"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "gitlab-ai-provider") return + const mod = yield* Effect.promise(() => import("gitlab-ai-provider")) + evt.sdk = mod.createGitLab({ + ...evt.options, + instanceUrl: + typeof evt.options.instanceUrl === "string" + ? evt.options.instanceUrl + : (process.env.GITLAB_INSTANCE_URL ?? "https://gitlab.com"), + apiKey: typeof evt.options.apiKey === "string" ? evt.options.apiKey : process.env.GITLAB_TOKEN, + aiGatewayHeaders: { + "User-Agent": `opencode/${InstallationVersion} gitlab-ai-provider/${mod.VERSION} (${os.platform()} ${os.release()}; ${os.arch()})`, + "anthropic-beta": "context-1m-2025-08-07", + ...evt.options.aiGatewayHeaders, + }, + featureFlags: { + duo_agent_platform_agentic_chat: true, + duo_agent_platform: true, + ...evt.options.featureFlags, + }, + }) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.gitlab) return + const featureFlags = + typeof evt.options.featureFlags === "object" && evt.options.featureFlags ? evt.options.featureFlags : {} + if (evt.model.apiID.startsWith("duo-workflow-")) { + const gitlab = yield* Effect.promise(() => import("gitlab-ai-provider")).pipe(Effect.orDie) + const workflowRef = + typeof evt.model.options.aisdk.request.workflowRef === "string" + ? evt.model.options.aisdk.request.workflowRef + : undefined + const workflowDefinition = + typeof evt.model.options.aisdk.request.workflowDefinition === "string" + ? evt.model.options.aisdk.request.workflowDefinition + : undefined + const language = evt.sdk.workflowChat( + gitlab.isWorkflowModel(evt.model.apiID) ? evt.model.apiID : "duo-workflow", + { + featureFlags, + workflowDefinition, + }, + ) + if (workflowRef) language.selectedModelRef = workflowRef + evt.language = language + return + } + evt.language = evt.sdk.agenticChat(evt.model.apiID, { + aiGatewayHeaders: evt.options.aiGatewayHeaders, + featureFlags, + }) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/google-vertex.ts b/packages/core/src/plugin/provider/google-vertex.ts new file mode 100644 index 000000000000..0c335df9312b --- /dev/null +++ b/packages/core/src/plugin/provider/google-vertex.ts @@ -0,0 +1,141 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +function resolveProject(options: Record) { + // models.dev advertises GOOGLE_VERTEX_PROJECT for Vertex, while Google SDKs + // and ADC examples commonly use the broader Google Cloud project aliases. + return ( + options.project ?? + process.env.GOOGLE_VERTEX_PROJECT ?? + process.env.GOOGLE_CLOUD_PROJECT ?? + process.env.GCP_PROJECT ?? + process.env.GCLOUD_PROJECT + ) +} + +function resolveLocation(options: Record) { + return ( + options.location ?? + process.env.GOOGLE_VERTEX_LOCATION ?? + process.env.GOOGLE_CLOUD_LOCATION ?? + process.env.VERTEX_LOCATION ?? + "us-central1" + ) +} + +function vertexEndpoint(location: string) { + return location === "global" ? "aiplatform.googleapis.com" : `${location}-aiplatform.googleapis.com` +} + +function replaceVertexVars(value: string, project: string | undefined, location: string) { + // Vertex OpenAI-compatible endpoints are stored as templates in the catalog; + // expand them after provider config/env project and location have been resolved. + return value + .replaceAll("${GOOGLE_VERTEX_PROJECT}", project ?? "${GOOGLE_VERTEX_PROJECT}") + .replaceAll("${GOOGLE_VERTEX_LOCATION}", location) + .replaceAll("${GOOGLE_VERTEX_ENDPOINT}", vertexEndpoint(location)) +} + +function authFetch(fetchWithRuntimeOptions?: unknown) { + // Native Vertex SDKs handle ADC internally. OpenAI-compatible Vertex endpoints + // do not, so inject a Google access token into their fetch path. + return async (input: Parameters[0], init?: RequestInit) => { + const { GoogleAuth } = await import("google-auth-library") + const auth = new GoogleAuth() + const client = await auth.getApplicationDefault() + const token = await client.credential.getAccessToken() + const headers = new Headers(init?.headers) + headers.set("Authorization", `Bearer ${token.token}`) + return typeof fetchWithRuntimeOptions === "function" + ? fetchWithRuntimeOptions(input, { ...init, headers }) + : fetch(input, { ...init, headers }) + } +} + +export const GoogleVertexPlugin = PluginV2.define({ + id: PluginV2.ID.make("google-vertex"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.googleVertex) return + const project = resolveProject(evt.provider.options.aisdk.provider) + const location = String(resolveLocation(evt.provider.options.aisdk.provider)) + if (project) evt.provider.options.aisdk.provider.project = project + evt.provider.options.aisdk.provider.location = location + if (evt.provider.endpoint.type === "aisdk" && evt.provider.endpoint.url) { + evt.provider.endpoint.url = replaceVertexVars(evt.provider.endpoint.url, project, location) + } + if ( + evt.provider.endpoint.type === "aisdk" && + evt.provider.endpoint.package.includes("@ai-sdk/openai-compatible") + ) { + evt.provider.options.aisdk.provider.fetch = authFetch(evt.provider.options.aisdk.provider.fetch) + } + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.model.providerID === ProviderV2.ID.googleVertex && evt.package.includes("@ai-sdk/openai-compatible")) { + evt.options.fetch = authFetch(evt.options.fetch) + return + } + if (evt.package !== "@ai-sdk/google-vertex") return + const mod = yield* Effect.promise(() => import("@ai-sdk/google-vertex")) + const project = resolveProject(evt.options) + const location = resolveLocation(evt.options) + const options = { ...evt.options } + delete options.fetch + evt.sdk = mod.createVertex({ + ...options, + project, + location, + }) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.googleVertex) return + evt.language = evt.sdk.languageModel(String(evt.model.apiID).trim()) + }), + } + }), +}) + +export const GoogleVertexAnthropicPlugin = PluginV2.define({ + id: PluginV2.ID.make("google-vertex-anthropic"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("google-vertex-anthropic")) return + const project = + evt.provider.options.aisdk.provider.project ?? + process.env.GOOGLE_CLOUD_PROJECT ?? + process.env.GCP_PROJECT ?? + process.env.GCLOUD_PROJECT + const location = + evt.provider.options.aisdk.provider.location ?? + process.env.GOOGLE_CLOUD_LOCATION ?? + process.env.VERTEX_LOCATION ?? + "global" + if (project) evt.provider.options.aisdk.provider.project = project + evt.provider.options.aisdk.provider.location = location + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/google-vertex/anthropic") return + const mod = yield* Effect.promise(() => import("@ai-sdk/google-vertex/anthropic")) + evt.sdk = mod.createVertexAnthropic({ + ...evt.options, + project: + typeof evt.options.project === "string" + ? evt.options.project + : (process.env.GOOGLE_CLOUD_PROJECT ?? process.env.GCP_PROJECT ?? process.env.GCLOUD_PROJECT), + location: + typeof evt.options.location === "string" + ? evt.options.location + : (process.env.GOOGLE_CLOUD_LOCATION ?? process.env.VERTEX_LOCATION ?? "global"), + }) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.make("google-vertex-anthropic")) return + evt.language = evt.sdk.languageModel(String(evt.model.apiID).trim()) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/google.ts b/packages/core/src/plugin/provider/google.ts new file mode 100644 index 000000000000..47e29c6b5d54 --- /dev/null +++ b/packages/core/src/plugin/provider/google.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const GooglePlugin = PluginV2.define({ + id: PluginV2.ID.make("google"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/google") return + const mod = yield* Effect.promise(() => import("@ai-sdk/google")) + evt.sdk = mod.createGoogleGenerativeAI(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/groq.ts b/packages/core/src/plugin/provider/groq.ts new file mode 100644 index 000000000000..f2052afd1a86 --- /dev/null +++ b/packages/core/src/plugin/provider/groq.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const GroqPlugin = PluginV2.define({ + id: PluginV2.ID.make("groq"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/groq") return + const mod = yield* Effect.promise(() => import("@ai-sdk/groq")) + evt.sdk = mod.createGroq(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/index.ts b/packages/core/src/plugin/provider/index.ts new file mode 100644 index 000000000000..fd02d322a1f9 --- /dev/null +++ b/packages/core/src/plugin/provider/index.ts @@ -0,0 +1,67 @@ +import { AlibabaPlugin } from "./alibaba" +import { AmazonBedrockPlugin } from "./amazon-bedrock" +import { AnthropicPlugin } from "./anthropic" +import { AzureCognitiveServicesPlugin, AzurePlugin } from "./azure" +import { CerebrasPlugin } from "./cerebras" +import { CloudflareAIGatewayPlugin } from "./cloudflare-ai-gateway" +import { CloudflareWorkersAIPlugin } from "./cloudflare-workers-ai" +import { CoherePlugin } from "./cohere" +import { DeepInfraPlugin } from "./deepinfra" +import { DynamicProviderPlugin } from "./dynamic" +import { GatewayPlugin } from "./gateway" +import { GithubCopilotPlugin } from "./github-copilot" +import { GitLabPlugin } from "./gitlab" +import { GooglePlugin } from "./google" +import { GoogleVertexAnthropicPlugin, GoogleVertexPlugin } from "./google-vertex" +import { GroqPlugin } from "./groq" +import { KiloPlugin } from "./kilo" +import { LLMGatewayPlugin } from "./llmgateway" +import { MistralPlugin } from "./mistral" +import { NvidiaPlugin } from "./nvidia" +import { OpenAIPlugin } from "./openai" +import { OpenAICompatiblePlugin } from "./openai-compatible" +import { OpencodePlugin } from "./opencode" +import { OpenRouterPlugin } from "./openrouter" +import { PerplexityPlugin } from "./perplexity" +import { SapAICorePlugin } from "./sap-ai-core" +import { TogetherAIPlugin } from "./togetherai" +import { VercelPlugin } from "./vercel" +import { VenicePlugin } from "./venice" +import { XAIPlugin } from "./xai" +import { ZenmuxPlugin } from "./zenmux" + +export const ProviderPlugins = [ + AlibabaPlugin, + AmazonBedrockPlugin, + AnthropicPlugin, + AzureCognitiveServicesPlugin, + AzurePlugin, + CerebrasPlugin, + CloudflareAIGatewayPlugin, + CloudflareWorkersAIPlugin, + CoherePlugin, + DeepInfraPlugin, + GatewayPlugin, + GithubCopilotPlugin, + GitLabPlugin, + GooglePlugin, + GoogleVertexAnthropicPlugin, + GoogleVertexPlugin, + GroqPlugin, + KiloPlugin, + LLMGatewayPlugin, + MistralPlugin, + NvidiaPlugin, + OpencodePlugin, + OpenAICompatiblePlugin, + OpenAIPlugin, + OpenRouterPlugin, + PerplexityPlugin, + SapAICorePlugin, + TogetherAIPlugin, + VercelPlugin, + VenicePlugin, + XAIPlugin, + ZenmuxPlugin, + DynamicProviderPlugin, +] diff --git a/packages/core/src/plugin/provider/kilo.ts b/packages/core/src/plugin/provider/kilo.ts new file mode 100644 index 000000000000..47b8ec99cd92 --- /dev/null +++ b/packages/core/src/plugin/provider/kilo.ts @@ -0,0 +1,16 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const KiloPlugin = PluginV2.define({ + id: PluginV2.ID.make("kilo"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("kilo")) return + evt.provider.options.headers["HTTP-Referer"] = "https://opencode.ai/" + evt.provider.options.headers["X-Title"] = "opencode" + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/llmgateway.ts b/packages/core/src/plugin/provider/llmgateway.ts new file mode 100644 index 000000000000..da1ab282bdab --- /dev/null +++ b/packages/core/src/plugin/provider/llmgateway.ts @@ -0,0 +1,18 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const LLMGatewayPlugin = PluginV2.define({ + id: PluginV2.ID.make("llmgateway"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("llmgateway")) return + if (evt.provider.enabled === false) return + evt.provider.options.headers["HTTP-Referer"] = "https://opencode.ai/" + evt.provider.options.headers["X-Title"] = "opencode" + evt.provider.options.headers["X-Source"] = "opencode" + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/mistral.ts b/packages/core/src/plugin/provider/mistral.ts new file mode 100644 index 000000000000..e7f0decb79ee --- /dev/null +++ b/packages/core/src/plugin/provider/mistral.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const MistralPlugin = PluginV2.define({ + id: PluginV2.ID.make("mistral"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/mistral") return + const mod = yield* Effect.promise(() => import("@ai-sdk/mistral")) + evt.sdk = mod.createMistral(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/nvidia.ts b/packages/core/src/plugin/provider/nvidia.ts new file mode 100644 index 000000000000..49ef6af0f60c --- /dev/null +++ b/packages/core/src/plugin/provider/nvidia.ts @@ -0,0 +1,17 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const NvidiaPlugin = PluginV2.define({ + id: PluginV2.ID.make("nvidia"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("nvidia")) return + evt.provider.options.headers["HTTP-Referer"] = "https://opencode.ai/" + evt.provider.options.headers["X-Title"] = "opencode" + evt.provider.options.headers["X-BILLING-INVOKE-ORIGIN"] ??= "OpenCode" + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/openai-compatible.ts b/packages/core/src/plugin/provider/openai-compatible.ts new file mode 100644 index 000000000000..76c33737066f --- /dev/null +++ b/packages/core/src/plugin/provider/openai-compatible.ts @@ -0,0 +1,17 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const OpenAICompatiblePlugin = PluginV2.define({ + id: PluginV2.ID.make("openai-compatible"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.sdk) return + if (!evt.package.includes("@ai-sdk/openai-compatible")) return + if (evt.options.includeUsage !== false) evt.options.includeUsage = true + const mod = yield* Effect.promise(() => import("@ai-sdk/openai-compatible")) + evt.sdk = mod.createOpenAICompatible(evt.options as any) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/openai.ts b/packages/core/src/plugin/provider/openai.ts new file mode 100644 index 000000000000..a81455f1985e --- /dev/null +++ b/packages/core/src/plugin/provider/openai.ts @@ -0,0 +1,27 @@ +import { Effect } from "effect" +import { ModelV2 } from "../../model" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const OpenAIPlugin = PluginV2.define({ + id: PluginV2.ID.make("openai"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/openai") return + const mod = yield* Effect.promise(() => import("@ai-sdk/openai")) + evt.sdk = mod.createOpenAI(evt.options) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.openai) return + evt.language = evt.sdk.responses(evt.model.apiID) + }), + "model.update": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.openai) return + // OpenAIPlugin sends OpenAI models through Responses; this alias is a + // chat-completions-only model, so remove it only from OpenAI's catalog. + if (evt.model.id === ModelV2.ID.make("gpt-5-chat-latest")) evt.cancel = true + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/opencode.ts b/packages/core/src/plugin/provider/opencode.ts new file mode 100644 index 000000000000..10bbb62dadbe --- /dev/null +++ b/packages/core/src/plugin/provider/opencode.ts @@ -0,0 +1,27 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const OpencodePlugin = PluginV2.define({ + id: PluginV2.ID.make("opencode"), + effect: Effect.gen(function* () { + let hasKey = false + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.opencode) return + hasKey = Boolean( + process.env.OPENCODE_API_KEY || + evt.provider.env.some((item) => process.env[item]) || + evt.provider.options.aisdk.provider.apiKey || + (evt.provider.enabled && evt.provider.enabled.via === "auth"), + ) + if (!hasKey) evt.provider.options.aisdk.provider.apiKey = "public" + }), + "model.update": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.opencode) return + if (hasKey) return + if (evt.model.cost.some((item) => item.input > 0)) evt.cancel = true + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/openrouter.ts b/packages/core/src/plugin/provider/openrouter.ts new file mode 100644 index 000000000000..976eea8c057b --- /dev/null +++ b/packages/core/src/plugin/provider/openrouter.ts @@ -0,0 +1,29 @@ +import { Effect } from "effect" +import { ModelV2 } from "../../model" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const OpenRouterPlugin = PluginV2.define({ + id: PluginV2.ID.make("openrouter"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.openrouter) return + evt.provider.options.headers["HTTP-Referer"] = "https://opencode.ai/" + evt.provider.options.headers["X-Title"] = "opencode" + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@openrouter/ai-sdk-provider") return + const mod = yield* Effect.promise(() => import("@openrouter/ai-sdk-provider")) + evt.sdk = mod.createOpenRouter(evt.options) + }), + "model.update": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.openrouter) return + // These are OpenRouter-specific OpenAI chat aliases that do not work on + // the generic path. Keep custom providers with matching IDs untouched. + if (evt.model.id === ModelV2.ID.make("gpt-5-chat-latest")) evt.cancel = true + if (evt.model.id === ModelV2.ID.make("openai/gpt-5-chat")) evt.cancel = true + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/perplexity.ts b/packages/core/src/plugin/provider/perplexity.ts new file mode 100644 index 000000000000..2415ab7c1a22 --- /dev/null +++ b/packages/core/src/plugin/provider/perplexity.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const PerplexityPlugin = PluginV2.define({ + id: PluginV2.ID.make("perplexity"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/perplexity") return + const mod = yield* Effect.promise(() => import("@ai-sdk/perplexity")) + evt.sdk = mod.createPerplexity(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/sap-ai-core.ts b/packages/core/src/plugin/provider/sap-ai-core.ts new file mode 100644 index 000000000000..7c57b785bff7 --- /dev/null +++ b/packages/core/src/plugin/provider/sap-ai-core.ts @@ -0,0 +1,44 @@ +import { Npm } from "../../npm" +import { Effect, Option } from "effect" +import { pathToFileURL } from "url" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const SapAICorePlugin = PluginV2.define({ + id: PluginV2.ID.make("sap-ai-core"), + effect: Effect.gen(function* () { + const npm = yield* Npm.Service + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.make("sap-ai-core")) return + const serviceKey = + process.env.AICORE_SERVICE_KEY ?? + (typeof evt.options.serviceKey === "string" ? evt.options.serviceKey : undefined) + if (serviceKey && !process.env.AICORE_SERVICE_KEY) process.env.AICORE_SERVICE_KEY = serviceKey + + const installedPath = evt.package.startsWith("file://") + ? evt.package + : Option.getOrUndefined((yield* npm.add(evt.package).pipe(Effect.orDie)).entrypoint) + if (!installedPath) throw new Error(`Package ${evt.package} has no import entrypoint`) + + const mod = yield* Effect.promise(async () => { + return (await import( + installedPath.startsWith("file://") ? installedPath : pathToFileURL(installedPath).href + )) as Record any> + }).pipe(Effect.orDie) + const match = Object.keys(mod).find((name) => name.startsWith("create")) + if (!match) throw new Error(`Package ${evt.package} has no provider factory export`) + + evt.sdk = mod[match]( + serviceKey + ? { deploymentId: process.env.AICORE_DEPLOYMENT_ID, resourceGroup: process.env.AICORE_RESOURCE_GROUP } + : {}, + ) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.make("sap-ai-core")) return + evt.language = evt.sdk(evt.model.apiID) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/togetherai.ts b/packages/core/src/plugin/provider/togetherai.ts new file mode 100644 index 000000000000..b1870f266253 --- /dev/null +++ b/packages/core/src/plugin/provider/togetherai.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const TogetherAIPlugin = PluginV2.define({ + id: PluginV2.ID.make("togetherai"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/togetherai") return + const mod = yield* Effect.promise(() => import("@ai-sdk/togetherai")) + evt.sdk = mod.createTogetherAI(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/venice.ts b/packages/core/src/plugin/provider/venice.ts new file mode 100644 index 000000000000..8a3b950245c6 --- /dev/null +++ b/packages/core/src/plugin/provider/venice.ts @@ -0,0 +1,15 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" + +export const VenicePlugin = PluginV2.define({ + id: PluginV2.ID.make("venice"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "venice-ai-sdk-provider") return + const mod = yield* Effect.promise(() => import("venice-ai-sdk-provider")) + evt.sdk = mod.createVenice(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/vercel.ts b/packages/core/src/plugin/provider/vercel.ts new file mode 100644 index 000000000000..2108542b1655 --- /dev/null +++ b/packages/core/src/plugin/provider/vercel.ts @@ -0,0 +1,21 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const VercelPlugin = PluginV2.define({ + id: PluginV2.ID.make("vercel"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("vercel")) return + evt.provider.options.headers["http-referer"] = "https://opencode.ai/" + evt.provider.options.headers["x-title"] = "opencode" + }), + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/vercel") return + const mod = yield* Effect.promise(() => import("@ai-sdk/vercel")) + evt.sdk = mod.createVercel(evt.options) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/xai.ts b/packages/core/src/plugin/provider/xai.ts new file mode 100644 index 000000000000..b54aa7374c67 --- /dev/null +++ b/packages/core/src/plugin/provider/xai.ts @@ -0,0 +1,20 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const XAIPlugin = PluginV2.define({ + id: PluginV2.ID.make("xai"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (evt.package !== "@ai-sdk/xai") return + const mod = yield* Effect.promise(() => import("@ai-sdk/xai")) + evt.sdk = mod.createXai(evt.options) + }), + "aisdk.language": Effect.fn(function* (evt) { + if (evt.model.providerID !== ProviderV2.ID.make("xai")) return + evt.language = evt.sdk.responses(evt.model.apiID) + }), + } + }), +}) diff --git a/packages/core/src/plugin/provider/zenmux.ts b/packages/core/src/plugin/provider/zenmux.ts new file mode 100644 index 000000000000..6bdd42601009 --- /dev/null +++ b/packages/core/src/plugin/provider/zenmux.ts @@ -0,0 +1,16 @@ +import { Effect } from "effect" +import { PluginV2 } from "../../plugin" +import { ProviderV2 } from "../../provider" + +export const ZenmuxPlugin = PluginV2.define({ + id: PluginV2.ID.make("zenmux"), + effect: Effect.gen(function* () { + return { + "provider.update": Effect.fn(function* (evt) { + if (evt.provider.id !== ProviderV2.ID.make("zenmux")) return + evt.provider.options.headers["HTTP-Referer"] ??= "https://opencode.ai/" + evt.provider.options.headers["X-Title"] ??= "opencode" + }), + } + }), +}) diff --git a/packages/core/src/process.ts b/packages/core/src/process.ts new file mode 100644 index 000000000000..f076ea4e42c8 --- /dev/null +++ b/packages/core/src/process.ts @@ -0,0 +1,234 @@ +import { Context, Duration, Effect, Fiber, Layer, Schema, Stream } from "effect" +import type { PlatformError } from "effect/PlatformError" +import { ChildProcess } from "effect/unstable/process" +import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner" +import { CrossSpawnSpawner } from "./cross-spawn-spawner" + +export class AppProcessError extends Schema.TaggedErrorClass()("AppProcessError", { + command: Schema.String, + exitCode: Schema.optional(Schema.Number), + stderr: Schema.optional(Schema.String), + cause: Schema.optional(Schema.Defect), +}) {} + +export interface RunOptions { + readonly maxOutputBytes?: number + readonly maxErrorBytes?: number + readonly signal?: AbortSignal + readonly timeout?: Duration.Input + readonly stdin?: string | Uint8Array | Stream.Stream +} + +export interface RunStreamOptions { + readonly signal?: AbortSignal + readonly includeStderr?: boolean + readonly okExitCodes?: ReadonlyArray + readonly maxErrorBytes?: number +} + +export interface RunResult { + readonly command: string + readonly exitCode: number + readonly stdout: Buffer + readonly stderr: Buffer + readonly stdoutTruncated: boolean + readonly stderrTruncated: boolean +} + +export type Interface = ChildProcessSpawner["Service"] & { + readonly run: (command: ChildProcess.Command, options?: RunOptions) => Effect.Effect + readonly runStream: ( + command: ChildProcess.Command, + options?: RunStreamOptions, + ) => Stream.Stream +} + +export class Service extends Context.Service()("@opencode/AppProcess") {} + +export const requireSuccess = (result: RunResult): Effect.Effect => + result.exitCode === 0 + ? Effect.succeed(result) + : Effect.fail( + new AppProcessError({ + command: result.command, + exitCode: result.exitCode, + stderr: result.stderr.toString("utf8"), + }), + ) + +export const requireExitIn = + (codes: ReadonlyArray) => + (result: RunResult): Effect.Effect => + codes.includes(result.exitCode) + ? Effect.succeed(result) + : Effect.fail( + new AppProcessError({ + command: result.command, + exitCode: result.exitCode, + stderr: result.stderr.toString("utf8"), + }), + ) + +const describeCommand = (command: ChildProcess.Command): string => { + if (command._tag === "StandardCommand") { + return command.args.length ? `${command.command} ${command.args.join(" ")}` : command.command + } + return `${describeCommand(command.left)} | ${describeCommand(command.right)}` +} + +const wrapError = (description: string, cause: unknown): AppProcessError => + cause instanceof AppProcessError ? cause : new AppProcessError({ command: description, cause }) + +const abortError = (signal: AbortSignal): Error => { + const reason = signal.reason + if (reason instanceof Error) return reason + const err = new Error("Aborted") + err.name = "AbortError" + return err +} + +const waitForAbort = (signal: AbortSignal) => + Effect.callback((resume) => { + if (signal.aborted) { + resume(Effect.fail(abortError(signal))) + return + } + const onabort = () => resume(Effect.fail(abortError(signal))) + signal.addEventListener("abort", onabort, { once: true }) + return Effect.sync(() => signal.removeEventListener("abort", onabort)) + }) + +const normalizeStdin = ( + input: string | Uint8Array | Stream.Stream, +): Stream.Stream => + typeof input === "string" + ? Stream.make(new TextEncoder().encode(input)) + : input instanceof Uint8Array + ? Stream.make(input) + : input + +const collectStream = (stream: Stream.Stream, maxOutputBytes: number | undefined) => + Stream.runFold( + stream, + () => ({ chunks: [] as Uint8Array[], bytes: 0, truncated: false }), + (acc, chunk) => { + if (maxOutputBytes === undefined) { + acc.chunks.push(chunk) + acc.bytes += chunk.length + return acc + } + const remaining = maxOutputBytes - acc.bytes + if (remaining > 0) acc.chunks.push(remaining >= chunk.length ? chunk : chunk.slice(0, remaining)) + acc.bytes += chunk.length + acc.truncated = acc.truncated || acc.bytes > maxOutputBytes + return acc + }, + ).pipe(Effect.map((x) => ({ buffer: Buffer.concat(x.chunks), truncated: x.truncated }))) + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const spawner = yield* ChildProcessSpawner + + const runCommand = (command: ChildProcess.Command, options?: RunOptions) => { + const description = describeCommand(command) + const collect = Effect.scoped( + Effect.gen(function* () { + const handle = yield* spawner.spawn(command) + const [stdout, stderr, exitCode] = yield* Effect.all( + [ + collectStream(handle.stdout, options?.maxOutputBytes), + collectStream(handle.stderr, options?.maxErrorBytes), + handle.exitCode, + ], + { concurrency: "unbounded" }, + ) + return { + command: description, + exitCode, + stdout: stdout.buffer, + stderr: stderr.buffer, + stdoutTruncated: stdout.truncated, + stderrTruncated: stderr.truncated, + } satisfies RunResult + }), + ) + const timed = options?.timeout + ? Effect.timeoutOrElse(collect, { + duration: options.timeout, + orElse: () => Effect.fail(new AppProcessError({ command: description, cause: new Error("Timed out") })), + }) + : collect + const aborted = options?.signal + ? timed.pipe( + Effect.raceFirst( + waitForAbort(options.signal).pipe(Effect.mapError((cause) => wrapError(description, cause))), + ), + ) + : timed + return aborted.pipe(Effect.catch((cause) => Effect.fail(wrapError(description, cause)))) + } + + const run = Effect.fn("AppProcess.run")(function* (command: ChildProcess.Command, options?: RunOptions) { + if (options?.stdin === undefined) return yield* runCommand(command, options) + if (command._tag !== "StandardCommand") { + return yield* new AppProcessError({ + command: describeCommand(command), + cause: new Error("stdin option only supports StandardCommand; received PipedCommand"), + }) + } + const next = ChildProcess.make(command.command, command.args, { + ...command.options, + stdin: normalizeStdin(options.stdin), + }) + return yield* runCommand(next, options) + }) + + const runStream = ( + command: ChildProcess.Command, + options?: RunStreamOptions, + ): Stream.Stream => { + const description = describeCommand(command) + const okExitCodes = options?.okExitCodes + const built: Stream.Stream = Stream.unwrap( + Effect.gen(function* () { + const handle = yield* spawner.spawn(command) + const stderrFiber = yield* Effect.forkScoped( + collectStream(handle.stderr, options?.maxErrorBytes).pipe(Effect.map((x) => x.buffer.toString("utf8"))), + ) + const source = options?.includeStderr === true ? handle.all : handle.stdout + const lines = source.pipe( + Stream.decodeText, + Stream.splitLines, + Stream.filter((line) => line.length > 0), + ) + const tail = Stream.unwrap( + Effect.gen(function* () { + const code = yield* handle.exitCode + if (okExitCodes && okExitCodes.length > 0 && !okExitCodes.includes(code)) { + const stderr = yield* Fiber.join(stderrFiber) + return Stream.fail(new AppProcessError({ command: description, exitCode: code, stderr })) + } + return Stream.empty + }), + ) + return Stream.concat(lines, tail) as Stream.Stream + }), + ) + const mapped = built.pipe( + Stream.catch((cause): Stream.Stream => Stream.fail(wrapError(description, cause))), + ) + if (!options?.signal) return mapped + const signal = options.signal + return mapped.pipe( + Stream.interruptWhen(waitForAbort(signal).pipe(Effect.mapError((cause) => wrapError(description, cause)))), + ) + } + + return Service.of({ ...spawner, run, runStream }) + }), +) + +export const defaultLayer = layer.pipe(Layer.provide(CrossSpawnSpawner.defaultLayer)) + +export * as AppProcess from "./process" diff --git a/packages/core/src/provider.ts b/packages/core/src/provider.ts new file mode 100644 index 000000000000..7c1c9666542e --- /dev/null +++ b/packages/core/src/provider.ts @@ -0,0 +1,120 @@ +export * as ProviderV2 from "./provider" + +import { withStatics } from "./schema" +import { Schema } from "effect" + +export const ID = Schema.String.pipe( + Schema.brand("ProviderV2.ID"), + withStatics((schema) => ({ + // Well-known providers + opencode: schema.make("opencode"), + anthropic: schema.make("anthropic"), + openai: schema.make("openai"), + google: schema.make("google"), + googleVertex: schema.make("google-vertex"), + githubCopilot: schema.make("github-copilot"), + amazonBedrock: schema.make("amazon-bedrock"), + azure: schema.make("azure"), + openrouter: schema.make("openrouter"), + mistral: schema.make("mistral"), + gitlab: schema.make("gitlab"), + })), +) +export type ID = typeof ID.Type + +const OpenAIResponses = Schema.Struct({ + type: Schema.Literal("openai/responses"), + url: Schema.String, + websocket: Schema.optional(Schema.Boolean), +}) + +const OpenAICompletions = Schema.Struct({ + type: Schema.Literal("openai/completions"), + url: Schema.String, + reasoning: Schema.Union([ + Schema.Struct({ + type: Schema.Literal("reasoning_content"), + }), + Schema.Struct({ + type: Schema.Literal("reasoning_details"), + }), + ]).pipe(Schema.optional), +}) +export type OpenAICompletions = typeof OpenAICompletions.Type + +const AISDK = Schema.Struct({ + type: Schema.Literal("aisdk"), + package: Schema.String, + url: Schema.String.pipe(Schema.optional), +}) + +const AnthropicMessages = Schema.Struct({ + type: Schema.Literal("anthropic/messages"), + url: Schema.String, +}) + +const UnknownEndpoint = Schema.Struct({ + type: Schema.Literal("unknown"), +}) + +export const Endpoint = Schema.Union([ + UnknownEndpoint, + OpenAIResponses, + OpenAICompletions, + AnthropicMessages, + AISDK, +]).pipe(Schema.toTaggedUnion("type")) +export type Endpoint = typeof Endpoint.Type + +export const Options = Schema.Struct({ + headers: Schema.Record(Schema.String, Schema.String), + body: Schema.Record(Schema.String, Schema.Any), + aisdk: Schema.Struct({ + provider: Schema.Record(Schema.String, Schema.Any), + request: Schema.Record(Schema.String, Schema.Any), + }), +}) +export type Options = typeof Options.Type + +export class Info extends Schema.Class("ProviderV2.Info")({ + id: ID, + name: Schema.String, + enabled: Schema.Union([ + Schema.Literal(false), + Schema.Struct({ + via: Schema.Literal("env"), + name: Schema.String, + }), + Schema.Struct({ + via: Schema.Literal("auth"), + service: Schema.String, + }), + Schema.Struct({ + via: Schema.Literal("custom"), + data: Schema.Record(Schema.String, Schema.Any), + }), + ]), + env: Schema.String.pipe(Schema.Array), + endpoint: Endpoint, + options: Options, +}) { + static empty(providerID: ID) { + return new Info({ + id: providerID, + name: providerID, + enabled: false, + env: [], + endpoint: { + type: "unknown", + }, + options: { + headers: {}, + body: {}, + aisdk: { + provider: {}, + request: {}, + }, + }, + }) + } +} diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.ts index 2a6c02349fbb..5b4042c7369f 100644 --- a/packages/core/src/schema.ts +++ b/packages/core/src/schema.ts @@ -1,5 +1,4 @@ import { Option, Schema, SchemaGetter } from "effect" -import { zod, ZodOverride } from "./effect-zod" /** * Integer greater than zero. @@ -21,7 +20,6 @@ export const optionalOmitUndefined = (schema: S) => decode: SchemaGetter.passthrough({ strict: false }), encode: SchemaGetter.transformOptional(Option.filter((value) => value !== undefined)), }), - Schema.annotate({ [ZodOverride]: zod(schema).optional() }), ) /** diff --git a/packages/opencode/src/v2/session-event.ts b/packages/core/src/session-event.ts similarity index 72% rename from packages/opencode/src/v2/session-event.ts rename to packages/core/src/session-event.ts index fa211bd8c4ed..a98d9cc05144 100644 --- a/packages/opencode/src/v2/session-event.ts +++ b/packages/core/src/session-event.ts @@ -1,12 +1,13 @@ -import { SessionID } from "@/session/schema" -import { NonNegativeInt } from "@opencode-ai/core/schema" +import { Schema } from "effect" import { EventV2 } from "./event" +import { ModelV2 } from "./model" +import { NonNegativeInt } from "./schema" +import { Session } from "./session" import { FileAttachment, Prompt } from "./session-prompt" -import { Schema } from "effect" -export { FileAttachment } import { ToolOutput } from "./tool-output" -import { V2Schema } from "./schema" -import { Modelv2 } from "./model" +import { V2Schema } from "./v2-schema" + +export { FileAttachment } export const Source = Schema.Struct({ start: NonNegativeInt, @@ -15,104 +16,106 @@ export const Source = Schema.Struct({ }).annotate({ identifier: "session.next.event.source", }) -export type Source = Schema.Schema.Type +export type Source = typeof Source.Type const Base = { timestamp: V2Schema.DateTimeUtcFromMillis, - sessionID: SessionID, + sessionID: Session.ID, } +const options = { + aggregate: "sessionID", + version: 1, +} as const + export const UnknownError = Schema.Struct({ type: Schema.Literal("unknown"), message: Schema.String, }).annotate({ identifier: "Session.Error.Unknown", }) -export type UnknownError = Schema.Schema.Type +export type UnknownError = typeof UnknownError.Type export const AgentSwitched = EventV2.define({ type: "session.next.agent.switched", - aggregate: "sessionID", - version: 1, + ...options, schema: { ...Base, agent: Schema.String, }, }) -export type AgentSwitched = Schema.Schema.Type +export type AgentSwitched = typeof AgentSwitched.Type export const ModelSwitched = EventV2.define({ type: "session.next.model.switched", - aggregate: "sessionID", - version: 1, + ...options, schema: { ...Base, - model: Modelv2.Ref, + model: ModelV2.Ref, }, }) -export type ModelSwitched = Schema.Schema.Type +export type ModelSwitched = typeof ModelSwitched.Type export const Prompted = EventV2.define({ type: "session.next.prompted", - aggregate: "sessionID", - version: 1, + ...options, schema: { ...Base, prompt: Prompt, }, }) -export type Prompted = Schema.Schema.Type +export type Prompted = typeof Prompted.Type export const Synthetic = EventV2.define({ type: "session.next.synthetic", - aggregate: "sessionID", + ...options, schema: { ...Base, text: Schema.String, }, }) -export type Synthetic = Schema.Schema.Type +export type Synthetic = typeof Synthetic.Type export namespace Shell { export const Started = EventV2.define({ type: "session.next.shell.started", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, command: Schema.String, }, }) - export type Started = Schema.Schema.Type + export type Started = typeof Started.Type export const Ended = EventV2.define({ type: "session.next.shell.ended", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, output: Schema.String, }, }) - export type Ended = Schema.Schema.Type + export type Ended = typeof Ended.Type } export namespace Step { export const Started = EventV2.define({ type: "session.next.step.started", - aggregate: "sessionID", + ...options, schema: { ...Base, agent: Schema.String, - model: Modelv2.Ref, + model: ModelV2.Ref, snapshot: Schema.String.pipe(Schema.optional), }, }) - export type Started = Schema.Schema.Type + export type Started = typeof Started.Type export const Ended = EventV2.define({ type: "session.next.step.ended", - aggregate: "sessionID", + ...options, schema: { ...Base, finish: Schema.String, @@ -129,123 +132,123 @@ export namespace Step { snapshot: Schema.String.pipe(Schema.optional), }, }) - export type Ended = Schema.Schema.Type + export type Ended = typeof Ended.Type export const Failed = EventV2.define({ type: "session.next.step.failed", - aggregate: "sessionID", + ...options, schema: { ...Base, error: UnknownError, }, }) - export type Failed = Schema.Schema.Type + export type Failed = typeof Failed.Type } export namespace Text { export const Started = EventV2.define({ type: "session.next.text.started", - aggregate: "sessionID", + ...options, schema: { ...Base, }, }) - export type Started = Schema.Schema.Type + export type Started = typeof Started.Type export const Delta = EventV2.define({ type: "session.next.text.delta", - aggregate: "sessionID", + ...options, schema: { ...Base, delta: Schema.String, }, }) - export type Delta = Schema.Schema.Type + export type Delta = typeof Delta.Type export const Ended = EventV2.define({ type: "session.next.text.ended", - aggregate: "sessionID", + ...options, schema: { ...Base, text: Schema.String, }, }) - export type Ended = Schema.Schema.Type + export type Ended = typeof Ended.Type } export namespace Reasoning { export const Started = EventV2.define({ type: "session.next.reasoning.started", - aggregate: "sessionID", + ...options, schema: { ...Base, reasoningID: Schema.String, }, }) - export type Started = Schema.Schema.Type + export type Started = typeof Started.Type export const Delta = EventV2.define({ type: "session.next.reasoning.delta", - aggregate: "sessionID", + ...options, schema: { ...Base, reasoningID: Schema.String, delta: Schema.String, }, }) - export type Delta = Schema.Schema.Type + export type Delta = typeof Delta.Type export const Ended = EventV2.define({ type: "session.next.reasoning.ended", - aggregate: "sessionID", + ...options, schema: { ...Base, reasoningID: Schema.String, text: Schema.String, }, }) - export type Ended = Schema.Schema.Type + export type Ended = typeof Ended.Type } export namespace Tool { export namespace Input { export const Started = EventV2.define({ type: "session.next.tool.input.started", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, name: Schema.String, }, }) - export type Started = Schema.Schema.Type + export type Started = typeof Started.Type export const Delta = EventV2.define({ type: "session.next.tool.input.delta", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, delta: Schema.String, }, }) - export type Delta = Schema.Schema.Type + export type Delta = typeof Delta.Type export const Ended = EventV2.define({ type: "session.next.tool.input.ended", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, text: Schema.String, }, }) - export type Ended = Schema.Schema.Type + export type Ended = typeof Ended.Type } export const Called = EventV2.define({ type: "session.next.tool.called", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, @@ -257,11 +260,11 @@ export namespace Tool { }), }, }) - export type Called = Schema.Schema.Type + export type Called = typeof Called.Type export const Progress = EventV2.define({ type: "session.next.tool.progress", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, @@ -269,11 +272,11 @@ export namespace Tool { content: Schema.Array(ToolOutput.Content), }, }) - export type Progress = Schema.Schema.Type + export type Progress = typeof Progress.Type export const Success = EventV2.define({ type: "session.next.tool.success", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, @@ -285,11 +288,11 @@ export namespace Tool { }), }, }) - export type Success = Schema.Schema.Type + export type Success = typeof Success.Type export const Failed = EventV2.define({ type: "session.next.tool.failed", - aggregate: "sessionID", + ...options, schema: { ...Base, callID: Schema.String, @@ -300,7 +303,7 @@ export namespace Tool { }), }, }) - export type Failed = Schema.Schema.Type + export type Failed = typeof Failed.Type } export const RetryError = Schema.Struct({ @@ -313,49 +316,50 @@ export const RetryError = Schema.Struct({ }).annotate({ identifier: "session.next.retry_error", }) -export type RetryError = Schema.Schema.Type +export type RetryError = typeof RetryError.Type export const Retried = EventV2.define({ type: "session.next.retried", - aggregate: "sessionID", + ...options, schema: { ...Base, attempt: Schema.Finite, error: RetryError, }, }) -export type Retried = Schema.Schema.Type +export type Retried = typeof Retried.Type export namespace Compaction { export const Started = EventV2.define({ type: "session.next.compaction.started", - aggregate: "sessionID", + ...options, schema: { ...Base, reason: Schema.Union([Schema.Literal("auto"), Schema.Literal("manual")]), }, }) - export type Started = Schema.Schema.Type + export type Started = typeof Started.Type export const Delta = EventV2.define({ type: "session.next.compaction.delta", - aggregate: "sessionID", + ...options, schema: { ...Base, text: Schema.String, }, }) + export type Delta = typeof Delta.Type export const Ended = EventV2.define({ type: "session.next.compaction.ended", - aggregate: "sessionID", + ...options, schema: { ...Base, text: Schema.String, include: Schema.String.pipe(Schema.optional), }, }) - export type Ended = Schema.Schema.Type + export type Ended = typeof Ended.Type } export const All = Schema.Union( @@ -392,16 +396,7 @@ export const All = Schema.Union( }, ).pipe(Schema.toTaggedUnion("type")) -// user -// assistant -// assistant -// assistant -// user -// compaction marker -// -> text -// assistant - -export type Event = Schema.Schema.Type +export type Event = typeof All.Type export type Type = Event["type"] export * as SessionEvent from "./session-event" diff --git a/packages/opencode/src/v2/session-message-updater.ts b/packages/core/src/session-message-updater.ts similarity index 100% rename from packages/opencode/src/v2/session-message-updater.ts rename to packages/core/src/session-message-updater.ts diff --git a/packages/opencode/src/v2/session-message.ts b/packages/core/src/session-message.ts similarity index 89% rename from packages/opencode/src/v2/session-message.ts rename to packages/core/src/session-message.ts index 62fc75fc8386..73b6dd7da2b9 100644 --- a/packages/opencode/src/v2/session-message.ts +++ b/packages/core/src/session-message.ts @@ -3,8 +3,8 @@ import { Prompt } from "./session-prompt" import { SessionEvent } from "./session-event" import { EventV2 } from "./event" import { ToolOutput } from "./tool-output" -import { V2Schema } from "./schema" -import { Modelv2 } from "./model" +import { V2Schema } from "./v2-schema" +import { ModelV2 } from "./model" export const ID = EventV2.ID export type ID = Schema.Schema.Type @@ -20,13 +20,13 @@ const Base = { export class AgentSwitched extends Schema.Class("Session.Message.AgentSwitched")({ ...Base, type: Schema.Literal("agent-switched"), - agent: SessionEvent.AgentSwitched.fields.data.fields.agent, + agent: SessionEvent.AgentSwitched.data.fields.agent, }) {} export class ModelSwitched extends Schema.Class("Session.Message.ModelSwitched")({ ...Base, type: Schema.Literal("model-switched"), - model: Modelv2.Ref, + model: ModelV2.Ref, }) {} export class User extends Schema.Class("Session.Message.User")({ @@ -43,16 +43,16 @@ export class User extends Schema.Class("Session.Message.User")({ export class Synthetic extends Schema.Class("Session.Message.Synthetic")({ ...Base, - sessionID: SessionEvent.Synthetic.fields.data.fields.sessionID, - text: SessionEvent.Synthetic.fields.data.fields.text, + sessionID: SessionEvent.Synthetic.data.fields.sessionID, + text: SessionEvent.Synthetic.data.fields.text, type: Schema.Literal("synthetic"), }) {} export class Shell extends Schema.Class("Session.Message.Shell")({ ...Base, type: Schema.Literal("shell"), - callID: SessionEvent.Shell.Started.fields.data.fields.callID, - command: SessionEvent.Shell.Started.fields.data.fields.command, + callID: SessionEvent.Shell.Started.data.fields.callID, + command: SessionEvent.Shell.Started.data.fields.command, output: Schema.String, time: Schema.Struct({ created: V2Schema.DateTimeUtcFromMillis, @@ -130,7 +130,7 @@ export class Assistant extends Schema.Class("Session.Message.Assistan ...Base, type: Schema.Literal("assistant"), agent: Schema.String, - model: SessionEvent.Step.Started.fields.data.fields.model, + model: SessionEvent.Step.Started.data.fields.model, content: AssistantContent.pipe(Schema.Array), snapshot: Schema.Struct({ start: Schema.String.pipe(Schema.optional), @@ -147,7 +147,7 @@ export class Assistant extends Schema.Class("Session.Message.Assistan write: Schema.Finite, }), }).pipe(Schema.optional), - error: SessionEvent.Step.Failed.fields.data.fields.error.pipe(Schema.optional), + error: SessionEvent.Step.Failed.data.fields.error.pipe(Schema.optional), time: Schema.Struct({ created: V2Schema.DateTimeUtcFromMillis, completed: V2Schema.DateTimeUtcFromMillis.pipe(Schema.optional), @@ -156,7 +156,7 @@ export class Assistant extends Schema.Class("Session.Message.Assistan export class Compaction extends Schema.Class("Session.Message.Compaction")({ type: Schema.Literal("compaction"), - reason: SessionEvent.Compaction.Started.fields.data.fields.reason, + reason: SessionEvent.Compaction.Started.data.fields.reason, summary: Schema.String, include: Schema.String.pipe(Schema.optional), ...Base, diff --git a/packages/opencode/src/v2/session-prompt.ts b/packages/core/src/session-prompt.ts similarity index 100% rename from packages/opencode/src/v2/session-prompt.ts rename to packages/core/src/session-prompt.ts diff --git a/packages/core/src/session.ts b/packages/core/src/session.ts new file mode 100644 index 000000000000..756531e32809 --- /dev/null +++ b/packages/core/src/session.ts @@ -0,0 +1,13 @@ +export * as Session from "./session" + +import { Schema } from "effect" +import { withStatics } from "./schema" +import { Identifier } from "./util/identifier" + +export const ID = Schema.String.check(Schema.isStartsWith("ses")).pipe( + Schema.brand("SessionID"), + withStatics((schema) => ({ + descending: (id?: string) => schema.make(id ?? "ses_" + Identifier.descending()), + })), +) +export type ID = typeof ID.Type diff --git a/packages/opencode/src/v2/tool-output.ts b/packages/core/src/tool-output.ts similarity index 100% rename from packages/opencode/src/v2/tool-output.ts rename to packages/core/src/tool-output.ts diff --git a/packages/core/src/util/error.ts b/packages/core/src/util/error.ts index 9d3b7c661a3e..7338571f298e 100644 --- a/packages/core/src/util/error.ts +++ b/packages/core/src/util/error.ts @@ -1,8 +1,8 @@ -import z from "zod" +import { Schema } from "effect" export abstract class NamedError extends Error { - abstract schema(): z.core.$ZodType - abstract toObject(): { name: string; data: any } + abstract schema(): Schema.Top + abstract toObject(): { name: string; data: unknown } static hasName(error: unknown, name: string): boolean { return ( @@ -10,30 +10,42 @@ export abstract class NamedError extends Error { ) } - static create(name: Name, data: Data) { - const schema = z - .object({ - name: z.literal(name), - data, - }) - .meta({ - ref: name, - }) + static create( + name: Name, + fields: Fields, + ): ReturnType>> + static create( + name: Name, + data: DataSchema, + ): ReturnType> + static create(name: Name, data: Schema.Top | Schema.Struct.Fields) { + return NamedError.createSchemaClass(name, Schema.isSchema(data) ? data : Schema.Struct(data)) + } + + private static createSchemaClass(name: Name, data: DataSchema) { + const schema = Schema.Struct({ + name: Schema.Literal(name), + data, + }).annotate({ identifier: name }) + type Data = Schema.Schema.Type + const result = class extends NamedError { public static readonly Schema = schema + public static readonly EffectSchema = schema + public static readonly tag = name - public override readonly name = name as Name + public override readonly name = name constructor( - public readonly data: z.input, + public readonly data: Data, options?: ErrorOptions, ) { super(name, options) this.name = name } - static isInstance(input: any): input is InstanceType { - return typeof input === "object" && "name" in input && input.name === name + static isInstance(input: unknown): input is InstanceType { + return NamedError.hasName(input, name) } schema() { @@ -51,10 +63,7 @@ export abstract class NamedError extends Error { return result } - public static readonly Unknown = NamedError.create( - "UnknownError", - z.object({ - message: z.string(), - }), - ) + public static readonly Unknown = NamedError.create("UnknownError", { + message: Schema.String, + }) } diff --git a/packages/core/src/util/fn.ts b/packages/core/src/util/fn.ts deleted file mode 100644 index 9efe4622fcdb..000000000000 --- a/packages/core/src/util/fn.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { z } from "zod" - -export function fn(schema: T, cb: (input: z.infer) => Result) { - const result = (input: z.infer) => { - const parsed = schema.parse(input) - return cb(parsed) - } - result.force = (input: z.infer) => cb(input) - result.schema = schema - return result -} diff --git a/packages/core/src/util/log.ts b/packages/core/src/util/log.ts index e1962aed4ca9..3b5249cdc3e8 100644 --- a/packages/core/src/util/log.ts +++ b/packages/core/src/util/log.ts @@ -4,11 +4,14 @@ import path from "path" import fs from "fs/promises" import { createWriteStream } from "fs" import * as Global from "../global" -import z from "zod" +import { Schema } from "effect" import { Glob } from "./glob" -export const Level = z.enum(["DEBUG", "INFO", "WARN", "ERROR"]).meta({ ref: "LogLevel", description: "Log level" }) -export type Level = z.infer +export const Level = Schema.Literals(["DEBUG", "INFO", "WARN", "ERROR"]).annotate({ + identifier: "LogLevel", + description: "Log level", +}) +export type Level = Schema.Schema.Type const levelPriority: Record = { DEBUG: 0, @@ -17,6 +20,7 @@ const levelPriority: Record = { ERROR: 3, } const keep = 10 +const initializedRunID = "OPENCODE_LOG_INITIALIZED_RUN_ID" let level: Level = "INFO" @@ -67,7 +71,10 @@ export async function init(options: Options) { Global.Path.log, options.dev ? "dev.log" : new Date().toISOString().split(".")[0].replace(/:/g, "") + ".log", ) - await fs.truncate(logpath).catch(() => {}) + const runID = process.env.OPENCODE_RUN_ID + const shouldTruncate = !options.dev || !runID || process.env[initializedRunID] !== runID + if (shouldTruncate) await fs.truncate(logpath).catch(() => {}) + if (options.dev && runID) process.env[initializedRunID] = runID const stream = createWriteStream(logpath, { flags: "a" }) write = async (msg: any) => { return new Promise((resolve, reject) => { diff --git a/packages/opencode/src/v2/schema.ts b/packages/core/src/v2-schema.ts similarity index 88% rename from packages/opencode/src/v2/schema.ts rename to packages/core/src/v2-schema.ts index 44587b838a43..a34b0b151690 100644 --- a/packages/opencode/src/v2/schema.ts +++ b/packages/core/src/v2-schema.ts @@ -7,4 +7,4 @@ export const DateTimeUtcFromMillis = Schema.Finite.pipe( }), ) -export * as V2Schema from "./schema" +export * as V2Schema from "./v2-schema" diff --git a/packages/core/test/catalog.test.ts b/packages/core/test/catalog.test.ts new file mode 100644 index 000000000000..594f42d1c8b5 --- /dev/null +++ b/packages/core/test/catalog.test.ts @@ -0,0 +1,233 @@ +import { describe, expect } from "bun:test" +import { DateTime, Effect, Fiber, Layer, Option, Stream } from "effect" +import { Catalog } from "@opencode-ai/core/catalog" +import { EventV2 } from "@opencode-ai/core/event" +import { Location } from "@opencode-ai/core/location" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderV2 } from "@opencode-ai/core/provider" +import { testEffect } from "./lib/effect" + +const locationLayer = Layer.succeed(Location.Service, Location.Service.of({ directory: "test" })) +const it = testEffect( + Catalog.layer.pipe( + Layer.provideMerge(EventV2.defaultLayer), + Layer.provideMerge(PluginV2.defaultLayer), + Layer.provideMerge(locationLayer), + ), +) + +describe("CatalogV2", () => { + it.effect("normalizes provider baseURL into endpoint url", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.make("test") + + yield* catalog.provider.update(providerID, (provider) => { + provider.endpoint = { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://default.example.com", + } + provider.options.aisdk.provider.baseURL = "https://override.example.com" + }) + + const provider = yield* catalog.provider.get(providerID) + + expect(provider.endpoint).toEqual({ + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://override.example.com", + }) + expect(provider.options.aisdk.provider.baseURL).toBeUndefined() + }), + ) + + it.effect("normalizes model baseURL into endpoint url", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.make("test") + const modelID = ModelV2.ID.make("model") + + yield* catalog.provider.update(providerID, (provider) => { + provider.endpoint = { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://provider.example.com", + } + }) + yield* catalog.model.update(providerID, modelID, (model) => { + model.endpoint = { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://model.example.com", + } + model.options.aisdk.provider.baseURL = "https://override.example.com" + }) + + const model = yield* catalog.model.get(providerID, modelID) + + expect(model.endpoint).toEqual({ + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://override.example.com", + }) + expect(model.options.aisdk.provider.baseURL).toBeUndefined() + }), + ) + + it.effect("publishes model updated events", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const events = yield* EventV2.Service + const providerID = ProviderV2.ID.make("test") + const modelID = ModelV2.ID.make("model") + const fiber = yield* events + .subscribe(Catalog.Event.ModelUpdated) + .pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped) + + yield* Effect.yieldNow + yield* catalog.provider.update(providerID, () => {}) + yield* catalog.model.update(providerID, modelID, (model) => { + model.name = "Updated Model" + }) + const event = Array.from(yield* Fiber.join(fiber))[0] + + expect(event?.type).toBe("catalog.model.updated") + expect(event?.data.model.providerID).toBe(providerID) + expect(event?.data.model.id).toBe(modelID) + expect(event?.data.model.name).toBe("Updated Model") + expect(event?.location).toEqual({ directory: "test" }) + }), + ) + + it.effect("resolves unknown model endpoint from provider endpoint", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.make("test") + const modelID = ModelV2.ID.make("model") + + yield* catalog.provider.update(providerID, (provider) => { + provider.endpoint = { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://provider.example.com", + } + }) + yield* catalog.model.update(providerID, modelID, () => {}) + + const model = yield* catalog.model.get(providerID, modelID) + + expect(model.endpoint).toEqual({ + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://provider.example.com", + }) + }), + ) + + it.effect("runs provider hooks after baseURL is normalized", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const plugin = yield* PluginV2.Service + const providerID = ProviderV2.ID.make("test") + const seen: unknown[] = [] + + yield* plugin.add({ + id: PluginV2.ID.make("test"), + effect: Effect.succeed({ + "provider.update": (evt) => + Effect.sync(() => { + seen.push(evt.provider.endpoint.type) + if (evt.provider.endpoint.type === "aisdk") seen.push(evt.provider.endpoint.url) + seen.push(evt.provider.options.aisdk.provider.baseURL) + }), + }), + }) + yield* catalog.provider.update(providerID, (provider) => { + provider.endpoint = { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + } + provider.options.aisdk.provider.baseURL = "https://provider.example.com" + }) + + expect(seen).toEqual(["aisdk", "https://provider.example.com", undefined]) + }), + ) + + it.effect("resolves provider and model option merges", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.make("test") + const modelID = ModelV2.ID.make("model") + + yield* catalog.provider.update(providerID, (provider) => { + provider.options.headers.provider = "provider" + provider.options.headers.shared = "provider" + provider.options.body.provider = true + provider.options.aisdk.provider.provider = true + }) + yield* catalog.model.update(providerID, modelID, (model) => { + model.options.headers.model = "model" + model.options.headers.shared = "model" + model.options.body.model = true + model.options.aisdk.provider.model = true + model.options.aisdk.request.request = true + }) + + const model = yield* catalog.model.get(providerID, modelID) + + expect(model.options.headers).toEqual({ provider: "provider", shared: "model", model: "model" }) + expect(model.options.body).toEqual({ provider: true, model: true }) + expect(model.options.aisdk.provider).toEqual({ provider: true, model: true }) + expect(model.options.aisdk.request).toEqual({ request: true }) + }), + ) + + it.effect("falls back to newest available model when no default is configured", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.make("test") + + yield* catalog.provider.update(providerID, (provider) => { + provider.enabled = { via: "custom", data: {} } + }) + yield* catalog.model.update(providerID, ModelV2.ID.make("old"), (model) => { + model.time.released = DateTime.makeUnsafe(1000) + }) + yield* catalog.model.update(providerID, ModelV2.ID.make("new"), (model) => { + model.time.released = DateTime.makeUnsafe(2000) + }) + + const model = yield* catalog.model.default() + + expect(Option.getOrUndefined(model)?.id).toMatch("new") + }), + ) + + it.effect("small model prefers small keyword candidates before cost scoring", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.make("test") + + yield* catalog.provider.update(providerID, () => {}) + yield* catalog.model.update(providerID, ModelV2.ID.make("cheap-large"), (model) => { + model.capabilities.input = ["text"] + model.capabilities.output = ["text"] + model.cost = [{ input: 1, output: 1, cache: { read: 0, write: 0 } }] + model.time.released = DateTime.makeUnsafe(Date.now()) + }) + yield* catalog.model.update(providerID, ModelV2.ID.make("expensive-mini"), (model) => { + model.capabilities.input = ["text"] + model.capabilities.output = ["text"] + model.cost = [{ input: 10, output: 10, cache: { read: 0, write: 0 } }] + model.time.released = DateTime.makeUnsafe(Date.now()) + }) + + const model = yield* catalog.model.small(providerID) + + expect(Option.getOrUndefined(model)?.id).toMatch("expensive-mini") + }), + ) +}) diff --git a/packages/core/test/event.test.ts b/packages/core/test/event.test.ts new file mode 100644 index 000000000000..b67b2897a1b0 --- /dev/null +++ b/packages/core/test/event.test.ts @@ -0,0 +1,132 @@ +import { describe, expect } from "bun:test" +import { Effect, Fiber, Layer, Schema, Stream } from "effect" +import { EventV2 } from "@opencode-ai/core/event" +import { Location } from "@opencode-ai/core/location" +import { testEffect } from "./lib/effect" + +const locationLayer = Layer.succeed( + Location.Service, + Location.Service.of({ directory: "project", workspaceID: "workspace" }), +) +const it = testEffect(EventV2.layer.pipe(Layer.provideMerge(locationLayer))) +const itWithoutLocation = testEffect(EventV2.layer) + +const Message = EventV2.define({ + type: "test.message", + schema: { + text: Schema.String, + }, +}) + +const GlobalMessage = EventV2.define({ + type: "test.global", + schema: { + text: Schema.String, + }, +}) + +const VersionedMessage = EventV2.define({ + type: "test.versioned", + version: 2, + schema: { + text: Schema.String, + }, +}) + +describe("EventV2", () => { + it.effect("publishes events with the current location", () => + Effect.gen(function* () { + const events = yield* EventV2.Service + const fiber = yield* events.subscribe(Message).pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped) + yield* Effect.yieldNow + const event = yield* events.publish(Message, { text: "hello" }) + const received = Array.from(yield* Fiber.join(fiber)) + + expect(received).toEqual([event]) + expect(event.type).toBe("test.message") + expect(event).not.toHaveProperty("version") + expect(event.data).toEqual({ text: "hello" }) + expect(event.location).toEqual({ directory: "project", workspaceID: "workspace" }) + }), + ) + + itWithoutLocation.effect("omits location when no location is available", () => + Effect.gen(function* () { + const events = yield* EventV2.Service + const event = yield* events.publish(GlobalMessage, { text: "hello" }) + + expect(event).not.toHaveProperty("location") + expect(event.type).toBe("test.global") + }), + ) + + it.effect("publishes definition version", () => + Effect.gen(function* () { + const events = yield* EventV2.Service + const event = yield* events.publish(VersionedMessage, { text: "hello" }) + + expect(event.type).toBe("test.versioned") + expect(event.version).toBe(2) + }), + ) + + it.effect("stores definitions in the exported registry", () => + Effect.sync(() => { + expect(EventV2.registry.get(Message.type)).toBe(Message) + }), + ) + + it.effect("publishes to typed and wildcard subscriptions", () => + Effect.gen(function* () { + const events = yield* EventV2.Service + const typed = yield* events.subscribe(Message).pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped) + const wildcard = yield* events.all().pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped) + yield* Effect.yieldNow + const event = yield* events.publish(Message, { text: "hello" }) + + expect(Array.from(yield* Fiber.join(typed))).toEqual([event]) + expect(Array.from(yield* Fiber.join(wildcard))).toEqual([event]) + }), + ) + + it.effect("runs sync handlers inline", () => + Effect.gen(function* () { + const events = yield* EventV2.Service + const received = new Array() + const unsubscribe = yield* events.sync((event) => + Effect.sync(() => { + received.push(event) + }), + ) + + const event = yield* events.publish(Message, { text: "hello" }) + yield* unsubscribe + yield* events.publish(Message, { text: "after unsubscribe" }) + + expect(received).toEqual([event]) + }), + ) + + it.effect("runs sync handlers before publishing to streams", () => + Effect.gen(function* () { + const events = yield* EventV2.Service + const received = new Array() + const fiber = yield* events.all().pipe( + Stream.take(1), + Stream.runForEach(() => Effect.sync(() => received.push("stream"))), + Effect.forkScoped, + ) + yield* events.sync((event) => + Effect.sync(() => { + received.push(event.type) + }), + ) + + yield* Effect.yieldNow + yield* events.publish(Message, { text: "hello" }) + yield* Fiber.join(fiber) + + expect(received).toEqual([Message.type, "stream"]) + }), + ) +}) diff --git a/packages/opencode/test/provider/copilot/convert-to-copilot-messages.test.ts b/packages/core/test/github-copilot/convert-to-copilot-messages.test.ts similarity index 99% rename from packages/opencode/test/provider/copilot/convert-to-copilot-messages.test.ts rename to packages/core/test/github-copilot/convert-to-copilot-messages.test.ts index 6f874db6d2e9..65f4b6a5369c 100644 --- a/packages/opencode/test/provider/copilot/convert-to-copilot-messages.test.ts +++ b/packages/core/test/github-copilot/convert-to-copilot-messages.test.ts @@ -1,4 +1,4 @@ -import { convertToOpenAICompatibleChatMessages as convertToCopilotMessages } from "@/provider/sdk/copilot/chat/convert-to-openai-compatible-chat-messages" +import { convertToOpenAICompatibleChatMessages as convertToCopilotMessages } from "@opencode-ai/core/github-copilot/chat/convert-to-openai-compatible-chat-messages" import { describe, test, expect } from "bun:test" describe("system messages", () => { diff --git a/packages/opencode/test/provider/copilot/copilot-chat-model.test.ts b/packages/core/test/github-copilot/copilot-chat-model.test.ts similarity index 99% rename from packages/opencode/test/provider/copilot/copilot-chat-model.test.ts rename to packages/core/test/github-copilot/copilot-chat-model.test.ts index 389a72bb377b..bc1e2ecd956e 100644 --- a/packages/opencode/test/provider/copilot/copilot-chat-model.test.ts +++ b/packages/core/test/github-copilot/copilot-chat-model.test.ts @@ -1,4 +1,4 @@ -import { OpenAICompatibleChatLanguageModel } from "@/provider/sdk/copilot/chat/openai-compatible-chat-language-model" +import { OpenAICompatibleChatLanguageModel } from "@opencode-ai/core/github-copilot/chat/openai-compatible-chat-language-model" import { describe, test, expect, mock } from "bun:test" import type { LanguageModelV3Prompt } from "@ai-sdk/provider" diff --git a/packages/opencode/test/provider/models.test.ts b/packages/core/test/models.test.ts similarity index 93% rename from packages/opencode/test/provider/models.test.ts rename to packages/core/test/models.test.ts index 7ccf126a9caa..0ade327a5307 100644 --- a/packages/opencode/test/provider/models.test.ts +++ b/packages/core/test/models.test.ts @@ -4,8 +4,8 @@ import { HttpClient, HttpClientResponse } from "effect/unstable/http" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Flag } from "@opencode-ai/core/flag/flag" import { Global } from "@opencode-ai/core/global" -import { ModelsDev } from "../../src/provider/models" -import { it } from "../lib/effect" +import { ModelsDev } from "@opencode-ai/core/models" +import { it } from "./lib/effect" import { rm, writeFile, utimes, mkdir } from "fs/promises" import path from "path" @@ -70,13 +70,16 @@ const fixture2: Record = { interface MockState { body: string status: number - calls: Array<{ url: string }> + calls: Array<{ url: string; userAgent: string | null }> } const makeMockClient = (state: Ref.Ref) => HttpClient.make((request) => Effect.gen(function* () { - yield* Ref.update(state, (s) => ({ ...s, calls: [...s.calls, { url: request.url }] })) + yield* Ref.update(state, (s) => ({ + ...s, + calls: [...s.calls, { url: request.url, userAgent: request.headers["user-agent"] ?? null }], + })) const s = yield* Ref.get(state) return HttpClientResponse.fromWeb(request, new Response(s.body, { status: s.status })) }), @@ -133,14 +136,14 @@ describe("ModelsDev Service", () => { }), ) - it.live("get() returns {} when disk empty and fetch disabled", () => + it.live("get() returns bundled snapshot when disk empty and fetch disabled", () => Effect.gen(function* () { const state = yield* Ref.make(initialState) const result = yield* provided( state, ModelsDev.Service.use((s) => s.get()), ) - expect(result).toEqual({}) + expect(Object.keys(result).length).toBeGreaterThan(0) const final = yield* Ref.get(state) expect(final.calls).toEqual([]) }), @@ -202,6 +205,7 @@ describe("ModelsDev Service", () => { const final = yield* Ref.get(state) expect(final.calls.length).toBe(1) expect(final.calls[0].url).toContain("/api.json") + expect(final.calls[0].userAgent).toContain("/cli") }), ) @@ -251,7 +255,7 @@ describe("ModelsDev Service", () => { }), ) expect(result).toEqual(fixture) - // withTransientReadRetry retries 5xx, so calls may be > 1. + // retryTransient retries 5xx, so calls may be > 1. const final = yield* Ref.get(state) expect(final.calls.length).toBeGreaterThanOrEqual(1) }), diff --git a/packages/core/test/plugin/fixtures/provider-factory.ts b/packages/core/test/plugin/fixtures/provider-factory.ts new file mode 100644 index 000000000000..7278c231dd54 --- /dev/null +++ b/packages/core/test/plugin/fixtures/provider-factory.ts @@ -0,0 +1,9 @@ +export function createFixtureProvider(options: Record) { + const captured = Object.fromEntries(Object.entries(options)) + return Object.assign((modelID: string) => ({ modelID, options: captured }), { + options: captured, + languageModel(modelID: string) { + return { modelID, options: captured } + }, + }) +} diff --git a/packages/core/test/plugin/provider-alibaba.test.ts b/packages/core/test/plugin/provider-alibaba.test.ts new file mode 100644 index 000000000000..06e6f969fdc6 --- /dev/null +++ b/packages/core/test/plugin/provider-alibaba.test.ts @@ -0,0 +1,67 @@ +import { describe, expect } from "bun:test" +import { createAlibaba } from "@ai-sdk/alibaba" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AlibabaPlugin } from "@opencode-ai/core/plugin/provider/alibaba" +import { it, model } from "./provider-helper" + +describe("AlibabaPlugin", () => { + it.effect("creates an Alibaba SDK for @ai-sdk/alibaba", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AlibabaPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("alibaba", "qwen"), package: "@ai-sdk/alibaba", options: { name: "alibaba" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("ignores non-Alibaba SDK packages", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AlibabaPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("alibaba", "qwen"), package: "@ai-sdk/openai-compatible", options: { name: "alibaba" } }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + it.effect("matches the old bundled Alibaba SDK provider naming", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AlibabaPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-alibaba", "qwen"), + package: "@ai-sdk/alibaba", + options: { name: "custom-alibaba", apiKey: "test" }, + }, + {}, + ) + const expected = createAlibaba({ apiKey: "test", ...{ name: "custom-alibaba" } }).languageModel("qwen") + const actual = result.sdk?.languageModel("qwen") + expect(actual?.provider).toBe(expected.provider) + expect(actual?.modelId).toBe(expected.modelId) + }), + ) + + it.effect("uses the old default languageModel(apiID) behavior", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AlibabaPlugin) + const item = model("alibaba", "alias", { apiID: ModelV2.ID.make("qwen-plus") }) + const result = yield* plugin.trigger("aisdk.sdk", { model: item, package: "@ai-sdk/alibaba", options: {} }, {}) + const language = result.sdk?.languageModel(item.apiID) + expect(language?.modelId).toBe("qwen-plus") + expect(language?.provider).toBe("alibaba.chat") + }), + ) +}) diff --git a/packages/core/test/plugin/provider-amazon-bedrock.test.ts b/packages/core/test/plugin/provider-amazon-bedrock.test.ts new file mode 100644 index 000000000000..c70ada08d94d --- /dev/null +++ b/packages/core/test/plugin/provider-amazon-bedrock.test.ts @@ -0,0 +1,465 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AmazonBedrockPlugin } from "@opencode-ai/core/plugin/provider/amazon-bedrock" +import { fakeSelectorSdk, it, model, provider, withEnv } from "./provider-helper" + +function bedrockBaseURL(sdk: unknown, modelID = "anthropic.claude-sonnet-4-5") { + const language = (sdk as { languageModel: (id: string) => unknown }).languageModel(modelID) + return (language as { config: { baseUrl: () => string } }).config.baseUrl() +} + +function bedrockFetch(sdk: unknown, modelID = "anthropic.claude-sonnet-4-5") { + const language = (sdk as { languageModel: (id: string) => unknown }).languageModel(modelID) + return ( + language as { config: { fetch: (input: Parameters[0], init?: RequestInit) => Promise } } + ).config.fetch +} + +describe("AmazonBedrockPlugin", () => { + it.effect("moves endpoint option to endpoint URL", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("amazon-bedrock", { + options: { + headers: {}, + body: {}, + aisdk: { provider: { endpoint: "https://bedrock.example" }, request: {} }, + }, + }), + cancel: false, + }, + ) + expect(result.provider.endpoint).toEqual({ + type: "aisdk", + package: "test-provider", + url: "https://bedrock.example", + }) + expect(result.provider.options.aisdk.provider.endpoint).toBeUndefined() + }), + ) + + it.effect("prefers endpoint over baseURL for SDK base URL", () => + withEnv({ AWS_BEARER_TOKEN_BEDROCK: undefined, AWS_PROFILE: undefined, AWS_ACCESS_KEY_ID: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { + name: "amazon-bedrock", + bearerToken: "token", + baseURL: "https://base.example", + endpoint: "https://endpoint.example", + region: "us-east-1", + }, + }, + {}, + ) + expect(bedrockBaseURL(result.sdk)).toBe("https://endpoint.example") + }), + ), + ) + + it.effect("uses baseURL as SDK base URL", () => + withEnv({ AWS_BEARER_TOKEN_BEDROCK: undefined, AWS_PROFILE: undefined, AWS_ACCESS_KEY_ID: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { + name: "amazon-bedrock", + bearerToken: "token", + baseURL: "https://base.example", + region: "us-east-1", + }, + }, + {}, + ) + expect(bedrockBaseURL(result.sdk)).toBe("https://base.example") + }), + ), + ) + + it.effect("creates SDK without explicit credential env so the default AWS chain can resolve credentials", () => + withEnv( + { + AWS_ACCESS_KEY_ID: undefined, + AWS_BEARER_TOKEN_BEDROCK: undefined, + AWS_CONTAINER_CREDENTIALS_FULL_URI: undefined, + AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: undefined, + AWS_PROFILE: undefined, + AWS_REGION: undefined, + AWS_WEB_IDENTITY_TOKEN_FILE: undefined, + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { name: "amazon-bedrock" }, + }, + {}, + ) + expect(result.sdk).toBeDefined() + expect(bedrockBaseURL(result.sdk)).toBe("https://bedrock-runtime.us-east-1.amazonaws.com") + }), + ), + ) + + it.effect("uses config region over AWS_REGION for SDK base URL", () => + withEnv({ AWS_BEARER_TOKEN_BEDROCK: "token", AWS_REGION: "us-east-1" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { name: "amazon-bedrock", region: "eu-west-1" }, + }, + {}, + ) + expect(bedrockBaseURL(result.sdk)).toBe("https://bedrock-runtime.eu-west-1.amazonaws.com") + }), + ), + ) + + it.effect("uses AWS_REGION for SDK base URL when config region is absent", () => + withEnv({ AWS_BEARER_TOKEN_BEDROCK: "token", AWS_REGION: "eu-west-1" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { name: "amazon-bedrock" }, + }, + {}, + ) + expect(bedrockBaseURL(result.sdk)).toBe("https://bedrock-runtime.eu-west-1.amazonaws.com") + }), + ), + ) + + it.effect("defaults SDK region to us-east-1", () => + withEnv({ AWS_BEARER_TOKEN_BEDROCK: "token", AWS_REGION: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { name: "amazon-bedrock" }, + }, + {}, + ) + expect(bedrockBaseURL(result.sdk)).toBe("https://bedrock-runtime.us-east-1.amazonaws.com") + }), + ), + ) + + it.effect("loads bearer token option into env and uses bearer auth", () => + withEnv({ AWS_ACCESS_KEY_ID: undefined, AWS_BEARER_TOKEN_BEDROCK: undefined, AWS_PROFILE: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const headers: Array = [] + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { + name: "amazon-bedrock", + bearerToken: "option-token", + fetch: async (_input: Parameters[0], init?: RequestInit) => { + headers.push(new Headers(init?.headers).get("Authorization")) + return new Response("{}") + }, + }, + }, + {}, + ) + yield* Effect.promise(() => bedrockFetch(result.sdk)("https://bedrock.example", { method: "POST" })) + expect(process.env.AWS_BEARER_TOKEN_BEDROCK).toBe("option-token") + expect(headers).toEqual(["Bearer option-token"]) + }), + ), + ) + + it.effect("prefers bearer token env over bearer token option", () => + withEnv({ AWS_BEARER_TOKEN_BEDROCK: "env-token" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const headers: Array = [] + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { + name: "amazon-bedrock", + bearerToken: "option-token", + fetch: async (_input: Parameters[0], init?: RequestInit) => { + headers.push(new Headers(init?.headers).get("Authorization")) + return new Response("{}") + }, + }, + }, + {}, + ) + yield* Effect.promise(() => bedrockFetch(result.sdk)("https://bedrock.example", { method: "POST" })) + expect(process.env.AWS_BEARER_TOKEN_BEDROCK).toBe("env-token") + expect(headers).toEqual(["Bearer env-token"]) + }), + ), + ) + + it.effect("uses SigV4 credential env when bearer token is absent", () => + withEnv( + { + AWS_ACCESS_KEY_ID: "test-access-key", + AWS_BEARER_TOKEN_BEDROCK: undefined, + AWS_REGION: "us-east-1", + AWS_SECRET_ACCESS_KEY: "test-secret-key", + AWS_SESSION_TOKEN: "test-session-token", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const headers: Array = [] + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + package: "@ai-sdk/amazon-bedrock", + options: { + name: "amazon-bedrock", + fetch: async (_input: Parameters[0], init?: RequestInit) => { + headers.push(new Headers(init?.headers).get("Authorization")) + return new Response("{}") + }, + }, + }, + {}, + ) + yield* Effect.promise(() => + bedrockFetch(result.sdk)("https://bedrock-runtime.us-east-1.amazonaws.com/model/test/invoke", { + body: "{}", + method: "POST", + }), + ) + expect(headers[0]?.startsWith("AWS4-HMAC-SHA256 ")).toBe(true) + }), + ), + ) + + it.effect("applies legacy cross-region inference prefixes", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AmazonBedrockPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: { region: "eu-west-1" }, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", "global.anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: { region: "eu-west-1" }, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: { region: "ap-northeast-1" }, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: { region: "ap-southeast-2" }, + }, + {}, + ) + expect(calls).toEqual([ + "languageModel:us.anthropic.claude-sonnet-4-5", + "languageModel:eu.anthropic.claude-sonnet-4-5", + "languageModel:global.anthropic.claude-sonnet-4-5", + "languageModel:jp.anthropic.claude-sonnet-4-5", + "languageModel:au.anthropic.claude-sonnet-4-5", + ]) + }), + ) + + it.effect("uses AWS_REGION for language prefixes when region option is absent", () => + withEnv({ AWS_REGION: "eu-west-1" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AmazonBedrockPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", "anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual(["languageModel:eu.anthropic.claude-sonnet-4-5"]) + }), + ), + ) + + it.effect("applies the full legacy cross-region prefix matrix", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + const cases = [ + { region: "us-east-1", modelID: "amazon.nova-micro-v1:0", expected: "us.amazon.nova-micro-v1:0" }, + { region: "us-east-1", modelID: "amazon.nova-lite-v1:0", expected: "us.amazon.nova-lite-v1:0" }, + { region: "us-east-1", modelID: "amazon.nova-pro-v1:0", expected: "us.amazon.nova-pro-v1:0" }, + { region: "us-east-1", modelID: "amazon.nova-premier-v1:0", expected: "us.amazon.nova-premier-v1:0" }, + { region: "us-east-1", modelID: "amazon.nova-2-lite-v1:0", expected: "us.amazon.nova-2-lite-v1:0" }, + { region: "us-east-1", modelID: "anthropic.claude-sonnet-4-5", expected: "us.anthropic.claude-sonnet-4-5" }, + { region: "us-east-1", modelID: "deepseek.r1-v1:0", expected: "us.deepseek.r1-v1:0" }, + { region: "us-gov-west-1", modelID: "anthropic.claude-sonnet-4-5", expected: "anthropic.claude-sonnet-4-5" }, + { region: "us-east-1", modelID: "cohere.command-r-plus-v1:0", expected: "cohere.command-r-plus-v1:0" }, + { region: "eu-west-1", modelID: "anthropic.claude-sonnet-4-5", expected: "eu.anthropic.claude-sonnet-4-5" }, + { region: "eu-west-2", modelID: "amazon.nova-lite-v1:0", expected: "eu.amazon.nova-lite-v1:0" }, + { region: "eu-west-3", modelID: "amazon.nova-micro-v1:0", expected: "eu.amazon.nova-micro-v1:0" }, + { + region: "eu-north-1", + modelID: "meta.llama3-70b-instruct-v1:0", + expected: "eu.meta.llama3-70b-instruct-v1:0", + }, + { region: "eu-central-1", modelID: "mistral.pixtral-large-v1:0", expected: "eu.mistral.pixtral-large-v1:0" }, + { region: "eu-south-1", modelID: "anthropic.claude-sonnet-4-5", expected: "eu.anthropic.claude-sonnet-4-5" }, + { region: "eu-south-2", modelID: "anthropic.claude-sonnet-4-5", expected: "eu.anthropic.claude-sonnet-4-5" }, + { region: "eu-central-2", modelID: "anthropic.claude-sonnet-4-5", expected: "anthropic.claude-sonnet-4-5" }, + { region: "eu-west-1", modelID: "cohere.command-r-plus-v1:0", expected: "cohere.command-r-plus-v1:0" }, + { + region: "ap-southeast-2", + modelID: "anthropic.claude-sonnet-4-5", + expected: "au.anthropic.claude-sonnet-4-5", + }, + { + region: "ap-southeast-4", + modelID: "anthropic.claude-haiku-v1:0", + expected: "au.anthropic.claude-haiku-v1:0", + }, + { region: "ap-southeast-2", modelID: "anthropic.claude-opus-4", expected: "apac.anthropic.claude-opus-4" }, + { + region: "ap-northeast-1", + modelID: "anthropic.claude-sonnet-4-5", + expected: "jp.anthropic.claude-sonnet-4-5", + }, + { region: "ap-northeast-1", modelID: "amazon.nova-pro-v1:0", expected: "jp.amazon.nova-pro-v1:0" }, + { region: "ap-south-1", modelID: "anthropic.claude-sonnet-4-5", expected: "apac.anthropic.claude-sonnet-4-5" }, + { region: "ap-south-1", modelID: "amazon.nova-lite-v1:0", expected: "apac.amazon.nova-lite-v1:0" }, + { region: "ca-central-1", modelID: "anthropic.claude-sonnet-4-5", expected: "anthropic.claude-sonnet-4-5" }, + { + region: "us-east-1", + modelID: "global.anthropic.claude-sonnet-4-5", + expected: "global.anthropic.claude-sonnet-4-5", + }, + { region: "us-east-1", modelID: "us.anthropic.claude-sonnet-4-5", expected: "us.anthropic.claude-sonnet-4-5" }, + { region: "eu-west-1", modelID: "eu.anthropic.claude-sonnet-4-5", expected: "eu.anthropic.claude-sonnet-4-5" }, + { + region: "ap-northeast-1", + modelID: "jp.anthropic.claude-sonnet-4-5", + expected: "jp.anthropic.claude-sonnet-4-5", + }, + { + region: "ap-south-1", + modelID: "apac.anthropic.claude-sonnet-4-5", + expected: "apac.anthropic.claude-sonnet-4-5", + }, + { + region: "ap-southeast-2", + modelID: "au.anthropic.claude-sonnet-4-5", + expected: "au.anthropic.claude-sonnet-4-5", + }, + ] + yield* plugin.add(AmazonBedrockPlugin) + for (const item of cases) { + yield* plugin.trigger( + "aisdk.language", + { + model: model("amazon-bedrock", item.modelID), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: { region: item.region }, + }, + {}, + ) + } + expect(calls).toEqual(cases.map((item) => `languageModel:${item.expected}`)) + }), + ) + + it.effect("ignores non-Bedrock providers for language selection", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AmazonBedrockPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("openai", "anthropic.claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: { region: "eu-west-1" }, + }, + {}, + ) + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-anthropic.test.ts b/packages/core/test/plugin/provider-anthropic.test.ts new file mode 100644 index 000000000000..bbea4a372151 --- /dev/null +++ b/packages/core/test/plugin/provider-anthropic.test.ts @@ -0,0 +1,91 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AnthropicPlugin } from "@opencode-ai/core/plugin/provider/anthropic" +import { it, model, provider } from "./provider-helper" + +describe("AnthropicPlugin", () => { + it.effect("applies legacy beta headers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AnthropicPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("anthropic", { + options: { headers: { Existing: "1" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.options.headers["anthropic-beta"]).toBe( + "interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14", + ) + expect(result.provider.options.headers.Existing).toBe("1") + }), + ) + + it.effect("ignores non-Anthropic providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AnthropicPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("openai"), cancel: false }) + expect(result.provider.options.headers["anthropic-beta"]).toBeUndefined() + }), + ) + + it.effect("creates Anthropic SDKs with the model provider ID as the SDK name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + yield* plugin.add(AnthropicPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("anthropic-sdk-inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + providers.push(evt.sdk.languageModel("claude-sonnet-4-5").provider) + }), + }), + }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-anthropic", "claude-sonnet-4-5"), + package: "@ai-sdk/anthropic", + options: { name: "custom-anthropic", apiKey: "test" }, + }, + {}, + ) + expect(providers).toEqual(["custom-anthropic"]) + }), + ) + + it.effect("uses the Anthropic provider ID as the SDK name for the bundled Anthropic provider", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + yield* plugin.add(AnthropicPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("anthropic-sdk-inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + providers.push(evt.sdk.languageModel("claude-sonnet-4-5").provider) + }), + }), + }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("anthropic", "claude-sonnet-4-5"), + package: "@ai-sdk/anthropic", + options: { name: "anthropic", apiKey: "test" }, + }, + {}, + ) + expect(providers).toEqual(["anthropic"]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-azure-cognitive-services.test.ts b/packages/core/test/plugin/provider-azure-cognitive-services.test.ts new file mode 100644 index 000000000000..b835cbeeff09 --- /dev/null +++ b/packages/core/test/plugin/provider-azure-cognitive-services.test.ts @@ -0,0 +1,127 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AzureCognitiveServicesPlugin } from "@opencode-ai/core/plugin/provider/azure" +import { fakeSelectorSdk, it, model, provider, withEnv } from "./provider-helper" + +describe("AzureCognitiveServicesPlugin", () => { + it.effect("maps the resource env var to the Azure SDK baseURL", () => + withEnv({ AZURE_COGNITIVE_SERVICES_RESOURCE_NAME: "cognitive" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzureCognitiveServicesPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("azure-cognitive-services"), cancel: false }, + ) + expect(result.provider.endpoint).toEqual({ + type: "aisdk", + package: "test-provider", + }) + expect(result.provider.options.aisdk.provider.baseURL).toBe( + "https://cognitive.cognitiveservices.azure.com/openai", + ) + expect(result.provider.options.aisdk.provider.resourceName).toBeUndefined() + }), + ), + ) + + it.effect("leaves baseURL unset without resource env and ignores other providers", () => + withEnv({ AZURE_COGNITIVE_SERVICES_RESOURCE_NAME: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzureCognitiveServicesPlugin) + const azure = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("azure-cognitive-services"), cancel: false }, + ) + const other = yield* plugin.trigger("provider.update", {}, { provider: provider("openai"), cancel: false }) + expect(azure.provider.options.aisdk.provider.baseURL).toBeUndefined() + expect(azure.provider.endpoint).toEqual({ type: "aisdk", package: "test-provider" }) + expect(other.provider.options.aisdk.provider.baseURL).toBeUndefined() + expect(other.provider.endpoint).toEqual({ type: "aisdk", package: "test-provider" }) + }), + ), + ) + + it.effect("selects chat only for completion URLs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AzureCognitiveServicesPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("azure-cognitive-services", "deployment"), + sdk: fakeSelectorSdk(calls), + options: { useCompletionUrls: true }, + }, + {}, + ) + expect(calls).toEqual(["chat:deployment"]) + }), + ) + + it.effect("uses the legacy Azure selector order and provider guard", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AzureCognitiveServicesPlugin) + yield* plugin.trigger( + "aisdk.language", + { model: model("azure-cognitive-services", "deployment"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + const ignored = yield* plugin.trigger( + "aisdk.language", + { model: model("openai", "deployment"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + expect(calls).toEqual(["responses:deployment"]) + expect(ignored.language).toBeUndefined() + }), + ) + + it.effect("falls back from responses to messages, chat, then languageModel", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + const sdk = fakeSelectorSdk(calls) + yield* plugin.add(AzureCognitiveServicesPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("azure-cognitive-services", "messages-deployment"), + sdk: { messages: sdk.messages, chat: sdk.chat, languageModel: sdk.languageModel }, + options: {}, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("azure-cognitive-services", "chat-deployment"), + sdk: { chat: sdk.chat, languageModel: sdk.languageModel }, + options: {}, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("azure-cognitive-services", "language-deployment"), + sdk: { languageModel: sdk.languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual([ + "messages:messages-deployment", + "chat:chat-deployment", + "languageModel:language-deployment", + ]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-azure.test.ts b/packages/core/test/plugin/provider-azure.test.ts new file mode 100644 index 000000000000..5121b1eec028 --- /dev/null +++ b/packages/core/test/plugin/provider-azure.test.ts @@ -0,0 +1,245 @@ +import { describe, expect } from "bun:test" +import { Effect, Layer } from "effect" +import { AuthV2 } from "@opencode-ai/core/auth" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AuthPlugin } from "@opencode-ai/core/plugin/auth" +import { AzurePlugin } from "@opencode-ai/core/plugin/provider/azure" +import { testEffect } from "../lib/effect" +import { fakeSelectorSdk, it, model, npmLayer, provider, withEnv } from "./provider-helper" + +const itWithAuth = testEffect(Layer.mergeAll(PluginV2.defaultLayer, AuthV2.defaultLayer, npmLayer)) + +describe("AzurePlugin", () => { + it.effect("resolves resourceName from env", () => + withEnv({ AZURE_RESOURCE_NAME: "from-env" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzurePlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("azure"), cancel: false }) + expect(result.provider.options.aisdk.provider.resourceName).toBe("from-env") + }), + ), + ) + + it.effect("keeps explicit resourceName over env and ignores other providers", () => + withEnv({ AZURE_RESOURCE_NAME: "from-env" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzurePlugin) + const azure = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("azure", { + options: { headers: {}, body: {}, aisdk: { provider: { resourceName: "from-config" }, request: {} } }, + }), + cancel: false, + }, + ) + const other = yield* plugin.trigger("provider.update", {}, { provider: provider("openai"), cancel: false }) + expect(azure.provider.options.aisdk.provider.resourceName).toBe("from-config") + expect(other.provider.options.aisdk.provider.resourceName).toBeUndefined() + }), + ), + ) + + itWithAuth.effect("prefers auth resourceName over env", () => + withEnv( + { + AZURE_RESOURCE_NAME: "from-env", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const auth = yield* AuthV2.Service + yield* auth.create({ + serviceID: AuthV2.ServiceID.make("azure"), + credential: new AuthV2.ApiKeyCredential({ + type: "api", + key: "key", + metadata: { resourceName: "from-auth" }, + }), + active: true, + }) + yield* plugin.add({ + ...AuthPlugin, + effect: AuthPlugin.effect.pipe(Effect.provideService(AuthV2.Service, auth)), + }) + yield* plugin.add(AzurePlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("azure"), cancel: false }) + expect(result.provider.options.aisdk.provider.resourceName).toBe("from-auth") + }), + ), + ) + + it.effect("falls back to env when configured resourceName is blank", () => + withEnv({ AZURE_RESOURCE_NAME: "from-env" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzurePlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("azure", { + options: { headers: {}, body: {}, aisdk: { provider: { resourceName: "" }, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.options.aisdk.provider.resourceName).toBe("from-env") + }), + ), + ) + + it.effect("falls back to env when configured resourceName is whitespace", () => + withEnv({ AZURE_RESOURCE_NAME: "from-env" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzurePlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("azure", { + options: { headers: {}, body: {}, aisdk: { provider: { resourceName: " " }, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.options.aisdk.provider.resourceName).toBe("from-env") + }), + ), + ) + + it.effect("allows configured baseURL without resourceName", () => + withEnv({ AZURE_RESOURCE_NAME: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzurePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("azure", "deployment"), + package: "@ai-sdk/azure", + options: { name: "azure", baseURL: "https://proxy.example.com/openai" }, + }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ), + ) + + it.effect("rejects missing resourceName when baseURL is not configured", () => + withEnv({ AZURE_RESOURCE_NAME: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(AzurePlugin) + const exit = yield* plugin + .trigger( + "aisdk.sdk", + { model: model("azure", "deployment"), package: "@ai-sdk/azure", options: { name: "azure" } }, + {}, + ) + .pipe(Effect.exit) + expect(exit._tag).toBe("Failure") + }), + ), + ) + + it.effect("selects chat only for completion URLs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AzurePlugin) + yield* plugin.trigger( + "aisdk.language", + { model: model("azure", "deployment"), sdk: fakeSelectorSdk(calls), options: { useCompletionUrls: true } }, + {}, + ) + expect(calls).toEqual(["chat:deployment"]) + }), + ) + + it.effect("selects chat from per-call useCompletionUrls", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AzurePlugin) + yield* plugin.trigger( + "aisdk.language", + { model: model("azure", "deployment"), sdk: fakeSelectorSdk(calls), options: { useCompletionUrls: true } }, + {}, + ) + expect(calls).toEqual(["chat:deployment"]) + }), + ) + + it.effect("ignores model useCompletionUrls when per-call option is unset", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AzurePlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("azure", "deployment", { + options: { headers: {}, body: {}, aisdk: { provider: {}, request: { useCompletionUrls: true } } }, + }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + expect(calls).toEqual(["responses:deployment"]) + }), + ) + + it.effect("uses the legacy Azure selector order and provider guard", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(AzurePlugin) + yield* plugin.trigger( + "aisdk.language", + { model: model("azure", "deployment"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + const ignored = yield* plugin.trigger( + "aisdk.language", + { model: model("openai", "deployment"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + expect(calls).toEqual(["responses:deployment"]) + expect(ignored.language).toBeUndefined() + }), + ) + + it.effect("falls back through the legacy Azure selector order", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + const make = (method: string) => (id: string) => { + calls.push(`${method}:${id}`) + return { modelId: id, provider: method, specificationVersion: "v3" } + } + yield* plugin.add(AzurePlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("azure", "messages-deployment"), + sdk: { messages: make("messages"), chat: make("chat"), languageModel: make("languageModel") }, + options: {}, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { model: model("azure", "language-deployment"), sdk: { languageModel: make("languageModel") }, options: {} }, + {}, + ) + expect(calls).toEqual(["messages:messages-deployment", "languageModel:language-deployment"]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-cerebras.test.ts b/packages/core/test/plugin/provider-cerebras.test.ts new file mode 100644 index 000000000000..7270d5367ae2 --- /dev/null +++ b/packages/core/test/plugin/provider-cerebras.test.ts @@ -0,0 +1,102 @@ +import { describe, expect, mock } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { CerebrasPlugin } from "@opencode-ai/core/plugin/provider/cerebras" +import { it, model, provider } from "./provider-helper" + +const cerebrasOptions: Record[] = [] + +void mock.module("@ai-sdk/cerebras", () => ({ + createCerebras: (options: Record) => { + const snapshot = { ...options } + cerebrasOptions.push(snapshot) + return { + languageModel: (modelID: string) => ({ modelID, provider: snapshot.name, specificationVersion: "v3" }), + } + }, +})) + +describe("CerebrasPlugin", () => { + it.effect("applies the legacy integration header", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CerebrasPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("cerebras", { + options: { headers: { Existing: "1" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.options.headers).toEqual({ Existing: "1", "X-Cerebras-3rd-Party-Integration": "opencode" }) + }), + ) + + it.effect("ignores non-Cerebras providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CerebrasPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("groq"), cancel: false }) + expect(result.provider.options.headers).toEqual({}) + }), + ) + + it.effect("creates a bundled Cerebras SDK with the model provider ID as the SDK name", () => + Effect.gen(function* () { + cerebrasOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(CerebrasPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-cerebras", "llama-4-scout-17b-16e-instruct"), + package: "@ai-sdk/cerebras", + options: { name: "custom-cerebras", apiKey: "test" }, + }, + {}, + ) + expect(cerebrasOptions).toEqual([{ name: "custom-cerebras", apiKey: "test" }]) + expect(result.sdk.languageModel("llama-4-scout-17b-16e-instruct").provider).toBe("custom-cerebras") + }), + ) + + it.effect("preserves an explicit bundled Cerebras SDK name option", () => + Effect.gen(function* () { + cerebrasOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(CerebrasPlugin) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-cerebras", "llama-4-scout-17b-16e-instruct"), + package: "@ai-sdk/cerebras", + options: { name: "configured-cerebras", apiKey: "test" }, + }, + {}, + ) + expect(cerebrasOptions).toEqual([{ name: "configured-cerebras", apiKey: "test" }]) + }), + ) + + it.effect("ignores non-Cerebras SDK packages", () => + Effect.gen(function* () { + cerebrasOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(CerebrasPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-cerebras", "llama-4-scout-17b-16e-instruct"), + package: "@ai-sdk/groq", + options: { name: "custom-cerebras", apiKey: "test" }, + }, + {}, + ) + expect(cerebrasOptions).toEqual([]) + expect(result.sdk).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-cloudflare-ai-gateway.test.ts b/packages/core/test/plugin/provider-cloudflare-ai-gateway.test.ts new file mode 100644 index 000000000000..72ad5da33f1a --- /dev/null +++ b/packages/core/test/plugin/provider-cloudflare-ai-gateway.test.ts @@ -0,0 +1,384 @@ +import { describe, expect, mock } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { CloudflareAIGatewayPlugin } from "@opencode-ai/core/plugin/provider/cloudflare-ai-gateway" +import { it, model, withEnv } from "./provider-helper" + +const aiGatewayCalls: Record[] = [] +const unifiedCalls: string[] = [] +const gatewayModelCalls: unknown[] = [] + +function captureAiGatewayOptions(options: Record) { + const nested = + options.options && typeof options.options === "object" ? (options.options as Record) : undefined + return { + ...options, + ...(nested + ? { + options: { + ...nested, + headers: + nested.headers && typeof nested.headers === "object" + ? { ...(nested.headers as Record) } + : nested.headers, + }, + } + : {}), + } +} + +function resetCalls() { + aiGatewayCalls.length = 0 + unifiedCalls.length = 0 + gatewayModelCalls.length = 0 +} + +function cloudflareEnv(overrides: Record = {}) { + return { + CLOUDFLARE_ACCOUNT_ID: "env-account", + CLOUDFLARE_GATEWAY_ID: "env-gateway", + CLOUDFLARE_API_TOKEN: "env-token", + CF_AIG_TOKEN: undefined, + ...overrides, + } +} + +mock.module("ai-gateway-provider", () => ({ + createAiGateway(options: Record) { + aiGatewayCalls.push(captureAiGatewayOptions(options)) + return (input: unknown) => { + gatewayModelCalls.push(input) + return { + modelId: input, + provider: "cloudflare-ai-gateway", + specificationVersion: "v3", + } + } + }, +})) + +mock.module("ai-gateway-provider/providers/unified", () => ({ + createUnified() { + return (modelID: string) => { + unifiedCalls.push(modelID) + return { unifiedModelID: modelID } + } + }, +})) + +describe("CloudflareAIGatewayPlugin", () => { + it.effect("requires account, gateway, and token before creating the unified SDK", () => + withEnv( + { + CLOUDFLARE_ACCOUNT_ID: "acct", + CLOUDFLARE_GATEWAY_ID: "gateway", + CLOUDFLARE_API_TOKEN: "token", + CF_AIG_TOKEN: undefined, + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { name: "cloudflare-ai-gateway" }, + }, + {}, + ) + expect(result.sdk.languageModel("openai/gpt-5")).toBeDefined() + }), + ), + ) + + it.effect("passes legacy metadata, cache, log, and User-Agent values under the AI Gateway options key", () => + withEnv(cloudflareEnv(), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { + name: "cloudflare-ai-gateway", + metadata: { invoked_by: "test", project: "opencode" }, + cacheTtl: 300, + cacheKey: "cache-key", + skipCache: true, + collectLog: false, + }, + }, + {}, + ) + + expect(aiGatewayCalls).toHaveLength(1) + expect(aiGatewayCalls[0]).toEqual({ + accountId: "env-account", + gateway: "env-gateway", + apiKey: "env-token", + options: { + metadata: { invoked_by: "test", project: "opencode" }, + cacheTtl: 300, + cacheKey: "cache-key", + skipCache: true, + collectLog: false, + headers: { + "User-Agent": expect.stringContaining("opencode/"), + }, + }, + }) + }), + ), + ) + + it.effect("parses legacy cf-aig-metadata header when metadata option is absent", () => + withEnv(cloudflareEnv(), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { + name: "cloudflare-ai-gateway", + headers: { + "cf-aig-metadata": JSON.stringify({ invoked_by: "header", project: "opencode" }), + }, + }, + }, + {}, + ) + + expect(aiGatewayCalls[0]?.options).toMatchObject({ + metadata: { invoked_by: "header", project: "opencode" }, + }) + }), + ), + ) + + it.effect("prefers Cloudflare env values over auth/config-derived options", () => + withEnv(cloudflareEnv(), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { + name: "cloudflare-ai-gateway", + accountId: "auth-account", + gateway: "auth-gateway", + apiKey: "auth-token", + }, + }, + {}, + ) + + expect(aiGatewayCalls[0]).toMatchObject({ + accountId: "env-account", + gateway: "env-gateway", + apiKey: "env-token", + }) + }), + ), + ) + + it.effect("accepts gatewayId metadata copied from auth into provider options", () => + withEnv( + cloudflareEnv({ + CLOUDFLARE_ACCOUNT_ID: undefined, + CLOUDFLARE_GATEWAY_ID: undefined, + CLOUDFLARE_API_TOKEN: undefined, + }), + () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { + name: "cloudflare-ai-gateway", + accountId: "auth-account", + gatewayId: "auth-gateway", + apiKey: "auth-token", + }, + }, + {}, + ) + + expect(aiGatewayCalls[0]).toMatchObject({ + accountId: "auth-account", + gateway: "auth-gateway", + apiKey: "auth-token", + }) + }), + ), + ) + + it.effect("falls back to CF_AIG_TOKEN when CLOUDFLARE_API_TOKEN is unset", () => + withEnv(cloudflareEnv({ CLOUDFLARE_API_TOKEN: undefined, CF_AIG_TOKEN: "cf-aig-token" }), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { name: "cloudflare-ai-gateway" }, + }, + {}, + ) + + expect(aiGatewayCalls[0]).toMatchObject({ apiKey: "cf-aig-token" }) + }), + ), + ) + + it.effect("does not create an SDK when account and gateway IDs are missing", () => + withEnv(cloudflareEnv({ CLOUDFLARE_ACCOUNT_ID: undefined, CLOUDFLARE_GATEWAY_ID: undefined }), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { name: "cloudflare-ai-gateway" }, + }, + {}, + ) + + expect(result.sdk).toBeUndefined() + expect(aiGatewayCalls).toHaveLength(0) + }), + ), + ) + + it.effect("does not create an SDK when the token is missing", () => + withEnv(cloudflareEnv({ CLOUDFLARE_API_TOKEN: undefined, CF_AIG_TOKEN: undefined }), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { name: "cloudflare-ai-gateway" }, + }, + {}, + ) + + expect(result.sdk).toBeUndefined() + expect(aiGatewayCalls).toHaveLength(0) + }), + ), + ) + + it.effect("does not replace a configured baseURL with the Cloudflare AI Gateway SDK", () => + withEnv( + cloudflareEnv({ + CLOUDFLARE_ACCOUNT_ID: undefined, + CLOUDFLARE_GATEWAY_ID: undefined, + CLOUDFLARE_API_TOKEN: undefined, + }), + () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "ai-gateway-provider", + options: { name: "cloudflare-ai-gateway", baseURL: "https://proxy.example/v1" }, + }, + {}, + ) + + expect(result.sdk).toBeUndefined() + expect(aiGatewayCalls).toHaveLength(0) + }), + ), + ) + + it.effect("maps provider/model IDs through the unified Cloudflare provider unchanged", () => + withEnv(cloudflareEnv(), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "anthropic/claude-sonnet-4-5"), + package: "ai-gateway-provider", + options: { name: "cloudflare-ai-gateway" }, + }, + {}, + ) + + expect(result.sdk.languageModel("anthropic/claude-sonnet-4-5")).toEqual({ + modelId: { unifiedModelID: "anthropic/claude-sonnet-4-5" }, + provider: "cloudflare-ai-gateway", + specificationVersion: "v3", + }) + expect(unifiedCalls).toEqual(["anthropic/claude-sonnet-4-5"]) + expect(gatewayModelCalls).toEqual([{ unifiedModelID: "anthropic/claude-sonnet-4-5" }]) + }), + ), + ) + + it.effect("ignores non Cloudflare AI Gateway packages", () => + withEnv(cloudflareEnv(), () => + Effect.gen(function* () { + resetCalls() + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareAIGatewayPlugin) + + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-ai-gateway", "openai/gpt-5"), + package: "@ai-sdk/openai-compatible", + options: { name: "cloudflare-ai-gateway" }, + }, + {}, + ) + + expect(result.sdk).toBeUndefined() + expect(aiGatewayCalls).toHaveLength(0) + }), + ), + ) +}) diff --git a/packages/core/test/plugin/provider-cloudflare-workers-ai.test.ts b/packages/core/test/plugin/provider-cloudflare-workers-ai.test.ts new file mode 100644 index 000000000000..10aba171c337 --- /dev/null +++ b/packages/core/test/plugin/provider-cloudflare-workers-ai.test.ts @@ -0,0 +1,267 @@ +import { describe, expect } from "bun:test" +import { Effect, Layer } from "effect" +import { AuthV2 } from "@opencode-ai/core/auth" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AuthPlugin } from "@opencode-ai/core/plugin/auth" +import { CloudflareWorkersAIPlugin } from "@opencode-ai/core/plugin/provider/cloudflare-workers-ai" +import { testEffect } from "../lib/effect" +import { fakeSelectorSdk, it, model, npmLayer, provider, withEnv } from "./provider-helper" + +const itWithAuth = testEffect(Layer.mergeAll(PluginV2.defaultLayer, AuthV2.defaultLayer, npmLayer)) + +function cloudflareLanguage(sdk: unknown, modelID = "@cf/model") { + return (sdk as { languageModel: (id: string) => { config: CloudflareConfig; provider: string } }).languageModel( + modelID, + ) +} + +type CloudflareConfig = { + url: (input: { path: string; modelId: string }) => string + headers: () => Record | Promise> +} + +function cloudflareURL(sdk: unknown, modelID = "@cf/model") { + return cloudflareLanguage(sdk, modelID).config.url({ path: "/chat/completions", modelId: modelID }) +} + +function cloudflareHeaders(sdk: unknown, modelID = "@cf/model") { + return cloudflareLanguage(sdk, modelID).config.headers() +} + +describe("CloudflareWorkersAIPlugin", () => { + it.effect("maps account ID to endpoint URL and creates an OpenAI-compatible SDK", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: "acct", CLOUDFLARE_API_KEY: "key" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const updated = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("cloudflare-workers-ai"), cancel: false }, + ) + const sdk = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-workers-ai", "@cf/model", { endpoint: updated.provider.endpoint }), + package: "@ai-sdk/openai-compatible", + options: { name: "cloudflare-workers-ai", headers: { custom: "header" } }, + }, + {}, + ) + expect(updated.provider.endpoint).toEqual({ + type: "aisdk", + package: "test-provider", + url: "https://api.cloudflare.com/client/v4/accounts/acct/ai/v1", + }) + expect(sdk.sdk).toBeDefined() + }), + ), + ) + + it.effect("preserves a configured endpoint URL instead of deriving one from account ID", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: "acct" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("cloudflare-workers-ai", { + endpoint: { type: "aisdk", package: "test-provider", url: "https://proxy.example/v1" }, + }), + cancel: false, + }, + ) + expect(result.provider.endpoint).toEqual({ + type: "aisdk", + package: "test-provider", + url: "https://proxy.example/v1", + }) + }), + ), + ) + + it.effect("allows a configured baseURL without account ID", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: undefined, CLOUDFLARE_API_KEY: "key" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-workers-ai", "@cf/model", { + endpoint: { type: "aisdk", package: "@ai-sdk/openai-compatible", url: "https://proxy.example/v1" }, + }), + package: "@ai-sdk/openai-compatible", + options: { name: "cloudflare-workers-ai", baseURL: "https://proxy.example/v1" }, + }, + {}, + ) + expect(cloudflareURL(result.sdk)).toBe("https://proxy.example/v1/chat/completions") + }), + ), + ) + + itWithAuth.effect("falls back to auth account metadata when account env is absent", () => + withEnv( + { + CLOUDFLARE_ACCOUNT_ID: undefined, + CLOUDFLARE_API_KEY: undefined, + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const auth = yield* AuthV2.Service + yield* auth.create({ + serviceID: AuthV2.ServiceID.make("cloudflare-workers-ai"), + credential: new AuthV2.ApiKeyCredential({ + type: "api", + key: "auth-key", + metadata: { accountId: "auth-acct" }, + }), + active: true, + }) + yield* plugin.add({ + ...AuthPlugin, + effect: AuthPlugin.effect.pipe(Effect.provideService(AuthV2.Service, auth)), + }) + yield* plugin.add(CloudflareWorkersAIPlugin) + const updated = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("cloudflare-workers-ai"), cancel: false }, + ) + expect(updated.provider.endpoint).toEqual({ + type: "aisdk", + package: "test-provider", + url: "https://api.cloudflare.com/client/v4/accounts/auth-acct/ai/v1", + }) + }), + ), + ) + + it.effect("uses env account ID over configured account ID", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: "env-acct" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("cloudflare-workers-ai", { + options: { headers: {}, body: {}, aisdk: { provider: { accountId: "configured-acct" }, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.endpoint).toEqual({ + type: "aisdk", + package: "test-provider", + url: "https://api.cloudflare.com/client/v4/accounts/env-acct/ai/v1", + }) + }), + ), + ) + + it.effect("uses env API key over auth or configured API key and keeps the Cloudflare User-Agent", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: "acct", CLOUDFLARE_API_KEY: "env-key" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-workers-ai", "@cf/model", { + endpoint: { type: "aisdk", package: "@ai-sdk/openai-compatible", url: "https://proxy.example/v1" }, + }), + package: "@ai-sdk/openai-compatible", + options: { + name: "cloudflare-workers-ai", + apiKey: "auth-key", + baseURL: "https://proxy.example/v1", + headers: { custom: "header" }, + }, + }, + {}, + ) + const headers = yield* Effect.promise(() => Promise.resolve(cloudflareHeaders(result.sdk))) + expect(headers.authorization).toBe("Bearer env-key") + expect(headers.custom).toBe("header") + expect(headers["user-agent"]).toMatch(/^opencode\/.* cloudflare-workers-ai \(.+\) ai-sdk\/openai-compatible\//) + }), + ), + ) + + it.effect("expands account ID vars in endpoint URLs", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: "acct", CLOUDFLARE_API_KEY: "key" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-workers-ai", "@cf/model", { + endpoint: { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1", + }, + }), + package: "@ai-sdk/openai-compatible", + options: { + name: "cloudflare-workers-ai", + baseURL: "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1", + }, + }, + {}, + ) + expect(cloudflareURL(result.sdk)).toBe( + "https://api.cloudflare.com/client/v4/accounts/acct/ai/v1/chat/completions", + ) + }), + ), + ) + + it.effect("selects languageModel with the API model ID", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("cloudflare-workers-ai", "alias", { apiID: ModelV2.ID.make("@cf/api-model") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + expect(result.language).toBeDefined() + expect(calls).toEqual(["languageModel:@cf/api-model"]) + }), + ) + + it.effect("does not create an SDK for non OpenAI-compatible packages", () => + withEnv({ CLOUDFLARE_ACCOUNT_ID: "acct", CLOUDFLARE_API_KEY: "key" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CloudflareWorkersAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-workers-ai", "@cf/model", { + endpoint: { type: "aisdk", package: "@ai-sdk/anthropic", url: "https://proxy.example/v1" }, + }), + package: "@ai-sdk/anthropic", + options: { name: "cloudflare-workers-ai" }, + }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ), + ) +}) diff --git a/packages/core/test/plugin/provider-cohere.test.ts b/packages/core/test/plugin/provider-cohere.test.ts new file mode 100644 index 000000000000..54bec2cec45d --- /dev/null +++ b/packages/core/test/plugin/provider-cohere.test.ts @@ -0,0 +1,86 @@ +import { describe, expect, mock } from "bun:test" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { CoherePlugin } from "@opencode-ai/core/plugin/provider/cohere" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +const cohereOptions: Record[] = [] + +void mock.module("@ai-sdk/cohere", () => ({ + createCohere: (options: Record) => { + cohereOptions.push({ ...options }) + return { + languageModel: (modelID: string) => ({ + modelID, + provider: `${options.name ?? "cohere"}.chat`, + specificationVersion: "v3", + }), + } + }, +})) + +describe("CoherePlugin", () => { + it.effect("creates a Cohere SDK only for @ai-sdk/cohere", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CoherePlugin) + + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { model: model("cohere", "command"), package: "@ai-sdk/openai-compatible", options: { name: "cohere" } }, + {}, + ) + expect(ignored.sdk).toBeUndefined() + + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("cohere", "command"), package: "@ai-sdk/cohere", options: { name: "cohere" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("uses the model provider ID as the bundled SDK name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(CoherePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-cohere", "command-r-plus"), + package: "@ai-sdk/cohere", + options: { name: "custom-cohere", apiKey: "test", baseURL: "https://cohere.example" }, + }, + {}, + ) + + expect(cohereOptions.at(-1)).toEqual({ + name: "custom-cohere", + apiKey: "test", + baseURL: "https://cohere.example", + }) + expect(result.sdk?.languageModel("command-r-plus").provider).toBe("custom-cohere.chat") + }), + ) + + it.effect("leaves language selection to the default languageModel fallback", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + const sdk = fakeSelectorSdk(calls) + yield* plugin.add(CoherePlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { model: model("cohere", "alias", { apiID: ModelV2.ID.make("command-r-plus") }), sdk, options: {} }, + {}, + ) + + expect(result.language).toBeUndefined() + expect(calls).toEqual([]) + expect(result.language ?? sdk.languageModel("command-r-plus")).toBeDefined() + expect(calls).toEqual(["languageModel:command-r-plus"]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-deepinfra.test.ts b/packages/core/test/plugin/provider-deepinfra.test.ts new file mode 100644 index 000000000000..9a9cb861eaf8 --- /dev/null +++ b/packages/core/test/plugin/provider-deepinfra.test.ts @@ -0,0 +1,129 @@ +import { describe, expect, mock } from "bun:test" +import { Effect, Layer } from "effect" +import { AISDK } from "@opencode-ai/core/aisdk" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { DeepInfraPlugin } from "@opencode-ai/core/plugin/provider/deepinfra" +import { testEffect } from "../lib/effect" +import { it, model } from "./provider-helper" + +const itAISDK = testEffect(Layer.provideMerge(AISDK.layer, PluginV2.defaultLayer)) +const deepinfraOptions: Record[] = [] +const deepinfraLanguageModels: string[] = [] + +void mock.module("@ai-sdk/deepinfra", () => ({ + createDeepInfra: (options: Record) => { + const captured = { ...options } + deepinfraOptions.push(captured) + return { + languageModel: (modelID: string) => { + deepinfraLanguageModels.push(modelID) + return { modelID, provider: `${captured.name ?? "deepinfra"}.chat`, specificationVersion: "v3" } + }, + } + }, +})) + +function resetDeepInfraMock() { + deepinfraOptions.length = 0 + deepinfraLanguageModels.length = 0 +} + +describe("DeepInfraPlugin", () => { + it.effect("creates a DeepInfra SDK for @ai-sdk/deepinfra", () => + Effect.gen(function* () { + resetDeepInfraMock() + const plugin = yield* PluginV2.Service + yield* plugin.add(DeepInfraPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("deepinfra", "model"), package: "@ai-sdk/deepinfra", options: { name: "deepinfra" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("passes the model provider ID as the bundled DeepInfra SDK name", () => + Effect.gen(function* () { + resetDeepInfraMock() + const plugin = yield* PluginV2.Service + yield* plugin.add(DeepInfraPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-deepinfra", "model"), + package: "@ai-sdk/deepinfra", + options: { name: "custom-deepinfra", apiKey: "test" }, + }, + {}, + ) + expect(result.sdk.languageModel("model").provider).toBe("custom-deepinfra.chat") + expect(deepinfraOptions).toEqual([{ name: "custom-deepinfra", apiKey: "test" }]) + }), + ) + + it.effect("uses the canonical provider ID as the bundled DeepInfra SDK name", () => + Effect.gen(function* () { + resetDeepInfraMock() + const plugin = yield* PluginV2.Service + yield* plugin.add(DeepInfraPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("deepinfra", "model"), + package: "@ai-sdk/deepinfra", + options: { name: "deepinfra", apiKey: "test" }, + }, + {}, + ) + expect(result.sdk.languageModel("model").provider).toBe("deepinfra.chat") + expect(deepinfraOptions).toEqual([{ name: "deepinfra", apiKey: "test" }]) + }), + ) + + it.effect("matches only the exact bundled DeepInfra package", () => + Effect.gen(function* () { + resetDeepInfraMock() + const plugin = yield* PluginV2.Service + yield* plugin.add(DeepInfraPlugin) + const packages = [ + "unmatched-package", + "@ai-sdk/deepinfra-compatible", + "file:///tmp/@ai-sdk/deepinfra-provider.js", + ] + yield* Effect.forEach(packages, (item) => + Effect.gen(function* () { + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { model: model("deepinfra", "model"), package: item, options: { name: "deepinfra" } }, + {}, + ) + expect(ignored.sdk).toBeUndefined() + }), + ) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("deepinfra", "model"), package: "@ai-sdk/deepinfra", options: { name: "deepinfra" } }, + {}, + ) + expect(result.sdk).toBeDefined() + expect(deepinfraOptions).toEqual([{ name: "deepinfra" }]) + }), + ) + + itAISDK.effect("uses the default languageModel selection for DeepInfra models", () => + Effect.gen(function* () { + resetDeepInfraMock() + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + yield* plugin.add(DeepInfraPlugin) + const language = yield* aisdk.language( + model("deepinfra", "meta-llama/Llama-3.3-70B-Instruct", { + endpoint: { type: "aisdk", package: "@ai-sdk/deepinfra" }, + }), + ) + expect(language.provider).toBe("deepinfra.chat") + expect(deepinfraLanguageModels).toEqual(["meta-llama/Llama-3.3-70B-Instruct"]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-dynamic.test.ts b/packages/core/test/plugin/provider-dynamic.test.ts new file mode 100644 index 000000000000..c15568eebd15 --- /dev/null +++ b/packages/core/test/plugin/provider-dynamic.test.ts @@ -0,0 +1,172 @@ +import { Npm } from "@opencode-ai/core/npm" +import { describe, expect } from "bun:test" +import { Cause, Effect, Layer, Option } from "effect" +import fs from "fs/promises" +import os from "os" +import path from "path" +import { fileURLToPath } from "url" +import { AISDK } from "@opencode-ai/core/aisdk" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { DynamicProviderPlugin } from "@opencode-ai/core/plugin/provider/dynamic" +import { testEffect } from "../lib/effect" +import { fixtureProvider, it, model, npmLayer } from "./provider-helper" + +const fixtureProviderPath = fileURLToPath(fixtureProvider) +const itWithAISDK = testEffect(AISDK.layer.pipe(Layer.provideMerge(PluginV2.defaultLayer))) + +function npmEntrypointLayer(entrypoint: Option.Option) { + return Layer.succeed( + Npm.Service, + Npm.Service.of({ + add: () => Effect.succeed({ directory: "", entrypoint }), + install: () => Effect.void, + which: () => Effect.succeed(Option.none()), + }), + ) +} + +function dynamicPlugin(layer = npmLayer) { + return { id: DynamicProviderPlugin.id, effect: DynamicProviderPlugin.effect.pipe(Effect.provide(layer)) } +} + +function tempEntrypoint(source: string) { + return Effect.acquireRelease( + Effect.promise(async () => { + const directory = await fs.mkdtemp(path.join(os.tmpdir(), "opencode-provider-dynamic-")) + const entrypoint = path.join(directory, "provider.mjs") + await Bun.write(entrypoint, source) + return { directory, entrypoint } + }), + (tmp) => Effect.promise(() => fs.rm(tmp.directory, { recursive: true, force: true })), + ) +} + +describe("DynamicProviderPlugin", () => { + it.effect("creates an SDK from a provider factory export", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(dynamicPlugin()) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom", "test-model"), + package: fixtureProvider, + options: { name: "custom", marker: "dynamic" }, + }, + {}, + ) + expect(result.sdk.options).toEqual({ marker: "dynamic", name: "custom" }) + expect(result.sdk.languageModel("x")).toEqual({ modelID: "x", options: { marker: "dynamic", name: "custom" } }) + }), + ) + + it.effect("does not override an SDK already supplied by an earlier plugin", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const sdk = { marker: "existing" } + yield* plugin.add(dynamicPlugin()) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom", "test-model"), + package: fixtureProvider, + options: { name: "custom", marker: "dynamic" }, + }, + { sdk }, + ) + expect(result.sdk).toBe(sdk) + }), + ) + + it.effect("injects the provider ID as the SDK factory name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(dynamicPlugin()) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-provider", "test-model"), + package: fixtureProvider, + options: { name: "custom-provider", marker: "dynamic" }, + }, + {}, + ) + expect(result.sdk.options).toEqual({ marker: "dynamic", name: "custom-provider" }) + }), + ) + + it.effect("loads npm packages through their resolved import entrypoint", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(dynamicPlugin(npmEntrypointLayer(Option.some(fixtureProviderPath)))) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("npm-provider", "test-model"), + package: "fixture-provider", + options: { name: "npm-provider", marker: "npm" }, + }, + {}, + ) + expect(result.sdk.languageModel("x")).toEqual({ modelID: "x", options: { marker: "npm", name: "npm-provider" } }) + }), + ) + + itWithAISDK.effect("wraps missing npm entrypoint failures as AISDK init errors", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + yield* plugin.add(dynamicPlugin(npmEntrypointLayer(Option.none()))) + const exit = yield* aisdk + .language(model("missing-entrypoint", "alias", { endpoint: { type: "aisdk", package: "fixture-provider" } })) + .pipe(Effect.exit) + expect(exit._tag).toBe("Failure") + if (exit._tag === "Failure") expect(Cause.prettyErrors(exit.cause).join("\n")).toContain("AISDK.InitError") + }), + ) + + itWithAISDK.effect("wraps dynamic import failures as AISDK init errors", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + yield* plugin.add(dynamicPlugin()) + const exit = yield* aisdk + .language( + model("bad-import", "alias", { endpoint: { type: "aisdk", package: "file:///missing/provider-factory.js" } }), + ) + .pipe(Effect.exit) + expect(exit._tag).toBe("Failure") + if (exit._tag === "Failure") expect(Cause.prettyErrors(exit.cause).join("\n")).toContain("AISDK.InitError") + }), + ) + + itWithAISDK.live("wraps missing provider factory exports as AISDK init errors", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + const tmp = yield* tempEntrypoint("export const notAProviderFactory = true\n") + yield* plugin.add(dynamicPlugin(npmEntrypointLayer(Option.some(tmp.entrypoint)))) + const exit = yield* aisdk + .language(model("missing-factory", "alias", { endpoint: { type: "aisdk", package: "fixture-provider" } })) + .pipe(Effect.exit) + expect(exit._tag).toBe("Failure") + if (exit._tag === "Failure") expect(Cause.prettyErrors(exit.cause).join("\n")).toContain("AISDK.InitError") + }), + ) + + itWithAISDK.effect("uses the model apiID for the default language model", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + yield* plugin.add(dynamicPlugin()) + const language = yield* aisdk.language( + model("custom", "alias", { + apiID: ModelV2.ID.make("test-model-api"), + endpoint: { type: "aisdk", package: fixtureProvider }, + }), + ) + expect(language).toMatchObject({ modelID: "test-model-api", options: { name: "custom" } }) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-gateway.test.ts b/packages/core/test/plugin/provider-gateway.test.ts new file mode 100644 index 000000000000..8ee69b7dd49a --- /dev/null +++ b/packages/core/test/plugin/provider-gateway.test.ts @@ -0,0 +1,87 @@ +import { describe, expect, mock } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { GatewayPlugin } from "@opencode-ai/core/plugin/provider/gateway" +import { it, model } from "./provider-helper" + +const gatewayCalls: Record[] = [] +const vercelGatewayModels = ["anthropic/claude-sonnet-4", "openai/gpt-5", "google/gemini-2.5-pro"] + +mock.module("@ai-sdk/gateway", () => ({ + createGateway(options: Record) { + gatewayCalls.push({ ...options }) + return { + languageModel(modelID: string) { + return { + modelId: modelID, + provider: options.name, + specificationVersion: "v3", + } + }, + } + }, +})) + +describe("GatewayPlugin", () => { + it.effect("creates a Gateway SDK for @ai-sdk/gateway", () => + Effect.gen(function* () { + gatewayCalls.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GatewayPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("gateway", "model"), package: "@ai-sdk/gateway", options: { name: "gateway" } }, + {}, + ) + expect(result.sdk).toBeDefined() + expect(gatewayCalls).toHaveLength(1) + }), + ) + + it.effect("passes the model providerID as the Gateway SDK name", () => + Effect.gen(function* () { + gatewayCalls.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GatewayPlugin) + + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("vercel", "anthropic/claude-sonnet-4"), + package: "@ai-sdk/gateway", + options: { name: "vercel", apiKey: "test-key" }, + }, + {}, + ) + + expect(gatewayCalls).toEqual([{ name: "vercel", apiKey: "test-key" }]) + expect(result.sdk.languageModel("anthropic/claude-sonnet-4").provider).toBe("vercel") + }), + ) + + it.effect("matches Vercel AI Gateway models by their @ai-sdk/gateway package", () => + Effect.gen(function* () { + gatewayCalls.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GatewayPlugin) + + for (const modelID of vercelGatewayModels) { + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { model: model("vercel", modelID), package: "@ai-sdk/vercel", options: { name: "vercel" } }, + {}, + ) + expect(ignored.sdk).toBeUndefined() + + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("vercel", modelID), package: "@ai-sdk/gateway", options: { name: "vercel" } }, + {}, + ) + expect(result.sdk).toBeDefined() + } + + expect(gatewayCalls).toHaveLength(3) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-github-copilot.test.ts b/packages/core/test/plugin/provider-github-copilot.test.ts new file mode 100644 index 000000000000..e2bd899ff3fb --- /dev/null +++ b/packages/core/test/plugin/provider-github-copilot.test.ts @@ -0,0 +1,188 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { GithubCopilotPlugin } from "@opencode-ai/core/plugin/provider/github-copilot" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +describe("GithubCopilotPlugin", () => { + it.effect("creates the bundled Copilot SDK for the GitHub Copilot package", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GithubCopilotPlugin) + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("github-copilot", "gpt-5"), + package: "@ai-sdk/openai-compatible", + options: { name: "github-copilot" }, + }, + {}, + ) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("github-copilot", "gpt-5"), + package: "@ai-sdk/github-copilot", + options: { name: "github-copilot" }, + }, + {}, + ) + expect(ignored.sdk).toBeUndefined() + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("selects languageModel when responses and chat are absent", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GithubCopilotPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("github-copilot", "claude-sonnet-4"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual(["languageModel:claude-sonnet-4"]) + }), + ) + + it.effect("selects languageModel with the API model ID when responses and chat are absent", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GithubCopilotPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("github-copilot", "alias", { apiID: ModelV2.ID.make("claude-sonnet-4") }), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual(["languageModel:claude-sonnet-4"]) + }), + ) + + it.effect("uses responses for gpt-5 models except gpt-5-mini", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GithubCopilotPlugin) + yield* plugin.trigger( + "aisdk.language", + { model: model("github-copilot", "gpt-5"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { model: model("github-copilot", "gpt-5.1-codex"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { model: model("github-copilot", "gpt-4o"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { model: model("github-copilot", "gpt-5-mini"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { model: model("github-copilot", "gpt-5-mini-2025-08-07"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + expect(calls).toEqual([ + "responses:gpt-5", + "responses:gpt-5.1-codex", + "chat:gpt-4o", + "chat:gpt-5-mini", + "chat:gpt-5-mini-2025-08-07", + ]) + }), + ) + + it.effect("uses the API model ID when selecting responses or chat", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GithubCopilotPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("github-copilot", "default", { apiID: ModelV2.ID.make("gpt-5") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("github-copilot", "small", { apiID: ModelV2.ID.make("gpt-5-mini") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + yield* plugin.trigger( + "aisdk.language", + { + model: model("github-copilot", "sonnet", { apiID: ModelV2.ID.make("claude-sonnet-4") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + expect(calls).toEqual(["responses:gpt-5", "chat:gpt-5-mini", "chat:claude-sonnet-4"]) + }), + ) + + it.effect("filters gpt-5-chat-latest before Copilot language selection", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GithubCopilotPlugin) + const result = yield* plugin.trigger( + "model.update", + {}, + { model: model("github-copilot", "gpt-5-chat-latest"), cancel: false }, + ) + expect(result.cancel).toBe(true) + }), + ) + + it.effect("does not filter gpt-5-chat-latest for non-Copilot providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GithubCopilotPlugin) + const result = yield* plugin.trigger( + "model.update", + {}, + { model: model("custom-copilot", "gpt-5-chat-latest"), cancel: false }, + ) + expect(result.cancel).toBe(false) + }), + ) + + it.effect("ignores non-Copilot providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GithubCopilotPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { model: model("openai", "gpt-5"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-gitlab.test.ts b/packages/core/test/plugin/provider-gitlab.test.ts new file mode 100644 index 000000000000..56a22649a992 --- /dev/null +++ b/packages/core/test/plugin/provider-gitlab.test.ts @@ -0,0 +1,346 @@ +import { describe, expect, mock } from "bun:test" +import { Effect, Layer } from "effect" +import { AuthV2 } from "@opencode-ai/core/auth" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { AuthPlugin } from "@opencode-ai/core/plugin/auth" +import { GitLabPlugin } from "@opencode-ai/core/plugin/provider/gitlab" +import { testEffect } from "../lib/effect" +import { it, model, npmLayer, provider, withEnv } from "./provider-helper" + +const gitlabSDKOptions: Record[] = [] + +void mock.module("gitlab-ai-provider", () => ({ + VERSION: "test-version", + createGitLab: (options: Record) => { + gitlabSDKOptions.push(options) + return { + agenticChat: (id: string, options: unknown) => ({ id, options, type: "agentic" }), + workflowChat: (id: string, options: unknown) => ({ id, options, type: "workflow" }), + } + }, + discoverWorkflowModels: async () => ({ models: [], project: undefined }), + isWorkflowModel: (id: string) => id === "duo-workflow" || id === "duo-workflow-exact", +})) + +const itWithAuth = testEffect(Layer.mergeAll(PluginV2.defaultLayer, AuthV2.defaultLayer, npmLayer)) + +describe("GitLabPlugin", () => { + it.effect("creates SDKs with legacy default instance URL, token env, headers, and feature flags", () => + withEnv( + { + GITLAB_INSTANCE_URL: undefined, + GITLAB_TOKEN: "env-token", + }, + () => + Effect.gen(function* () { + gitlabSDKOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GitLabPlugin) + yield* plugin.trigger( + "aisdk.sdk", + { model: model("gitlab", "claude"), package: "gitlab-ai-provider", options: { name: "gitlab" } }, + {}, + ) + expect(gitlabSDKOptions).toHaveLength(1) + expect(gitlabSDKOptions[0].instanceUrl).toBe("https://gitlab.com") + expect(gitlabSDKOptions[0].apiKey).toBe("env-token") + expect(gitlabSDKOptions[0].aiGatewayHeaders).toMatchObject({ + "anthropic-beta": "context-1m-2025-08-07", + }) + expect(String((gitlabSDKOptions[0].aiGatewayHeaders as Record)["User-Agent"])).toContain( + "gitlab-ai-provider/test-version", + ) + expect(gitlabSDKOptions[0].featureFlags).toEqual({ + duo_agent_platform_agentic_chat: true, + duo_agent_platform: true, + }) + }), + ), + ) + + it.effect("uses GITLAB_INSTANCE_URL when instanceUrl is not configured", () => + withEnv( + { + GITLAB_INSTANCE_URL: "https://env.gitlab.example", + GITLAB_TOKEN: undefined, + }, + () => + Effect.gen(function* () { + gitlabSDKOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GitLabPlugin) + yield* plugin.trigger( + "aisdk.sdk", + { model: model("gitlab", "claude"), package: "gitlab-ai-provider", options: { name: "gitlab" } }, + {}, + ) + expect(gitlabSDKOptions[0].instanceUrl).toBe("https://env.gitlab.example") + }), + ), + ) + + it.effect("keeps configured instance URL, apiKey, aiGatewayHeaders, and featureFlags over env/defaults", () => + withEnv( + { + GITLAB_INSTANCE_URL: "https://env.gitlab.example", + GITLAB_TOKEN: "env-token", + }, + () => + Effect.gen(function* () { + gitlabSDKOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GitLabPlugin) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("gitlab", "claude"), + package: "gitlab-ai-provider", + options: { + name: "gitlab", + instanceUrl: "https://configured.gitlab.example", + apiKey: "configured-token", + aiGatewayHeaders: { + "anthropic-beta": "configured-beta", + "x-gitlab-test": "1", + }, + featureFlags: { + duo_agent_platform: false, + custom_flag: true, + }, + }, + }, + {}, + ) + expect(gitlabSDKOptions[0].instanceUrl).toBe("https://configured.gitlab.example") + expect(gitlabSDKOptions[0].apiKey).toBe("configured-token") + expect(gitlabSDKOptions[0].aiGatewayHeaders).toMatchObject({ + "anthropic-beta": "configured-beta", + "x-gitlab-test": "1", + }) + expect(gitlabSDKOptions[0].featureFlags).toEqual({ + duo_agent_platform_agentic_chat: true, + duo_agent_platform: false, + custom_flag: true, + }) + }), + ), + ) + + it.effect("ignores non-GitLab SDK packages", () => + Effect.gen(function* () { + gitlabSDKOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GitLabPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("gitlab", "claude"), package: "@ai-sdk/openai", options: { name: "gitlab" } }, + {}, + ) + expect(result.sdk).toBeUndefined() + expect(gitlabSDKOptions).toHaveLength(0) + }), + ) + + itWithAuth.effect("uses active API auth token over GITLAB_TOKEN", () => + withEnv( + { + GITLAB_TOKEN: "env-token", + }, + () => + Effect.gen(function* () { + gitlabSDKOptions.length = 0 + const plugin = yield* PluginV2.Service + const auth = yield* AuthV2.Service + yield* auth.create({ + serviceID: AuthV2.ServiceID.make("gitlab"), + credential: new AuthV2.ApiKeyCredential({ type: "api", key: "auth-token" }), + active: true, + }) + yield* plugin.add({ + ...AuthPlugin, + effect: AuthPlugin.effect.pipe(Effect.provideService(AuthV2.Service, auth)), + }) + yield* plugin.add(GitLabPlugin) + const updated = yield* plugin.trigger("provider.update", {}, { provider: provider("gitlab"), cancel: false }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("gitlab", "claude"), + package: "gitlab-ai-provider", + options: updated.provider.options.aisdk.provider, + }, + {}, + ) + expect(gitlabSDKOptions[0].apiKey).toBe("auth-token") + }), + ), + ) + + itWithAuth.effect("uses active OAuth access token when no API auth exists", () => + withEnv( + { + GITLAB_TOKEN: undefined, + }, + () => + Effect.gen(function* () { + gitlabSDKOptions.length = 0 + const plugin = yield* PluginV2.Service + const auth = yield* AuthV2.Service + yield* auth.create({ + serviceID: AuthV2.ServiceID.make("gitlab"), + credential: new AuthV2.OAuthCredential({ + type: "oauth", + refresh: "refresh-token", + access: "oauth-token", + expires: 9999999999999, + }), + active: true, + }) + yield* plugin.add({ + ...AuthPlugin, + effect: AuthPlugin.effect.pipe(Effect.provideService(AuthV2.Service, auth)), + }) + yield* plugin.add(GitLabPlugin) + const updated = yield* plugin.trigger("provider.update", {}, { provider: provider("gitlab"), cancel: false }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("gitlab", "claude"), + package: "gitlab-ai-provider", + options: updated.provider.options.aisdk.provider, + }, + {}, + ) + expect(gitlabSDKOptions[0].apiKey).toBe("oauth-token") + }), + ), + ) + + it.effect("uses workflowChat for duo workflow models and preserves selectedModelRef", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: [string, unknown][] = [] + yield* plugin.add(GitLabPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("gitlab", "duo-workflow-custom", { + options: { + headers: {}, + body: {}, + aisdk: { provider: {}, request: { workflowRef: "ref", workflowDefinition: "definition" } }, + }, + }), + sdk: { + workflowChat: (id: string, options: unknown) => { + calls.push([id, options]) + return { id, options } + }, + agenticChat: () => undefined, + }, + options: { featureFlags: { configured: true } }, + }, + {}, + ) + expect(calls).toEqual([ + ["duo-workflow", { featureFlags: { configured: true }, workflowDefinition: "definition" }], + ]) + expect(result.language as unknown).toEqual({ + id: "duo-workflow", + options: calls[0]?.[1], + selectedModelRef: "ref", + }) + }), + ) + + it.effect("uses exact static workflow model ids when the provider recognizes them", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: [string, unknown][] = [] + yield* plugin.add(GitLabPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("gitlab", "duo-workflow-exact"), + sdk: { + workflowChat: (id: string, options: unknown) => { + calls.push([id, options]) + return { id, options } + }, + agenticChat: () => undefined, + }, + options: { featureFlags: { configured: true } }, + }, + {}, + ) + expect(calls).toEqual([ + ["duo-workflow-exact", { featureFlags: { configured: true }, workflowDefinition: undefined }], + ]) + expect(result.language as unknown).toEqual({ id: "duo-workflow-exact", options: calls[0]?.[1] }) + }), + ) + + it.effect("uses provider feature flags instead of request feature flags", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: [string, unknown][] = [] + yield* plugin.add(GitLabPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("gitlab", "duo-workflow-custom", { + options: { + headers: {}, + body: {}, + aisdk: { provider: {}, request: { featureFlags: { request_flag: true } } }, + }, + }), + sdk: { + workflowChat: (id: string, options: unknown) => { + calls.push([id, options]) + return { id, options } + }, + agenticChat: () => undefined, + }, + options: { featureFlags: { configured: true } }, + }, + {}, + ) + expect(calls).toEqual([["duo-workflow", { featureFlags: { configured: true }, workflowDefinition: undefined }]]) + }), + ) + + it.effect("uses agenticChat with provider aiGatewayHeaders and feature flags for normal models", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: [string, unknown][] = [] + yield* plugin.add(GitLabPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("gitlab", "claude", { + options: { headers: { h: "v" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + sdk: { + workflowChat: () => undefined, + agenticChat: (id: string, options: unknown) => { + const selected = options as { + aiGatewayHeaders?: Record + featureFlags?: Record + } + calls.push([ + id, + { aiGatewayHeaders: { ...selected.aiGatewayHeaders }, featureFlags: { ...selected.featureFlags } }, + ]) + }, + }, + options: { aiGatewayHeaders: { fallback: "header" }, featureFlags: { duo_agent_platform: true } }, + }, + {}, + ) + expect(calls).toEqual([ + ["claude", { aiGatewayHeaders: { fallback: "header" }, featureFlags: { duo_agent_platform: true } }], + ]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-google-vertex-anthropic.test.ts b/packages/core/test/plugin/provider-google-vertex-anthropic.test.ts new file mode 100644 index 000000000000..6bcece53c959 --- /dev/null +++ b/packages/core/test/plugin/provider-google-vertex-anthropic.test.ts @@ -0,0 +1,147 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { GoogleVertexAnthropicPlugin } from "@opencode-ai/core/plugin/provider/google-vertex" +import { fakeSelectorSdk, it, model, provider, withEnv } from "./provider-helper" + +describe("GoogleVertexAnthropicPlugin", () => { + it.effect("resolves legacy project and location env on provider update", () => + withEnv( + { + GOOGLE_CLOUD_PROJECT: "cloud-project", + GCP_PROJECT: "gcp-project", + GCLOUD_PROJECT: "gcloud-project", + GOOGLE_CLOUD_LOCATION: "cloud-location", + VERTEX_LOCATION: "vertex-location", + GOOGLE_VERTEX_LOCATION: "google-vertex-location", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexAnthropicPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("google-vertex-anthropic"), cancel: false }, + ) + expect(result.provider.options.aisdk.provider.project).toBe("cloud-project") + expect(result.provider.options.aisdk.provider.location).toBe("cloud-location") + }), + ), + ) + + it.effect("keeps configured project and location over env fallback", () => + withEnv({ GOOGLE_CLOUD_PROJECT: "env-project", GOOGLE_CLOUD_LOCATION: "env-location" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexAnthropicPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("google-vertex-anthropic", { + options: { + headers: {}, + body: {}, + aisdk: { provider: { project: "configured-project", location: "configured-location" }, request: {} }, + }, + }), + cancel: false, + }, + ) + expect(result.provider.options.aisdk.provider.project).toBe("configured-project") + expect(result.provider.options.aisdk.provider.location).toBe("configured-location") + }), + ), + ) + + it.effect("creates SDKs from legacy env fallback and default location", () => + withEnv( + { + GOOGLE_CLOUD_PROJECT: undefined, + GCP_PROJECT: "gcp-project", + GCLOUD_PROJECT: "gcloud-project", + GOOGLE_CLOUD_LOCATION: undefined, + VERTEX_LOCATION: undefined, + GOOGLE_VERTEX_LOCATION: "ignored-location", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexAnthropicPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("google-vertex-anthropic", "claude-sonnet-4-5"), + package: "@ai-sdk/google-vertex/anthropic", + options: { name: "google-vertex-anthropic" }, + }, + {}, + ) + expect(result.sdk.languageModel("claude-sonnet-4-5").config.baseURL).toBe( + "https://aiplatform.googleapis.com/v1/projects/gcp-project/locations/global/publishers/anthropic/models", + ) + }), + ), + ) + + it.effect("uses GOOGLE_CLOUD_LOCATION before VERTEX_LOCATION when creating SDKs", () => + withEnv( + { GOOGLE_CLOUD_PROJECT: "project", GOOGLE_CLOUD_LOCATION: "cloud-location", VERTEX_LOCATION: "vertex-location" }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexAnthropicPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("google-vertex-anthropic", "claude-sonnet-4-5"), + package: "@ai-sdk/google-vertex/anthropic", + options: { name: "google-vertex-anthropic" }, + }, + {}, + ) + expect(result.sdk.languageModel("claude-sonnet-4-5").config.baseURL).toBe( + "https://cloud-location-aiplatform.googleapis.com/v1/projects/project/locations/cloud-location/publishers/anthropic/models", + ) + }), + ), + ) + + it.effect("trims model IDs before selecting language models", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GoogleVertexAnthropicPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("google-vertex-anthropic", " claude-sonnet-4-5 "), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual(["languageModel:claude-sonnet-4-5"]) + }), + ) + + it.effect("ignores non Vertex Anthropic providers for language selection", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GoogleVertexAnthropicPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("google-vertex", "claude-sonnet-4-5"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-google-vertex.test.ts b/packages/core/test/plugin/provider-google-vertex.test.ts new file mode 100644 index 000000000000..3bd60fd72119 --- /dev/null +++ b/packages/core/test/plugin/provider-google-vertex.test.ts @@ -0,0 +1,300 @@ +import { describe, expect, mock } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { GoogleVertexPlugin } from "@opencode-ai/core/plugin/provider/google-vertex" +import { fakeSelectorSdk, it, model, provider, withEnv } from "./provider-helper" + +const vertexOptions: Record[] = [] + +void mock.module("@ai-sdk/google-vertex", () => ({ + createVertex: (options: Record) => { + vertexOptions.push(options) + return { + languageModel: (modelID: string) => ({ modelID, provider: "google-vertex", specificationVersion: "v3" }), + } + }, +})) + +void mock.module("google-auth-library", () => ({ + GoogleAuth: class { + async getApplicationDefault() { + return { + credential: { + async getAccessToken() { + return { token: "vertex-token" } + }, + }, + } + } + }, +})) + +describe("GoogleVertexPlugin", () => { + it.effect("resolves project and location from env using legacy precedence", () => + withEnv( + { + GOOGLE_CLOUD_PROJECT: "google-cloud-project", + GCP_PROJECT: "gcp-project", + GCLOUD_PROJECT: "gcloud-project", + GOOGLE_VERTEX_LOCATION: "google-vertex-location", + GOOGLE_CLOUD_LOCATION: "google-cloud-location", + VERTEX_LOCATION: "vertex-location", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("google-vertex", { + endpoint: { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}", + }, + }), + cancel: false, + }, + ) + expect(result.provider.options.aisdk.provider.project).toBe("google-cloud-project") + expect(result.provider.options.aisdk.provider.location).toBe("google-vertex-location") + expect(result.provider.endpoint).toEqual({ + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://google-vertex-location-aiplatform.googleapis.com/v1/projects/google-cloud-project/locations/google-vertex-location", + }) + }), + ), + ) + + it.effect("resolves the advertised GOOGLE_VERTEX_PROJECT env for provider updates and SDKs", () => + withEnv( + { + GOOGLE_VERTEX_PROJECT: "vertex-project", + GOOGLE_CLOUD_PROJECT: undefined, + GCP_PROJECT: undefined, + GCLOUD_PROJECT: undefined, + GOOGLE_VERTEX_LOCATION: "europe-west4", + GOOGLE_CLOUD_LOCATION: undefined, + VERTEX_LOCATION: undefined, + }, + () => + Effect.gen(function* () { + vertexOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexPlugin) + const updated = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("google-vertex", { + endpoint: { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}", + }, + }), + cancel: false, + }, + ) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("google-vertex", "gemini", { + endpoint: { type: "aisdk", package: "@ai-sdk/google-vertex" }, + }), + package: "@ai-sdk/google-vertex", + options: { name: "google-vertex" }, + }, + {}, + ) + + expect(updated.provider.options.aisdk.provider.project).toBe("vertex-project") + expect(updated.provider.endpoint).toEqual({ + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://europe-west4-aiplatform.googleapis.com/v1/projects/vertex-project/locations/europe-west4", + }) + expect(vertexOptions[0].project).toBe("vertex-project") + expect(vertexOptions[0].location).toBe("europe-west4") + }), + ), + ) + + it.effect("keeps configured project and location over env and uses global endpoint", () => + withEnv( + { + GOOGLE_CLOUD_PROJECT: "env-project", + GCP_PROJECT: "env-gcp-project", + GCLOUD_PROJECT: "env-gcloud-project", + GOOGLE_VERTEX_LOCATION: "env-location", + GOOGLE_CLOUD_LOCATION: "env-google-cloud-location", + VERTEX_LOCATION: "env-vertex-location", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("google-vertex", { + endpoint: { + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}", + }, + options: { + headers: {}, + body: {}, + aisdk: { provider: { project: "config-project", location: "global" }, request: {} }, + }, + }), + cancel: false, + }, + ) + expect(result.provider.options.aisdk.provider.project).toBe("config-project") + expect(result.provider.options.aisdk.provider.location).toBe("global") + expect(result.provider.endpoint).toEqual({ + type: "aisdk", + package: "@ai-sdk/openai-compatible", + url: "https://aiplatform.googleapis.com/v1/projects/config-project/locations/global", + }) + }), + ), + ) + + it.effect("defaults location to us-central1 when only project is configured", () => + withEnv( + { + GOOGLE_CLOUD_PROJECT: undefined, + GCP_PROJECT: undefined, + GCLOUD_PROJECT: undefined, + GOOGLE_VERTEX_LOCATION: undefined, + GOOGLE_CLOUD_LOCATION: undefined, + VERTEX_LOCATION: undefined, + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("google-vertex", { + options: { headers: {}, body: {}, aisdk: { provider: { project: "config-project" }, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.options.aisdk.provider.project).toBe("config-project") + expect(result.provider.options.aisdk.provider.location).toBe("us-central1") + }), + ), + ) + + it.effect("does not pass Google auth fetch to the native Vertex SDK", () => + withEnv( + { + GOOGLE_CLOUD_PROJECT: "env-project", + GOOGLE_VERTEX_LOCATION: "env-location", + }, + () => + Effect.gen(function* () { + vertexOptions.length = 0 + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexPlugin) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("google-vertex", "gemini", { + endpoint: { type: "aisdk", package: "@ai-sdk/google-vertex" }, + }), + package: "@ai-sdk/google-vertex", + options: { name: "google-vertex" }, + }, + {}, + ) + expect(vertexOptions).toHaveLength(1) + expect(vertexOptions[0].project).toBe("env-project") + expect(vertexOptions[0].location).toBe("env-location") + expect(vertexOptions[0].fetch).toBeUndefined() + }), + ), + ) + + it.effect("keeps Google auth fetch for OpenAI-compatible Vertex endpoints", () => + Effect.gen(function* () { + const fetchCalls: { input: Parameters[0]; init?: RequestInit }[] = [] + const plugin = yield* PluginV2.Service + yield* plugin.add(GoogleVertexPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("capture-openai-compatible"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.promise(async () => { + if (evt.model.providerID !== "google-vertex") return + if (evt.package !== "@ai-sdk/openai-compatible") return + expect(typeof evt.options.fetch).toBe("function") + await evt.options.fetch("https://vertex.example", { + headers: { "x-test": "1" }, + }) + }), + }), + }) + const originalFetch = fetch + ;(globalThis as typeof globalThis & { fetch: typeof fetch }).fetch = (async ( + input: Parameters[0], + init?: RequestInit, + ) => { + fetchCalls.push({ input, init }) + return new Response("ok") + }) as typeof fetch + yield* Effect.acquireUseRelease( + Effect.void, + () => + plugin.trigger( + "aisdk.sdk", + { + model: model("google-vertex", "gemini", { + endpoint: { type: "aisdk", package: "@ai-sdk/openai-compatible" }, + }), + package: "@ai-sdk/openai-compatible", + options: { name: "google-vertex" }, + }, + {}, + ), + () => + Effect.sync(() => { + ;(globalThis as typeof globalThis & { fetch: typeof fetch }).fetch = originalFetch + }), + ) + expect(fetchCalls).toHaveLength(1) + expect(fetchCalls[0].input).toBe("https://vertex.example") + expect(new Headers(fetchCalls[0].init?.headers).get("authorization")).toBe("Bearer vertex-token") + expect(new Headers(fetchCalls[0].init?.headers).get("x-test")).toBe("1") + }), + ) + + it.effect("trims model IDs before selecting language models", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(GoogleVertexPlugin) + yield* plugin.trigger( + "aisdk.language", + { + model: model("google-vertex", " gemini-2.5-pro "), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + expect(calls).toEqual(["languageModel:gemini-2.5-pro"]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-google.test.ts b/packages/core/test/plugin/provider-google.test.ts new file mode 100644 index 000000000000..fdb7bf75eeaf --- /dev/null +++ b/packages/core/test/plugin/provider-google.test.ts @@ -0,0 +1,70 @@ +import { describe, expect } from "bun:test" +import { Effect, Layer } from "effect" +import { AISDK } from "@opencode-ai/core/aisdk" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { GooglePlugin } from "@opencode-ai/core/plugin/provider/google" +import { testEffect } from "../lib/effect" +import { it, model } from "./provider-helper" + +const itWithAISDK = testEffect(AISDK.layer.pipe(Layer.provideMerge(PluginV2.defaultLayer))) + +describe("GooglePlugin", () => { + it.effect("creates a Google Generative AI SDK for @ai-sdk/google using the provider ID as SDK name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GooglePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-google", "gemini"), + package: "@ai-sdk/google", + options: { name: "custom-google", apiKey: "test" }, + }, + {}, + ) + expect(result.sdk).toBeDefined() + expect(result.sdk?.languageModel("gemini").provider).toBe("custom-google") + }), + ) + + it.effect("ignores non-Google SDK packages", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GooglePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("google", "gemini"), package: "@ai-sdk/google-vertex", options: { name: "google" } }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + itWithAISDK.effect("uses default languageModel loading with provider ID parity", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + yield* plugin.add(GooglePlugin) + const language = yield* aisdk.language( + model("custom-google", "alias", { + apiID: ModelV2.ID.make("gemini-api"), + endpoint: { + type: "aisdk", + package: "@ai-sdk/google", + }, + options: { + headers: {}, + body: {}, + aisdk: { + provider: { apiKey: "test" }, + request: {}, + }, + }, + }), + ) + expect(language.modelId).toBe("gemini-api") + expect(language.provider).toBe("custom-google") + }), + ) +}) diff --git a/packages/core/test/plugin/provider-groq.test.ts b/packages/core/test/plugin/provider-groq.test.ts new file mode 100644 index 000000000000..579d70da59a3 --- /dev/null +++ b/packages/core/test/plugin/provider-groq.test.ts @@ -0,0 +1,101 @@ +import { describe, expect } from "bun:test" +import { createGroq } from "@ai-sdk/groq" +import { Effect, Layer } from "effect" +import { AISDK } from "@opencode-ai/core/aisdk" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { GroqPlugin } from "@opencode-ai/core/plugin/provider/groq" +import { it, model } from "./provider-helper" +import { testEffect } from "../lib/effect" + +const aisdkIt = testEffect(AISDK.layer.pipe(Layer.provideMerge(PluginV2.defaultLayer))) + +describe("GroqPlugin", () => { + it.effect("creates a Groq SDK for @ai-sdk/groq", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GroqPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("groq", "llama"), package: "@ai-sdk/groq", options: { name: "groq" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("ignores non-Groq SDK packages", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GroqPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("groq", "llama"), package: "@ai-sdk/openai-compatible", options: { name: "groq" } }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + it.effect("only matches the bundled @ai-sdk/groq package exactly", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GroqPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("groq", "llama"), package: "@ai-sdk/groq/compat", options: { name: "groq" } }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + it.effect("matches the old bundled Groq SDK provider naming", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(GroqPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-groq", "llama"), + package: "@ai-sdk/groq", + options: { name: "custom-groq", apiKey: "test" }, + }, + {}, + ) + const expected = createGroq({ name: "custom-groq", apiKey: "test" } as Parameters[0] & { + name: string + }).languageModel("llama") + const actual = result.sdk?.languageModel("llama") + expect(actual?.provider).toBe(expected.provider) + expect(actual?.modelId).toBe(expected.modelId) + }), + ) + + aisdkIt.effect("uses the default languageModel(apiID) behavior", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const aisdk = yield* AISDK.Service + yield* plugin.add(GroqPlugin) + const result = yield* aisdk.language( + model("groq", "alias", { + apiID: ModelV2.ID.make("llama-api"), + endpoint: { + type: "aisdk", + package: "@ai-sdk/groq", + }, + options: { + headers: {}, + body: {}, + aisdk: { + provider: { apiKey: "test" }, + request: {}, + }, + }, + }), + ) + expect(result.modelId).toBe("llama-api") + expect(result.provider).toBe("groq.chat") + }), + ) +}) diff --git a/packages/core/test/plugin/provider-helper.ts b/packages/core/test/plugin/provider-helper.ts new file mode 100644 index 000000000000..0d67075ac8e5 --- /dev/null +++ b/packages/core/test/plugin/provider-helper.ts @@ -0,0 +1,100 @@ +import { Npm } from "@opencode-ai/core/npm" +import type { LanguageModelV3 } from "@ai-sdk/provider" +import { expect } from "bun:test" +import { Effect, Layer, Option } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderV2 } from "@opencode-ai/core/provider" +import { testEffect } from "../lib/effect" + +export const fixtureProvider = new URL("./fixtures/provider-factory.ts", import.meta.url).href + +export const npmLayer = Layer.succeed( + Npm.Service, + Npm.Service.of({ + add: () => Effect.succeed({ directory: "", entrypoint: Option.none() }), + install: () => Effect.void, + which: () => Effect.succeed(Option.none()), + }), +) + +export const it = testEffect(Layer.mergeAll(PluginV2.defaultLayer, npmLayer)) + +export function provider(providerID: string, options?: Partial) { + return new ProviderV2.Info({ + ...ProviderV2.Info.empty(ProviderV2.ID.make(providerID)), + endpoint: { + type: "aisdk", + package: "test-provider", + }, + ...options, + options: { + headers: {}, + body: {}, + aisdk: { + provider: {}, + request: {}, + }, + ...options?.options, + }, + }) +} + +export function model(providerID: string, modelID: string, options?: Partial) { + return new ModelV2.Info({ + ...ModelV2.Info.empty(ProviderV2.ID.make(providerID), ModelV2.ID.make(modelID)), + apiID: ModelV2.ID.make(modelID), + endpoint: { + type: "aisdk", + package: "test-provider", + }, + ...options, + options: { + headers: {}, + body: {}, + aisdk: { + provider: {}, + request: {}, + }, + ...options?.options, + }, + }) +} + +export function withEnv(vars: Record, fx: () => Effect.Effect) { + return Effect.acquireUseRelease( + Effect.sync(() => { + const previous = Object.fromEntries(Object.keys(vars).map((key) => [key, process.env[key]])) + for (const [key, value] of Object.entries(vars)) { + if (value === undefined) delete process.env[key] + else process.env[key] = value + } + return previous + }), + () => fx(), + (previous) => + Effect.sync(() => { + for (const [key, value] of Object.entries(previous)) { + if (value === undefined) delete process.env[key] + else process.env[key] = value + } + }), + ) +} + +export function fakeSelectorSdk(calls: string[]) { + const make = (method: string) => (id: string) => { + calls.push(`${method}:${id}`) + return { modelId: id, provider: method, specificationVersion: "v3" } as unknown as LanguageModelV3 + } + return { + responses: make("responses"), + messages: make("messages"), + chat: make("chat"), + languageModel: make("languageModel"), + } +} + +export function expectPluginRegistered(ids: string[], id: string) { + expect(ids).toContain(PluginV2.ID.make(id)) +} diff --git a/packages/core/test/plugin/provider-kilo.test.ts b/packages/core/test/plugin/provider-kilo.test.ts new file mode 100644 index 000000000000..4261ae1328f6 --- /dev/null +++ b/packages/core/test/plugin/provider-kilo.test.ts @@ -0,0 +1,90 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderPlugins } from "@opencode-ai/core/plugin/provider" +import { KiloPlugin } from "@opencode-ai/core/plugin/provider/kilo" +import { expectPluginRegistered, it, provider } from "./provider-helper" + +describe("KiloPlugin", () => { + it.effect("is registered so legacy referer headers can be applied", () => + Effect.sync(() => + expectPluginRegistered( + ProviderPlugins.map((item) => item.id), + "kilo", + ), + ), + ) + + it.effect("applies legacy referer headers only to kilo", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(KiloPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("kilo", { + options: { headers: { Existing: "value" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + const ignored = yield* plugin.trigger("provider.update", {}, { provider: provider("openrouter"), cancel: false }) + expect(result.provider.options.headers).toEqual({ + Existing: "value", + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + }) + expect(ignored.provider.options.headers).toEqual({}) + }), + ) + + it.effect("uses the exact legacy Kilo header casing and set", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(KiloPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("kilo"), cancel: false }) + + expect(result.provider.options.headers).toEqual({ + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + }) + expect(result.provider.options.headers).not.toHaveProperty("http-referer") + expect(result.provider.options.headers).not.toHaveProperty("x-title") + expect(result.provider.options.headers).not.toHaveProperty("X-Source") + }), + ) + + it.effect("uses the legacy provider-id guard instead of endpoint package matching", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(KiloPlugin) + const matchingID = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("kilo", { + endpoint: { type: "aisdk", package: "not-kilo" }, + }), + cancel: false, + }, + ) + const matchingPackage = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("custom-kilo", { + endpoint: { type: "aisdk", package: "kilo" }, + }), + cancel: false, + }, + ) + + expect(matchingID.provider.options.headers).toEqual({ + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + }) + expect(matchingPackage.provider.options.headers).toEqual({}) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-llmgateway.test.ts b/packages/core/test/plugin/provider-llmgateway.test.ts new file mode 100644 index 000000000000..1ffea96bcbd0 --- /dev/null +++ b/packages/core/test/plugin/provider-llmgateway.test.ts @@ -0,0 +1,63 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderPlugins } from "@opencode-ai/core/plugin/provider" +import { LLMGatewayPlugin } from "@opencode-ai/core/plugin/provider/llmgateway" +import { expectPluginRegistered, it, provider } from "./provider-helper" + +describe("LLMGatewayPlugin", () => { + it.effect("is registered so legacy referer headers can be applied", () => + Effect.sync(() => + expectPluginRegistered( + ProviderPlugins.map((item) => item.id), + "llmgateway", + ), + ), + ) + + it.effect("applies legacy referer headers only to enabled llmgateway", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(LLMGatewayPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("llmgateway", { + enabled: { via: "env", name: "LLMGATEWAY_API_KEY" }, + options: { headers: { Existing: "value" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + const ignored = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("openrouter", { + enabled: { via: "env", name: "OPENROUTER_API_KEY" }, + }), + cancel: false, + }, + ) + expect(result.provider.options.headers).toEqual({ + Existing: "value", + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + "X-Source": "opencode", + }) + expect(ignored.provider.options.headers).toEqual({}) + }), + ) + + it.effect("does not apply legacy headers to a disabled llmgateway provider", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(LLMGatewayPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("llmgateway"), cancel: false }) + + expect(result.provider.enabled).toBe(false) + expect(result.provider.options.headers).toEqual({}) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-mistral.test.ts b/packages/core/test/plugin/provider-mistral.test.ts new file mode 100644 index 000000000000..f24ff53e5be2 --- /dev/null +++ b/packages/core/test/plugin/provider-mistral.test.ts @@ -0,0 +1,106 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { MistralPlugin } from "@opencode-ai/core/plugin/provider/mistral" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +describe("MistralPlugin", () => { + it.effect("creates a Mistral SDK for @ai-sdk/mistral", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(MistralPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("mistral", "mistral-large"), package: "@ai-sdk/mistral", options: { name: "mistral" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("ignores non-Mistral SDK packages", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(MistralPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("mistral", "mistral-large"), + package: "@ai-sdk/openai-compatible", + options: { name: "mistral" }, + }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + it.effect("matches the old bundled Mistral SDK provider name for the bundled provider ID", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + yield* plugin.add(MistralPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("mistral-sdk-inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + providers.push(evt.sdk.languageModel("mistral-large").provider) + }), + }), + }) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("mistral", "mistral-large"), package: "@ai-sdk/mistral", options: { name: "mistral" } }, + {}, + ) + expect(result.sdk).toBeDefined() + expect(providers).toEqual(["mistral.chat"]) + }), + ) + + it.effect("matches the old bundled Mistral SDK provider name for custom provider IDs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + yield* plugin.add(MistralPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("mistral-sdk-inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + providers.push(evt.sdk.languageModel("mistral-large").provider) + }), + }), + }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-mistral", "mistral-large"), + package: "@ai-sdk/mistral", + options: { name: "custom-mistral" }, + }, + {}, + ) + expect(providers).toEqual(["mistral.chat"]) + }), + ) + + it.effect("leaves Mistral language selection on the default sdk.languageModel(apiID) path", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + const sdk = fakeSelectorSdk(calls) + yield* plugin.add(MistralPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { model: model("mistral", "alias", { apiID: ModelV2.ID.make("mistral-large") }), sdk, options: {} }, + {}, + ) + const language = result.language ?? sdk.languageModel(result.model.apiID) + expect(calls).toEqual(["languageModel:mistral-large"]) + expect(language).toBeDefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-nvidia.test.ts b/packages/core/test/plugin/provider-nvidia.test.ts new file mode 100644 index 000000000000..26e7db0bfbf1 --- /dev/null +++ b/packages/core/test/plugin/provider-nvidia.test.ts @@ -0,0 +1,93 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderPlugins } from "@opencode-ai/core/plugin/provider" +import { NvidiaPlugin } from "@opencode-ai/core/plugin/provider/nvidia" +import { expectPluginRegistered, it, provider } from "./provider-helper" + +describe("NvidiaPlugin", () => { + it.effect("is registered so legacy referer headers can be applied", () => + Effect.sync(() => + expectPluginRegistered( + ProviderPlugins.map((item) => item.id), + "nvidia", + ), + ), + ) + + it.effect("applies NVIDIA tracking headers only to nvidia", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(NvidiaPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("nvidia", { + options: { headers: { Existing: "value" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + const ignored = yield* plugin.trigger("provider.update", {}, { provider: provider("openrouter"), cancel: false }) + expect(result.provider.options.headers).toEqual({ + Existing: "value", + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + "X-BILLING-INVOKE-ORIGIN": "OpenCode", + }) + expect(ignored.provider.options.headers).toEqual({}) + }), + ) + + it.effect("adds billing origin for custom NVIDIA endpoints", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(NvidiaPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("nvidia", { + endpoint: { type: "aisdk", package: "test-provider", url: "http://localhost:8000/v1" }, + options: { headers: {}, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + + expect(result.provider.options.headers).toEqual({ + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + "X-BILLING-INVOKE-ORIGIN": "OpenCode", + }) + }), + ) + + it.effect("preserves an explicit NVIDIA billing origin header", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(NvidiaPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("nvidia", { + options: { + headers: { "X-BILLING-INVOKE-ORIGIN": "CustomOrigin" }, + body: {}, + aisdk: { provider: { baseURL: "https://integrate.api.nvidia.com/v1" }, request: {} }, + }, + }), + cancel: false, + }, + ) + + expect(result.provider.options.headers).toEqual({ + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + "X-BILLING-INVOKE-ORIGIN": "CustomOrigin", + }) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-openai-compatible.test.ts b/packages/core/test/plugin/provider-openai-compatible.test.ts new file mode 100644 index 000000000000..e8bf1f7575fc --- /dev/null +++ b/packages/core/test/plugin/provider-openai-compatible.test.ts @@ -0,0 +1,101 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { OpenAICompatiblePlugin } from "@opencode-ai/core/plugin/provider/openai-compatible" +import { it, model } from "./provider-helper" + +describe("OpenAICompatiblePlugin", () => { + it.effect("preserves explicit includeUsage false and defaults it to true", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenAICompatiblePlugin) + const defaulted = yield* plugin.trigger( + "aisdk.sdk", + { model: model("custom", "model"), package: "@ai-sdk/openai-compatible", options: { name: "custom" } }, + {}, + ) + const disabled = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom", "model"), + package: "@ai-sdk/openai-compatible", + options: { name: "custom", includeUsage: false }, + }, + {}, + ) + expect(defaulted.options.includeUsage).toBe(true) + expect(disabled.options.includeUsage).toBe(false) + }), + ) + + it.effect("defaults includeUsage for OpenAI-compatible package matches", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenAICompatiblePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom", "model"), + package: "file:///tmp/@ai-sdk/openai-compatible-provider.js", + options: { name: "custom" }, + }, + {}, + ) + expect(result.options.includeUsage).toBe(true) + }), + ) + + it.effect("uses the provider ID as the OpenAI-compatible provider name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const observed: string[] = [] + yield* plugin.add(OpenAICompatiblePlugin) + yield* plugin.add({ + id: PluginV2.ID.make("inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + observed.push(evt.sdk.languageModel("model").provider) + }), + }), + }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-provider", "model"), + package: "@ai-sdk/openai-compatible", + options: { name: "custom-provider", baseURL: "https://example.com/v1" }, + }, + {}, + ) + expect(observed).toEqual(["custom-provider.chat"]) + }), + ) + + it.effect("does not overwrite an SDK created by an earlier provider-specific plugin", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const sentinel = { languageModel: (modelID: string) => ({ modelID }) } + yield* plugin.add({ + id: PluginV2.ID.make("sentinel"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + evt.sdk = sentinel + }), + }), + }) + yield* plugin.add(OpenAICompatiblePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("cloudflare-workers-ai", "model"), + package: "@ai-sdk/openai-compatible", + options: { name: "cloudflare-workers-ai" }, + }, + {}, + ) + expect(result.sdk).toBe(sentinel) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-openai.test.ts b/packages/core/test/plugin/provider-openai.test.ts new file mode 100644 index 000000000000..31d6dd0b6d11 --- /dev/null +++ b/packages/core/test/plugin/provider-openai.test.ts @@ -0,0 +1,100 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { OpenAIPlugin } from "@opencode-ai/core/plugin/provider/openai" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +describe("OpenAIPlugin", () => { + it.effect("creates an OpenAI SDK for @ai-sdk/openai using the provider ID as SDK name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-openai", "gpt-5"), + package: "@ai-sdk/openai", + options: { name: "custom-openai", apiKey: "test" }, + }, + {}, + ) + expect(result.sdk?.responses("gpt-5").provider).toBe("custom-openai.responses") + }), + ) + + it.effect("ignores non-OpenAI SDK packages", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("openai", "gpt-5"), package: "@ai-sdk/openai-compatible", options: { name: "openai" } }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + it.effect("uses the Responses API for language models", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(OpenAIPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("openai", "alias", { apiID: ModelV2.ID.make("gpt-5") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + expect(calls).toEqual(["responses:gpt-5"]) + expect(result.language).toBeDefined() + }), + ) + + it.effect("ignores non-OpenAI providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(OpenAIPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { model: model("anthropic", "gpt-5"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) + + it.effect("cancels gpt-5-chat-latest during model updates", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenAIPlugin) + const normal = yield* plugin.trigger("model.update", {}, { model: model("openai", "gpt-5"), cancel: false }) + const filtered = yield* plugin.trigger( + "model.update", + {}, + { model: model("openai", "gpt-5-chat-latest"), cancel: false }, + ) + expect(normal.cancel).toBe(false) + expect(filtered.cancel).toBe(true) + }), + ) + + it.effect("does not cancel gpt-5-chat-latest for non-OpenAI providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenAIPlugin) + const result = yield* plugin.trigger( + "model.update", + {}, + { model: model("custom-openai", "gpt-5-chat-latest"), cancel: false }, + ) + expect(result.cancel).toBe(false) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-opencode.test.ts b/packages/core/test/plugin/provider-opencode.test.ts new file mode 100644 index 000000000000..ed82686a21ce --- /dev/null +++ b/packages/core/test/plugin/provider-opencode.test.ts @@ -0,0 +1,197 @@ +import { describe, expect } from "bun:test" +import { DateTime, Effect, Layer, Option } from "effect" +import { Catalog } from "@opencode-ai/core/catalog" +import { Location } from "@opencode-ai/core/location" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { OpencodePlugin } from "@opencode-ai/core/plugin/provider/opencode" +import { ProviderV2 } from "@opencode-ai/core/provider" +import { it, model, provider, withEnv } from "./provider-helper" + +const cost = (input: number, output = 0) => [{ input, output, cache: { read: 0, write: 0 } }] +const locationLayer = Layer.succeed(Location.Service, Location.Service.of({ directory: "test" })) + +describe("OpencodePlugin", () => { + it.effect("uses a public key and cancels paid models without credentials", () => + withEnv({ OPENCODE_API_KEY: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + const updated = yield* plugin.trigger("provider.update", {}, { provider: provider("opencode"), cancel: false }) + const paid = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "paid", { cost: cost(1) }), cancel: false }, + ) + expect(updated.provider.options.aisdk.provider.apiKey).toBe("public") + expect(paid.cancel).toBe(true) + }), + ), + ) + + it.effect("keeps free models without credentials", () => + withEnv({ OPENCODE_API_KEY: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + yield* plugin.trigger("provider.update", {}, { provider: provider("opencode"), cancel: false }) + const free = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "free", { cost: cost(0) }), cancel: false }, + ) + expect(free.cancel).toBe(false) + }), + ), + ) + + it.effect("treats output-only cost as free without credentials", () => + withEnv({ OPENCODE_API_KEY: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + yield* plugin.trigger("provider.update", {}, { provider: provider("opencode"), cancel: false }) + const outputOnly = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "output-only", { cost: cost(0, 1) }), cancel: false }, + ) + expect(outputOnly.cancel).toBe(false) + }), + ), + ) + + it.effect("uses OPENCODE_API_KEY as credentials", () => + withEnv({ OPENCODE_API_KEY: "secret" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + const updated = yield* plugin.trigger("provider.update", {}, { provider: provider("opencode"), cancel: false }) + const paid = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "paid", { cost: cost(1) }), cancel: false }, + ) + expect(updated.provider.options.aisdk.provider.apiKey).toBeUndefined() + expect(paid.cancel).toBe(false) + }), + ), + ) + + it.effect("uses configured provider env vars as credentials", () => + withEnv({ OPENCODE_API_KEY: undefined, CUSTOM_OPENCODE_API_KEY: "secret" }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + const updated = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("opencode", { env: ["CUSTOM_OPENCODE_API_KEY"] }), cancel: false }, + ) + const paid = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "paid", { cost: cost(1) }), cancel: false }, + ) + expect(updated.provider.options.aisdk.provider.apiKey).toBeUndefined() + expect(paid.cancel).toBe(false) + }), + ), + ) + + it.effect("uses configured apiKey as credentials", () => + withEnv({ OPENCODE_API_KEY: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + const updated = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("opencode", { + options: { + headers: {}, + body: {}, + aisdk: { + provider: { apiKey: "configured" }, + request: {}, + }, + }, + }), + cancel: false, + }, + ) + const paid = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "paid", { cost: cost(1) }), cancel: false }, + ) + expect(updated.provider.options.aisdk.provider.apiKey).toBe("configured") + expect(paid.cancel).toBe(false) + }), + ), + ) + + it.effect("uses auth-enabled providers as credentials", () => + withEnv({ OPENCODE_API_KEY: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + const updated = yield* plugin.trigger( + "provider.update", + {}, + { provider: provider("opencode", { enabled: { via: "auth", service: "opencode" } }), cancel: false }, + ) + const paid = yield* plugin.trigger( + "model.update", + {}, + { model: model("opencode", "paid", { cost: cost(1) }), cancel: false }, + ) + expect(updated.provider.options.aisdk.provider.apiKey).toBeUndefined() + expect(paid.cancel).toBe(false) + }), + ), + ) + + it.effect("ignores non-opencode providers and models", () => + withEnv({ OPENCODE_API_KEY: undefined }, () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpencodePlugin) + const updated = yield* plugin.trigger("provider.update", {}, { provider: provider("openai"), cancel: false }) + const paid = yield* plugin.trigger( + "model.update", + {}, + { model: model("openai", "paid", { cost: cost(1) }), cancel: false }, + ) + expect(updated.provider.options.aisdk.provider.apiKey).toBeUndefined() + expect(paid.cancel).toBe(false) + }), + ), + ) + + it.effect("prefers gpt-5-nano as the opencode small model", () => + Effect.gen(function* () { + const catalog = yield* Catalog.Service + const providerID = ProviderV2.ID.opencode + + yield* catalog.provider.update(providerID, () => {}) + yield* catalog.model.update(providerID, ModelV2.ID.make("cheap-mini"), (model) => { + model.capabilities.input = ["text"] + model.capabilities.output = ["text"] + model.cost = cost(1, 1) + model.time.released = DateTime.makeUnsafe(Date.now()) + }) + yield* catalog.model.update(providerID, ModelV2.ID.make("gpt-5-nano"), (model) => { + model.capabilities.input = ["text"] + model.capabilities.output = ["text"] + model.cost = cost(10, 10) + model.time.released = DateTime.makeUnsafe(Date.now()) + }) + + const selected = yield* catalog.model.small(providerID) + + expect(Option.getOrUndefined(selected)?.id).toBe(ModelV2.ID.make("gpt-5-nano")) + }).pipe(Effect.provide(Catalog.defaultLayer.pipe(Layer.provide(locationLayer)))), + ) +}) diff --git a/packages/core/test/plugin/provider-openrouter.test.ts b/packages/core/test/plugin/provider-openrouter.test.ts new file mode 100644 index 000000000000..3d143ac7f2bc --- /dev/null +++ b/packages/core/test/plugin/provider-openrouter.test.ts @@ -0,0 +1,105 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderPlugins } from "@opencode-ai/core/plugin/provider" +import { OpenRouterPlugin } from "@opencode-ai/core/plugin/provider/openrouter" +import { expectPluginRegistered, it, model, provider } from "./provider-helper" + +describe("OpenRouterPlugin", () => { + it.effect("is registered so legacy OpenRouter behavior can be applied", () => + Effect.sync(() => + expectPluginRegistered( + ProviderPlugins.map((item) => item.id), + "openrouter", + ), + ), + ) + + it.effect("applies legacy referer headers only to openrouter", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenRouterPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("openrouter", { + options: { headers: { Existing: "value" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + const ignored = yield* plugin.trigger("provider.update", {}, { provider: provider("nvidia"), cancel: false }) + expect(result.provider.options.headers).toEqual({ + Existing: "value", + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + }) + expect(ignored.provider.options.headers).toEqual({}) + }), + ) + + it.effect("creates an SDK only for the OpenRouter package", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenRouterPlugin) + + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("openrouter", "openai/gpt-5"), + package: "@ai-sdk/openai-compatible", + options: { name: "openrouter" }, + }, + {}, + ) + expect(ignored.sdk).toBeUndefined() + + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("custom", "openai/gpt-5"), package: "@openrouter/ai-sdk-provider", options: { name: "custom" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("filters OpenRouter's gpt-5 chat alias", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenRouterPlugin) + const result = yield* plugin.trigger( + "model.update", + {}, + { model: model("openrouter", "openai/gpt-5-chat"), cancel: false }, + ) + const regular = yield* plugin.trigger( + "model.update", + {}, + { model: model("openrouter", "openai/gpt-5"), cancel: false }, + ) + const ignored = yield* plugin.trigger( + "model.update", + {}, + { model: model("openai", "openai/gpt-5-chat"), cancel: false }, + ) + + expect(result.cancel).toBe(true) + expect(regular.cancel).toBe(false) + expect(ignored.cancel).toBe(false) + }), + ) + + it.effect("does not filter gpt-5-chat-latest for non-OpenRouter providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(OpenRouterPlugin) + const result = yield* plugin.trigger( + "model.update", + {}, + { model: model("custom-openrouter", "gpt-5-chat-latest"), cancel: false }, + ) + expect(result.cancel).toBe(false) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-perplexity.test.ts b/packages/core/test/plugin/provider-perplexity.test.ts new file mode 100644 index 000000000000..d03f583375d9 --- /dev/null +++ b/packages/core/test/plugin/provider-perplexity.test.ts @@ -0,0 +1,107 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { PerplexityPlugin } from "@opencode-ai/core/plugin/provider/perplexity" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +describe("PerplexityPlugin", () => { + it.effect("creates a Perplexity SDK for the exact @ai-sdk/perplexity package", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(PerplexityPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("perplexity", "sonar"), package: "@ai-sdk/perplexity", options: { name: "perplexity" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("ignores packages that are not the bundled Perplexity package", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(PerplexityPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("perplexity", "sonar"), + package: "@ai-sdk/perplexity-compatible", + options: { name: "perplexity" }, + }, + {}, + ) + expect(result.sdk).toBeUndefined() + }), + ) + + it.effect("uses the Perplexity provider ID as the SDK name for the bundled provider", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + yield* plugin.add(PerplexityPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("perplexity-sdk-inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + providers.push(evt.sdk.languageModel("sonar").provider) + }), + }), + }) + yield* plugin.trigger( + "aisdk.sdk", + { model: model("perplexity", "sonar"), package: "@ai-sdk/perplexity", options: { name: "perplexity" } }, + {}, + ) + expect(providers).toEqual(["perplexity"]) + }), + ) + + it.effect("creates bundled Perplexity SDKs for custom provider IDs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + yield* plugin.add(PerplexityPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("custom-perplexity-sdk-inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + providers.push(evt.sdk.languageModel("sonar").provider) + }), + }), + }) + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-perplexity", "sonar"), + package: "@ai-sdk/perplexity", + options: { name: "custom-perplexity" }, + }, + {}, + ) + expect(providers).toEqual(["perplexity"]) + }), + ) + + it.effect("leaves Perplexity language selection to the default languageModel fallback", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(PerplexityPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("perplexity", "alias", { apiID: ModelV2.ID.make("sonar") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-sap-ai-core.test.ts b/packages/core/test/plugin/provider-sap-ai-core.test.ts new file mode 100644 index 000000000000..565b9280ab95 --- /dev/null +++ b/packages/core/test/plugin/provider-sap-ai-core.test.ts @@ -0,0 +1,127 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { SapAICorePlugin } from "@opencode-ai/core/plugin/provider/sap-ai-core" +import { fixtureProvider, it, model, npmLayer, withEnv } from "./provider-helper" + +const pluginWithNpm = { id: SapAICorePlugin.id, effect: SapAICorePlugin.effect.pipe(Effect.provide(npmLayer)) } + +describe("SapAICorePlugin", () => { + it.effect("copies serviceKey option into AICORE_SERVICE_KEY but keeps SDK options to deployment metadata", () => + withEnv( + { AICORE_SERVICE_KEY: undefined, AICORE_DEPLOYMENT_ID: "deployment", AICORE_RESOURCE_GROUP: "resource-group" }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(pluginWithNpm) + const sdk = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("sap-ai-core", "sap-model"), + package: fixtureProvider, + options: { name: "sap-ai-core", serviceKey: "service-key" }, + }, + {}, + ) + expect(process.env.AICORE_SERVICE_KEY).toBe("service-key") + expect(sdk.sdk.options).toEqual({ deploymentId: "deployment", resourceGroup: "resource-group" }) + }), + ), + ) + + it.effect("preserves existing AICORE_SERVICE_KEY over serviceKey option", () => + withEnv( + { + AICORE_SERVICE_KEY: "env-service-key", + AICORE_DEPLOYMENT_ID: "deployment", + AICORE_RESOURCE_GROUP: "resource-group", + }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(pluginWithNpm) + const sdk = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("sap-ai-core", "sap-model"), + package: fixtureProvider, + options: { name: "sap-ai-core", serviceKey: "option-service-key" }, + }, + {}, + ) + expect(process.env.AICORE_SERVICE_KEY).toBe("env-service-key") + expect(sdk.sdk.options).toEqual({ deploymentId: "deployment", resourceGroup: "resource-group" }) + }), + ), + ) + + it.effect("omits deployment and resourceGroup SDK options when no service key is available", () => + withEnv( + { AICORE_SERVICE_KEY: undefined, AICORE_DEPLOYMENT_ID: "deployment", AICORE_RESOURCE_GROUP: "resource-group" }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(pluginWithNpm) + const sdk = yield* plugin.trigger( + "aisdk.sdk", + { model: model("sap-ai-core", "sap-model"), package: fixtureProvider, options: { name: "sap-ai-core" } }, + {}, + ) + expect(process.env.AICORE_SERVICE_KEY).toBeUndefined() + expect(sdk.sdk.options).toEqual({}) + }), + ), + ) + + it.effect("uses the callable SDK for language selection", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(pluginWithNpm) + const sdk = Object.assign((modelID: string) => ({ modelID, provider: "callable" }), { + languageModel() { + throw new Error("SAP AI Core should call the SDK directly") + }, + }) + const language = yield* plugin.trigger( + "aisdk.language", + { model: model("sap-ai-core", "sap-model"), sdk, options: {} }, + {}, + ) + expect(language.language as unknown).toEqual({ modelID: "sap-model", provider: "callable" }) + }), + ) + + it.effect("ignores non-SAP AI Core providers", () => + withEnv( + { AICORE_SERVICE_KEY: undefined, AICORE_DEPLOYMENT_ID: "deployment", AICORE_RESOURCE_GROUP: "resource-group" }, + () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(pluginWithNpm) + const sdk = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("openai", "sap-model"), + package: fixtureProvider, + options: { name: "openai", serviceKey: "service-key" }, + }, + {}, + ) + const language = yield* plugin.trigger( + "aisdk.language", + { + model: model("openai", "sap-model"), + sdk: () => { + throw new Error("SAP AI Core should ignore other providers") + }, + options: {}, + }, + {}, + ) + expect(process.env.AICORE_SERVICE_KEY).toBeUndefined() + expect(sdk.sdk).toBeUndefined() + expect(language.language).toBeUndefined() + }), + ), + ) +}) diff --git a/packages/core/test/plugin/provider-togetherai.test.ts b/packages/core/test/plugin/provider-togetherai.test.ts new file mode 100644 index 000000000000..65090037bef4 --- /dev/null +++ b/packages/core/test/plugin/provider-togetherai.test.ts @@ -0,0 +1,97 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { TogetherAIPlugin } from "@opencode-ai/core/plugin/provider/togetherai" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +describe("TogetherAIPlugin", () => { + it.effect("creates a TogetherAI SDK for @ai-sdk/togetherai", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(TogetherAIPlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("togetherai", "model"), package: "@ai-sdk/togetherai", options: { name: "togetherai" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("matches the old bundled provider package exactly", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(TogetherAIPlugin) + + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("togetherai", "model"), + package: "file:///tmp/@ai-sdk/togetherai-provider.js", + options: { name: "togetherai" }, + }, + {}, + ) + expect(ignored.sdk).toBeUndefined() + + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("togetherai", "model"), package: "@ai-sdk/togetherai", options: { name: "togetherai" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("creates bundled TogetherAI SDKs for custom provider IDs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const observed: string[] = [] + yield* plugin.add(TogetherAIPlugin) + yield* plugin.add({ + id: PluginV2.ID.make("inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + observed.push(evt.sdk.languageModel("model").provider) + }), + }), + }) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-togetherai", "model"), + package: "@ai-sdk/togetherai", + options: { name: "custom-togetherai" }, + }, + {}, + ) + + expect(observed).toEqual(["togetherai.chat"]) + }), + ) + + it.effect("defaults language selection to sdk.languageModel with the model API ID", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(TogetherAIPlugin) + + const result = yield* plugin.trigger( + "aisdk.language", + { + model: model("togetherai", "meta-llama/Llama-3.3-70B-Instruct-Turbo"), + sdk: { languageModel: fakeSelectorSdk(calls).languageModel }, + options: {}, + }, + {}, + ) + + expect(result.language).toBeUndefined() + expect(calls).toEqual([]) + expect(result.language ?? fakeSelectorSdk(calls).languageModel(result.model.apiID)).toBeDefined() + expect(calls).toEqual(["languageModel:meta-llama/Llama-3.3-70B-Instruct-Turbo"]) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-venice.test.ts b/packages/core/test/plugin/provider-venice.test.ts new file mode 100644 index 000000000000..ff4a922ab1e1 --- /dev/null +++ b/packages/core/test/plugin/provider-venice.test.ts @@ -0,0 +1,86 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { VenicePlugin } from "@opencode-ai/core/plugin/provider/venice" +import { fakeSelectorSdk, it, model } from "./provider-helper" + +describe("VenicePlugin", () => { + it.effect("creates a Venice SDK for venice-ai-sdk-provider", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(VenicePlugin) + const result = yield* plugin.trigger( + "aisdk.sdk", + { model: model("venice", "model"), package: "venice-ai-sdk-provider", options: { name: "venice" } }, + {}, + ) + expect(result.sdk).toBeDefined() + }), + ) + + it.effect("uses the model provider ID as the bundled Venice SDK name", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const observed: string[] = [] + yield* plugin.add(VenicePlugin) + yield* plugin.add({ + id: PluginV2.ID.make("inspector"), + effect: Effect.succeed({ + "aisdk.sdk": (evt) => + Effect.sync(() => { + observed.push(evt.sdk.languageModel("model").provider) + }), + }), + }) + const result = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("custom-venice", "model"), + package: "venice-ai-sdk-provider", + options: { name: "custom-venice", apiKey: "test" }, + }, + {}, + ) + expect(result.sdk).toBeDefined() + expect(observed).toEqual(["custom-venice.chat"]) + }), + ) + + it.effect("only handles the bundled venice-ai-sdk-provider package", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(VenicePlugin) + const similar = yield* plugin.trigger( + "aisdk.sdk", + { + model: model("venice", "model"), + package: "file:///tmp/venice-ai-sdk-provider.js", + options: { name: "venice" }, + }, + {}, + ) + const other = yield* plugin.trigger( + "aisdk.sdk", + { model: model("venice", "model"), package: "@ai-sdk/openai-compatible", options: { name: "venice" } }, + {}, + ) + expect(similar.sdk).toBeUndefined() + expect(other.sdk).toBeUndefined() + }), + ) + + it.effect("leaves Venice language selection to the default languageModel fallback", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + yield* plugin.add(VenicePlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { model: model("venice", "alias"), sdk: fakeSelectorSdk(calls), options: {} }, + {}, + ) + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-vercel.test.ts b/packages/core/test/plugin/provider-vercel.test.ts new file mode 100644 index 000000000000..3134a7b83c58 --- /dev/null +++ b/packages/core/test/plugin/provider-vercel.test.ts @@ -0,0 +1,62 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { VercelPlugin } from "@opencode-ai/core/plugin/provider/vercel" +import { it, model, provider } from "./provider-helper" + +describe("VercelPlugin", () => { + it.effect("applies legacy lower-case referer headers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(VercelPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("vercel", { + options: { headers: { Existing: "1" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + expect(result.provider.options.headers).toEqual({ + Existing: "1", + "http-referer": "https://opencode.ai/", + "x-title": "opencode", + }) + }), + ) + + it.effect("does not add legacy upper-case referer headers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(VercelPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("vercel"), cancel: false }) + expect(result.provider.options.headers).not.toHaveProperty("HTTP-Referer") + expect(result.provider.options.headers).not.toHaveProperty("X-Title") + }), + ) + + it.effect("creates @ai-sdk/vercel SDKs for custom provider IDs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(VercelPlugin) + const event = yield* plugin.trigger( + "aisdk.sdk", + { model: model("custom-vercel", "v0-1.0-md"), package: "@ai-sdk/vercel", options: { name: "custom-vercel" } }, + {}, + ) + expect(event.sdk).toBeDefined() + expect(event.sdk.languageModel("v0-1.0-md").provider).toBe("vercel.chat") + }), + ) + + it.effect("ignores non-Vercel providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(VercelPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("gateway"), cancel: false }) + expect(result.provider.options.headers).toEqual({}) + }), + ) +}) diff --git a/packages/core/test/plugin/provider-xai.test.ts b/packages/core/test/plugin/provider-xai.test.ts new file mode 100644 index 000000000000..63af32dae7de --- /dev/null +++ b/packages/core/test/plugin/provider-xai.test.ts @@ -0,0 +1,115 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { ModelV2 } from "@opencode-ai/core/model" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { XAIPlugin } from "@opencode-ai/core/plugin/provider/xai" +import { ProviderV2 } from "@opencode-ai/core/provider" +import { testEffect } from "../lib/effect" +import { fakeSelectorSdk } from "./provider-helper" + +const it = testEffect(PluginV2.defaultLayer) + +const model = new ModelV2.Info({ + ...ModelV2.Info.empty(ProviderV2.ID.make("xai"), ModelV2.ID.make("grok-4")), + apiID: ModelV2.ID.make("grok-4"), + endpoint: { + type: "aisdk", + package: "@ai-sdk/xai", + }, +}) + +describe("XAIPlugin", () => { + it.effect("creates an xAI SDK only for @ai-sdk/xai", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(XAIPlugin) + + const ignored = yield* plugin.trigger( + "aisdk.sdk", + { model, package: "@ai-sdk/openai-compatible", options: {} }, + {}, + ) + + const result = yield* plugin.trigger("aisdk.sdk", { model, package: "@ai-sdk/xai", options: {} }, {}) + + expect(ignored.sdk).toBeUndefined() + expect(typeof result.sdk?.responses).toBe("function") + }), + ) + + it.effect("creates xAI SDKs for custom provider IDs", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const providers: string[] = [] + + yield* plugin.add(XAIPlugin) + yield* plugin.add( + PluginV2.define({ + id: PluginV2.ID.make("xai-sdk-name-observer"), + effect: Effect.gen(function* () { + return { + "aisdk.sdk": Effect.fn(function* (evt) { + if (!evt.sdk) return + providers.push(evt.sdk.responses("grok-4").provider) + }), + } + }), + }), + ) + + yield* plugin.trigger( + "aisdk.sdk", + { + model: new ModelV2.Info({ ...model, providerID: ProviderV2.ID.make("custom-xai") }), + package: "@ai-sdk/xai", + options: {}, + }, + {}, + ) + + expect(providers).toEqual(["xai.responses"]) + }), + ) + + it.effect("uses responses with the model apiID for xAI language models", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + + yield* plugin.add(XAIPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: new ModelV2.Info({ ...model, id: ModelV2.ID.make("alias"), apiID: ModelV2.ID.make("grok-4") }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + + expect(calls).toEqual(["responses:grok-4"]) + expect(result.language).toBeDefined() + }), + ) + + it.effect("ignores non-xAI providers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + const calls: string[] = [] + + yield* plugin.add(XAIPlugin) + const result = yield* plugin.trigger( + "aisdk.language", + { + model: new ModelV2.Info({ ...model, providerID: ProviderV2.ID.openai }), + sdk: fakeSelectorSdk(calls), + options: {}, + }, + {}, + ) + + expect(calls).toEqual([]) + expect(result.language).toBeUndefined() + }), + ) +}) diff --git a/packages/core/test/plugin/provider-zenmux.test.ts b/packages/core/test/plugin/provider-zenmux.test.ts new file mode 100644 index 000000000000..2b7730e6c752 --- /dev/null +++ b/packages/core/test/plugin/provider-zenmux.test.ts @@ -0,0 +1,103 @@ +import { describe, expect } from "bun:test" +import { Effect } from "effect" +import { PluginV2 } from "@opencode-ai/core/plugin" +import { ProviderPlugins } from "@opencode-ai/core/plugin/provider" +import { ZenmuxPlugin } from "@opencode-ai/core/plugin/provider/zenmux" +import { expectPluginRegistered, it, provider } from "./provider-helper" + +describe("ZenmuxPlugin", () => { + it.effect("is registered so legacy referer headers can be applied", () => + Effect.sync(() => + expectPluginRegistered( + ProviderPlugins.map((item) => item.id), + "zenmux", + ), + ), + ) + + it.effect("applies the exact legacy Zenmux headers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(ZenmuxPlugin) + const result = yield* plugin.trigger("provider.update", {}, { provider: provider("zenmux"), cancel: false }) + expect(result.provider.options.headers).toEqual({ "HTTP-Referer": "https://opencode.ai/", "X-Title": "opencode" }) + expect(Object.keys(result.provider.options.headers).sort()).toEqual(["HTTP-Referer", "X-Title"]) + expect(result.cancel).toBe(false) + }), + ) + + it.effect("merges legacy Zenmux headers with existing headers", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(ZenmuxPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("zenmux", { + options: { headers: { Existing: "value" }, body: {}, aisdk: { provider: {}, request: {} } }, + }), + cancel: false, + }, + ) + + expect(result.provider.options.headers).toEqual({ + Existing: "value", + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + }) + }), + ) + + it.effect("lets configured Zenmux legacy headers override defaults", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(ZenmuxPlugin) + const result = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("zenmux", { + options: { + headers: { "HTTP-Referer": "https://example.com/", "X-Title": "custom-title" }, + body: {}, + aisdk: { provider: {}, request: {} }, + }, + }), + cancel: false, + }, + ) + + expect(result.provider.options.headers).toEqual({ + "HTTP-Referer": "https://example.com/", + "X-Title": "custom-title", + }) + }), + ) + + it.effect("guards legacy Zenmux headers to the exact zenmux provider id", () => + Effect.gen(function* () { + const plugin = yield* PluginV2.Service + yield* plugin.add(ZenmuxPlugin) + const ignored = yield* plugin.trigger( + "provider.update", + {}, + { + provider: provider("openrouter", { + options: { + headers: { "HTTP-Referer": "https://example.com/", "X-Title": "custom-title" }, + body: {}, + aisdk: { provider: {}, request: {} }, + }, + }), + cancel: false, + }, + ) + + expect(ignored.provider.options.headers).toEqual({ + "HTTP-Referer": "https://example.com/", + "X-Title": "custom-title", + }) + }), + ) +}) diff --git a/packages/core/test/process/process.test.ts b/packages/core/test/process/process.test.ts new file mode 100644 index 000000000000..f6a52b7a6874 --- /dev/null +++ b/packages/core/test/process/process.test.ts @@ -0,0 +1,292 @@ +import { describe, expect } from "bun:test" +import { realpathSync } from "node:fs" +import { tmpdir } from "node:os" +import { Effect, Exit, Stream } from "effect" +import { ChildProcess } from "effect/unstable/process" +import { AppProcess } from "@opencode-ai/core/process" +import { testEffect } from "../lib/effect" + +const it = testEffect(AppProcess.defaultLayer) + +const NODE = process.execPath +const cmd = (...args: string[]) => ChildProcess.make(NODE, args) + +describe("AppProcess", () => { + describe("run", () => { + it.effect( + "captures stdout and exit code zero", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", "process.stdout.write('hi\\n')")) + expect(result.exitCode).toBe(0) + expect(result.stdout.toString("utf8")).toBe("hi\n") + expect(result.stdoutTruncated).toBe(false) + expect(result.stderrTruncated).toBe(false) + }), + ) + + it.effect( + "non-zero exit returns RunResult; caller can require success", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", "process.exit(1)")) + expect(result.exitCode).toBe(1) + }), + ) + + it.effect( + "requireSuccess fails on non-zero exit", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const exit = yield* Effect.exit( + svc.run(cmd("-e", "process.exit(1)")).pipe(Effect.flatMap(AppProcess.requireSuccess)), + ) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const reason = exit.cause.reasons[0] + if (reason && reason._tag === "Fail") { + expect(reason.error).toBeInstanceOf(AppProcess.AppProcessError) + expect((reason.error as AppProcess.AppProcessError).exitCode).toBe(1) + } else { + throw new Error("expected fail reason") + } + } + }), + ) + + it.effect( + "requireSuccess succeeds on exit 0", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", "process.exit(0)")).pipe(Effect.flatMap(AppProcess.requireSuccess)) + expect(result.exitCode).toBe(0) + }), + ) + + it.effect( + "requireExitIn allowlists multiple exit codes", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const requireZeroOrOne = AppProcess.requireExitIn([0, 1]) + const okZero = yield* svc.run(cmd("-e", "process.exit(0)")).pipe(Effect.flatMap(requireZeroOrOne)) + expect(okZero.exitCode).toBe(0) + const okOne = yield* svc.run(cmd("-e", "process.exit(1)")).pipe(Effect.flatMap(requireZeroOrOne)) + expect(okOne.exitCode).toBe(1) + const exit = yield* Effect.exit(svc.run(cmd("-e", "process.exit(2)")).pipe(Effect.flatMap(requireZeroOrOne))) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const reason = exit.cause.reasons[0] + if (reason && reason._tag === "Fail") { + expect(reason.error).toBeInstanceOf(AppProcess.AppProcessError) + expect((reason.error as AppProcess.AppProcessError).exitCode).toBe(2) + } + } + }), + ) + + it.effect( + "truncates stdout when maxOutputBytes is set", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", "process.stdout.write('0123456789')"), { maxOutputBytes: 5 }) + expect(result.exitCode).toBe(0) + expect(result.stdoutTruncated).toBe(true) + expect(result.stderrTruncated).toBe(false) + expect(result.stdout.length).toBe(5) + expect(result.stdout.toString("utf8")).toBe("01234") + }), + ) + + it.effect( + "truncates stderr when maxErrorBytes is set", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", "process.stderr.write('0123456789')"), { maxErrorBytes: 5 }) + expect(result.exitCode).toBe(0) + expect(result.stdoutTruncated).toBe(false) + expect(result.stderrTruncated).toBe(true) + expect(result.stderr.length).toBe(5) + expect(result.stderr.toString("utf8")).toBe("01234") + }), + ) + + it.effect( + "result includes command description", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", "process.stdout.write('hi')")) + expect(result.command).toBe(`${NODE} -e process.stdout.write('hi')`) + }), + ) + }) + + describe("inherited platform methods", () => { + it.effect( + "string returns stdout as string", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const out = yield* svc.string(cmd("-e", "process.stdout.write('hi\\n')")) + expect(out).toBe("hi\n") + }), + ) + + it.effect( + "lines returns the platform's array of lines", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const out = yield* svc.lines(cmd("-e", "process.stdout.write('a\\nb\\n')")) + expect(Array.from(out)).toEqual(["a", "b"]) + }), + ) + }) + + describe("run with stdin option", () => { + const echoStdin = "process.stdin.on('data', c => process.stdout.write(c))" + + it.effect( + "feeds a string to stdin and returns it on stdout", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", echoStdin), { stdin: "hello" }) + expect(result.exitCode).toBe(0) + expect(result.stdout.toString("utf8")).toBe("hello") + }), + ) + + it.effect( + "feeds a Uint8Array to stdin", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const bytes = new TextEncoder().encode("bytes") + const result = yield* svc.run(cmd("-e", echoStdin), { stdin: bytes }) + expect(result.exitCode).toBe(0) + expect(result.stdout.toString("utf8")).toBe("bytes") + }), + ) + + it.effect( + "feeds a Stream of Uint8Array chunks to stdin", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const enc = new TextEncoder() + const stream = Stream.fromIterable([enc.encode("one"), enc.encode("-two"), enc.encode("-three")]) + const result = yield* svc.run(cmd("-e", echoStdin), { stdin: stream }) + expect(result.exitCode).toBe(0) + expect(result.stdout.toString("utf8")).toBe("one-two-three") + }), + ) + + it.effect( + "completes correctly with empty input", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.run(cmd("-e", echoStdin), { stdin: "" }) + expect(result.exitCode).toBe(0) + expect(result.stdout.toString("utf8")).toBe("") + }), + ) + + it.effect( + "carries existing Command options like env", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const script = + "process.stdout.write(process.env.FEED + ':'); process.stdin.on('data', c => process.stdout.write(c))" + const command = ChildProcess.make(NODE, ["-e", script], { env: { FEED: "envset" }, extendEnv: true }) + const result = yield* svc.run(command, { stdin: "payload" }) + expect(result.exitCode).toBe(0) + expect(result.stdout.toString("utf8")).toBe("envset:payload") + }), + ) + + it.effect( + "carries existing Command options like cwd", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const dir = realpathSync(tmpdir()) + const script = + "process.stdout.write(process.cwd() + '|'); process.stdin.on('data', c => process.stdout.write(c))" + const command = ChildProcess.make(NODE, ["-e", script], { cwd: dir }) + const result = yield* svc.run(command, { stdin: "ok" }) + expect(result.exitCode).toBe(0) + const [cwd, stdin] = result.stdout.toString("utf8").split("|") + expect(realpathSync(cwd)).toBe(dir) + expect(stdin).toBe("ok") + }), + ) + }) + + describe("runStream", () => { + it.live( + "emits lines incrementally and ends cleanly on exit 0", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc + .runStream(cmd("-e", "console.log('one'); console.log('two'); console.log('three')")) + .pipe(Stream.runCollect) + expect(Array.from(result)).toEqual(["one", "two", "three"]) + }), + ) + + it.live( + "okExitCodes determines whether a non-zero exit fails the stream", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const allowed = yield* svc + .runStream(cmd("-e", "console.log('only'); process.exit(1)"), { okExitCodes: [0, 1] }) + .pipe(Stream.runCollect) + expect(Array.from(allowed)).toEqual(["only"]) + const exit = yield* Effect.exit( + svc + .runStream(cmd("-e", "console.log('a'); process.exit(2)"), { okExitCodes: [0, 1] }) + .pipe(Stream.runCollect), + ) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const reason = exit.cause.reasons[0] + if (reason && reason._tag === "Fail") { + expect(reason.error).toBeInstanceOf(AppProcess.AppProcessError) + } + } + }), + ) + + it.live( + "without okExitCodes, never fails on exit code", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const result = yield* svc.runStream(cmd("-e", "console.log('only'); process.exit(7)")).pipe(Stream.runCollect) + expect(Array.from(result)).toEqual(["only"]) + }), + ) + + it.live( + "AbortSignal interrupts the stream", + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const controller = new AbortController() + controller.abort() + const exit = yield* Effect.exit( + svc + .runStream(cmd("-e", "setInterval(() => {}, 60_000)"), { signal: controller.signal }) + .pipe(Stream.runCollect), + ) + expect(Exit.isFailure(exit)).toBe(true) + }), + ) + }) + + describe("spawn (inherited)", () => { + it.live( + "returns the platform ChildProcessHandle for advanced use", + Effect.scoped( + Effect.gen(function* () { + const svc = yield* AppProcess.Service + const handle = yield* svc.spawn(cmd("-e", "setInterval(() => {}, 1_000)")) + expect(yield* handle.isRunning).toBe(true) + yield* handle.kill() + }), + ), + ) + }) +}) diff --git a/packages/desktop/.gitignore b/packages/desktop/.gitignore index ac9d8db96943..6923045cd9b8 100644 --- a/packages/desktop/.gitignore +++ b/packages/desktop/.gitignore @@ -26,3 +26,4 @@ out/ resources/opencode-cli* resources/icons +resources/*.metainfo.xml diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 0dfcd4544bc5..522dbb5d9bf1 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop", "private": true, - "version": "1.14.48", + "version": "1.15.0", "type": "module", "license": "MIT", "homepage": "https://opencode.ai", diff --git a/packages/desktop/scripts/copy-metainfo.ts b/packages/desktop/scripts/copy-metainfo.ts new file mode 100644 index 000000000000..e7585ccafdae --- /dev/null +++ b/packages/desktop/scripts/copy-metainfo.ts @@ -0,0 +1,47 @@ +import { resolveChannel } from "./utils" + +const arg = process.argv[2] +const channel = arg === "dev" || arg === "beta" || arg === "prod" ? arg : resolveChannel() + +const appId = channel === "prod" ? "ai.opencode.desktop" : `ai.opencode.desktop.${channel}` +const productName = channel === "prod" ? "OpenCode" : `OpenCode ${channel.charAt(0).toUpperCase() + channel.slice(1)}` +const summary = `Open source AI coding agent${channel !== "prod" ? ` (${channel})` : ""}` + +const xml = ` + + ${appId} + + CC0-1.0 + MIT + + ${productName} + ${summary} + + + Anomaly Innovations Inc. + + + +

+ OpenCode is an open source agent that helps you write and run code with any AI model. +

+
+ + ${appId}.desktop + + + + https://github.com/anomalyco/opencode/issues + https://opencode.ai + https://github.com/anomalyco/opencode + + + + https://raw.githubusercontent.com/anomalyco/opencode/b75d4d1c5ec449585d515c756fc81f080a157a9a/packages/web/src/assets/lander/screenshot.png + + +
+` + +await Bun.write(`resources/${appId}.metainfo.xml`, xml) +console.log(`Generated metainfo for ${channel} at resources/${appId}.metainfo.xml`) diff --git a/packages/desktop/scripts/prebuild.ts b/packages/desktop/scripts/prebuild.ts index 46a2475ea51a..79b0e30afcd0 100644 --- a/packages/desktop/scripts/prebuild.ts +++ b/packages/desktop/scripts/prebuild.ts @@ -5,5 +5,6 @@ import { resolveChannel } from "./utils" const channel = resolveChannel() await $`bun ./scripts/copy-icons.ts ${channel}` +await $`bun ./scripts/copy-metainfo.ts ${channel}` await $`cd ../opencode && bun script/build-node.ts` diff --git a/packages/desktop/src/main/apps.ts b/packages/desktop/src/main/apps.ts index bf25417b8347..f9c0a603e6ad 100644 --- a/packages/desktop/src/main/apps.ts +++ b/packages/desktop/src/main/apps.ts @@ -58,7 +58,7 @@ async function checkMacosApp(appName: string) { async function resolveWindowsAppPath(appName: string): Promise { let output: string try { - output = execFilePromise("where", [appName]).toString() + output = await execFilePromise("where", [appName]).then((r) => r.stdout.toString()) } catch { return null } diff --git a/packages/desktop/src/main/env.d.ts b/packages/desktop/src/main/env.d.ts index eee21e48cb19..1d03be5055c1 100644 --- a/packages/desktop/src/main/env.d.ts +++ b/packages/desktop/src/main/env.d.ts @@ -19,7 +19,7 @@ declare module "virtual:opencode-server" { export const init: typeof import("../../../opencode/dist/types/src/node").Log.init } export namespace Database { - export const Path: typeof import("../../../opencode/dist/types/src/node").Database.Path + export const getPath: typeof import("../../../opencode/dist/types/src/node").Database.getPath export const Client: typeof import("../../../opencode/dist/types/src/node").Database.Client } export namespace JsonMigration { diff --git a/packages/desktop/src/main/index.ts b/packages/desktop/src/main/index.ts index 1b624800e8e0..23f2d7027ab6 100644 --- a/packages/desktop/src/main/index.ts +++ b/packages/desktop/src/main/index.ts @@ -291,25 +291,19 @@ const main = Effect.gen(function* () { if (mainWindow) sendSqliteMigrationProgress(mainWindow, progress) }) + ensureLoopbackNoProxy() + useEnvProxy() + logger.log("spawning sidecar", { url }) const { listener, health } = yield* Effect.promise(() => - spawnLocalServer( - hostname, - port, - password, - () => { - ensureLoopbackNoProxy() - useEnvProxy() - }, - { - needsMigration, - userDataPath: app.getPath("userData"), - onSqliteProgress: (progress) => initEmitter.emit("sqlite", progress), - onStdout: (message) => logger.log("sidecar stdout", { message }), - onStderr: (message) => logger.warn("sidecar stderr", { message }), - onExit: (code) => logger.warn("sidecar exited", { code }), - }, - ), + spawnLocalServer(hostname, port, password, { + needsMigration, + userDataPath: app.getPath("userData"), + onSqliteProgress: (progress) => initEmitter.emit("sqlite", progress), + onStdout: (message) => logger.log("sidecar stdout", { message }), + onStderr: (message) => logger.warn("sidecar stderr", { message }), + onExit: (code) => logger.warn("sidecar exited", { code }), + }), ) server = listener yield* Deferred.succeed(serverReady, { diff --git a/packages/desktop/src/main/server.ts b/packages/desktop/src/main/server.ts index 909138b89cf8..cfdafdc67bea 100644 --- a/packages/desktop/src/main/server.ts +++ b/packages/desktop/src/main/server.ts @@ -70,10 +70,8 @@ export async function spawnLocalServer( hostname: string, port: number, password: string, - configureEnv: () => void, options: SpawnLocalServerOptions, ) { - configureEnv?.() const sidecar = join(dirname(fileURLToPath(import.meta.url)), "sidecar.js") const child = utilityProcess.fork(sidecar, [], { cwd: process.cwd(), diff --git a/packages/desktop/src/main/shell-env.test.ts b/packages/desktop/src/main/shell-env.test.ts index cfe88277ea6b..e71708ad0491 100644 --- a/packages/desktop/src/main/shell-env.test.ts +++ b/packages/desktop/src/main/shell-env.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "bun:test" -import { isNushell, mergeShellEnv, parseShellEnv } from "./shell-env" +import { isNushell, mergeShellEnv, parseShellEnv, resolveUserShell } from "./shell-env" describe("shell env", () => { test("parseShellEnv supports null-delimited pairs", () => { @@ -34,6 +34,13 @@ describe("shell env", () => { expect(env.OPENCODE_CLIENT).toBe("desktop") }) + test("resolveUserShell falls back to the login shell before /bin/sh", () => { + expect(resolveUserShell("/custom/env-shell", "/bin/zsh")).toBe("/custom/env-shell") + expect(resolveUserShell(undefined, "/bin/zsh")).toBe("/bin/zsh") + expect(resolveUserShell(undefined, "unknown")).toBe("/bin/sh") + expect(resolveUserShell(undefined, undefined)).toBe("/bin/sh") + }) + test("isNushell handles path and binary name", () => { expect(isNushell("nu")).toBe(true) expect(isNushell("/opt/homebrew/bin/nu")).toBe(true) diff --git a/packages/desktop/src/main/shell-env.ts b/packages/desktop/src/main/shell-env.ts index 4a65fbf0f7f8..deb43033aefc 100644 --- a/packages/desktop/src/main/shell-env.ts +++ b/packages/desktop/src/main/shell-env.ts @@ -1,4 +1,5 @@ import { spawnSync } from "node:child_process" +import { userInfo } from "node:os" import { basename } from "node:path" import { getLogger } from "./logging" @@ -6,8 +7,17 @@ const TIMEOUT = 5_000 type Probe = { type: "Loaded"; value: Record } | { type: "Timeout" } | { type: "Unavailable" } +export function resolveUserShell(envShell: string | undefined, loginShell: string | null | undefined) { + const resolvedLoginShell = loginShell && loginShell !== "unknown" ? loginShell : undefined + return envShell || resolvedLoginShell || "/bin/sh" +} + export function getUserShell() { - return process.env.SHELL || "/bin/sh" + try { + return resolveUserShell(process.env.SHELL, userInfo().shell) + } catch { + return resolveUserShell(process.env.SHELL, undefined) + } } export function parseShellEnv(out: Buffer) { diff --git a/packages/desktop/src/main/windows.ts b/packages/desktop/src/main/windows.ts index 41abfc784dfa..3150a5237bfb 100644 --- a/packages/desktop/src/main/windows.ts +++ b/packages/desktop/src/main/windows.ts @@ -84,6 +84,7 @@ export function createMainWindow() { width: state.width, height: state.height, show: false, + autoHideMenuBar: true, title: "OpenCode", icon: iconPath(), backgroundColor, @@ -142,6 +143,7 @@ export function createLoadingWindow() { resizable: false, center: true, show: true, + autoHideMenuBar: true, icon: iconPath(), backgroundColor, ...(process.platform === "darwin" ? { titleBarStyle: "hidden" as const } : {}), diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index 88e5406cbf8a..2a4510bc3a0b 100644 --- a/packages/enterprise/package.json +++ b/packages/enterprise/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/enterprise", - "version": "1.14.48", + "version": "1.15.0", "private": true, "type": "module", "license": "MIT", diff --git a/packages/enterprise/src/core/share.ts b/packages/enterprise/src/core/share.ts index fb8cd302951d..a39171462d41 100644 --- a/packages/enterprise/src/core/share.ts +++ b/packages/enterprise/src/core/share.ts @@ -1,9 +1,12 @@ import { Message, Model, Part, Session, SnapshotFileDiff } from "@opencode-ai/sdk/v2" -import { fn } from "@opencode-ai/core/util/fn" import { iife } from "@opencode-ai/core/util/iife" import z from "zod" import { Storage } from "./storage" +function fn(schema: T, cb: (input: z.infer) => Result) { + return (input: z.infer) => cb(schema.parse(input)) +} + export namespace Share { export const Info = z.object({ id: z.string(), diff --git a/packages/enterprise/src/routes/share/[shareID].tsx b/packages/enterprise/src/routes/share/[shareID].tsx index b12afce27aef..7cfb2bb4a79c 100644 --- a/packages/enterprise/src/routes/share/[shareID].tsx +++ b/packages/enterprise/src/routes/share/[shareID].tsx @@ -15,7 +15,6 @@ import { Binary } from "@opencode-ai/core/util/binary" import { NamedError } from "@opencode-ai/core/util/error" import { DateTime } from "luxon" import { createStore } from "solid-js/store" -import z from "zod" import NotFound from "../[...404]" import { Tabs } from "@opencode-ai/ui/tabs" import { MessageNav } from "@opencode-ai/ui/message-nav" @@ -33,13 +32,28 @@ const ClientOnlyWorkerPoolProvider = clientOnly(() => })), ) -const SessionDataMissingError = NamedError.create( - "SessionDataMissingError", - z.object({ - sessionID: z.string(), - message: z.string().optional(), - }), -) +class SessionDataMissingError extends NamedError { + public override readonly name = "SessionDataMissingError" + + constructor( + public readonly data: { sessionID: string; message?: string }, + options?: ErrorOptions, + ) { + super("SessionDataMissingError", options) + } + + static isInstance(input: unknown): input is SessionDataMissingError { + return NamedError.hasName(input, "SessionDataMissingError") + } + + schema(): never { + throw new Error("SessionDataMissingError does not expose a schema") + } + + toObject() { + return { name: this.name, data: this.data } + } +} const getData = query(async (shareID) => { "use server" diff --git a/packages/enterprise/sst-env.d.ts b/packages/enterprise/sst-env.d.ts index 9680a53aab1e..088db5be2c7e 100644 --- a/packages/enterprise/sst-env.d.ts +++ b/packages/enterprise/sst-env.d.ts @@ -298,6 +298,7 @@ declare module "sst" { "EnterpriseStorage": cloudflare.R2Bucket "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service + "Stat": cloudflare.Service "ZenData": cloudflare.R2Bucket "ZenDataNew": cloudflare.R2Bucket } diff --git a/packages/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index 9b77cf8b9f16..637b93dd0af1 100644 --- a/packages/extensions/zed/extension.toml +++ b/packages/extensions/zed/extension.toml @@ -1,7 +1,7 @@ id = "opencode" name = "OpenCode" description = "The open source coding agent." -version = "1.14.48" +version = "1.15.0" schema_version = 1 authors = ["Anomaly"] repository = "https://github.com/anomalyco/opencode" @@ -11,26 +11,26 @@ name = "OpenCode" icon = "./icons/opencode.svg" [agent_servers.opencode.targets.darwin-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.48/opencode-darwin-arm64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.15.0/opencode-darwin-arm64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.darwin-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.48/opencode-darwin-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.15.0/opencode-darwin-x64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.48/opencode-linux-arm64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.15.0/opencode-linux-arm64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.48/opencode-linux-x64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.15.0/opencode-linux-x64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.windows-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.48/opencode-windows-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.15.0/opencode-windows-x64.zip" cmd = "./opencode.exe" args = ["acp"] diff --git a/packages/function/package.json b/packages/function/package.json index b644ca7df50e..f588e8cf2d7f 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/function", - "version": "1.14.48", + "version": "1.15.0", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/function/sst-env.d.ts b/packages/function/sst-env.d.ts index 9680a53aab1e..088db5be2c7e 100644 --- a/packages/function/sst-env.d.ts +++ b/packages/function/sst-env.d.ts @@ -298,6 +298,7 @@ declare module "sst" { "EnterpriseStorage": cloudflare.R2Bucket "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service + "Stat": cloudflare.Service "ZenData": cloudflare.R2Bucket "ZenDataNew": cloudflare.R2Bucket } diff --git a/packages/http-recorder/README.md b/packages/http-recorder/README.md index 5920c9670a11..f527dd0cca0b 100644 --- a/packages/http-recorder/README.md +++ b/packages/http-recorder/README.md @@ -166,11 +166,11 @@ import { Effect } from "effect" const audit = Effect.gen(function* () { const cassettes = yield* HttpRecorder.Cassette.Service - const entries = yield* cassettes.list() - const issues = yield* Effect.forEach(entries, (entry) => + const names = yield* cassettes.list() + const issues = yield* Effect.forEach(names, (name) => cassettes - .read(entry.name) - .pipe(Effect.map((interactions) => ({ name: entry.name, findings: HttpRecorder.secretFindings(interactions) }))), + .read(name) + .pipe(Effect.map((interactions) => ({ name, findings: HttpRecorder.secretFindings(interactions) }))), ) return issues.filter((i) => i.findings.length > 0) }) @@ -196,14 +196,13 @@ type RecordReplayOptions = { ## Layout -| File | Purpose | -| -------------- | -------------------------------------------------------------------------------- | -| `effect.ts` | `cassetteLayer` / `recordingLayer` — the `HttpClient` adapter. | -| `websocket.ts` | `makeWebSocketExecutor` — WebSocket record/replay. | -| `cassette.ts` | `Cassette.Service` — reads/writes cassette files, accumulates state. | -| `recorder.ts` | Shared transport plumbing: `UnsafeCassetteError`, `appendOrFail`, `ReplayState`. | -| `redactor.ts` | Composable `Redactor` — headers, url, body redaction. | -| `redaction.ts` | Lower-level header/URL primitives + secret pattern detection. | -| `schema.ts` | Effect Schema definitions for the cassette JSON format. | -| `storage.ts` | Path resolution, JSON encode/decode, sync existence check. | -| `matching.ts` | Request matcher, canonicalization, sequential cursor, mismatch diagnostics. | +| File | Purpose | +| -------------- | --------------------------------------------------------------------------- | +| `effect.ts` | `cassetteLayer` / `recordingLayer` — the `HttpClient` adapter. | +| `websocket.ts` | `makeWebSocketExecutor` — WebSocket record/replay. | +| `cassette.ts` | `Cassette.Service` — `fileSystem` / `memory` adapters, error types. | +| `recorder.ts` | Shared transport plumbing: `resolveAutoMode`, `ReplayState`. | +| `redactor.ts` | Composable `Redactor` — headers, url, body redaction. | +| `redaction.ts` | Lower-level header/URL primitives + secret pattern detection. | +| `schema.ts` | Effect Schema definitions for the cassette JSON format. | +| `matching.ts` | Request matcher, canonicalization, sequential cursor, mismatch diagnostics. | diff --git a/packages/http-recorder/package.json b/packages/http-recorder/package.json index 18ea8b175962..607b4c60d942 100644 --- a/packages/http-recorder/package.json +++ b/packages/http-recorder/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.14.48", + "version": "1.15.0", "name": "@opencode-ai/http-recorder", "type": "module", "license": "MIT", diff --git a/packages/http-recorder/src/cassette.ts b/packages/http-recorder/src/cassette.ts index 3897f0222c4e..331f3d4b600b 100644 --- a/packages/http-recorder/src/cassette.ts +++ b/packages/http-recorder/src/cassette.ts @@ -1,7 +1,7 @@ import { Context, Effect, FileSystem, Layer, Schema } from "effect" import * as fs from "node:fs" import * as path from "node:path" -import { secretFindings, type SecretFinding } from "./redaction" +import { secretFindings, SecretFindingSchema, type SecretFinding } from "./redaction" import { decodeCassette, encodeCassette, type Cassette, type CassetteMetadata, type Interaction } from "./schema" const DEFAULT_RECORDINGS_DIR = path.resolve(process.cwd(), "test", "fixtures", "recordings") @@ -14,13 +14,24 @@ export class CassetteNotFoundError extends Schema.TaggedErrorClass +export class UnsafeCassetteError extends Schema.TaggedErrorClass()("UnsafeCassetteError", { + cassetteName: Schema.String, + findings: Schema.Array(SecretFindingSchema), +}) { + override get message() { + return `Refusing to write cassette "${this.cassetteName}" because it contains possible secrets: ${this.findings + .map((finding) => `${finding.path} (${finding.reason})`) + .join(", ")}` + } } export interface Interface { readonly read: (name: string) => Effect.Effect, CassetteNotFoundError> - readonly append: (name: string, interaction: Interaction, metadata?: CassetteMetadata) => Effect.Effect + readonly append: ( + name: string, + interaction: Interaction, + metadata?: CassetteMetadata, + ) => Effect.Effect readonly exists: (name: string) => Effect.Effect readonly list: () => Effect.Effect> } @@ -44,6 +55,9 @@ const formatCassette = (cassette: Cassette) => `${JSON.stringify(encodeCassette( const parseCassette = (raw: string) => decodeCassette(JSON.parse(raw)) +const failIfUnsafe = (name: string, findings: ReadonlyArray) => + findings.length === 0 ? Effect.void : Effect.fail(new UnsafeCassetteError({ cassetteName: name, findings })) + export const fileSystem = ( options: { readonly directory?: string } = {}, ): Layer.Layer => @@ -92,11 +106,9 @@ export const fileSystem = ( entry.findings.push(...secretFindings(interaction)) const cassette = buildCassette(name, entry.interactions, metadata) const findings = [...entry.findings, ...secretFindings(cassette.metadata ?? {})] - if (findings.length === 0) { - yield* ensureDirectory(name) - yield* fs.writeFileString(cassettePath(name), formatCassette(cassette)).pipe(Effect.orDie) - } - return { findings } + yield* failIfUnsafe(name, findings) + yield* ensureDirectory(name) + yield* fs.writeFileString(cassettePath(name), formatCassette(cassette)).pipe(Effect.orDie) }), exists: (name) => fs.access(cassettePath(name)).pipe( @@ -133,17 +145,17 @@ export const memory = (initial: Record> = {}) stored.has(name) ? Effect.succeed(stored.get(name) ?? []) : Effect.fail(new CassetteNotFoundError({ cassetteName: name })), - append: (name, interaction, metadata) => - Effect.sync(() => { - const existing = stored.get(name) - if (existing) existing.push(interaction) - else stored.set(name, [interaction]) - const findings = accumulatedFindings.get(name) - if (findings) findings.push(...secretFindings(interaction)) - else accumulatedFindings.set(name, [...secretFindings(interaction)]) - if (metadata) accumulatedFindings.get(name)!.push(...secretFindings({ name, ...metadata })) - return { findings: accumulatedFindings.get(name) ?? [] } - }), + append: (name, interaction, metadata) => { + const existing = stored.get(name) + if (existing) existing.push(interaction) + else stored.set(name, [interaction]) + const existingFindings = accumulatedFindings.get(name) + const findings = existingFindings ?? [] + if (!existingFindings) accumulatedFindings.set(name, findings) + findings.push(...secretFindings(interaction)) + if (metadata) findings.push(...secretFindings({ name, ...metadata })) + return failIfUnsafe(name, findings) + }, exists: (name) => Effect.sync(() => stored.has(name)), list: () => Effect.sync(() => Array.from(stored.keys()).toSorted()), }) diff --git a/packages/http-recorder/src/effect.ts b/packages/http-recorder/src/effect.ts index 61193a013c14..e9cb60cc2e26 100644 --- a/packages/http-recorder/src/effect.ts +++ b/packages/http-recorder/src/effect.ts @@ -12,7 +12,7 @@ import { } from "effect/unstable/http" import * as CassetteService from "./cassette" import { defaultMatcher, selectSequential, type RequestMatcher } from "./matching" -import { appendOrFail, makeReplayState, resolveAutoMode } from "./recorder" +import { makeReplayState, resolveAutoMode } from "./recorder" import { defaults, type Redactor } from "./redactor" import { redactUrl } from "./redaction" import { httpInteractions, type CassetteMetadata, type HttpInteraction, type ResponseSnapshot } from "./schema" @@ -100,9 +100,11 @@ export const recordingLayer = ( ...captured, }), } - yield* appendOrFail(cassetteService, name, interaction, options.metadata).pipe( - Effect.catchTag("UnsafeCassetteError", (error) => Effect.fail(transportError(request, error.message))), - ) + yield* cassetteService + .append(name, interaction, options.metadata) + .pipe( + Effect.catchTag("UnsafeCassetteError", (error) => Effect.fail(transportError(request, error.message))), + ) return HttpClientResponse.fromWeb( request, new Response(decodeResponseBody(interaction.response), interaction.response), diff --git a/packages/http-recorder/src/index.ts b/packages/http-recorder/src/index.ts index 4b47e4513d42..d05098996ecd 100644 --- a/packages/http-recorder/src/index.ts +++ b/packages/http-recorder/src/index.ts @@ -7,10 +7,9 @@ export type { WebSocketFrame, WebSocketInteraction, } from "./schema" -export { CassetteNotFoundError, hasCassetteSync } from "./cassette" +export { CassetteNotFoundError, hasCassetteSync, UnsafeCassetteError } from "./cassette" export { defaultMatcher, type RequestMatcher } from "./matching" export { redactHeaders, redactUrl, secretFindings, type SecretFinding } from "./redaction" -export { UnsafeCassetteError } from "./recorder" export { cassetteLayer, recordingLayer, type RecordReplayMode, type RecordReplayOptions } from "./effect" export { makeWebSocketExecutor, diff --git a/packages/http-recorder/src/matching.ts b/packages/http-recorder/src/matching.ts index ab647ab37a02..1dced17d071b 100644 --- a/packages/http-recorder/src/matching.ts +++ b/packages/http-recorder/src/matching.ts @@ -36,7 +36,7 @@ export const canonicalSnapshot = (snapshot: RequestSnapshot): string => export const defaultMatcher: RequestMatcher = (incoming, recorded) => canonicalSnapshot(incoming) === canonicalSnapshot(recorded) -const safeText = (value: unknown) => { +export const safeText = (value: unknown) => { if (value === undefined) return "undefined" if (secretFindings(value).length > 0) return JSON.stringify(REDACTED) const text = JSON.stringify(value) diff --git a/packages/http-recorder/src/recorder.ts b/packages/http-recorder/src/recorder.ts index 460b427c2a03..0a13282c2d78 100644 --- a/packages/http-recorder/src/recorder.ts +++ b/packages/http-recorder/src/recorder.ts @@ -1,47 +1,22 @@ -import { Effect, Ref, Schema, Scope } from "effect" +import { Effect, Ref, Scope } from "effect" import type * as CassetteService from "./cassette" import type { CassetteNotFoundError } from "./cassette" -import { SecretFindingSchema } from "./redaction" -import type { CassetteMetadata, Interaction } from "./schema" - -export class UnsafeCassetteError extends Schema.TaggedErrorClass()("UnsafeCassetteError", { - cassetteName: Schema.String, - findings: Schema.Array(SecretFindingSchema), -}) { - override get message() { - return `Refusing to write cassette "${this.cassetteName}" because it contains possible secrets: ${this.findings - .map((finding) => `${finding.path} (${finding.reason})`) - .join(", ")}` - } -} - -export type ResolvedMode = "record" | "replay" | "passthrough" +import type { Interaction } from "./schema" const isCI = () => { const value = process.env.CI return value !== undefined && value !== "" && value !== "false" && value !== "0" } -export const resolveAutoMode = (cassette: CassetteService.Interface, name: string): Effect.Effect => +export const resolveAutoMode = ( + cassette: CassetteService.Interface, + name: string, +): Effect.Effect<"record" | "replay" | "passthrough"> => Effect.gen(function* () { if (isCI()) return "replay" return (yield* cassette.exists(name)) ? "replay" : "record" }) -export const appendOrFail = ( - cassette: CassetteService.Interface, - name: string, - interaction: Interaction, - metadata: CassetteMetadata | undefined, -): Effect.Effect => - cassette - .append(name, interaction, metadata) - .pipe( - Effect.flatMap(({ findings }) => - findings.length === 0 ? Effect.void : Effect.fail(new UnsafeCassetteError({ cassetteName: name, findings })), - ), - ) - export interface ReplayState { readonly load: Effect.Effect, CassetteNotFoundError> readonly cursor: Effect.Effect diff --git a/packages/http-recorder/src/redaction.ts b/packages/http-recorder/src/redaction.ts index b6aa8b3b87b6..9d89fff2f5f7 100644 --- a/packages/http-recorder/src/redaction.ts +++ b/packages/http-recorder/src/redaction.ts @@ -1,3 +1,5 @@ +import { Schema } from "effect" + export const REDACTED = "[REDACTED]" const DEFAULT_REDACT_HEADERS = [ @@ -95,8 +97,6 @@ export const redactHeaders = ( ) } -import { Schema } from "effect" - export const SecretFindingSchema = Schema.Struct({ path: Schema.String, reason: Schema.String, diff --git a/packages/http-recorder/src/websocket.ts b/packages/http-recorder/src/websocket.ts index f7529b488809..2cccc6749c77 100644 --- a/packages/http-recorder/src/websocket.ts +++ b/packages/http-recorder/src/websocket.ts @@ -1,9 +1,10 @@ import { Effect, Option, Ref, Scope, Stream } from "effect" import type { Headers } from "effect/unstable/http" import * as CassetteService from "./cassette" -import { canonicalizeJson, decodeJson } from "./matching" -import { appendOrFail, makeReplayState, resolveAutoMode } from "./recorder" +import { canonicalizeJson, decodeJson, safeText } from "./matching" +import { makeReplayState, resolveAutoMode } from "./recorder" import type { RecordReplayMode } from "./effect" +import { redactUrl } from "./redaction" import { defaults, type Redactor } from "./redactor" import { webSocketInteractions, type CassetteMetadata, type WebSocketFrame } from "./schema" @@ -53,7 +54,7 @@ const decodeFrameText = (frame: WebSocketFrame) => const assertEqual = (message: string, actual: unknown, expected: unknown) => Effect.sync(() => { if (JSON.stringify(actual) === JSON.stringify(expected)) return - throw new Error(`${message}: expected ${JSON.stringify(expected)}, received ${JSON.stringify(actual)}`) + throw new Error(`${message}: expected ${safeText(expected)}, received ${safeText(actual)}`) }) const jsonOrText = (value: string) => Option.match(decodeJson(value), { onNone: () => value, onSome: canonicalizeJson }) @@ -61,7 +62,7 @@ const jsonOrText = (value: string) => Option.match(decodeJson(value), { onNone: const compareClientMessage = (actual: string, expected: WebSocketFrame | undefined, index: number, asJson: boolean) => { if (!expected) return Effect.sync(() => { - throw new Error(`Unexpected WebSocket client frame ${index + 1}: ${actual}`) + throw new Error(`Unexpected WebSocket client frame ${index + 1}: ${safeText(actual)}`) }) const expectedText = decodeFrameText(expected) if (!asJson) return assertEqual(`WebSocket client frame ${index + 1}`, actual, expectedText) @@ -98,12 +99,13 @@ export const makeWebSocketExecutor = ( const closeOnce = Effect.gen(function* () { if (yield* Ref.getAndSet(closed, true)) return yield* connection.close - yield* appendOrFail( - options.cassette, - options.name, - { transport: "websocket", open: openSnapshot(request), client, server }, - options.metadata, - ).pipe(Effect.orDie) + yield* options.cassette + .append( + options.name, + { transport: "websocket", open: openSnapshot(request), client, server }, + options.metadata, + ) + .pipe(Effect.orDie) }) return { sendText: (message) => @@ -111,10 +113,7 @@ export const makeWebSocketExecutor = ( .sendText(message) .pipe(Effect.tap(() => Effect.sync(() => client.push(encodeFrame(message))))), messages: connection.messages.pipe( - Stream.map((message) => { - server.push(encodeFrame(message)) - return message - }), + Stream.tap((message) => Effect.sync(() => server.push(encodeFrame(message)))), ), close: closeOnce, } @@ -130,20 +129,22 @@ export const makeWebSocketExecutor = ( const interactions = yield* replay.load.pipe(Effect.orDie) const index = yield* replay.cursor const interaction = interactions[index] - if (!interaction) return yield* Effect.die(new Error(`No recorded WebSocket interaction for ${request.url}`)) + if (!interaction) + return yield* Effect.die(new Error(`No recorded WebSocket interaction for ${redactUrl(request.url)}`)) yield* replay.advance yield* assertEqual(`WebSocket open frame ${index + 1}`, openSnapshot(request), interaction.open) const messageIndex = yield* Ref.make(0) return { sendText: (message) => Effect.gen(function* () { - const current = yield* Ref.getAndUpdate(messageIndex, (value) => value + 1) + const current = yield* Ref.get(messageIndex) yield* compareClientMessage( message, interaction.client[current], current, options.compareClientMessagesAsJson === true, ) + yield* Ref.update(messageIndex, (value) => value + 1) }), messages: Stream.fromIterable(interaction.server).pipe(Stream.map(decodeFrameMessage)), close: Effect.gen(function* () { diff --git a/packages/http-recorder/test/record-replay.test.ts b/packages/http-recorder/test/record-replay.test.ts index 503f87ac507d..72512868ee63 100644 --- a/packages/http-recorder/test/record-replay.test.ts +++ b/packages/http-recorder/test/record-replay.test.ts @@ -323,4 +323,118 @@ describe("http-recorder", () => { }), ) }) + + test("auto mode records to disk when the cassette is missing", async () => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "http-recorder-auto-record-")) + using server = Bun.serve({ + port: 0, + fetch: () => new Response('{"reply":"recorded"}', { headers: { "content-type": "application/json" } }), + }) + const url = `http://127.0.0.1:${server.port}/echo` + // CI=true forces replay; clear it so we exercise the local-dev auto-record path. + const previous = process.env.CI + delete process.env.CI + try { + const result = await runWith("auto-record", { directory, mode: "auto" }, post(url, { step: 1 })) + expect(result).toBe('{"reply":"recorded"}') + expect(fs.existsSync(path.join(directory, "auto-record.json"))).toBe(true) + } finally { + if (previous !== undefined) process.env.CI = previous + } + }) + + test("passthrough mode bypasses the recorder entirely", async () => { + using server = Bun.serve({ port: 0, fetch: () => new Response("from-upstream") }) + const url = `http://127.0.0.1:${server.port}/path` + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "http-recorder-passthrough-")) + + const result = await runWith("passthrough-noop", { directory, mode: "passthrough" }, post(url, {})) + expect(result).toBe("from-upstream") + expect(fs.existsSync(path.join(directory, "passthrough-noop.json"))).toBe(false) + }) + + test("UnsafeCassetteError fails the request when a recording would write a known secret", async () => { + using server = Bun.serve({ port: 0, fetch: () => new Response("Bearer abcdefghijklmnopqrstuvwxyz1234") }) + const url = `http://127.0.0.1:${server.port}/leaky` + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "http-recorder-unsafe-")) + + const exit = await Effect.runPromise( + Effect.exit( + post(url, { ok: true }).pipe( + Effect.provide(HttpRecorder.cassetteLayer("unsafe-record", { directory, mode: "record" })), + ), + ), + ) + expect(Exit.isFailure(exit)).toBe(true) + expect(failureText(exit)).toContain("contains possible secrets") + expect(fs.existsSync(path.join(directory, "unsafe-record.json"))).toBe(false) + }) + + test("Cassette.list enumerates recorded cassette names", async () => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "http-recorder-list-")) + await seedCassetteDirectory(directory, "alpha/one", [ + { + transport: "http", + request: { method: "GET", url: "https://x.test/a", headers: {}, body: "" }, + response: { status: 200, headers: {}, body: "a" }, + }, + ]) + await seedCassetteDirectory(directory, "beta", [ + { + transport: "http", + request: { method: "GET", url: "https://x.test/b", headers: {}, body: "" }, + response: { status: 200, headers: {}, body: "b" }, + }, + ]) + + const names = await Effect.runPromise( + Effect.gen(function* () { + const cassette = yield* HttpRecorder.Cassette.Service + return yield* cassette.list() + }).pipe(Effect.provide(HttpRecorder.Cassette.fileSystem({ directory })), Effect.provide(NodeFileSystem.layer)), + ) + expect(names).toEqual(["alpha/one", "beta"]) + }) + + test("WebSocket replay decodes binary frames recorded as base64", async () => { + const binaryServer = new Uint8Array([1, 2, 3, 4]) + await Effect.runPromise( + Effect.scoped( + Effect.gen(function* () { + const cassette = yield* HttpRecorder.Cassette.Service + const executor = yield* HttpRecorder.makeWebSocketExecutor({ + name: "ws/binary", + cassette, + live: { open: () => Effect.die(new Error("unexpected live WebSocket open")) }, + }) + const connection = yield* executor.open({ + url: "wss://example.test/binary", + headers: Headers.fromInput({}), + }) + const messages: Array = [] + yield* connection.messages.pipe(Stream.runForEach((m) => Effect.sync(() => messages.push(m)))) + yield* connection.close + + expect(messages).toHaveLength(1) + expect(messages[0]).toBeInstanceOf(Uint8Array) + expect(Array.from(messages[0] as Uint8Array)).toEqual([1, 2, 3, 4]) + }).pipe( + Effect.provide( + HttpRecorder.Cassette.memory({ + "ws/binary": [ + { + transport: "websocket", + open: { url: "wss://example.test/binary", headers: {} }, + client: [], + server: [ + { kind: "binary", body: Buffer.from(binaryServer).toString("base64"), bodyEncoding: "base64" }, + ], + }, + ], + }), + ), + ), + ), + ) + }) }) diff --git a/packages/llm/example/tutorial.ts b/packages/llm/example/tutorial.ts index a9adecf3699e..429ac4824bb8 100644 --- a/packages/llm/example/tutorial.ts +++ b/packages/llm/example/tutorial.ts @@ -78,7 +78,7 @@ const streamText = LLM.stream(request).pipe( Stream.tap((event) => Effect.sync(() => { if (event.type === "text-delta") process.stdout.write(`\ntext: ${event.text}`) - if (event.type === "request-finish") process.stdout.write(`\nfinish: ${event.reason}\n`) + if (event.type === "finish") process.stdout.write(`\nfinish: ${event.reason}\n`) }), ), Stream.runDrain, @@ -185,7 +185,7 @@ const FakeProtocol = Protocol.make({ event: Schema.String, initial: () => undefined, step: (_, frame) => Effect.succeed([undefined, [{ type: "text-delta", id: "text-0", text: frame }]] as const), - onHalt: () => [{ type: "request-finish", reason: "stop" }], + onHalt: () => [{ type: "finish", reason: "stop" }], }, }) diff --git a/packages/llm/package.json b/packages/llm/package.json index 4070681cf730..f6258a2c68ea 100644 --- a/packages/llm/package.json +++ b/packages/llm/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.14.48", + "version": "1.15.0", "name": "@opencode-ai/llm", "type": "module", "license": "MIT", diff --git a/packages/llm/src/index.ts b/packages/llm/src/index.ts index f4adf4859a9b..acf73b360e13 100644 --- a/packages/llm/src/index.ts +++ b/packages/llm/src/index.ts @@ -17,6 +17,7 @@ export type { ExecutableTools, Tool as ToolShape, ToolExecute, + ToolExecuteContext, Tools, ToolSchema, } from "./tool" diff --git a/packages/llm/src/protocols/anthropic-messages.ts b/packages/llm/src/protocols/anthropic-messages.ts index d893888fd22e..e27af18426ef 100644 --- a/packages/llm/src/protocols/anthropic-messages.ts +++ b/packages/llm/src/protocols/anthropic-messages.ts @@ -17,6 +17,7 @@ import { } from "../schema" import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared" import * as Cache from "./utils/cache" +import { Lifecycle } from "./utils/lifecycle" import { ToolStream } from "./utils/tool-stream" const ADAPTER = "anthropic-messages" @@ -190,6 +191,7 @@ type AnthropicEvent = Schema.Schema.Type interface ParserState { readonly tools: ToolStream.State readonly usage?: Usage + readonly lifecycle: Lifecycle.State } const invalid = ProviderShared.invalidRequest @@ -500,37 +502,45 @@ const onContentBlockStart = (state: ParserState, event: AnthropicEvent): StepRes if (!block) return [state, NO_EVENTS] if ((block.type === "tool_use" || block.type === "server_tool_use") && event.index !== undefined) { + const events: LLMEvent[] = [] + const lifecycle = Lifecycle.stepStart(state.lifecycle, events) return [ { ...state, + lifecycle, tools: ToolStream.start(state.tools, event.index, { id: block.id ?? String(event.index), name: block.name ?? "", providerExecuted: block.type === "server_tool_use", }), }, - NO_EVENTS, + [...events, LLMEvent.toolInputStart({ id: block.id ?? String(event.index), name: block.name ?? "" })], ] } if (block.type === "text" && block.text) { - return [state, [LLMEvent.textDelta({ id: `text-${event.index ?? 0}`, text: block.text })]] + const events: LLMEvent[] = [] + return [ + { ...state, lifecycle: Lifecycle.textDelta(state.lifecycle, events, `text-${event.index ?? 0}`, block.text) }, + events, + ] } if (block.type === "thinking" && block.thinking) { + const events: LLMEvent[] = [] return [ - state, - [ - LLMEvent.reasoningDelta({ - id: `reasoning-${event.index ?? 0}`, - text: block.thinking, - }), - ], + { + ...state, + lifecycle: Lifecycle.reasoningDelta(state.lifecycle, events, `reasoning-${event.index ?? 0}`, block.thinking), + }, + events, ] } const result = serverToolResultEvent(block) - return [state, result ? [result] : NO_EVENTS] + if (!result) return [state, NO_EVENTS] + const events: LLMEvent[] = [] + return [{ ...state, lifecycle: Lifecycle.stepStart(state.lifecycle, events) }, [...events, result]] } const onContentBlockDelta = Effect.fn("AnthropicMessages.onContentBlockDelta")(function* ( @@ -540,25 +550,37 @@ const onContentBlockDelta = Effect.fn("AnthropicMessages.onContentBlockDelta")(f const delta = event.delta if (delta?.type === "text_delta" && delta.text) { - return [state, [LLMEvent.textDelta({ id: `text-${event.index ?? 0}`, text: delta.text })]] satisfies StepResult + const events: LLMEvent[] = [] + return [ + { ...state, lifecycle: Lifecycle.textDelta(state.lifecycle, events, `text-${event.index ?? 0}`, delta.text) }, + events, + ] satisfies StepResult } if (delta?.type === "thinking_delta" && delta.thinking) { + const events: LLMEvent[] = [] return [ - state, - [LLMEvent.reasoningDelta({ id: `reasoning-${event.index ?? 0}`, text: delta.thinking })], + { + ...state, + lifecycle: Lifecycle.reasoningDelta(state.lifecycle, events, `reasoning-${event.index ?? 0}`, delta.thinking), + }, + events, ] satisfies StepResult } if (delta?.type === "signature_delta" && delta.signature) { + const events: LLMEvent[] = [] return [ - state, - [ - LLMEvent.reasoningEnd({ - id: `reasoning-${event.index ?? 0}`, - providerMetadata: anthropicMetadata({ signature: delta.signature }), - }), - ], + { + ...state, + lifecycle: Lifecycle.reasoningEnd( + state.lifecycle, + events, + `reasoning-${event.index ?? 0}`, + anthropicMetadata({ signature: delta.signature }), + ), + }, + events, ] satisfies StepResult } @@ -572,7 +594,10 @@ const onContentBlockDelta = Effect.fn("AnthropicMessages.onContentBlockDelta")(f "Anthropic Messages tool argument delta is missing its tool call", ) if (ToolStream.isError(result)) return yield* result - return [{ ...state, tools: result.tools }, result.event ? [result.event] : NO_EVENTS] satisfies StepResult + const events: LLMEvent[] = [] + const lifecycle = result.events.length ? Lifecycle.stepStart(state.lifecycle, events) : state.lifecycle + events.push(...result.events) + return [{ ...state, lifecycle, tools: result.tools }, events] satisfies StepResult } return [state, NO_EVENTS] satisfies StepResult @@ -584,23 +609,30 @@ const onContentBlockStop = Effect.fn("AnthropicMessages.onContentBlockStop")(fun ) { if (event.index === undefined) return [state, NO_EVENTS] satisfies StepResult const result = yield* ToolStream.finish(ADAPTER, state.tools, event.index) - return [{ ...state, tools: result.tools }, result.event ? [result.event] : NO_EVENTS] satisfies StepResult + const events: LLMEvent[] = [] + const resultEvents = result.events ?? [] + const lifecycle = resultEvents.length + ? Lifecycle.stepStart(state.lifecycle, events) + : Lifecycle.reasoningEnd( + Lifecycle.textEnd(state.lifecycle, events, `text-${event.index}`), + events, + `reasoning-${event.index}`, + ) + events.push(...resultEvents) + return [{ ...state, lifecycle, tools: result.tools }, events] satisfies StepResult }) const onMessageDelta = (state: ParserState, event: AnthropicEvent): StepResult => { const usage = mergeUsage(state.usage, mapUsage(event.usage)) - return [ - { ...state, usage }, - [ - LLMEvent.requestFinish({ - reason: mapFinishReason(event.delta?.stop_reason), - usage, - providerMetadata: event.delta?.stop_sequence - ? anthropicMetadata({ stopSequence: event.delta.stop_sequence }) - : undefined, - }), - ], - ] + const events: LLMEvent[] = [] + const lifecycle = Lifecycle.finish(state.lifecycle, events, { + reason: mapFinishReason(event.delta?.stop_reason), + usage, + providerMetadata: event.delta?.stop_sequence + ? anthropicMetadata({ stopSequence: event.delta.stop_sequence }) + : undefined, + }) + return [{ ...state, lifecycle, usage }, events] } const onError = (state: ParserState, event: AnthropicEvent): StepResult => [ @@ -634,7 +666,7 @@ export const protocol = Protocol.make({ }, stream: { event: Protocol.jsonEvent(AnthropicEvent), - initial: () => ({ tools: ToolStream.empty() }), + initial: () => ({ tools: ToolStream.empty(), lifecycle: Lifecycle.initial() }), step, }, }) diff --git a/packages/llm/src/protocols/bedrock-converse.ts b/packages/llm/src/protocols/bedrock-converse.ts index f561a6d7c5a9..7f5647c4a7be 100644 --- a/packages/llm/src/protocols/bedrock-converse.ts +++ b/packages/llm/src/protocols/bedrock-converse.ts @@ -17,6 +17,7 @@ import { JsonObject, optionalArray, ProviderShared } from "./shared" import { BedrockAuth, type Credentials as BedrockCredentials } from "./utils/bedrock-auth" import { BedrockCache } from "./utils/bedrock-cache" import { BedrockMedia } from "./utils/bedrock-media" +import { Lifecycle } from "./utils/lifecycle" import { ToolStream } from "./utils/tool-stream" const ADAPTER = "bedrock-converse" @@ -420,45 +421,64 @@ interface ParserState { // `metadata` (carries usage). Hold the terminal event in state so `onHalt` // can emit exactly one finish after both chunks have had a chance to arrive. readonly pendingFinish: { readonly reason: FinishReason; readonly usage?: Usage } | undefined + readonly hasToolCalls: boolean + readonly lifecycle: Lifecycle.State } const step = (state: ParserState, event: BedrockEvent) => Effect.gen(function* () { if (event.contentBlockStart?.start?.toolUse) { const index = event.contentBlockStart.contentBlockIndex + const events: LLMEvent[] = [] + const lifecycle = Lifecycle.stepStart(state.lifecycle, events) return [ { ...state, + lifecycle, tools: ToolStream.start(state.tools, index, { id: event.contentBlockStart.start.toolUse.toolUseId, name: event.contentBlockStart.start.toolUse.name, }), }, - [], + [ + ...events, + LLMEvent.toolInputStart({ + id: event.contentBlockStart.start.toolUse.toolUseId, + name: event.contentBlockStart.start.toolUse.name, + }), + ], ] as const } if (event.contentBlockDelta?.delta?.text) { + const events: LLMEvent[] = [] return [ - state, - [ - LLMEvent.textDelta({ - id: `text-${event.contentBlockDelta.contentBlockIndex}`, - text: event.contentBlockDelta.delta.text, - }), - ], + { + ...state, + lifecycle: Lifecycle.textDelta( + state.lifecycle, + events, + `text-${event.contentBlockDelta.contentBlockIndex}`, + event.contentBlockDelta.delta.text, + ), + }, + events, ] as const } if (event.contentBlockDelta?.delta?.reasoningContent?.text) { + const events: LLMEvent[] = [] return [ - state, - [ - LLMEvent.reasoningDelta({ - id: `reasoning-${event.contentBlockDelta.contentBlockIndex}`, - text: event.contentBlockDelta.delta.reasoningContent.text, - }), - ], + { + ...state, + lifecycle: Lifecycle.reasoningDelta( + state.lifecycle, + events, + `reasoning-${event.contentBlockDelta.contentBlockIndex}`, + event.contentBlockDelta.delta.reasoningContent.text, + ), + }, + events, ] as const } @@ -472,12 +492,33 @@ const step = (state: ParserState, event: BedrockEvent) => "Bedrock Converse tool delta is missing its tool call", ) if (ToolStream.isError(result)) return yield* result - return [{ ...state, tools: result.tools }, result.event ? [result.event] : []] as const + const events: LLMEvent[] = [] + const lifecycle = result.events.length ? Lifecycle.stepStart(state.lifecycle, events) : state.lifecycle + events.push(...result.events) + return [{ ...state, lifecycle, tools: result.tools }, events] as const } if (event.contentBlockStop) { const result = yield* ToolStream.finish(ADAPTER, state.tools, event.contentBlockStop.contentBlockIndex) - return [{ ...state, tools: result.tools }, result.event ? [result.event] : []] as const + const events: LLMEvent[] = [] + const resultEvents = result.events ?? [] + const lifecycle = resultEvents.length + ? Lifecycle.stepStart(state.lifecycle, events) + : Lifecycle.reasoningEnd( + Lifecycle.textEnd(state.lifecycle, events, `text-${event.contentBlockStop.contentBlockIndex}`), + events, + `reasoning-${event.contentBlockStop.contentBlockIndex}`, + ) + events.push(...resultEvents) + return [ + { + ...state, + hasToolCalls: resultEvents.some(LLMEvent.is.toolCall) ? true : state.hasToolCalls, + lifecycle, + tools: result.tools, + }, + events, + ] as const } if (event.messageStop) { @@ -517,7 +558,15 @@ const framing = BedrockEventStream.framing(ADAPTER) const onHalt = (state: ParserState): ReadonlyArray => state.pendingFinish - ? [LLMEvent.requestFinish({ reason: state.pendingFinish.reason, usage: state.pendingFinish.usage })] + ? (() => { + const events: LLMEvent[] = [] + Lifecycle.finish(state.lifecycle, events, { + reason: + state.pendingFinish.reason === "stop" && state.hasToolCalls ? "tool-calls" : state.pendingFinish.reason, + usage: state.pendingFinish.usage, + }) + return events + })() : [] // ============================================================================= @@ -535,7 +584,12 @@ export const protocol = Protocol.make({ }, stream: { event: BedrockEvent, - initial: () => ({ tools: ToolStream.empty(), pendingFinish: undefined }), + initial: () => ({ + tools: ToolStream.empty(), + pendingFinish: undefined, + hasToolCalls: false, + lifecycle: Lifecycle.initial(), + }), step, onHalt, }, diff --git a/packages/llm/src/protocols/gemini.ts b/packages/llm/src/protocols/gemini.ts index 0ee88f3beb04..6e0b82abba9a 100644 --- a/packages/llm/src/protocols/gemini.ts +++ b/packages/llm/src/protocols/gemini.ts @@ -16,6 +16,7 @@ import { } from "../schema" import { JsonObject, optionalArray, ProviderShared } from "./shared" import { GeminiToolSchema } from "./utils/gemini-tool-schema" +import { Lifecycle } from "./utils/lifecycle" const ADAPTER = "gemini" export const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta" @@ -134,10 +135,9 @@ interface ParserState { readonly hasToolCalls: boolean readonly nextToolCallId: number readonly usage?: Usage + readonly lifecycle: Lifecycle.State } -const invalid = ProviderShared.invalidRequest - const mediaData = ProviderShared.mediaBytes // ============================================================================= @@ -324,7 +324,14 @@ const mapFinishReason = (finishReason: string | undefined, hasToolCalls: boolean const finish = (state: ParserState): ReadonlyArray => state.finishReason || state.usage - ? [LLMEvent.requestFinish({ reason: mapFinishReason(state.finishReason, state.hasToolCalls), usage: state.usage })] + ? (() => { + const events: LLMEvent[] = [] + Lifecycle.finish(state.lifecycle, events, { + reason: mapFinishReason(state.finishReason, state.hasToolCalls), + usage: state.usage, + }) + return events + })() : [] const step = (state: ParserState, event: GeminiEvent) => { @@ -341,21 +348,21 @@ const step = (state: ParserState, event: GeminiEvent) => { const events: LLMEvent[] = [] let hasToolCalls = nextState.hasToolCalls + let lifecycle = nextState.lifecycle let nextToolCallId = nextState.nextToolCallId for (const part of candidate.content.parts) { if ("text" in part && part.text.length > 0) { - events.push( - part.thought - ? LLMEvent.reasoningDelta({ id: "reasoning-0", text: part.text }) - : LLMEvent.textDelta({ id: "text-0", text: part.text }), - ) + lifecycle = part.thought + ? Lifecycle.reasoningDelta(lifecycle, events, "reasoning-0", part.text) + : Lifecycle.textDelta(lifecycle, events, "text-0", part.text) continue } if ("functionCall" in part) { const input = part.functionCall.args const id = `tool_${nextToolCallId++}` + lifecycle = Lifecycle.stepStart(lifecycle, events) events.push(LLMEvent.toolCall({ id, name: part.functionCall.name, input })) hasToolCalls = true } @@ -365,6 +372,7 @@ const step = (state: ParserState, event: GeminiEvent) => { { ...nextState, hasToolCalls, + lifecycle, nextToolCallId, finishReason: candidate.finishReason ?? nextState.finishReason, }, @@ -388,7 +396,7 @@ export const protocol = Protocol.make({ }, stream: { event: Protocol.jsonEvent(GeminiEvent), - initial: () => ({ hasToolCalls: false, nextToolCallId: 0 }), + initial: () => ({ hasToolCalls: false, nextToolCallId: 0, lifecycle: Lifecycle.initial() }), step, onHalt: finish, }, diff --git a/packages/llm/src/protocols/openai-chat.ts b/packages/llm/src/protocols/openai-chat.ts index 133adb503bcf..470a1473c40b 100644 --- a/packages/llm/src/protocols/openai-chat.ts +++ b/packages/llm/src/protocols/openai-chat.ts @@ -16,6 +16,7 @@ import { } from "../schema" import { isRecord, JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared" import { OpenAIOptions } from "./utils/openai-options" +import { Lifecycle } from "./utils/lifecycle" import { ToolStream } from "./utils/tool-stream" const ADAPTER = "openai-chat" @@ -147,6 +148,7 @@ interface ParserState { readonly toolCallEvents: ReadonlyArray readonly usage?: Usage readonly finishReason?: FinishReason + readonly lifecycle: Lifecycle.State } const invalid = ProviderShared.invalidRequest @@ -321,7 +323,9 @@ const step = (state: ParserState, event: OpenAIChatEvent) => const toolDeltas = delta?.tool_calls ?? [] let tools = state.tools - if (delta?.content) events.push(LLMEvent.textDelta({ id: "text-0", text: delta.content })) + let lifecycle = state.lifecycle + + if (delta?.content) lifecycle = Lifecycle.textDelta(lifecycle, events, "text-0", delta.content) for (const tool of toolDeltas) { const result = ToolStream.appendOrStart( @@ -333,7 +337,8 @@ const step = (state: ParserState, event: OpenAIChatEvent) => ) if (ToolStream.isError(result)) return yield* result tools = result.tools - if (result.event) events.push(result.event) + if (result.events.length) lifecycle = Lifecycle.stepStart(lifecycle, events) + events.push(...result.events) } // Finalize accumulated tool inputs eagerly when finish_reason arrives so @@ -349,15 +354,20 @@ const step = (state: ParserState, event: OpenAIChatEvent) => toolCallEvents: finished?.events ?? state.toolCallEvents, usage, finishReason, + lifecycle, }, events, ] as const }) const finishEvents = (state: ParserState): ReadonlyArray => { + const events: LLMEvent[] = [] const hasToolCalls = state.toolCallEvents.length > 0 const reason = state.finishReason === "stop" && hasToolCalls ? "tool-calls" : state.finishReason - return [...state.toolCallEvents, ...(reason ? [LLMEvent.requestFinish({ reason, usage: state.usage })] : [])] + const lifecycle = state.toolCallEvents.length ? Lifecycle.stepStart(state.lifecycle, events) : state.lifecycle + events.push(...state.toolCallEvents) + if (reason) Lifecycle.finish(lifecycle, events, { reason, usage: state.usage }) + return events } // ============================================================================= @@ -377,7 +387,7 @@ export const protocol = Protocol.make({ }, stream: { event: Protocol.jsonEvent(OpenAIChatEvent), - initial: () => ({ tools: ToolStream.empty(), toolCallEvents: [] }), + initial: () => ({ tools: ToolStream.empty(), toolCallEvents: [], lifecycle: Lifecycle.initial() }), step, onHalt: finishEvents, }, diff --git a/packages/llm/src/protocols/openai-responses.ts b/packages/llm/src/protocols/openai-responses.ts index 035cc07713cc..7cf734f02785 100644 --- a/packages/llm/src/protocols/openai-responses.ts +++ b/packages/llm/src/protocols/openai-responses.ts @@ -17,6 +17,7 @@ import { } from "../schema" import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared" import { OpenAIOptions } from "./utils/openai-options" +import { Lifecycle } from "./utils/lifecycle" import { ToolStream } from "./utils/tool-stream" const ADAPTER = "openai-responses" @@ -165,6 +166,7 @@ type OpenAIResponsesEvent = Schema.Schema.Type interface ParserState { readonly tools: ToolStream.State readonly hasFunctionCall: boolean + readonly lifecycle: Lifecycle.State } const invalid = ProviderShared.invalidRequest @@ -378,30 +380,39 @@ type StepResult = readonly [ParserState, ReadonlyArray] const NO_EVENTS: StepResult["1"] = [] // `response.completed` / `response.incomplete` are clean finishes that emit a -// `request-finish` event; `response.failed` is a hard failure that emits a +// `finish` event; `response.failed` is a hard failure that emits a // `provider-error`. All three end the stream — kept in one set so `step` and // the protocol's `terminal` predicate stay in sync. const TERMINAL_TYPES = new Set(["response.completed", "response.incomplete", "response.failed"]) const onOutputTextDelta = (state: ParserState, event: OpenAIResponsesEvent): StepResult => { if (!event.delta) return [state, NO_EVENTS] - return [state, [LLMEvent.textDelta({ id: event.item_id ?? "text-0", text: event.delta })]] + const events: LLMEvent[] = [] + return [ + { ...state, lifecycle: Lifecycle.textDelta(state.lifecycle, events, event.item_id ?? "text-0", event.delta) }, + events, + ] } const onOutputItemAdded = (state: ParserState, event: OpenAIResponsesEvent): StepResult => { const item = event.item if (item?.type !== "function_call" || !item.id) return [state, NO_EVENTS] + const providerMetadata = openaiMetadata({ itemId: item.id }) + const events: LLMEvent[] = [] + const lifecycle = Lifecycle.stepStart(state.lifecycle, events) return [ { + ...state, + lifecycle, hasFunctionCall: state.hasFunctionCall, tools: ToolStream.start(state.tools, item.id, { id: item.call_id ?? item.id, name: item.name ?? "", input: item.arguments ?? "", - providerMetadata: openaiMetadata({ itemId: item.id }), + providerMetadata, }), }, - NO_EVENTS, + [...events, LLMEvent.toolInputStart({ id: item.call_id ?? item.id, name: item.name ?? "", providerMetadata })], ] } @@ -418,10 +429,10 @@ const onFunctionCallArgumentsDelta = Effect.fn("OpenAIResponses.onFunctionCallAr "OpenAI Responses tool argument delta is missing its tool call", ) if (ToolStream.isError(result)) return yield* result - return [ - { hasFunctionCall: state.hasFunctionCall, tools: result.tools }, - result.event ? [result.event] : NO_EVENTS, - ] satisfies StepResult + const events: LLMEvent[] = [] + const lifecycle = result.events.length ? Lifecycle.stepStart(state.lifecycle, events) : state.lifecycle + events.push(...result.events) + return [{ ...state, lifecycle, tools: result.tools }, events] satisfies StepResult }) const onOutputItemDone = Effect.fn("OpenAIResponses.onOutputItemDone")(function* ( @@ -440,33 +451,46 @@ const onOutputItemDone = Effect.fn("OpenAIResponses.onOutputItemDone")(function* item.arguments === undefined ? yield* ToolStream.finish(ADAPTER, tools, item.id) : yield* ToolStream.finishWithInput(ADAPTER, tools, item.id, item.arguments) + const events: LLMEvent[] = [] + const resultEvents = result.events ?? [] + const lifecycle = resultEvents.length ? Lifecycle.stepStart(state.lifecycle, events) : state.lifecycle + events.push(...resultEvents) return [ - { hasFunctionCall: result.event ? true : state.hasFunctionCall, tools: result.tools }, - result.event ? [result.event] : NO_EVENTS, + { + ...state, + lifecycle, + hasFunctionCall: resultEvents.some(LLMEvent.is.toolCall) ? true : state.hasFunctionCall, + tools: result.tools, + }, + events, ] satisfies StepResult } - if (isHostedToolItem(item)) return [state, hostedToolEvents(item)] satisfies StepResult + if (isHostedToolItem(item)) { + const events: LLMEvent[] = [] + const lifecycle = Lifecycle.stepStart(state.lifecycle, events) + events.push(...hostedToolEvents(item)) + return [{ ...state, lifecycle }, events] satisfies StepResult + } return [state, NO_EVENTS] satisfies StepResult }) -const onResponseFinish = (state: ParserState, event: OpenAIResponsesEvent): StepResult => [ - state, - [ - LLMEvent.requestFinish({ - reason: mapFinishReason(event, state.hasFunctionCall), - usage: mapUsage(event.response?.usage), - providerMetadata: - event.response?.id || event.response?.service_tier - ? openaiMetadata({ - responseId: event.response.id, - serviceTier: event.response.service_tier, - }) - : undefined, - }), - ], -] +const onResponseFinish = (state: ParserState, event: OpenAIResponsesEvent): StepResult => { + const events: LLMEvent[] = [] + const lifecycle = Lifecycle.finish(state.lifecycle, events, { + reason: mapFinishReason(event, state.hasFunctionCall), + usage: mapUsage(event.response?.usage), + providerMetadata: + event.response?.id || event.response?.service_tier + ? openaiMetadata({ + responseId: event.response.id, + serviceTier: event.response.service_tier, + }) + : undefined, + }) + return [{ ...state, lifecycle }, events] +} const onResponseFailed = (state: ParserState, event: OpenAIResponsesEvent): StepResult => [ state, @@ -506,7 +530,7 @@ export const protocol = Protocol.make({ }, stream: { event: Protocol.jsonEvent(OpenAIResponsesEvent), - initial: () => ({ hasFunctionCall: false, tools: ToolStream.empty() }), + initial: () => ({ hasFunctionCall: false, tools: ToolStream.empty(), lifecycle: Lifecycle.initial() }), step, terminal: (event) => TERMINAL_TYPES.has(event.type), }, diff --git a/packages/llm/src/protocols/utils/lifecycle.ts b/packages/llm/src/protocols/utils/lifecycle.ts new file mode 100644 index 000000000000..c249d75cee8e --- /dev/null +++ b/packages/llm/src/protocols/utils/lifecycle.ts @@ -0,0 +1,88 @@ +import { LLMEvent, type FinishReason, type ProviderMetadata, type Usage } from "../../schema" + +export interface State { + readonly stepStarted: boolean + readonly text: ReadonlySet + readonly reasoning: ReadonlySet +} + +export const initial = (): State => ({ stepStarted: false, text: new Set(), reasoning: new Set() }) + +export const stepStart = (state: State, events: LLMEvent[]): State => { + if (state.stepStarted) return state + events.push(LLMEvent.stepStart({ index: 0 })) + return { ...state, stepStarted: true } +} + +export const textDelta = (state: State, events: LLMEvent[], id: string, text: string): State => { + const stepped = stepStart(state, events) + if (stepped.text.has(id)) { + events.push(LLMEvent.textDelta({ id, text })) + return stepped + } + events.push(LLMEvent.textStart({ id }), LLMEvent.textDelta({ id, text })) + return { ...stepped, text: new Set([...stepped.text, id]) } +} + +export const reasoningDelta = (state: State, events: LLMEvent[], id: string, text: string): State => { + const stepped = stepStart(state, events) + if (stepped.reasoning.has(id)) { + events.push(LLMEvent.reasoningDelta({ id, text })) + return stepped + } + events.push(LLMEvent.reasoningStart({ id }), LLMEvent.reasoningDelta({ id, text })) + return { ...stepped, reasoning: new Set([...stepped.reasoning, id]) } +} + +export const reasoningEnd = ( + state: State, + events: LLMEvent[], + id: string, + providerMetadata?: ProviderMetadata, +): State => { + if (!state.reasoning.has(id)) return state + const stepped = stepStart(state, events) + events.push(LLMEvent.reasoningEnd({ id, providerMetadata })) + const reasoning = new Set(stepped.reasoning) + reasoning.delete(id) + return { ...stepped, reasoning } +} + +export const textEnd = (state: State, events: LLMEvent[], id: string, providerMetadata?: ProviderMetadata): State => { + if (!state.text.has(id)) return state + const stepped = stepStart(state, events) + events.push(LLMEvent.textEnd({ id, providerMetadata })) + const text = new Set(stepped.text) + text.delete(id) + return { ...stepped, text } +} + +const closeOpenBlocks = (state: State, events: LLMEvent[]): State => { + for (const id of state.reasoning) events.push(LLMEvent.reasoningEnd({ id })) + for (const id of state.text) events.push(LLMEvent.textEnd({ id })) + return { ...state, text: new Set(), reasoning: new Set() } +} + +export const finish = ( + state: State, + events: LLMEvent[], + input: { + readonly reason: FinishReason + readonly usage?: Usage + readonly providerMetadata?: ProviderMetadata + }, +): State => { + const stepped = closeOpenBlocks(stepStart(state, events), events) + events.push( + LLMEvent.stepFinish({ + index: 0, + reason: input.reason, + usage: input.usage, + providerMetadata: input.providerMetadata, + }), + LLMEvent.finish(input), + ) + return { ...stepped, stepStarted: false } +} + +export * as Lifecycle from "./lifecycle" diff --git a/packages/llm/src/protocols/utils/tool-stream.ts b/packages/llm/src/protocols/utils/tool-stream.ts index aa9c70f017b3..8e07a64bfed8 100644 --- a/packages/llm/src/protocols/utils/tool-stream.ts +++ b/packages/llm/src/protocols/utils/tool-stream.ts @@ -1,5 +1,5 @@ import { Effect } from "effect" -import { LLMError, LLMEvent, type ProviderMetadata, type ToolCall, type ToolInputDelta } from "../../schema" +import { LLMError, LLMEvent, type ProviderMetadata, type ToolCall } from "../../schema" import { eventError, parseToolInput, type ToolAccumulator } from "../shared" type StreamKey = string | number @@ -27,13 +27,13 @@ export type State = Partial> /** * Result of adding argument text to one pending tool call. It returns both the * next `tools` state and the updated `tool` because parsers often need the - * current id/name immediately. `event` is present only when new text arrived; - * metadata-only deltas update identity without emitting `tool-input-delta`. + * current id/name immediately. `events` contains lifecycle and delta events + * produced by the append; metadata-only deltas update identity without output. */ export interface AppendOutcome { readonly tools: State readonly tool: PendingTool - readonly event?: ToolInputDelta + readonly events: ReadonlyArray } /** Create empty accumulator state for one provider stream. */ @@ -49,7 +49,14 @@ const withoutTool = (tools: State, key: K): State => return next } -const inputDelta = (tool: PendingTool, text: string): ToolInputDelta => +const inputStart = (tool: PendingTool) => + LLMEvent.toolInputStart({ + id: tool.id, + name: tool.name, + providerMetadata: tool.providerMetadata, + }) + +const inputDelta = (tool: PendingTool, text: string) => LLMEvent.toolInputDelta({ id: tool.id, name: tool.name, @@ -76,11 +83,16 @@ const appendTool = ( key: K, tool: PendingTool, text: string, -): AppendOutcome => ({ - tools: withTool(tools, key, tool), - tool, - event: text.length === 0 ? undefined : inputDelta(tool, text), -}) +): AppendOutcome => { + const events: LLMEvent[] = [] + if (!tools[key]) events.push(inputStart(tool)) + if (text.length > 0) events.push(inputDelta(tool, text)) + return { + tools: withTool(tools, key, tool), + tool, + events, + } +} export const isError = (result: AppendOutcome | LLMError): result is LLMError => result instanceof LLMError @@ -121,7 +133,8 @@ export const appendOrStart = ( providerExecuted: current?.providerExecuted, providerMetadata: current?.providerMetadata, } - if (current && delta.text.length === 0 && current.id === id && current.name === name) return { tools, tool: current } + if (current && delta.text.length === 0 && current.id === id && current.name === name) + return { tools, tool: current, events: [] } return appendTool(tools, key, tool, delta.text) } @@ -139,7 +152,7 @@ export const appendExisting = ( ): AppendOutcome | LLMError => { const current = tools[key] if (!current) return eventError(route, missingToolMessage) - if (text.length === 0) return { tools, tool: current } + if (text.length === 0) return { tools, tool: current, events: [] } return appendTool(tools, key, { ...current, input: `${current.input}${text}` }, text) } @@ -152,7 +165,13 @@ export const finish = (route: string, tools: State, key: Effect.gen(function* () { const tool = tools[key] if (!tool) return { tools } - return { tools: withoutTool(tools, key), event: yield* toolCall(route, tool) } + return { + tools: withoutTool(tools, key), + events: [ + LLMEvent.toolInputEnd({ id: tool.id, name: tool.name, providerMetadata: tool.providerMetadata }), + yield* toolCall(route, tool), + ], + } }) /** @@ -164,7 +183,13 @@ export const finishWithInput = (route: string, tools: State Effect.gen(function* () { const tool = tools[key] if (!tool) return { tools } - return { tools: withoutTool(tools, key), event: yield* toolCall(route, tool, input) } + return { + tools: withoutTool(tools, key), + events: [ + LLMEvent.toolInputEnd({ id: tool.id, name: tool.name, providerMetadata: tool.providerMetadata }), + yield* toolCall(route, tool, input), + ], + } }) /** @@ -179,7 +204,14 @@ export const finishAll = (route: string, tools: State) = ) return { tools: empty(), - events: yield* Effect.forEach(pending, (tool) => toolCall(route, tool)), + events: yield* Effect.forEach(pending, (tool) => + toolCall(route, tool).pipe( + Effect.map((call) => [ + LLMEvent.toolInputEnd({ id: tool.id, name: tool.name, providerMetadata: tool.providerMetadata }), + call, + ]), + ), + ).pipe(Effect.map((events) => events.flat())), } }) diff --git a/packages/llm/src/schema/errors.ts b/packages/llm/src/schema/errors.ts index 9bcc8e16941c..39bf5b6252d1 100644 --- a/packages/llm/src/schema/errors.ts +++ b/packages/llm/src/schema/errors.ts @@ -198,5 +198,6 @@ export class LLMError extends Schema.TaggedErrorClass()("LLM.Error", { */ export class ToolFailure extends Schema.TaggedErrorClass()("LLM.ToolFailure", { message: Schema.String, + error: Schema.optional(Schema.Defect), metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), }) {} diff --git a/packages/llm/src/schema/events.ts b/packages/llm/src/schema/events.ts index 6e6bb1541bfd..63c9b7b7df54 100644 --- a/packages/llm/src/schema/events.ts +++ b/packages/llm/src/schema/events.ts @@ -1,5 +1,5 @@ import { Schema } from "effect" -import { ContentBlockID, FinishReason, ProtocolID, ProviderMetadata, ResponseID, RouteID, ToolCallID } from "./ids" +import { ContentBlockID, FinishReason, ProtocolID, ProviderMetadata, RouteID, ToolCallID } from "./ids" import { ModelRef } from "./options" import { ToolResultValue } from "./messages" @@ -66,14 +66,13 @@ export class Usage extends Schema.Class("LLM.Usage")({ get visibleOutputTokens() { return Math.max(0, (this.outputTokens ?? 0) - (this.reasoningTokens ?? 0)) } + + static from(input: UsageInput) { + return input instanceof Usage ? input : new Usage(input) + } } -export const RequestStart = Schema.Struct({ - type: Schema.tag("request-start"), - id: ResponseID, - model: ModelRef, -}).annotate({ identifier: "LLM.Event.RequestStart" }) -export type RequestStart = Schema.Schema.Type +export type UsageInput = Usage | ConstructorParameters[0] export const StepStart = Schema.Struct({ type: Schema.tag("step-start"), @@ -172,6 +171,7 @@ export const ToolError = Schema.Struct({ id: ToolCallID, name: Schema.String, message: Schema.String, + error: Schema.optional(Schema.Defect), providerMetadata: Schema.optional(ProviderMetadata), }).annotate({ identifier: "LLM.Event.ToolError" }) export type ToolError = Schema.Schema.Type @@ -185,13 +185,13 @@ export const StepFinish = Schema.Struct({ }).annotate({ identifier: "LLM.Event.StepFinish" }) export type StepFinish = Schema.Schema.Type -export const RequestFinish = Schema.Struct({ - type: Schema.tag("request-finish"), +export const Finish = Schema.Struct({ + type: Schema.tag("finish"), reason: FinishReason, usage: Schema.optional(Usage), providerMetadata: Schema.optional(ProviderMetadata), -}).annotate({ identifier: "LLM.Event.RequestFinish" }) -export type RequestFinish = Schema.Schema.Type +}).annotate({ identifier: "LLM.Event.Finish" }) +export type Finish = Schema.Schema.Type export const ProviderErrorEvent = Schema.Struct({ type: Schema.tag("provider-error"), @@ -202,7 +202,6 @@ export const ProviderErrorEvent = Schema.Struct({ export type ProviderErrorEvent = Schema.Schema.Type const llmEventTagged = Schema.Union([ - RequestStart, StepStart, TextStart, TextDelta, @@ -217,13 +216,15 @@ const llmEventTagged = Schema.Union([ ToolResult, ToolError, StepFinish, - RequestFinish, + Finish, ProviderErrorEvent, ]).pipe(Schema.toTaggedUnion("type")) type WithID = Omit & { readonly id: ID | string } +type WithUsage = Omit & { + readonly usage?: UsageInput +} -const responseID = (value: ResponseID | string) => ResponseID.make(value) const contentBlockID = (value: ContentBlockID | string) => ContentBlockID.make(value) const toolCallID = (value: ToolCallID | string) => ToolCallID.make(value) @@ -233,7 +234,6 @@ const toolCallID = (value: ToolCallID | string) => ToolCallID.make(value) * `events.filter(LLMEvent.guards["tool-call"])`. */ export const LLMEvent = Object.assign(llmEventTagged, { - requestStart: (input: WithID) => RequestStart.make({ ...input, id: responseID(input.id) }), stepStart: StepStart.make, textStart: (input: WithID) => TextStart.make({ ...input, id: contentBlockID(input.id) }), textDelta: (input: WithID) => TextDelta.make({ ...input, id: contentBlockID(input.id) }), @@ -252,11 +252,18 @@ export const LLMEvent = Object.assign(llmEventTagged, { toolCall: (input: WithID) => ToolCall.make({ ...input, id: toolCallID(input.id) }), toolResult: (input: WithID) => ToolResult.make({ ...input, id: toolCallID(input.id) }), toolError: (input: WithID) => ToolError.make({ ...input, id: toolCallID(input.id) }), - stepFinish: StepFinish.make, - requestFinish: RequestFinish.make, + stepFinish: (input: WithUsage) => + StepFinish.make({ + ...input, + usage: input.usage === undefined ? undefined : Usage.from(input.usage), + }), + finish: (input: WithUsage) => + Finish.make({ + ...input, + usage: input.usage === undefined ? undefined : Usage.from(input.usage), + }), providerError: ProviderErrorEvent.make, is: { - requestStart: llmEventTagged.guards["request-start"], stepStart: llmEventTagged.guards["step-start"], textStart: llmEventTagged.guards["text-start"], textDelta: llmEventTagged.guards["text-delta"], @@ -271,7 +278,7 @@ export const LLMEvent = Object.assign(llmEventTagged, { toolResult: llmEventTagged.guards["tool-result"], toolError: llmEventTagged.guards["tool-error"], stepFinish: llmEventTagged.guards["step-finish"], - requestFinish: llmEventTagged.guards["request-finish"], + finish: llmEventTagged.guards.finish, providerError: llmEventTagged.guards["provider-error"], }, }) diff --git a/packages/llm/src/tool-runtime.ts b/packages/llm/src/tool-runtime.ts index c6e716d45ee3..ef527faa21b4 100644 --- a/packages/llm/src/tool-runtime.ts +++ b/packages/llm/src/tool-runtime.ts @@ -12,6 +12,7 @@ import { ToolFailure, ToolResultPart, type ToolResultValue, + Usage, } from "./schema" import { type AnyTool, type ExecutableTools, type Tools, toDefinitions } from "./tool" @@ -72,31 +73,70 @@ export const stream = (options: StreamOptions): Stream.Strea tools: [...options.request.tools.filter((tool) => !runtimeToolNames.has(tool.name)), ...runtimeTools], }) - const loop = (request: LLMRequest, step: number): Stream.Stream => + const loop = ( + request: LLMRequest, + step: number, + usage: Usage | undefined, + providerMetadata: ProviderMetadata | undefined, + ): Stream.Stream => Stream.unwrap( Effect.gen(function* () { - const state: StepState = { assistantContent: [], toolCalls: [], finishReason: undefined } + const state: StepState = { + assistantContent: [], + toolCalls: [], + finishReason: undefined, + usage: undefined, + providerMetadata: undefined, + } const modelStream = options .stream(request) + .pipe(Stream.map((event) => indexStep(event, step))) .pipe(Stream.tap((event) => Effect.sync(() => accumulate(state, event)))) + .pipe(Stream.filter((event) => event.type !== "finish")) const continuation = Stream.unwrap( Effect.gen(function* () { - if (state.finishReason !== "tool-calls" || state.toolCalls.length === 0) return Stream.empty - if (options.toolExecution === "none") return Stream.empty + const totalUsage = addUsage(usage, state.usage) + const totalProviderMetadata = mergeProviderMetadata(providerMetadata, state.providerMetadata) + const finishStream = Stream.fromIterable([ + LLMEvent.finish({ + reason: state.finishReason ?? "unknown", + usage: totalUsage, + providerMetadata: totalProviderMetadata, + }), + ]) + + if (state.finishReason !== "tool-calls" || state.toolCalls.length === 0) return finishStream + if (options.toolExecution === "none") return finishStream const dispatched = yield* Effect.forEach( state.toolCalls, - (call) => dispatch(tools, call).pipe(Effect.map((result) => [call, result] as const)), + (call) => + dispatch(tools, call).pipe(Effect.map((result) => [call, result.result, result.error] as const)), { concurrency }, ) - const resultStream = Stream.fromIterable(dispatched.flatMap(([call, result]) => emitEvents(call, result))) + const resultStream = Stream.fromIterable( + dispatched.flatMap(([call, result, error]) => emitEvents(call, result, error)), + ) - if (!options.stopWhen) return resultStream - if (options.stopWhen({ step, request })) return resultStream + if (!options.stopWhen) return resultStream.pipe(Stream.concat(finishStream)) + if (options.stopWhen({ step, request })) return resultStream.pipe(Stream.concat(finishStream)) - return resultStream.pipe(Stream.concat(loop(followUpRequest(request, state, dispatched), step + 1))) + return resultStream.pipe( + Stream.concat( + loop( + followUpRequest( + request, + state, + dispatched.map(([call, result]) => [call, result] as const), + ), + step + 1, + totalUsage, + totalProviderMetadata, + ), + ), + ) }), ) @@ -104,13 +144,21 @@ export const stream = (options: StreamOptions): Stream.Strea }), ) - return loop(initialRequest, 0) + return loop(initialRequest, 0, undefined, undefined) +} + +const indexStep = (event: LLMEvent, index: number): LLMEvent => { + if (event.type === "step-start") return LLMEvent.stepStart({ index }) + if (event.type === "step-finish") return LLMEvent.stepFinish({ ...event, index }) + return event } interface StepState { assistantContent: ContentPart[] toolCalls: ToolCallPart[] finishReason: FinishReason | undefined + usage: Usage | undefined + providerMetadata: ProviderMetadata | undefined } const accumulate = (state: StepState, event: LLMEvent) => { @@ -154,11 +202,45 @@ const accumulate = (state: StepState, event: LLMEvent) => { ) return } - if (event.type === "request-finish") { - state.finishReason = event.reason + if (event.type === "step-finish") { + state.finishReason = event.reason === "stop" && state.toolCalls.length > 0 ? "tool-calls" : event.reason + state.usage = addUsage(state.usage, event.usage) + state.providerMetadata = mergeProviderMetadata(state.providerMetadata, event.providerMetadata) + return + } + if (event.type === "finish") { + state.finishReason ??= event.reason + state.usage ??= event.usage + state.providerMetadata = mergeProviderMetadata(state.providerMetadata, event.providerMetadata) } } +const addUsage = (left: Usage | undefined, right: Usage | undefined) => { + if (!left) return right + if (!right) return left + type UsageKey = + | "inputTokens" + | "outputTokens" + | "nonCachedInputTokens" + | "cacheReadInputTokens" + | "cacheWriteInputTokens" + | "reasoningTokens" + | "totalTokens" + const sum = (key: UsageKey) => + left[key] === undefined && right[key] === undefined ? undefined : (left[key] ?? 0) + (right[key] ?? 0) + + return new Usage({ + inputTokens: sum("inputTokens"), + outputTokens: sum("outputTokens"), + nonCachedInputTokens: sum("nonCachedInputTokens"), + cacheReadInputTokens: sum("cacheReadInputTokens"), + cacheWriteInputTokens: sum("cacheWriteInputTokens"), + reasoningTokens: sum("reasoningTokens"), + totalTokens: sum("totalTokens"), + providerMetadata: mergeProviderMetadata(left.providerMetadata, right.providerMetadata), + }) +} + const sameProviderMetadata = (left: ProviderMetadata | undefined, right: ProviderMetadata | undefined) => left === right || JSON.stringify(left) === JSON.stringify(right) @@ -194,23 +276,27 @@ const appendStreamingText = ( state.assistantContent.push({ type, text, providerMetadata }) } -const dispatch = (tools: Tools, call: ToolCallPart): Effect.Effect => { +const dispatch = (tools: Tools, call: ToolCallPart): Effect.Effect<{ result: ToolResultValue; error?: unknown }> => { const tool = tools[call.name] - if (!tool) return Effect.succeed({ type: "error" as const, value: `Unknown tool: ${call.name}` }) + if (!tool) return Effect.succeed({ result: { type: "error" as const, value: `Unknown tool: ${call.name}` } }) if (!tool.execute) - return Effect.succeed({ type: "error" as const, value: `Tool has no execute handler: ${call.name}` }) + return Effect.succeed({ result: { type: "error" as const, value: `Tool has no execute handler: ${call.name}` } }) - return decodeAndExecute(tool, call.input).pipe( + return decodeAndExecute(tool, call).pipe( Effect.catchTag("LLM.ToolFailure", (failure) => - Effect.succeed({ type: "error" as const, value: failure.message } satisfies ToolResultValue), + Effect.succeed({ + result: { type: "error" as const, value: failure.message } satisfies ToolResultValue, + error: failure.error, + }), ), + Effect.map((result) => ("result" in result ? result : { result })), ) } -const decodeAndExecute = (tool: AnyTool, input: unknown): Effect.Effect => - tool._decode(input).pipe( +const decodeAndExecute = (tool: AnyTool, call: ToolCallPart): Effect.Effect => + tool._decode(call.input).pipe( Effect.mapError((error) => new ToolFailure({ message: `Invalid tool input: ${error.message}` })), - Effect.flatMap((decoded) => tool.execute!(decoded)), + Effect.flatMap((decoded) => tool.execute!(decoded, { id: call.id, name: call.name })), Effect.flatMap((value) => tool._encode(value).pipe( Effect.mapError( @@ -224,10 +310,10 @@ const decodeAndExecute = (tool: AnyTool, input: unknown): Effect.Effect ({ type: "json", value: encoded })), ) -const emitEvents = (call: ToolCallPart, result: ToolResultValue): ReadonlyArray => +const emitEvents = (call: ToolCallPart, result: ToolResultValue, error: unknown): ReadonlyArray => result.type === "error" ? [ - LLMEvent.toolError({ id: call.id, name: call.name, message: String(result.value) }), + LLMEvent.toolError({ id: call.id, name: call.name, message: String(result.value), error }), LLMEvent.toolResult({ id: call.id, name: call.name, result }), ] : [LLMEvent.toolResult({ id: call.id, name: call.name, result })] diff --git a/packages/llm/src/tool.ts b/packages/llm/src/tool.ts index 311c8798b6fa..df0a1cd3d324 100644 --- a/packages/llm/src/tool.ts +++ b/packages/llm/src/tool.ts @@ -1,5 +1,5 @@ import { Effect, JsonSchema, Schema } from "effect" -import type { ToolDefinition as ToolDefinitionClass } from "./schema" +import type { ToolCallPart, ToolDefinition as ToolDefinitionClass } from "./schema" import { ToolDefinition, ToolFailure } from "./schema" /** @@ -8,9 +8,14 @@ import { ToolDefinition, ToolFailure } from "./schema" * beyond pure data conversion belongs in the handler closure. */ export type ToolSchema = Schema.Codec +export interface ToolExecuteContext { + readonly id: ToolCallPart["id"] + readonly name: ToolCallPart["name"] +} export type ToolExecute, Success extends ToolSchema> = ( params: Schema.Schema.Type, + context?: ToolExecuteContext, ) => Effect.Effect, ToolFailure> /** @@ -61,7 +66,7 @@ type TypedToolConfig = { type DynamicToolConfig = { readonly description: string readonly jsonSchema: JsonSchema.JsonSchema - readonly execute?: (params: unknown) => Effect.Effect + readonly execute?: (params: unknown, context?: ToolExecuteContext) => Effect.Effect } /** @@ -110,7 +115,7 @@ export function make, Success extends ToolSch export function make(config: { readonly description: string readonly jsonSchema: JsonSchema.JsonSchema - readonly execute: (params: unknown) => Effect.Effect + readonly execute: (params: unknown, context?: ToolExecuteContext) => Effect.Effect }): AnyExecutableTool export function make(config: { readonly description: string diff --git a/packages/llm/test/adapter.test.ts b/packages/llm/test/adapter.test.ts index 5ac8b9d818fd..80349a5ae5a6 100644 --- a/packages/llm/test/adapter.test.ts +++ b/packages/llm/test/adapter.test.ts @@ -51,7 +51,7 @@ const request = LLM.request({ const raiseEvent = (event: FakeEvent): import("../src/schema").LLMEvent => event.type === "finish" - ? { type: "request-finish", reason: event.reason } + ? { type: "finish", reason: event.reason } : { type: "text-delta", id: "text-0", text: event.text } const fakeProtocol = Protocol.make({ @@ -112,8 +112,8 @@ describe("llm route", () => { const events = Array.from(yield* llm.stream(request).pipe(Stream.runCollect)) const response = yield* llm.generate(request) - expect(events.map((event) => event.type)).toEqual(["text-delta", "request-finish"]) - expect(response.events.map((event) => event.type)).toEqual(["text-delta", "request-finish"]) + expect(events.map((event) => event.type)).toEqual(["text-delta", "finish"]) + expect(response.events.map((event) => event.type)).toEqual(["text-delta", "finish"]) }), ) diff --git a/packages/llm/test/llm.test.ts b/packages/llm/test/llm.test.ts index c01fe33b2906..a20c48411eb2 100644 --- a/packages/llm/test/llm.test.ts +++ b/packages/llm/test/llm.test.ts @@ -127,7 +127,7 @@ describe("llm constructors", () => { LLMResponse.text({ events: [ { type: "text-delta", id: "text-0", text: "hi" }, - { type: "request-finish", reason: "stop" }, + { type: "finish", reason: "stop" }, ], }), ).toBe("hi") diff --git a/packages/llm/test/provider/anthropic-messages.test.ts b/packages/llm/test/provider/anthropic-messages.test.ts index 0df3541d58de..71204bcd6399 100644 --- a/packages/llm/test/provider/anthropic-messages.test.ts +++ b/packages/llm/test/provider/anthropic-messages.test.ts @@ -124,7 +124,7 @@ describe("Anthropic Messages route", () => { providerMetadata: { anthropic: { signature: "sig_1" } }, }) expect(response.events.at(-1)).toMatchObject({ - type: "request-finish", + type: "finish", reason: "stop", providerMetadata: { anthropic: { stopSequence: "\n\nHuman:" } }, }) @@ -146,24 +146,46 @@ describe("Anthropic Messages route", () => { tools: [{ name: "lookup", description: "Lookup data", inputSchema: { type: "object" } }], }), ).pipe(Effect.provide(fixedResponse(body))) + const usage = new Usage({ + inputTokens: 5, + outputTokens: 1, + nonCachedInputTokens: 5, + cacheReadInputTokens: undefined, + cacheWriteInputTokens: undefined, + totalTokens: 6, + providerMetadata: { anthropic: { input_tokens: 5, output_tokens: 1 } }, + }) expect(response.toolCalls).toEqual([ - { type: "tool-call", id: "call_1", name: "lookup", input: { query: "weather" } }, + { + type: "tool-call", + id: "call_1", + name: "lookup", + input: { query: "weather" }, + providerExecuted: undefined, + providerMetadata: undefined, + }, ]) expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { type: "tool-input-start", id: "call_1", name: "lookup" }, { type: "tool-input-delta", id: "call_1", name: "lookup", text: '{"query"' }, { type: "tool-input-delta", id: "call_1", name: "lookup", text: ':"weather"}' }, - { type: "tool-call", id: "call_1", name: "lookup", input: { query: "weather" } }, + { type: "tool-input-end", id: "call_1", name: "lookup", providerMetadata: undefined }, { - type: "request-finish", + type: "tool-call", + id: "call_1", + name: "lookup", + input: { query: "weather" }, + providerExecuted: undefined, + providerMetadata: undefined, + }, + { type: "step-finish", index: 0, reason: "tool-calls", usage, providerMetadata: undefined }, + { + type: "finish", reason: "tool-calls", - usage: new Usage({ - inputTokens: 5, - outputTokens: 1, - nonCachedInputTokens: 5, - totalTokens: 6, - providerMetadata: { anthropic: { input_tokens: 5, output_tokens: 1 } }, - }), + providerMetadata: undefined, + usage, }, ]) }), @@ -253,7 +275,7 @@ describe("Anthropic Messages route", () => { providerMetadata: { anthropic: { blockType: "web_search_tool_result" } }, }) expect(response.text).toBe("Found it.") - expect(response.events.at(-1)).toMatchObject({ type: "request-finish", reason: "stop" }) + expect(response.events.at(-1)).toMatchObject({ type: "finish", reason: "stop" }) }), ) diff --git a/packages/llm/test/provider/bedrock-converse.test.ts b/packages/llm/test/provider/bedrock-converse.test.ts index 7d1ad3f30954..ffdd6e800824 100644 --- a/packages/llm/test/provider/bedrock-converse.test.ts +++ b/packages/llm/test/provider/bedrock-converse.test.ts @@ -169,12 +169,12 @@ describe("Bedrock Converse route", () => { const response = yield* LLMClient.generate(baseRequest).pipe(Effect.provide(fixedBytes(body))) expect(response.text).toBe("Hello!") - const finishes = response.events.filter((event) => event.type === "request-finish") + const finishes = response.events.filter((event) => event.type === "finish") // Bedrock splits the finish across `messageStop` (carries reason) and // `metadata` (carries usage). We consolidate them into a single - // terminal `request-finish` event with both. + // terminal `finish` event with both. expect(finishes).toHaveLength(1) - expect(finishes[0]).toMatchObject({ type: "request-finish", reason: "stop" }) + expect(finishes[0]).toMatchObject({ type: "finish", reason: "stop" }) expect(response.usage).toMatchObject({ inputTokens: 5, outputTokens: 2, @@ -213,7 +213,7 @@ describe("Bedrock Converse route", () => { { type: "tool-input-delta", id: "tool_1", name: "lookup", text: '{"query"' }, { type: "tool-input-delta", id: "tool_1", name: "lookup", text: ':"weather"}' }, ]) - expect(response.events.at(-1)).toMatchObject({ type: "request-finish", reason: "tool-calls" }) + expect(response.events.at(-1)).toMatchObject({ type: "finish", reason: "tool-calls" }) }), ) diff --git a/packages/llm/test/provider/gemini.test.ts b/packages/llm/test/provider/gemini.test.ts index ea4eadc4989f..7e6bbc8466db 100644 --- a/packages/llm/test/provider/gemini.test.ts +++ b/packages/llm/test/provider/gemini.test.ts @@ -204,30 +204,37 @@ describe("Gemini route", () => { reasoningTokens: 1, totalTokens: 7, }) + const usage = new Usage({ + inputTokens: 5, + outputTokens: 3, + nonCachedInputTokens: 4, + cacheReadInputTokens: 1, + reasoningTokens: 1, + totalTokens: 7, + providerMetadata: { + google: { + promptTokenCount: 5, + candidatesTokenCount: 2, + totalTokenCount: 7, + thoughtsTokenCount: 1, + cachedContentTokenCount: 1, + }, + }, + }) expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { type: "reasoning-start", id: "reasoning-0" }, { type: "reasoning-delta", id: "reasoning-0", text: "thinking" }, + { type: "text-start", id: "text-0" }, { type: "text-delta", id: "text-0", text: "Hello" }, { type: "text-delta", id: "text-0", text: "!" }, + { type: "reasoning-end", id: "reasoning-0" }, + { type: "text-end", id: "text-0" }, + { type: "step-finish", index: 0, reason: "stop", usage, providerMetadata: undefined }, { - type: "request-finish", + type: "finish", reason: "stop", - usage: new Usage({ - inputTokens: 5, - outputTokens: 3, - nonCachedInputTokens: 4, - cacheReadInputTokens: 1, - reasoningTokens: 1, - totalTokens: 7, - providerMetadata: { - google: { - promptTokenCount: 5, - candidatesTokenCount: 2, - totalTokenCount: 7, - thoughtsTokenCount: 1, - cachedContentTokenCount: 1, - }, - }, - }), + usage, }, ]) }), @@ -252,22 +259,41 @@ describe("Gemini route", () => { tools: [{ name: "lookup", description: "Lookup data", inputSchema: { type: "object" } }], }), ).pipe(Effect.provide(fixedResponse(body))) + const usage = new Usage({ + inputTokens: 5, + outputTokens: 1, + nonCachedInputTokens: 5, + cacheReadInputTokens: undefined, + reasoningTokens: undefined, + totalTokens: 6, + providerMetadata: { google: { promptTokenCount: 5, candidatesTokenCount: 1 } }, + }) expect(response.toolCalls).toEqual([ - { type: "tool-call", id: "tool_0", name: "lookup", input: { query: "weather" } }, + { + type: "tool-call", + id: "tool_0", + name: "lookup", + input: { query: "weather" }, + providerExecuted: undefined, + providerMetadata: undefined, + }, ]) expect(response.events).toEqual([ - { type: "tool-call", id: "tool_0", name: "lookup", input: { query: "weather" } }, + { type: "step-start", index: 0 }, + { + type: "tool-call", + id: "tool_0", + name: "lookup", + input: { query: "weather" }, + providerExecuted: undefined, + providerMetadata: undefined, + }, + { type: "step-finish", index: 0, reason: "tool-calls", usage, providerMetadata: undefined }, { - type: "request-finish", + type: "finish", reason: "tool-calls", - usage: new Usage({ - inputTokens: 5, - outputTokens: 1, - nonCachedInputTokens: 5, - totalTokens: 6, - providerMetadata: { google: { promptTokenCount: 5, candidatesTokenCount: 1 } }, - }), + usage, }, ]) }), @@ -299,7 +325,7 @@ describe("Gemini route", () => { { type: "tool-call", id: "tool_0", name: "lookup", input: { query: "weather" } }, { type: "tool-call", id: "tool_1", name: "lookup", input: { query: "news" } }, ]) - expect(response.events.at(-1)).toMatchObject({ type: "request-finish", reason: "tool-calls" }) + expect(response.events.at(-1)).toMatchObject({ type: "finish", reason: "tool-calls" }) }), ) @@ -318,8 +344,10 @@ describe("Gemini route", () => { ), ) - expect(length.events).toEqual([{ type: "request-finish", reason: "length" }]) - expect(filtered.events).toEqual([{ type: "request-finish", reason: "content-filter" }]) + expect(length.events.map((event) => event.type)).toEqual(["step-start", "step-finish", "finish"]) + expect(length.events.at(-1)).toMatchObject({ type: "finish", reason: "length" }) + expect(filtered.events.map((event) => event.type)).toEqual(["step-start", "step-finish", "finish"]) + expect(filtered.events.at(-1)).toMatchObject({ type: "finish", reason: "content-filter" }) }), ) diff --git a/packages/llm/test/provider/openai-chat.test.ts b/packages/llm/test/provider/openai-chat.test.ts index 9c814226396d..4303a69ffa5c 100644 --- a/packages/llm/test/provider/openai-chat.test.ts +++ b/packages/llm/test/provider/openai-chat.test.ts @@ -222,31 +222,36 @@ describe("OpenAI Chat route", () => { }), ) const response = yield* LLMClient.generate(request).pipe(Effect.provide(fixedResponse(body))) + const usage = new Usage({ + inputTokens: 5, + outputTokens: 2, + nonCachedInputTokens: 4, + cacheReadInputTokens: 1, + reasoningTokens: 0, + totalTokens: 7, + providerMetadata: { + openai: { + prompt_tokens: 5, + completion_tokens: 2, + total_tokens: 7, + prompt_tokens_details: { cached_tokens: 1 }, + completion_tokens_details: { reasoning_tokens: 0 }, + }, + }, + }) expect(response.text).toBe("Hello!") expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { type: "text-start", id: "text-0" }, { type: "text-delta", id: "text-0", text: "Hello" }, { type: "text-delta", id: "text-0", text: "!" }, + { type: "text-end", id: "text-0" }, + { type: "step-finish", index: 0, reason: "stop", usage, providerMetadata: undefined }, { - type: "request-finish", + type: "finish", reason: "stop", - usage: new Usage({ - inputTokens: 5, - outputTokens: 2, - nonCachedInputTokens: 4, - cacheReadInputTokens: 1, - reasoningTokens: 0, - totalTokens: 7, - providerMetadata: { - openai: { - prompt_tokens: 5, - completion_tokens: 2, - total_tokens: 7, - prompt_tokens_details: { cached_tokens: 1 }, - completion_tokens_details: { reasoning_tokens: 0 }, - }, - }, - }), + usage, }, ]) }), @@ -269,10 +274,21 @@ describe("OpenAI Chat route", () => { ).pipe(Effect.provide(fixedResponse(body))) expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { type: "tool-input-start", id: "call_1", name: "lookup", providerMetadata: undefined }, { type: "tool-input-delta", id: "call_1", name: "lookup", text: '{"query"' }, { type: "tool-input-delta", id: "call_1", name: "lookup", text: ':"weather"}' }, - { type: "tool-call", id: "call_1", name: "lookup", input: { query: "weather" } }, - { type: "request-finish", reason: "tool-calls", usage: undefined }, + { type: "tool-input-end", id: "call_1", name: "lookup", providerMetadata: undefined }, + { + type: "tool-call", + id: "call_1", + name: "lookup", + input: { query: "weather" }, + providerExecuted: undefined, + providerMetadata: undefined, + }, + { type: "step-finish", index: 0, reason: "tool-calls", usage: undefined, providerMetadata: undefined }, + { type: "finish", reason: "tool-calls", usage: undefined }, ]) }), ) @@ -293,6 +309,8 @@ describe("OpenAI Chat route", () => { ).pipe(Effect.provide(fixedResponse(body))) expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { type: "tool-input-start", id: "call_1", name: "lookup", providerMetadata: undefined }, { type: "tool-input-delta", id: "call_1", name: "lookup", text: '{"query"' }, { type: "tool-input-delta", id: "call_1", name: "lookup", text: ':"weather"}' }, ]) @@ -352,7 +370,7 @@ describe("OpenAI Chat route", () => { const events = Array.from( yield* LLMClient.stream(request).pipe(Stream.take(1), Stream.runCollect, Effect.provide(fixedResponse(body))), ) - expect(events.map((event) => event.type)).toEqual(["text-delta"]) + expect(events.map((event) => event.type)).toEqual(["step-start"]) }), ) }) diff --git a/packages/llm/test/provider/openai-compatible-chat.test.ts b/packages/llm/test/provider/openai-compatible-chat.test.ts index 7759ff7202a0..50aac4109145 100644 --- a/packages/llm/test/provider/openai-compatible-chat.test.ts +++ b/packages/llm/test/provider/openai-compatible-chat.test.ts @@ -231,7 +231,7 @@ describe("OpenAI-compatible Chat route", () => { expect(response.text).toBe("Hello!") expect(response.usage).toMatchObject({ inputTokens: 5, outputTokens: 2, totalTokens: 7 }) - expect(response.events.at(-1)).toMatchObject({ type: "request-finish", reason: "stop" }) + expect(response.events.at(-1)).toMatchObject({ type: "finish", reason: "stop" }) }), ) }) diff --git a/packages/llm/test/provider/openai-responses.test.ts b/packages/llm/test/provider/openai-responses.test.ts index da9dbd82c22f..63452f61b0a6 100644 --- a/packages/llm/test/provider/openai-responses.test.ts +++ b/packages/llm/test/provider/openai-responses.test.ts @@ -333,32 +333,43 @@ describe("OpenAI Responses route", () => { }, ) const response = yield* LLMClient.generate(request).pipe(Effect.provide(fixedResponse(body))) + const usage = new Usage({ + inputTokens: 5, + outputTokens: 2, + nonCachedInputTokens: 4, + cacheReadInputTokens: 1, + reasoningTokens: 0, + totalTokens: 7, + providerMetadata: { + openai: { + input_tokens: 5, + output_tokens: 2, + total_tokens: 7, + input_tokens_details: { cached_tokens: 1 }, + output_tokens_details: { reasoning_tokens: 0 }, + }, + }, + }) expect(response.text).toBe("Hello!") expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { type: "text-start", id: "msg_1" }, { type: "text-delta", id: "msg_1", text: "Hello" }, { type: "text-delta", id: "msg_1", text: "!" }, + { type: "text-end", id: "msg_1" }, { - type: "request-finish", + type: "step-finish", + index: 0, reason: "stop", providerMetadata: { openai: { responseId: "resp_1", serviceTier: "default" } }, - usage: new Usage({ - inputTokens: 5, - outputTokens: 2, - nonCachedInputTokens: 4, - cacheReadInputTokens: 1, - reasoningTokens: 0, - totalTokens: 7, - providerMetadata: { - openai: { - input_tokens: 5, - output_tokens: 2, - total_tokens: 7, - input_tokens_details: { cached_tokens: 1 }, - output_tokens_details: { reasoning_tokens: 0 }, - }, - }, - }), + usage, + }, + { + type: "finish", + reason: "stop", + providerMetadata: { openai: { responseId: "resp_1", serviceTier: "default" } }, + usage, }, ]) }), @@ -390,8 +401,24 @@ describe("OpenAI Responses route", () => { tools: [{ name: "lookup", description: "Lookup data", inputSchema: { type: "object" } }], }), ).pipe(Effect.provide(fixedResponse(body))) + const usage = new Usage({ + inputTokens: 5, + outputTokens: 1, + nonCachedInputTokens: 5, + cacheReadInputTokens: undefined, + reasoningTokens: undefined, + totalTokens: 6, + providerMetadata: { openai: { input_tokens: 5, output_tokens: 1 } }, + }) expect(response.events).toEqual([ + { type: "step-start", index: 0 }, + { + type: "tool-input-start", + id: "call_1", + name: "lookup", + providerMetadata: { openai: { itemId: "item_1" } }, + }, { type: "tool-input-delta", id: "call_1", @@ -404,23 +431,26 @@ describe("OpenAI Responses route", () => { name: "lookup", text: ':"weather"}', }, + { + type: "tool-input-end", + id: "call_1", + name: "lookup", + providerMetadata: { openai: { itemId: "item_1" } }, + }, { type: "tool-call", id: "call_1", name: "lookup", input: { query: "weather" }, + providerExecuted: undefined, providerMetadata: { openai: { itemId: "item_1" } }, }, + { type: "step-finish", index: 0, reason: "tool-calls", usage, providerMetadata: undefined }, { - type: "request-finish", + type: "finish", reason: "tool-calls", - usage: new Usage({ - inputTokens: 5, - outputTokens: 1, - nonCachedInputTokens: 5, - totalTokens: 6, - providerMetadata: { openai: { input_tokens: 5, output_tokens: 1 } }, - }), + providerMetadata: undefined, + usage, }, ]) }), diff --git a/packages/llm/test/recorded-scenarios.ts b/packages/llm/test/recorded-scenarios.ts index bdba8580fd74..3af7a7760886 100644 --- a/packages/llm/test/recorded-scenarios.ts +++ b/packages/llm/test/recorded-scenarios.ts @@ -120,8 +120,8 @@ export const runWeatherToolLoop = (request: LLMRequest) => export const expectFinish = ( events: ReadonlyArray, - reason: Extract["reason"], -) => expect(events.at(-1)).toMatchObject({ type: "request-finish", reason }) + reason: Extract["reason"], +) => expect(events.at(-1)).toMatchObject({ type: "finish", reason }) export const expectWeatherToolCall = (response: LLMResponse) => expect(response.toolCalls).toMatchObject([ @@ -129,10 +129,12 @@ export const expectWeatherToolCall = (response: LLMResponse) => ]) export const expectWeatherToolLoop = (events: ReadonlyArray) => { - const finishes = events.filter(LLMEvent.is.requestFinish) - expect(finishes).toHaveLength(2) - expect(finishes[0]?.reason).toBe("tool-calls") - expect(finishes.at(-1)?.reason).toBe("stop") + const finishes = events.filter(LLMEvent.is.finish) + expect(finishes).toHaveLength(1) + expect(finishes[0]?.reason).toBe("stop") + + const stepFinishes = events.filter(LLMEvent.is.stepFinish) + expect(stepFinishes.map((event) => event.reason)).toEqual(["tool-calls", "stop"]) const toolCalls = events.filter(LLMEvent.is.toolCall) expect(toolCalls).toHaveLength(1) @@ -272,7 +274,7 @@ export const eventSummary = (events: ReadonlyArray) => { summary.push({ type: "tool-error", name: event.name, message: event.message }) continue } - if (event.type === "request-finish") { + if (event.type === "finish") { summary.push({ type: "finish", reason: event.reason, usage: usageSummary(event.usage) }) } } diff --git a/packages/llm/test/schema.test.ts b/packages/llm/test/schema.test.ts index 23bd9fd9bb67..01d6fadd9f54 100644 --- a/packages/llm/test/schema.test.ts +++ b/packages/llm/test/schema.test.ts @@ -44,6 +44,11 @@ describe("llm schema", () => { expect(() => Schema.decodeUnknownSync(LLMEvent)({ type: "bogus" })).toThrow() }) + test("finish constructors accept usage input", () => { + expect(LLMEvent.stepFinish({ index: 0, reason: "stop", usage: { inputTokens: 1 } }).usage).toBeInstanceOf(Usage) + expect(LLMEvent.finish({ reason: "stop", usage: { outputTokens: 2 } }).usage).toBeInstanceOf(Usage) + }) + test("content part tagged union exposes guards", () => { expect(ContentPart.guards.text({ type: "text", text: "hi" })).toBe(true) expect(ContentPart.guards.media({ type: "text", text: "hi" })).toBe(false) diff --git a/packages/llm/test/tool-runtime.test.ts b/packages/llm/test/tool-runtime.test.ts index 8f4221784d5a..81389a466b29 100644 --- a/packages/llm/test/tool-runtime.test.ts +++ b/packages/llm/test/tool-runtime.test.ts @@ -4,7 +4,8 @@ import { GenerationOptions, LLM, LLMEvent, LLMRequest, LLMResponse, ToolChoice } import { LLMClient } from "../src/route" import * as AnthropicMessages from "../src/protocols/anthropic-messages" import * as OpenAIChat from "../src/protocols/openai-chat" -import { tool, ToolFailure } from "../src/tool" +import { tool, ToolFailure, type ToolExecuteContext } from "../src/tool" +import { ToolRuntime } from "../src/tool-runtime" import { it } from "./lib/effect" import * as TestToolRuntime from "./lib/tool-runtime" import { dynamicResponse, scriptedResponses } from "./lib/http" @@ -24,6 +25,7 @@ const baseRequest = LLM.request({ model, prompt: "Use the tool.", }) +const weatherFailureCause = new Error("weather lookup denied") const get_weather = tool({ description: "Get current weather for a city.", @@ -31,7 +33,8 @@ const get_weather = tool({ success: Schema.Struct({ temperature: Schema.Number, condition: Schema.String }), execute: ({ city }) => Effect.gen(function* () { - if (city === "FAIL") return yield* new ToolFailure({ message: `Weather lookup failed for ${city}` }) + if (city === "FAIL") + return yield* new ToolFailure({ message: `Weather lookup failed for ${city}`, error: weatherFailureCause }) return { temperature: 22, condition: "sunny" } }), }) @@ -84,23 +87,27 @@ describe("LLMClient tools", () => { tools: { get_weather }, }).pipe(Stream.runCollect, Effect.provide(layer)) - const second = bodies[1] as { - readonly messages?: ReadonlyArray> - readonly tools?: ReadonlyArray - readonly tool_choice?: unknown - readonly max_tokens?: unknown - } - - expect(second.max_tokens).toBe(50) - expect(second.tool_choice).toBe("auto") - expect(second.tools).toHaveLength(1) - expect(second.messages?.map((message) => message.role)).toEqual(["user", "assistant", "tool"]) - expect(second.messages?.[1]).toMatchObject({ + const second = bodies[1] + if (!second || typeof second !== "object") throw new Error("Expected second request body") + const messages = Reflect.get(second, "messages") + const tools = Reflect.get(second, "tools") + + expect(Reflect.get(second, "max_tokens")).toBe(50) + expect(Reflect.get(second, "tool_choice")).toBe("auto") + expect(tools).toHaveLength(1) + expect( + Array.isArray(messages) + ? messages.map((message) => + message && typeof message === "object" ? Reflect.get(message, "role") : undefined, + ) + : undefined, + ).toEqual(["user", "assistant", "tool"]) + expect(Array.isArray(messages) ? messages[1] : undefined).toMatchObject({ role: "assistant", content: null, tool_calls: [{ id: "call_1", type: "function", function: { name: "get_weather" } }], }) - expect(second.messages?.[2]).toMatchObject({ + expect(Array.isArray(messages) ? messages[2] : undefined).toMatchObject({ role: "tool", tool_call_id: "call_1", content: '{"temperature":22,"condition":"sunny"}', @@ -129,7 +136,7 @@ describe("LLMClient tools", () => { name: "get_weather", result: { type: "json", value: { temperature: 22, condition: "sunny" } }, }) - expect(events.at(-1)?.type).toBe("request-finish") + expect(events.at(-1)?.type).toBe("finish") expect(LLMResponse.text({ events })).toBe("It's sunny in Paris.") }), ) @@ -148,11 +155,40 @@ describe("LLMClient tools", () => { ), ) - expect(events.filter(LLMEvent.is.requestFinish)).toHaveLength(1) + expect(events.filter(LLMEvent.is.finish)).toHaveLength(1) expect(events.find(LLMEvent.is.toolResult)).toMatchObject({ type: "tool-result", id: "call_1" }) }), ) + it.effect("passes tool call context to execute", () => + Effect.gen(function* () { + let context: ToolExecuteContext | undefined + const contextual = tool({ + description: "Capture tool context.", + parameters: Schema.Struct({ value: Schema.String }), + success: Schema.Struct({ ok: Schema.Boolean }), + execute: (_params, ctx) => + Effect.sync(() => { + context = ctx + return { ok: true } + }), + }) + const events = Array.from( + yield* TestToolRuntime.runTools({ request: baseRequest, tools: { contextual } }).pipe( + Stream.runCollect, + Effect.provide( + scriptedResponses([ + sseEvents(toolCallChunk("call_ctx", "contextual", '{"value":"x"}'), finishChunk("tool_calls")), + ]), + ), + ), + ) + + expect(events.some(LLMEvent.is.toolResult)).toBe(true) + expect(context).toEqual({ id: "call_ctx", name: "contextual" }) + }), + ) + it.effect("can expose tool schemas without executing tool calls", () => Effect.gen(function* () { const layer = scriptedResponses([ @@ -297,6 +333,7 @@ describe("LLMClient tools", () => { const toolError = events.find(LLMEvent.is.toolError) expect(toolError).toMatchObject({ type: "tool-error", id: "call_1", name: "get_weather" }) expect(toolError?.message).toBe("Weather lookup failed for FAIL") + expect(toolError?.error).toBe(weatherFailureCause) }), ) @@ -313,7 +350,14 @@ describe("LLMClient tools", () => { ), ) - expect(events.map((event) => event.type)).toEqual(["text-delta", "request-finish"]) + expect(events.map((event) => event.type)).toEqual([ + "step-start", + "text-start", + "text-delta", + "text-end", + "step-finish", + "finish", + ]) expect(LLMResponse.text({ events })).toBe("Done.") }), ) @@ -336,7 +380,57 @@ describe("LLMClient tools", () => { ), ) - expect(events.filter(LLMEvent.is.requestFinish)).toHaveLength(2) + expect(events.filter(LLMEvent.is.finish)).toHaveLength(1) + expect(events.filter(LLMEvent.is.stepStart).map((event) => event.index)).toEqual([0, 1]) + expect(events.filter(LLMEvent.is.stepFinish).map((event) => event.index)).toEqual([0, 1]) + }), + ) + + it.effect("emits one final finish with aggregate usage", () => + Effect.gen(function* () { + let calls = 0 + const events = Array.from( + yield* ToolRuntime.stream({ + request: baseRequest, + tools: { get_weather }, + stopWhen: ToolRuntime.stepCountIs(2), + stream: () => + Stream.fromIterable( + calls++ === 0 + ? [ + LLMEvent.stepStart({ index: 0 }), + LLMEvent.toolCall({ id: "call_1", name: "get_weather", input: { city: "Paris" } }), + LLMEvent.stepFinish({ + index: 0, + reason: "tool-calls", + usage: { inputTokens: 1, outputTokens: 2, totalTokens: 3 }, + }), + LLMEvent.finish({ + reason: "tool-calls", + usage: { inputTokens: 1, outputTokens: 2, totalTokens: 3 }, + }), + ] + : [ + LLMEvent.stepStart({ index: 0 }), + LLMEvent.textDelta({ id: "text_1", text: "Done." }), + LLMEvent.stepFinish({ + index: 0, + reason: "stop", + usage: { inputTokens: 4, outputTokens: 5, totalTokens: 9 }, + }), + LLMEvent.finish({ reason: "stop", usage: { inputTokens: 4, outputTokens: 5, totalTokens: 9 } }), + ], + ), + }).pipe(Stream.runCollect), + ) + + expect(events.filter(LLMEvent.is.stepFinish).map((event) => event.index)).toEqual([0, 1]) + expect(events.filter(LLMEvent.is.finish)).toHaveLength(1) + expect(events.find(LLMEvent.is.finish)?.usage).toMatchObject({ + inputTokens: 5, + outputTokens: 7, + totalTokens: 12, + }) }), ) @@ -355,7 +449,7 @@ describe("LLMClient tools", () => { }).pipe(Stream.runCollect, Effect.provide(layer)), ) - expect(events.filter(LLMEvent.is.requestFinish)).toHaveLength(1) + expect(events.filter(LLMEvent.is.finish)).toHaveLength(1) expect(events.find(LLMEvent.is.toolResult)).toMatchObject({ type: "tool-result", id: "call_1" }) }), ) diff --git a/packages/llm/test/tool-stream.test.ts b/packages/llm/test/tool-stream.test.ts index 04a0035c993f..b005d2666c8f 100644 --- a/packages/llm/test/tool-stream.test.ts +++ b/packages/llm/test/tool-stream.test.ts @@ -21,11 +21,17 @@ describe("ToolStream", () => { if (ToolStream.isError(second)) return yield* second const finished = yield* ToolStream.finish(ADAPTER, second.tools, 0) - expect(first.event).toEqual({ type: "tool-input-delta", id: "call_1", name: "lookup", text: '{"query"' }) - expect(second.event).toEqual({ type: "tool-input-delta", id: "call_1", name: "lookup", text: ':"weather"}' }) + expect(first.events).toEqual([ + { type: "tool-input-start", id: "call_1", name: "lookup" }, + { type: "tool-input-delta", id: "call_1", name: "lookup", text: '{"query"' }, + ]) + expect(second.events).toEqual([{ type: "tool-input-delta", id: "call_1", name: "lookup", text: ':"weather"}' }]) expect(finished).toEqual({ tools: {}, - event: { type: "tool-call", id: "call_1", name: "lookup", input: { query: "weather" } }, + events: [ + { type: "tool-input-end", id: "call_1", name: "lookup" }, + { type: "tool-call", id: "call_1", name: "lookup", input: { query: "weather" } }, + ], }) }), ) @@ -50,7 +56,10 @@ describe("ToolStream", () => { expect(finished).toEqual({ tools: {}, - event: { type: "tool-call", id: "call_1", name: "lookup", input: { query: "final" } }, + events: [ + { type: "tool-input-end", id: "call_1", name: "lookup" }, + { type: "tool-call", id: "call_1", name: "lookup", input: { query: "final" } }, + ], }) }), ) @@ -73,7 +82,9 @@ describe("ToolStream", () => { expect(finished).toEqual({ tools: {}, events: [ + { type: "tool-input-end", id: "call_1", name: "lookup" }, { type: "tool-call", id: "call_1", name: "lookup", input: {} }, + { type: "tool-input-end", id: "call_2", name: "web_search" }, { type: "tool-call", id: "call_2", diff --git a/packages/opencode/migration/20260510033149_session_usage/migration.sql b/packages/opencode/migration/20260510033149_session_usage/migration.sql new file mode 100644 index 000000000000..35641af46890 --- /dev/null +++ b/packages/opencode/migration/20260510033149_session_usage/migration.sql @@ -0,0 +1,27 @@ +ALTER TABLE `session` ADD `cost` real DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE `session` ADD `tokens_input` integer DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE `session` ADD `tokens_output` integer DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE `session` ADD `tokens_reasoning` integer DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE `session` ADD `tokens_cache_read` integer DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE `session` ADD `tokens_cache_write` integer DEFAULT 0 NOT NULL;--> statement-breakpoint +WITH `usage` AS ( + SELECT + `session_id`, + SUM(COALESCE(CAST(json_extract(`data`, '$.cost') AS real), 0)) AS `cost`, + SUM(COALESCE(CAST(json_extract(`data`, '$.tokens.input') AS integer), 0)) AS `tokens_input`, + SUM(COALESCE(CAST(json_extract(`data`, '$.tokens.output') AS integer), 0)) AS `tokens_output`, + SUM(COALESCE(CAST(json_extract(`data`, '$.tokens.reasoning') AS integer), 0)) AS `tokens_reasoning`, + SUM(COALESCE(CAST(json_extract(`data`, '$.tokens.cache.read') AS integer), 0)) AS `tokens_cache_read`, + SUM(COALESCE(CAST(json_extract(`data`, '$.tokens.cache.write') AS integer), 0)) AS `tokens_cache_write` + FROM `part` + WHERE json_extract(`data`, '$.type') = 'step-finish' + GROUP BY `session_id` +) +UPDATE `session` +SET + `cost` = COALESCE((SELECT `usage`.`cost` FROM `usage` WHERE `usage`.`session_id` = `session`.`id`), 0), + `tokens_input` = COALESCE((SELECT `usage`.`tokens_input` FROM `usage` WHERE `usage`.`session_id` = `session`.`id`), 0), + `tokens_output` = COALESCE((SELECT `usage`.`tokens_output` FROM `usage` WHERE `usage`.`session_id` = `session`.`id`), 0), + `tokens_reasoning` = COALESCE((SELECT `usage`.`tokens_reasoning` FROM `usage` WHERE `usage`.`session_id` = `session`.`id`), 0), + `tokens_cache_read` = COALESCE((SELECT `usage`.`tokens_cache_read` FROM `usage` WHERE `usage`.`session_id` = `session`.`id`), 0), + `tokens_cache_write` = COALESCE((SELECT `usage`.`tokens_cache_write` FROM `usage` WHERE `usage`.`session_id` = `session`.`id`), 0); diff --git a/packages/opencode/migration/20260510033149_session_usage/snapshot.json b/packages/opencode/migration/20260510033149_session_usage/snapshot.json new file mode 100644 index 000000000000..ce5e56f48c40 --- /dev/null +++ b/packages/opencode/migration/20260510033149_session_usage/snapshot.json @@ -0,0 +1,1519 @@ +{ + "version": "7", + "dialect": "sqlite", + "id": "be5eae31-b7f8-4292-8827-c36a524abd1b", + "prevIds": ["630a93f2-c6c6-4191-a351-868d8f3a05d4"], + "ddl": [ + { + "name": "account_state", + "entityType": "tables" + }, + { + "name": "account", + "entityType": "tables" + }, + { + "name": "control_account", + "entityType": "tables" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "name": "project", + "entityType": "tables" + }, + { + "name": "message", + "entityType": "tables" + }, + { + "name": "part", + "entityType": "tables" + }, + { + "name": "permission", + "entityType": "tables" + }, + { + "name": "session_message", + "entityType": "tables" + }, + { + "name": "session", + "entityType": "tables" + }, + { + "name": "todo", + "entityType": "tables" + }, + { + "name": "session_share", + "entityType": "tables" + }, + { + "name": "event_sequence", + "entityType": "tables" + }, + { + "name": "event", + "entityType": "tables" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account_state" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "active_account_id", + "entityType": "columns", + "table": "account_state" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "active_org_id", + "entityType": "columns", + "table": "account_state" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "url", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "access_token", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "refresh_token", + "entityType": "columns", + "table": "account" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token_expiry", + "entityType": "columns", + "table": "account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "url", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "access_token", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "refresh_token", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token_expiry", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "active", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "''", + "generated": null, + "name": "name", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "branch", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "directory", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "extra", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "project_id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_used", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "worktree", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "vcs", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon_url", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon_url_override", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon_color", + "entityType": "columns", + "table": "project" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "project" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "project" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_initialized", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "sandboxes", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "commands", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "message" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "message_id", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "part" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "part" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "project_id", + "entityType": "columns", + "table": "permission" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "permission" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "permission" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "permission" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "project_id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "parent_id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "slug", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "directory", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "path", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "title", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "version", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "share_url", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_additions", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_deletions", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_files", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_diffs", + "entityType": "columns", + "table": "session" + }, + { + "type": "real", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "cost", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_input", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_output", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_reasoning", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_cache_read", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_cache_write", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "revert", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "permission", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "agent", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_compacting", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_archived", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "content", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "status", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "priority", + "entityType": "columns", + "table": "todo" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "position", + "entityType": "columns", + "table": "todo" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "todo" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "secret", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "url", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "aggregate_id", + "entityType": "columns", + "table": "event_sequence" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "seq", + "entityType": "columns", + "table": "event_sequence" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "owner_id", + "entityType": "columns", + "table": "event_sequence" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "event" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "aggregate_id", + "entityType": "columns", + "table": "event" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "seq", + "entityType": "columns", + "table": "event" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "event" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "event" + }, + { + "columns": ["active_account_id"], + "tableTo": "account", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "nameExplicit": false, + "name": "fk_account_state_active_account_id_account_id_fk", + "entityType": "fks", + "table": "account_state" + }, + { + "columns": ["project_id"], + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_workspace_project_id_project_id_fk", + "entityType": "fks", + "table": "workspace" + }, + { + "columns": ["session_id"], + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_message_session_id_session_id_fk", + "entityType": "fks", + "table": "message" + }, + { + "columns": ["message_id"], + "tableTo": "message", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_part_message_id_message_id_fk", + "entityType": "fks", + "table": "part" + }, + { + "columns": ["project_id"], + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_permission_project_id_project_id_fk", + "entityType": "fks", + "table": "permission" + }, + { + "columns": ["session_id"], + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_message_session_id_session_id_fk", + "entityType": "fks", + "table": "session_message" + }, + { + "columns": ["project_id"], + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_project_id_project_id_fk", + "entityType": "fks", + "table": "session" + }, + { + "columns": ["session_id"], + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_todo_session_id_session_id_fk", + "entityType": "fks", + "table": "todo" + }, + { + "columns": ["session_id"], + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_share_session_id_session_id_fk", + "entityType": "fks", + "table": "session_share" + }, + { + "columns": ["aggregate_id"], + "tableTo": "event_sequence", + "columnsTo": ["aggregate_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_event_aggregate_id_event_sequence_aggregate_id_fk", + "entityType": "fks", + "table": "event" + }, + { + "columns": ["email", "url"], + "nameExplicit": false, + "name": "control_account_pk", + "entityType": "pks", + "table": "control_account" + }, + { + "columns": ["session_id", "position"], + "nameExplicit": false, + "name": "todo_pk", + "entityType": "pks", + "table": "todo" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "account_state_pk", + "table": "account_state", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "account_pk", + "table": "account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "workspace_pk", + "table": "workspace", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "project_pk", + "table": "project", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "message_pk", + "table": "message", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "part_pk", + "table": "part", + "entityType": "pks" + }, + { + "columns": ["project_id"], + "nameExplicit": false, + "name": "permission_pk", + "table": "permission", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "session_message_pk", + "table": "session_message", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "session_pk", + "table": "session", + "entityType": "pks" + }, + { + "columns": ["session_id"], + "nameExplicit": false, + "name": "session_share_pk", + "table": "session_share", + "entityType": "pks" + }, + { + "columns": ["aggregate_id"], + "nameExplicit": false, + "name": "event_sequence_pk", + "table": "event_sequence", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "event_pk", + "table": "event", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + }, + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "message_session_time_created_id_idx", + "entityType": "indexes", + "table": "message" + }, + { + "columns": [ + { + "value": "message_id", + "isExpression": false + }, + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "part_message_id_id_idx", + "entityType": "indexes", + "table": "part" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "part_session_idx", + "entityType": "indexes", + "table": "part" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_message_session_idx", + "entityType": "indexes", + "table": "session_message" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + }, + { + "value": "type", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_message_session_type_idx", + "entityType": "indexes", + "table": "session_message" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_message_time_created_idx", + "entityType": "indexes", + "table": "session_message" + }, + { + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_project_idx", + "entityType": "indexes", + "table": "session" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_workspace_idx", + "entityType": "indexes", + "table": "session" + }, + { + "columns": [ + { + "value": "parent_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_parent_idx", + "entityType": "indexes", + "table": "session" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "todo_session_idx", + "entityType": "indexes", + "table": "todo" + } + ], + "renames": [] +} diff --git a/packages/opencode/migration/20260512000132_session_goal/migration.sql b/packages/opencode/migration/20260512000132_session_goal/migration.sql new file mode 100644 index 000000000000..2a7212887883 --- /dev/null +++ b/packages/opencode/migration/20260512000132_session_goal/migration.sql @@ -0,0 +1,15 @@ +CREATE TABLE `session_goal` ( + `id` text PRIMARY KEY, + `session_id` text NOT NULL, + `objective` text NOT NULL, + `status` text NOT NULL, + `token_budget` integer, + `tokens_used` integer DEFAULT 0 NOT NULL, + `time_used` integer DEFAULT 0 NOT NULL, + `time_created` integer NOT NULL, + `time_updated` integer NOT NULL, + CONSTRAINT `fk_session_goal_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE +); +--> statement-breakpoint +CREATE UNIQUE INDEX `session_goal_session_idx` ON `session_goal` (`session_id`);--> statement-breakpoint +CREATE INDEX `session_goal_status_idx` ON `session_goal` (`status`); \ No newline at end of file diff --git a/packages/opencode/migration/20260512000132_session_goal/snapshot.json b/packages/opencode/migration/20260512000132_session_goal/snapshot.json new file mode 100644 index 000000000000..e55c3a3a12fe --- /dev/null +++ b/packages/opencode/migration/20260512000132_session_goal/snapshot.json @@ -0,0 +1,1771 @@ +{ + "version": "7", + "dialect": "sqlite", + "id": "74d27327-842d-4182-ae74-2774557616eb", + "prevIds": [ + "be5eae31-b7f8-4292-8827-c36a524abd1b", + "fdfcccee-fb3a-481f-b801-b9835fa30d5d" + ], + "ddl": [ + { + "name": "account_state", + "entityType": "tables" + }, + { + "name": "account", + "entityType": "tables" + }, + { + "name": "control_account", + "entityType": "tables" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "name": "data_migration", + "entityType": "tables" + }, + { + "name": "project", + "entityType": "tables" + }, + { + "name": "message", + "entityType": "tables" + }, + { + "name": "part", + "entityType": "tables" + }, + { + "name": "permission", + "entityType": "tables" + }, + { + "name": "session_goal", + "entityType": "tables" + }, + { + "name": "session_message", + "entityType": "tables" + }, + { + "name": "session", + "entityType": "tables" + }, + { + "name": "todo", + "entityType": "tables" + }, + { + "name": "session_share", + "entityType": "tables" + }, + { + "name": "event_sequence", + "entityType": "tables" + }, + { + "name": "event", + "entityType": "tables" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account_state" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "active_account_id", + "entityType": "columns", + "table": "account_state" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "active_org_id", + "entityType": "columns", + "table": "account_state" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "url", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "access_token", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "refresh_token", + "entityType": "columns", + "table": "account" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token_expiry", + "entityType": "columns", + "table": "account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "url", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "access_token", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "refresh_token", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token_expiry", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "active", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "control_account" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "''", + "generated": null, + "name": "name", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "branch", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "directory", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "extra", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "project_id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_used", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "data_migration" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_completed", + "entityType": "columns", + "table": "data_migration" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "worktree", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "vcs", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon_url", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon_url_override", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon_color", + "entityType": "columns", + "table": "project" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "project" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "project" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_initialized", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "sandboxes", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "commands", + "entityType": "columns", + "table": "project" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "message" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "message_id", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "part" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "part" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "part" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "project_id", + "entityType": "columns", + "table": "permission" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "permission" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "permission" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "permission" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "objective", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "status", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token_budget", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_used", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "time_used", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session_goal" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "session_message" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "project_id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "parent_id", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "slug", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "directory", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "path", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "title", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "version", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "share_url", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_additions", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_deletions", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_files", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "summary_diffs", + "entityType": "columns", + "table": "session" + }, + { + "type": "real", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "cost", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_input", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_output", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_reasoning", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_cache_read", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "name": "tokens_cache_write", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "revert", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "permission", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "agent", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_compacting", + "entityType": "columns", + "table": "session" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_archived", + "entityType": "columns", + "table": "session" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "content", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "status", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "priority", + "entityType": "columns", + "table": "todo" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "position", + "entityType": "columns", + "table": "todo" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "todo" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "todo" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "secret", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "url", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "session_share" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "aggregate_id", + "entityType": "columns", + "table": "event_sequence" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "seq", + "entityType": "columns", + "table": "event_sequence" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "owner_id", + "entityType": "columns", + "table": "event_sequence" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "event" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "aggregate_id", + "entityType": "columns", + "table": "event" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "seq", + "entityType": "columns", + "table": "event" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "type", + "entityType": "columns", + "table": "event" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "data", + "entityType": "columns", + "table": "event" + }, + { + "columns": [ + "active_account_id" + ], + "tableTo": "account", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "nameExplicit": false, + "name": "fk_account_state_active_account_id_account_id_fk", + "entityType": "fks", + "table": "account_state" + }, + { + "columns": [ + "project_id" + ], + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_workspace_project_id_project_id_fk", + "entityType": "fks", + "table": "workspace" + }, + { + "columns": [ + "session_id" + ], + "tableTo": "session", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_message_session_id_session_id_fk", + "entityType": "fks", + "table": "message" + }, + { + "columns": [ + "message_id" + ], + "tableTo": "message", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_part_message_id_message_id_fk", + "entityType": "fks", + "table": "part" + }, + { + "columns": [ + "project_id" + ], + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_permission_project_id_project_id_fk", + "entityType": "fks", + "table": "permission" + }, + { + "columns": [ + "session_id" + ], + "tableTo": "session", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_goal_session_id_session_id_fk", + "entityType": "fks", + "table": "session_goal" + }, + { + "columns": [ + "session_id" + ], + "tableTo": "session", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_message_session_id_session_id_fk", + "entityType": "fks", + "table": "session_message" + }, + { + "columns": [ + "project_id" + ], + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_project_id_project_id_fk", + "entityType": "fks", + "table": "session" + }, + { + "columns": [ + "session_id" + ], + "tableTo": "session", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_todo_session_id_session_id_fk", + "entityType": "fks", + "table": "todo" + }, + { + "columns": [ + "session_id" + ], + "tableTo": "session", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_session_share_session_id_session_id_fk", + "entityType": "fks", + "table": "session_share" + }, + { + "columns": [ + "aggregate_id" + ], + "tableTo": "event_sequence", + "columnsTo": [ + "aggregate_id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_event_aggregate_id_event_sequence_aggregate_id_fk", + "entityType": "fks", + "table": "event" + }, + { + "columns": [ + "email", + "url" + ], + "nameExplicit": false, + "name": "control_account_pk", + "entityType": "pks", + "table": "control_account" + }, + { + "columns": [ + "session_id", + "position" + ], + "nameExplicit": false, + "name": "todo_pk", + "entityType": "pks", + "table": "todo" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "account_state_pk", + "table": "account_state", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "account_pk", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspace_pk", + "table": "workspace", + "entityType": "pks" + }, + { + "columns": [ + "name" + ], + "nameExplicit": false, + "name": "data_migration_pk", + "table": "data_migration", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_pk", + "table": "project", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "message_pk", + "table": "message", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "part_pk", + "table": "part", + "entityType": "pks" + }, + { + "columns": [ + "project_id" + ], + "nameExplicit": false, + "name": "permission_pk", + "table": "permission", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "session_goal_pk", + "table": "session_goal", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "session_message_pk", + "table": "session_message", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "session_pk", + "table": "session", + "entityType": "pks" + }, + { + "columns": [ + "session_id" + ], + "nameExplicit": false, + "name": "session_share_pk", + "table": "session_share", + "entityType": "pks" + }, + { + "columns": [ + "aggregate_id" + ], + "nameExplicit": false, + "name": "event_sequence_pk", + "table": "event_sequence", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "event_pk", + "table": "event", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + }, + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "message_session_time_created_id_idx", + "entityType": "indexes", + "table": "message" + }, + { + "columns": [ + { + "value": "message_id", + "isExpression": false + }, + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "part_message_id_id_idx", + "entityType": "indexes", + "table": "part" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "part_session_idx", + "entityType": "indexes", + "table": "part" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": true, + "where": null, + "origin": "manual", + "name": "session_goal_session_idx", + "entityType": "indexes", + "table": "session_goal" + }, + { + "columns": [ + { + "value": "status", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_goal_status_idx", + "entityType": "indexes", + "table": "session_goal" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_message_session_idx", + "entityType": "indexes", + "table": "session_message" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + }, + { + "value": "type", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_message_session_type_idx", + "entityType": "indexes", + "table": "session_message" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_message_time_created_idx", + "entityType": "indexes", + "table": "session_message" + }, + { + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_project_idx", + "entityType": "indexes", + "table": "session" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_workspace_idx", + "entityType": "indexes", + "table": "session" + }, + { + "columns": [ + { + "value": "parent_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "session_parent_idx", + "entityType": "indexes", + "table": "session" + }, + { + "columns": [ + { + "value": "session_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "todo_session_idx", + "entityType": "indexes", + "table": "todo" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/opencode/package.json b/packages/opencode/package.json index e9b811fc5e1d..e3e8c1774a96 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.14.48", + "version": "1.15.0", "name": "opencode", "type": "module", "license": "MIT", @@ -32,11 +32,6 @@ "bun": "./src/pty/pty.bun.ts", "node": "./src/pty/pty.node.ts", "default": "./src/pty/pty.bun.ts" - }, - "#httpapi-server": { - "bun": "./src/server/httpapi-server.node.ts", - "node": "./src/server/httpapi-server.node.ts", - "default": "./src/server/httpapi-server.node.ts" } }, "devDependencies": { @@ -91,7 +86,6 @@ "@ai-sdk/openai-compatible": "2.0.41", "@ai-sdk/perplexity": "3.0.26", "@ai-sdk/provider": "3.0.8", - "@ai-sdk/provider-utils": "4.0.23", "@ai-sdk/togetherai": "2.0.41", "@ai-sdk/vercel": "2.0.39", "@ai-sdk/xai": "3.0.82", @@ -108,6 +102,7 @@ "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/ui": "workspace:*", "@openrouter/ai-sdk-provider": "2.8.1", "@opentelemetry/api": "1.9.0", "@opentelemetry/context-async-hooks": "2.6.1", @@ -129,7 +124,6 @@ "bonjour-service": "1.3.0", "bun-pty": "0.4.8", "chokidar": "4.0.3", - "cli-sound": "1.1.3", "clipboardy": "4.0.0", "cross-spawn": "catalog:", "decimal.js": "10.5.0", @@ -141,6 +135,7 @@ "glob": "13.0.5", "google-auth-library": "10.5.0", "gray-matter": "4.0.3", + "htmlparser2": "8.0.2", "ignore": "7.0.5", "immer": "11.1.4", "jsonc-parser": "3.3.1", diff --git a/packages/opencode/script/generate.ts b/packages/opencode/script/generate.ts index 52d0cef8da3b..bd9e7c064887 100644 --- a/packages/opencode/script/generate.ts +++ b/packages/opencode/script/generate.ts @@ -13,11 +13,11 @@ const modelsData = process.env.MODELS_DEV_API_JSON ? await Bun.file(process.env.MODELS_DEV_API_JSON).text() : await fetch(`${modelsUrl}/api.json`).then((x) => x.text()) await Bun.write( - path.join(dir, "src/provider/models-snapshot.js"), + path.join(dir, "../core/src/models-snapshot.js"), `// @ts-nocheck\n// Auto-generated by build.ts - do not edit\nexport const snapshot = ${modelsData}\n`, ) await Bun.write( - path.join(dir, "src/provider/models-snapshot.d.ts"), + path.join(dir, "../core/src/models-snapshot.d.ts"), `// Auto-generated by build.ts - do not edit\nexport declare const snapshot: Record\n`, ) console.log("Generated models-snapshot.js") diff --git a/packages/opencode/specs/effect/error-boundaries-plan.md b/packages/opencode/specs/effect/error-boundaries-plan.md new file mode 100644 index 000000000000..763bf5ea5e56 --- /dev/null +++ b/packages/opencode/specs/effect/error-boundaries-plan.md @@ -0,0 +1,235 @@ +# Error Boundaries Plan + +Plan for removing `NamedError` as connective tissue while keeping public +wire contracts stable. + +## Desired Shape + +```text +Domain/service error + Schema.TaggedErrorClass + - catchable with catchTag / catchTags + - appears in service method error type + - no HTTP status + - no toObject() + +HTTP public error + Schema.ErrorClass / TaggedErrorClass with httpApiStatus + - endpoint-declared public contract + - owns legacy { name, data } only when that is the SDK wire shape + +CLI/user rendering + FormatError and small format helpers + - converts domain errors to text + - preserves useful structured fields + +Session/model-visible error + first-class session/message error schema or helper + - owns { name, data } event/message shape + - not a service error class +``` + +The important rule: a service error should not also be the HTTP body, CLI +formatter, and session event body. Each seam adapts the error into the +shape it owns. + +## Concrete Example: Provider Model Not Found + +Before: + +```ts +export const ModelNotFoundError = NamedError.create("ProviderModelNotFoundError", { + providerID: ProviderID, + modelID: ModelID, + suggestions: Schema.optional(Schema.Array(Schema.String)), +}) +``` + +Problems: + +- Throwing it inside `Effect.fn` made it behave like a defect unless a + compatibility bridge caught it. +- HTTP middleware knew that this one domain error should be a `400`. +- Callers read `.data.*`, which couples them to the legacy `{ name, data }` + wire shape. + +After: + +```ts +export class ModelNotFoundError extends Schema.TaggedErrorClass()("ProviderModelNotFoundError", { + providerID: ProviderID, + modelID: ModelID, + suggestions: Schema.optional(Schema.Array(Schema.String)), + cause: Schema.optional(Schema.Defect), +}) {} + +export interface Interface { + readonly getModel: (providerID: ProviderID, modelID: ModelID) => Effect.Effect +} +``` + +Boundary adapters: + +```text +CLI +└─ FormatError sees _tag ProviderModelNotFoundError -> nice text + +Session prompt +└─ catch ModelNotFoundError -> publish Session.Event.Error as message/session wire shape + +HTTP route +└─ catch ModelNotFoundError -> declared BadRequest public API error when the endpoint needs it + +HTTP middleware +└─ no Provider.ModelNotFoundError knowledge +``` + +## Refining Known Promise Failures + +Use `EffectPromise.refineRejection(...)` when a Promise boundary can reject +with many unknown values, but only one or two rejection classes are expected +domain failures. Unknown rejections stay defects; the helper maps only known +rejection shapes to typed errors. + +```ts +const language = + yield * + EffectPromise.refineRejection( + async () => loadFromProvider(), + (cause) => (cause instanceof NoSuchModelError ? new ModelNotFoundError({ providerID, modelID, cause }) : undefined), + ) +``` + +Use this when the Promise can genuinely reject and most rejection values are +still defects for the current module. Use `Effect.tryPromise({ try, catch })` +when every rejection should become the same expected error type. Use +`Effect.promise(...)` only when rejection means a defect and you do not need +to refine known rejection classes. + +## Helper Modules We Probably Want + +Add helpers only when repeated call sites prove the seam is real. + +### HTTP API Errors + +Likely location: `src/server/routes/instance/httpapi/errors.ts`. + +Purpose: + +- construct public HTTP error bodies +- preserve legacy `{ name, data }` where needed +- attach `httpApiStatus` + +Good helpers: + +```ts +notFound(message) +badRequest(message) +unknown() +``` + +Avoid: + +```ts +mapAnyDomainError(error) +``` + +That recreates the giant middleware mapper problem. + +### Session / Message Error Wire Helpers + +Likely location: near `src/session/message-error.ts` or a new narrow +module such as `src/session/event-error.ts`. + +Purpose: + +- construct the `{ name, data }` shape used by `Session.Event.Error` and + assistant message errors +- replace `new NamedError.Unknown(...).toObject()` call sites +- keep model-visible error bodies separate from service/domain errors + +Good helpers: + +```ts +unknown(message) +agentNotFound(agent, available) +commandNotFound(command, available) +modelNotFound(error: Provider.ModelNotFoundError) +``` + +### CLI Formatters + +Likely location: `src/cli/error.ts` until repetition demands domain-local +format helpers. + +Purpose: + +- produce human-readable terminal messages from typed errors +- support old `{ name, data }` shapes only while compatibility is needed + +## Migration Queue + +### Remove Domain Knowledge From HTTP Middleware + +- [x] Storage not found no longer maps through defect fallback. +- [x] Worktree expected errors moved to typed errors. +- [x] Provider auth expected errors moved to typed errors. +- [x] Provider model not found no longer needs an HTTP middleware status + special case. +- [ ] Convert `Session.BusyError` and map it at route boundaries. +- [ ] Delete the broad `NamedError` middleware branch once no route relies + on defect-wrapped legacy domain errors. +- [ ] Keep one final unknown-defect fallback that logs `Cause.pretty(cause)` + and returns a safe `500` body. + +### Remaining `NamedError.create(...)` Service Errors + +These should become `Schema.TaggedErrorClass` when touched: + +- [ ] `src/provider/provider.ts` — `ProviderInitError`. +- [ ] `src/storage/db.ts` — database `NotFoundError`. +- [ ] `src/mcp/index.ts` — `MCPFailed`. +- [ ] `src/skill/index.ts` — `SkillInvalidError`, + `SkillNameMismatchError`. +- [ ] `src/lsp/client.ts` — `LSPInitializeError`. +- [ ] `src/ide/index.ts` — install errors. +- [ ] `src/config/error.ts`, `src/config/config.ts`, + `src/config/markdown.ts` — config errors. These already render well + in the CLI, so migrate carefully and preserve diagnostics. + +### Session / Message Wire Errors + +These are not ordinary service errors. They mostly build `{ name, data }` +objects for model-visible/session-visible output. + +- [ ] Add a first-class session/message error wire helper. +- [ ] Replace `new NamedError.Unknown(...).toObject()` in + `src/session/prompt.ts`. +- [ ] Replace `new NamedError.Unknown(...).toObject()` in config/skill/plugin + session event publishing. +- [ ] Move `src/session/message-error.ts` and `src/session/message-v2.ts` + away from `NamedError.create(...)` once the wire helper exists. +- [ ] Update retry/message tests to assert the wire schema/helper output, + not `NamedError` instances. + +### CLI Rendering + +- [x] Tagged config errors render with useful diagnostics. +- [x] Provider model not found renders from both old `{ name, data }` and + new `_tag` shapes. +- [ ] Add typed render cases as more `NamedError.create(...)` domains move + to `Schema.TaggedErrorClass`. +- [ ] Eventually remove old-shape compatibility branches when no callers can + produce them. + +## PR Checklist + +For each migrated error: + +- [ ] Domain error is `Schema.TaggedErrorClass`. +- [ ] Service method exposes the typed error in its error channel. +- [ ] No service error has `toObject()` just for compatibility. +- [ ] CLI, HTTP, and session/message adapters each own their output shape. +- [ ] HTTP middleware gets smaller or stays unchanged. +- [ ] Focused tests cover the domain error and any public rendering/wire + shape touched by the PR. diff --git a/packages/opencode/specs/effect/errors.md b/packages/opencode/specs/effect/errors.md index e19199ef4992..69298bde5cac 100644 --- a/packages/opencode/specs/effect/errors.md +++ b/packages/opencode/specs/effect/errors.md @@ -1,41 +1,25 @@ -# Typed error migration +# Typed Error Migration -Plan for moving `packages/opencode` from temporary defect/`NamedError` -compatibility toward typed Effect service errors and explicit HTTP error -contracts. +This note expands the `ERR`, `RENDER`, and `HTTP` tracks from +[`todo.md`](./todo.md). It is the current reference for expected failures, +typed service errors, and HTTP error boundaries. + +For the migration architecture and queue, see +[`error-boundaries-plan.md`](./error-boundaries-plan.md). ## Goal - Expected service failures live on the Effect error channel. - Service interfaces expose those failures in their return types. -- Domain errors are authored with Effect Schema so they are reusable by services, - tests, HTTP routes, tools, and OpenAPI generation. -- HTTP status codes and wire compatibility are handled at the HTTP boundary, not - inside service modules. -- `Effect.die`, `throw`, `catchDefect`, and global cause inspection are reserved - for defects, compatibility bridges, or final fallback behavior. - -## Current State - -- Many migrated services use Effect internally, but expected failures are still a - mix of `NamedError.create(...)`, `namedSchemaError(...)`, `class extends Error`, - `throw`, and `Effect.die(...)`. -- Some services already use `Schema.TaggedErrorClass`, for example `Account`, - `Auth`, `Permission`, `Question`, `Installation`, and parts of - `Workspace`. -- The temporary HttpApi compatibility middleware recognizes `NamedError`, - `Session.BusyError`, and a few name-based cases, then emits the legacy - `{ name, data }` JSON body. -- Effect `HttpApi` only knows how to encode errors that are declared on the - endpoint, group, or middleware. Undeclared expected errors become defects and - eventually fall through to generic HTTP handling. -- The temporary HttpApi error middleware catches defect-wrapped legacy errors to - preserve runtime behavior, but it is intentionally a bridge rather than the - final model. - -## End State +- Domain errors are authored with `Schema.TaggedErrorClass`. +- `Effect.die(...)` is reserved for defects: bugs, impossible states, + violated invariants, and final unknown-boundary fallbacks. +- HTTP status codes and public wire bodies are handled at HTTP route + boundaries, not inside service modules. +- User-facing boundaries render useful structured error details instead of + opaque `Error: SomeName` strings. -Service modules own domain failures. +## Service Error Shape ```ts export class SessionBusyError extends Schema.TaggedErrorClass()("SessionBusyError", { @@ -50,281 +34,90 @@ export interface Interface { } ``` -HTTP modules own transport mapping. - -```ts -const get = Effect.fn("SessionHttpApi.get")(function* (ctx: { params: { sessionID: SessionID } }) { - return yield* session - .get(ctx.params.sessionID) - .pipe( - Effect.catchTag("StorageNotFoundError", () => new SessionNotFoundHttpError({ sessionID: ctx.params.sessionID })), - ) -}) -``` - -HTTP-visible error schemas carry their own response status through Effect -HttpApi's `httpApiStatus` annotation. Prefer `HttpApiSchema.status(...)`, or the -equivalent declaration annotation, instead of maintaining a parallel status map. - -```ts -export class SessionNotFoundHttpError extends Schema.TaggedErrorClass()( - "SessionNotFoundHttpError", - { - sessionID: SessionID, - message: Schema.String, - }, - { httpApiStatus: 404 }, -) {} -``` +Rules: -Endpoint definitions still declare which HTTP-visible error schemas can be -emitted. The status annotation is only used if the error is part of the endpoint, -group, or middleware error schema and the handler fails with that error on the -typed error channel. - -```ts -HttpApiEndpoint.get("get", SessionPaths.get, { - success: Session.Info, - error: [SessionNotFoundHttpError, SessionBusyHttpError], -}) -``` - -The service error and HTTP error may be the same class when the wire shape is a -deliberate public contract. They should be different classes when the service -error contains internals, low-level causes, retry hints, or anything that should -not be exposed to API clients. - -## Rules - -- Use `Schema.TaggedErrorClass` for new expected domain errors. -- Include `cause: Schema.optional(Schema.Defect)` only when preserving an - underlying unknown failure is useful for logs or callers. -- Export a domain-level error union from each service module, for example - `export type Error = NotFoundError | BusyError | Storage.Error`. -- Put expected errors in service method signatures, for example - `Effect.Effect`. -- Use `yield* new DomainError(...)` for direct early failures inside +- Use `Schema.TaggedErrorClass` for expected domain failures. +- Export a domain-level `Error` union from each service module. +- Put expected errors in service method signatures. +- Use `yield* new DomainError(...)` for direct early failures in `Effect.gen` / `Effect.fn`. -- Use `Effect.try({ try, catch })`, `Effect.mapError`, or `Effect.catchTag` to - convert external exceptions into domain errors. -- Use `HttpApiSchema.status(...)` or `{ httpApiStatus: code }` on HTTP-visible - error schemas so Effect `HttpApiBuilder` and OpenAPI generation get the status - from the schema itself. -- Do not use `Effect.die(...)` for user, IO, validation, missing-resource, auth, - provider, worktree, or busy-state failures. -- Do not use `catchDefect` to recover expected domain errors. If recovery is - needed, the upstream effect should fail with a typed error instead. -- Do not make service modules import `HttpApiError`, `HttpServerResponse`, HTTP - status codes, or route-specific error schemas. -- Keep raw `HttpRouter` routes free to use `HttpServerRespondable` when that is - the right transport abstraction, but prefer declared `HttpApi` errors for - normal JSON API endpoints. +- Use `Schema.Defect` for unknown cause fields when preserving the cause is + useful for logs or callers. +- Use `Effect.try(...)`, `Effect.tryPromise(...)`, `Effect.mapError`, + `Effect.catchTag`, and `Effect.catchTags` to translate external + failures into domain errors. +- Do not use `throw`, `Effect.die(...)`, or `catchDefect` for expected + user, IO, validation, missing-resource, auth, provider, worktree, or + busy-state failures. ## HTTP Boundary Shape -Create an HttpApi-local error module, likely -`src/server/routes/instance/httpapi/errors.ts`. +Service modules stay transport-agnostic. They should not import HTTP +status codes, `HttpApiError`, `HttpServerResponse`, or route-specific +error schemas. -That module should provide: - -- Legacy-compatible public schemas for `{ name, data }` error bodies that must - remain SDK-compatible while route groups declare typed errors. -- Small constructors or mapping helpers for common API errors such as not found, - bad request, conflict, and unknown internal errors. -- Route-group-specific adapters only when they encode domain-specific public - data. -- A single place to document which public error shape is legacy-compatible and - which shape is new Effect-native API surface. - -Avoid one giant `unknown -> status` mapper. Prefer small, explicit mappers close -to the handler or route group. +HTTP handlers translate service errors into public endpoint errors: ```ts -const mapSessionError = (effect: Effect.Effect) => - effect.pipe( - Effect.catchTag("StorageNotFoundError", (error) => new SessionNotFoundHttpError({ message: error.message })), - Effect.catchTag("SessionBusyError", (error) => new SessionBusyHttpError({ message: error.message })), - ) +const get = Effect.fn("SessionHttpApi.get")(function* (ctx: { params: { sessionID: SessionID } }) { + return yield* session + .get(ctx.params.sessionID) + .pipe(Effect.catchTag("StorageNotFoundError", () => notFound("Session not found"))) +}) ``` -Use built-in `HttpApiError.BadRequest`, `HttpApiError.NotFound`, and related -types only when their generated response body and SDK surface are intentionally -acceptable. Use a custom schema-backed error when clients need the legacy -`{ name, data }` body or a domain-specific error payload. - -## Migration Phases +Endpoint definitions declare which public errors can be emitted. Public +HTTP error schemas carry their response status with `httpApiStatus` or the +equivalent HttpApi schema annotation. -### 1. Stabilize The Bridge +The service error and HTTP error may be the same class only when the wire +shape is intentionally public. Use separate HTTP error schemas when the +service error contains internals, low-level causes, retry hints, or data +that should not be exposed to API clients. -Keep the temporary HttpApi error middleware only as a compatibility bridge while -typed errors are introduced. +## Mapping Guidance -- Add tests that prove the bridge catches legacy `NamedError` defects. -- Add tests that prove declared HttpApi errors still use the declared endpoint - contract. -- Stop returning stack traces in unknown HTTP `500` responses; log the full - `Cause.pretty(cause)` server-side instead. -- Add a comment or TODO that names this plan and states the bridge must shrink - as route groups migrate. +- Keep one-off translations inline in the handler. +- Extract tiny shared helpers when the same translation repeats across a + route group. +- Do not create one giant `unknown -> status` mapper. +- Do not grow generic HTTP middleware into a registry of domain errors. +- Preserve existing public `{ name, data }` bodies until a deliberate + breaking API change. +- Use built-in `HttpApiError.*` only when its generated body and SDK + surface are intentionally the public contract. -### 2. Define The Shared HTTP Error Helpers +## Middleware Guidance -Add the `httpapi/errors.ts` module before converting route groups. +HTTP middleware should be cross-cutting: auth, context, schema decode +formatting, routing, and final unknown-defect fallback. -- Define a legacy `{ name, data }` body helper for SDK-compatible errors. -- Define `UnknownError` for generic internal failures with a safe public message. -- Define `BadRequestError` and `NotFoundError` equivalents only if the actual - wire body must match the existing SDK surface. -- Put the HTTP status on the public schema with `HttpApiSchema.status(...)` or - `{ httpApiStatus: code }`; do not keep a separate name-to-status table. -- Keep conversion helpers pure and small. They should not inspect `Cause` or - accept `unknown` unless they are final fallback helpers. +The current compatibility middleware still knows about some legacy domain +errors. As route groups declare expected errors and handlers map them, that +middleware should shrink. It should not gain new name checks. -### 3. Convert One Vertical Slice +Unknown `500` responses should log full details server-side with +`Cause.pretty(cause)` and return a safe public body. -Start with session read routes because they already have local `mapNotFound` -logic and are heavily covered by existing HttpApi tests. +## Migration Order -- Convert `Session.BusyError` from a plain `Error` to a typed service error, or - add a typed wrapper while preserving the old constructor until callers are - migrated. -- Replace `catchDefect` in `httpapi/handlers/session.ts` with typed error - mapping. -- Add endpoint error schemas for the affected session endpoints. -- Prove behavior with focused tests in `test/server/httpapi-session.test.ts`. -- Remove the migrated cases from the global compatibility middleware. - -### 4. Convert Legacy NamedError Domains - -Move legacy `NamedError.create(...)` services to Effect Schema-backed errors in -small domain PRs. - -Priority order: - -1. `storage/storage.ts` and `storage/db.ts` not-found errors. -2. `worktree/index.ts` `Worktree*` errors. -3. `provider/auth.ts` validation failures and `provider/provider.ts` model-not-found errors. -4. `mcp/index.ts`, `skill/index.ts`, `lsp/client.ts`, and `ide/index.ts` service errors. -5. Config and CLI-only errors after HTTP-facing domains are stable. - -For each domain: - -- Replace `NamedError.create(...)` with `Schema.TaggedErrorClass` when the error - is primarily a service error. -- Keep or add a separate HTTP error schema when the legacy `{ name, data }` wire - shape must remain stable. -- Update service interface return types to include the new error union. -- Replace `throw new X(...)` inside `Effect.fn` with `yield* new X(...)`. -- Replace async exceptions with `Effect.try({ catch })` or explicit `mapError`. -- Add service-level tests that assert the error tag and data, not just the HTTP - status. - -### 5. Declare HttpApi Errors Group By Group - -For each HttpApi group: - -- Inventory every service call and the typed errors it can return. -- Add only the public error schemas that endpoint can actually emit. -- Map service errors to HTTP errors in the handler file. -- Keep built-in `HttpApiError` only for generic request/validation failures where - the generated contract is accepted. -- Update `httpapi/public.ts` compatibility transforms only when the generated - spec cannot represent the desired source shape directly. -- Regenerate the SDK after OpenAPI-visible changes and verify the diff is - intentional. - -Suggested route order: - -1. `session` not-found and busy-state reads. -2. `experimental` worktree mutations. -3. `provider` auth and model selection errors. -4. `mcp` OAuth and connection errors. -5. Remaining route groups as typed error contracts are declared. - -### 6. Remove Defect Recovery - -After enough route groups declare their expected errors: - -- Delete `catchDefect` recovery for domain errors. -- Delete name-prefix checks such as `error.name.startsWith("Worktree")` from - HTTP middleware. -- Delete `NamedError` branches from the Effect HttpApi compatibility middleware - once no Effect route depends on them. -- Leave one final unknown-defect fallback that logs server-side and returns a - safe generic `500` body. - -## Inventory Checklist - -Use this checklist when touching a service or route group. - -- [ ] Does the service interface expose every expected failure in the Effect - error type? -- [ ] Are user-caused, provider-caused, IO, auth, missing-resource, and busy-state - failures modeled as typed errors instead of defects? -- [ ] Does the service avoid importing HTTP status, `HttpApiError`, or response - classes? -- [ ] Does the handler map each service error into a declared endpoint error? -- [ ] Does the endpoint `error` field include every public error the handler can - emit? -- [ ] Does OpenAPI/SDK output either stay byte-identical or have an explicitly - reviewed diff? -- [ ] Do tests cover both service-level error typing and HTTP-level status/body? -- [ ] Did the PR remove any now-unneeded case from the temporary compatibility - middleware? - -## Testing Requirements - -For service conversions: - -- Test the service method directly with `testEffect(...)`. -- Assert on `_tag` or class identity and the structured fields. -- Avoid testing by string-matching `Cause.pretty(...)`. - -For HttpApi conversions: - -- Add or update the focused `test/server/httpapi-*.test.ts` file. -- Assert status code, content type, and exact JSON body for declared public - errors. -- Add a regression test that the temporary middleware is no longer needed for the - migrated route. -- Keep compatibility tests aligned with the existing SDK contract until the - public error shape intentionally changes. - -## Verification Commands - -Run from `packages/opencode` unless noted otherwise. - -```bash -bun run prettier --write -bunx oxlint -bun typecheck -bun run test -- test/server/httpapi-session.test.ts -``` - -Run SDK generation from the repo root when schemas or OpenAPI-visible errors -change. - -```bash -./packages/sdk/js/script/build.ts -``` +Prefer small vertical slices: -## Open Questions +1. Fix rendering at one user-visible boundary. +2. Convert one service domain to `Schema.TaggedErrorClass` errors. +3. Map those errors at the affected HTTP handlers. +4. Remove the corresponding name-based middleware branch if possible. +5. Add or update focused tests for both service error tags and HTTP wire + bodies. -- Should legacy V1 routes keep `{ name, data }` forever while V2 routes expose a - more Effect-native tagged error body? -- Should storage not-found remain generic, or should callers map it to - domain-specific not-found errors before crossing service boundaries? -- Should `namedSchemaError(...)` stay as a long-term public-wire helper, or only - as a migration bridge for old `NamedError` contracts? -- Which SDK version boundary lets us stop remapping built-in Effect HttpApi error - schemas in `httpapi/public.ts`? +Good early domains are storage not-found, worktree errors, and provider +auth validation errors because they currently drive HTTP behavior. -## Success Criteria +## Checklist For A PR -- New service code no longer uses `die` for expected failures. -- A route reviewer can read an endpoint definition and see every public error it - can return. -- The temporary HttpApi error middleware shrinks over time instead of gaining new - name-based cases. -- Service tests prove domain error types without going through HTTP. -- HTTP tests prove status/body contracts without relying on defect recovery. +- [ ] Expected failures are typed errors, not defects. +- [ ] Service method signatures expose the expected error union. +- [ ] HTTP handlers translate domain errors at the boundary. +- [ ] Public HTTP error bodies preserve existing wire contracts. +- [ ] Generic middleware gets smaller or stays unchanged. +- [ ] Focused tests cover the service error and any public HTTP response. diff --git a/packages/opencode/specs/effect/guide.md b/packages/opencode/specs/effect/guide.md new file mode 100644 index 000000000000..5df029344853 --- /dev/null +++ b/packages/opencode/specs/effect/guide.md @@ -0,0 +1,251 @@ +# Effect Guide + +How we write Effect code in `packages/opencode`. The companion roadmap is +[`todo.md`](./todo.md). + +This guide describes the preferred shape for new work and migrations. If a +legacy file differs, migrate it only when it is already in scope. + +## Service Shape + +Use one module per service: flat top-level exports, traced Effect methods, +explicit layers, and a self-reexport at the bottom. + +```ts +export interface Interface { + readonly get: (id: FooID) => Effect.Effect +} + +export class Service extends Context.Service()("@opencode/Foo") {} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const state = yield* InstanceState.make(Effect.fn("Foo.state")(() => Effect.succeed({}))) + + const get = Effect.fn("Foo.get")(function* (id: FooID) { + const s = yield* InstanceState.get(state) + return yield* loadFoo(s, id) + }) + + return Service.of({ get }) + }), +) + +export const defaultLayer = layer.pipe(Layer.provide(FooDep.defaultLayer)) + +export * as Foo from "./foo" +``` + +Rules: + +- Do not use `export namespace Foo { ... }`. +- Use `Effect.fn("Foo.method")` for public service methods. +- Use `Effect.fnUntraced` for small internal helpers that do not need a + span. +- Keep helpers as non-exported top-level declarations in the same file. +- Self-reexport with `export * as Foo from "."` for `index.ts`, otherwise + `export * as Foo from "./foo"`. +- In `src/config`, keep the existing top-of-file self-export pattern. + +## Runtime Boundaries + +Most code should run through [`AppRuntime`](../../src/effect/app-runtime.ts). +It hosts `AppLayer`, shares the global `memoMap`, and restores the current +instance/workspace refs when crossing from non-Effect code. + +Use `AppRuntime.runPromise(effect)` at app boundaries such as CLI commands, +HTTP handlers, or plain async adapters. + +`makeRuntime(...)` still exists for a few intentional service-local +boundaries and migration leftovers. Do not add a new service-local runtime +unless the service truly cannot live in `AppLayer`. + +## Runtime Flags + +Read opencode runtime flags through +[`RuntimeFlags.Service`](../../src/effect/runtime-flags.ts), not through +mutable `Flag` or late `process.env` reads. + +Tests should vary behavior with explicit layer variants: + +```ts +const it = testEffect(MyService.defaultLayer.pipe(Layer.provide(RuntimeFlags.layer({ experimentalScout: true })))) +``` + +Do not mutate `process.env` or `Flag` after services/layers are built. + +## Per-Instance State + +Use [`InstanceState`](../../src/effect/instance-state.ts) when two open +directories should not share one copy of a service's state. It is backed by +a `ScopedCache`, keyed by directory, and disposed automatically when an +instance is unloaded. + +Put subscriptions, finalizers, and scoped background work inside the +`InstanceState.make(...)` initializer: + +```ts +const cache = + yield * + InstanceState.make( + Effect.fn("Foo.state")(function* () { + const bus = yield* Bus.Service + + yield* bus.subscribeAll().pipe( + Stream.runForEach((event) => handleEvent(event)), + Effect.forkScoped, + ) + + yield* Effect.acquireRelease(openResource, closeResource) + + return yield* loadInitialState() + }), + ) +``` + +Do not add separate `started` flags on top of `InstanceState`. Let +`ScopedCache` handle run-once and deduplication. + +To make `init()` non-blocking, fork at the caller/bootstrap boundary. Do +not fork inside `InstanceState.make(...)` just to return early with +partially initialized state. + +## Errors + +Expected domain failures belong on the Effect error channel. Defects are +for bugs, impossible states, and final unknown-boundary fallbacks. + +```ts +export class SessionBusyError extends Schema.TaggedErrorClass()("SessionBusyError", { + sessionID: SessionID, + message: Schema.String, +}) {} + +export type Error = Storage.Error | SessionBusyError + +export interface Interface { + readonly get: (id: SessionID) => Effect.Effect +} +``` + +Rules: + +- Use `Schema.TaggedErrorClass` for new expected domain errors. +- Export a domain-level `Error` union from service modules. +- In `Effect.gen` / `Effect.fn`, prefer `yield* new MyError(...)` for + direct expected failures. +- Use `Schema.Defect` for unknown cause fields. +- Use `Effect.try(...)`, `Effect.tryPromise(...)`, `Effect.mapError`, + `Effect.catchTag`, and `Effect.catchTags` to translate external + failures into domain errors. +- Do not use `Effect.die(...)` for user, IO, validation, missing-resource, + auth, provider, or busy-state failures. + +## HTTP Error Boundaries + +Service modules stay HTTP-agnostic. They should not import HTTP status +codes, `HttpApiError`, `HttpServerResponse`, or route-specific error +schemas. + +HTTP handlers translate service errors into endpoint-declared public error +schemas. Keep mappings inline when they are one-off; extract tiny shared +helpers only when the same translation repeats. + +Do not turn generic middleware into a registry of domain errors. Middleware +should handle cross-cutting concerns and the final unknown-defect fallback. + +Preserve legacy public wire shapes, such as `{ name, data }`, until a +deliberate breaking API change. + +## Schemas + +Use Effect Schema as the source of truth. + +- Use `Schema.Class` for exported data objects with a clear identity. +- Use `Schema.Struct` for local shapes and simple nested objects. +- Use `Schema.brand` for single-value IDs. +- Reuse named refinements instead of re-spelling constraints. +- Prefer narrow boundary helpers over generic Schema-to-Zod bridges. + +Intentional boundaries: + +- Public plugin tools still expose Zod through `tool.schema = z`. +- Tool parameter JSON Schema is generated through tool-specific helpers. +- Public config and TUI schemas are generated through the schema script. + +## Preferred Services + +In effectified code, yield existing services instead of dropping to ad hoc +platform APIs. + +- Use `AppFileSystem.Service` instead of raw `fs/promises` for app file IO. +- Use `AppProcess.Service` instead of direct `ChildProcessSpawner.spawn` or + legacy process helpers. +- Use `HttpClient.HttpClient` instead of raw `fetch` inside Effect code. +- Use `Path.Path`, `Config`, `Clock`, and `DateTime` when already inside + Effect. +- Use `Effect.callback` for callback-based APIs. +- Use `Effect.void` instead of `Effect.succeed(undefined)`. +- Use `Effect.cached` when concurrent callers should share one in-flight + computation. + +For background loops, use `Effect.repeat` or `Effect.schedule` with +`Effect.forkScoped` in the owning layer/state scope. + +## Promise And ALS Bridges + +[`EffectBridge`](../../src/effect/bridge.ts) is the sanctioned helper for +Promise/callback interop that needs to preserve instance/workspace context. +Keep it, but reduce its dependency on legacy `Instance.current` / +`Instance.restore` over time. + +`Instance.bind` / `Instance.restore` are transitional legacy tools. Use +them only for native callbacks that still require legacy ALS context. Do +not use them for `setTimeout`, `Promise.then`, `EventEmitter.on`, or +Effect fibers. + +## Testing + +Detailed test migration rules live in +[`test/EFFECT_TEST_MIGRATION.md`](../../test/EFFECT_TEST_MIGRATION.md). + +Core pattern: + +```ts +const it = testEffect(Layer.mergeAll(MyService.defaultLayer)) + +describe("my service", () => { + it.instance("does the thing", () => + Effect.gen(function* () { + const svc = yield* MyService.Service + expect(yield* svc.run()).toEqual("ok") + }), + ) +}) +``` + +Rules: + +- Use `it.effect(...)` for TestClock/TestConsole tests. +- Use `it.live(...)` for real timers, filesystem mtimes, child processes, + git, locks, or other live integration behavior. +- Use `it.instance(...)` for service tests that need a scoped instance. +- Prefer Effect-aware fixtures from `test/fixture/fixture.ts`. +- Avoid sleeps; wait for real events or deterministic state transitions. +- Avoid mutable `process.env`, `Flag`, or module-global changes after + layers are built. +- Use `Layer.mock` for partial service stubs. +- Avoid custom `ManagedRuntime`, `attach(...)`, or ad hoc `run(...)` test + wrappers. + +## Verification + +From `packages/opencode`: + +```bash +bun run typecheck +bun run test -- path/to/test.ts +``` + +Do not run tests from the repo root; the repo has a guard for that. diff --git a/packages/opencode/specs/effect/migration.md b/packages/opencode/specs/effect/migration.md index 01af9da6ce7a..5355feccc724 100644 --- a/packages/opencode/specs/effect/migration.md +++ b/packages/opencode/specs/effect/migration.md @@ -1,299 +1,62 @@ -# Effect patterns +# Effect Migration Patterns -Practical reference for new and migrated Effect code in `packages/opencode`. +This is the compact reference for moving code toward the current Effect +shape. The high-level roadmap is [`todo.md`](./todo.md); examples and +rules are in [`guide.md`](./guide.md). -## Choose scope +## Default Shape -Use `InstanceState` (from `src/effect/instance-state.ts`) for services that need per-directory state, per-instance cleanup, or project-bound background work. InstanceState uses a `ScopedCache` keyed by directory, so each open project gets its own copy of the state that is automatically cleaned up on disposal. +- Service methods return `Effect`. +- Service methods are named with `Effect.fn("Domain.method")`. +- Expected failures are typed errors on the error channel. +- Dependencies are yielded once at layer construction and closed over by + methods. +- `defaultLayer` wires production dependencies; tests can use open layers + when replacing dependencies. -Use `makeRuntime` (from `src/effect/run-service.ts`) to create a per-service `ManagedRuntime` that lazily initializes and shares layers via a global `memoMap`. Returns `{ runPromise, runFork, runCallback }`. +## Instance State -- Global services (no per-directory state): Account, Auth, AppFileSystem, Installation, Truncate, Worktree -- Instance-scoped (per-directory state via InstanceState): Agent, Bus, Command, Config, File, FileWatcher, Format, LSP, MCP, Permission, Plugin, ProviderAuth, Pty, Question, SessionStatus, Skill, Snapshot, ToolRegistry, Vcs +Use `InstanceState` for per-directory state, subscriptions, scoped +background work, and per-instance cleanup. -Rule of thumb: if two open directories should not share one copy of the service, it needs `InstanceState`. +Do not add ad hoc `started` flags on top of `InstanceState`; the scoped +cache handles run-once and concurrent deduplication. -## Instance context transition +## Runtime Boundaries -See `instance-context.md` for the phased plan to remove the legacy ALS / promise-backed `Instance` helper and move request / CLI / tool boundaries onto Effect-provided instance scope. +Prefer `AppRuntime` for crossing from non-Effect code into the shared app +layer. -## Service shape +`makeRuntime(...)` exists for intentional service-local boundaries and +legacy facades. Do not add new service-local runtimes unless the service is +genuinely outside `AppLayer`. -Every service follows the same pattern: one module, flat top-level exports, traced Effect methods, and a self-reexport at the bottom when the file is the public module. +## Platform Edges -```ts -export interface Interface { - readonly get: (id: FooID) => Effect.Effect -} +- Use `AppFileSystem.Service` instead of raw filesystem APIs in + effectified services. +- Use `AppProcess.Service` instead of raw process wrappers. +- Use `HttpClient.HttpClient` instead of raw `fetch` in Effect code. +- Use `Effect.cached` for shared in-flight work. +- Use `Effect.callback` for callback APIs. -export class Service extends Context.Service()("@opencode/Foo") {} +## Tests During Migration -export const layer = Layer.effect( - Service, - Effect.gen(function* () { - const state = yield* InstanceState.make( - Effect.fn("Foo.state")(() => Effect.succeed({ ... })), - ) +When migrating code, migrate touched tests toward +[`test/EFFECT_TEST_MIGRATION.md`](../../test/EFFECT_TEST_MIGRATION.md): - const get = Effect.fn("Foo.get")(function* (id: FooID) { - const s = yield* InstanceState.get(state) - // ... - }) +- `testEffect(...)` +- `it.effect`, `it.live`, or `it.instance` +- explicit layers for behavior changes +- deterministic waits instead of sleeps +- no mutable env/global flags after layers are built - return Service.of({ get }) - }), -) +## Migration Checklist -export const defaultLayer = layer.pipe(Layer.provide(FooDep.layer)) - -export * as Foo from "." -``` - -Rules: - -- Keep the service surface in one module; prefer flat top-level exports over `export namespace Foo { ... }` -- Use `Effect.fn("Foo.method")` for Effect methods -- Use a self-reexport (`export * as Foo from "."` or `"./foo"`) for the public namespace projection -- Avoid service-local `makeRuntime(...)` facades unless a file is still intentionally in the older migration phase -- No `Layer.fresh` for normal per-directory isolation; use `InstanceState` - -## Schema → Zod interop - -When a service uses Effect Schema internally but needs Zod schemas for the HTTP layer, derive Zod from Schema using the `zod()` helper from `@opencode-ai/core/effect-zod`: - -```ts -import { zod } from "@opencode-ai/core/effect-zod" - -export const ZodInfo = zod(Info) // derives z.ZodType from Schema.Union -``` - -See `Auth.ZodInfo` for the canonical example. - -## InstanceState init patterns - -The `InstanceState.make` init callback receives a `Scope`, so you can use `Effect.acquireRelease`, `Effect.addFinalizer`, and `Effect.forkScoped` inside it. Resources acquired this way are automatically cleaned up when the instance is disposed or invalidated by `ScopedCache`. This makes it the right place for: - -- **Subscriptions**: Yield `Bus.Service` at the layer level, then use `Stream` + `forkScoped` inside the init closure. The fiber is automatically interrupted when the instance scope closes: - -```ts -const bus = yield * Bus.Service - -const cache = - yield * - InstanceState.make( - Effect.fn("Foo.state")(function* (ctx) { - // ... load state ... - - yield* bus.subscribeAll().pipe( - Stream.runForEach((event) => - Effect.sync(() => { - /* handle */ - }), - ), - Effect.forkScoped, - ) - - return { - /* state */ - } - }), - ) -``` - -- **Resource cleanup**: Use `Effect.acquireRelease` or `Effect.addFinalizer` for resources that need teardown (native watchers, process handles, etc.): - -```ts -yield * - Effect.acquireRelease( - Effect.sync(() => nativeAddon.watch(dir)), - (watcher) => Effect.sync(() => watcher.close()), - ) -``` - -- **Background fibers**: Use `Effect.forkScoped` — the fiber is interrupted on disposal. -- **Side effects at init**: Config notification, event wiring, etc. all belong in the init closure. Callers just do `InstanceState.get(cache)` to trigger everything, and `ScopedCache` deduplicates automatically. - -The key insight: don't split init into a separate method with a `started` flag. Put everything in the `InstanceState.make` closure and let `ScopedCache` handle the run-once semantics. - -## Effect.cached for deduplication - -Use `Effect.cached` when multiple concurrent callers should share a single in-flight computation. It memoizes the result and deduplicates concurrent fibers — second caller joins the first caller's fiber instead of starting a new one. - -```ts -// Inside the layer — yield* to initialize the memo -let cached = yield * Effect.cached(loadExpensive()) - -const get = Effect.fn("Foo.get")(function* () { - return yield* cached // concurrent callers share the same fiber -}) - -// To invalidate: swap in a fresh memo -const invalidate = Effect.fn("Foo.invalidate")(function* () { - cached = yield* Effect.cached(loadExpensive()) -}) -``` - -Prefer `Effect.cached` over these patterns: - -- Storing a `Fiber.Fiber | undefined` with manual check-and-fork (e.g. `file/index.ts` `ensure`) -- Storing a `Promise` task for deduplication (e.g. `skill/index.ts` `ensure`) -- `let cached: X | undefined` with check-and-load (races when two callers see `undefined` before either resolves) - -`Effect.cached` handles the run-once + concurrent-join semantics automatically. For invalidatable caches, reassign with `yield* Effect.cached(...)` — the old memo is discarded. - -## Scheduled Tasks - -For loops or periodic work, use `Effect.repeat` or `Effect.schedule` with `Effect.forkScoped` in the layer definition. - -## Preferred Effect services - -In effectified services, prefer yielding existing Effect services over dropping down to ad hoc platform APIs. - -Prefer these first: - -- `FileSystem.FileSystem` instead of raw `fs/promises` for effectful file I/O -- `ChildProcessSpawner.ChildProcessSpawner` with `ChildProcess.make(...)` instead of custom process wrappers -- `HttpClient.HttpClient` instead of raw `fetch` -- `Path.Path` instead of mixing path helpers into service code when you already need a path service -- `Config` for effect-native configuration reads -- `Clock` / `DateTime` for time reads inside effects - -## Child processes - -For child process work in services, yield `ChildProcessSpawner.ChildProcessSpawner` in the layer and use `ChildProcess.make(...)`. - -Keep shelling-out code inside the service, not in callers. - -## Shared leaf models - -Shared schema or model files can stay outside the service namespace when lower layers also depend on them. - -That is fine for leaf files like `schema.ts`. Keep the service surface in the owning namespace. - -## Migration checklist - -Service-shape migrated (single namespace, traced methods, `InstanceState` where needed). - -This checklist is only about the service shape migration. Many of these services still keep `makeRuntime(...)` plus async facade exports; that facade-removal phase is tracked separately in `facades.md`. - -- [x] `Account` — `account/index.ts` -- [x] `Agent` — `agent/agent.ts` -- [x] `AppFileSystem` — `filesystem/index.ts` -- [x] `Auth` — `auth/index.ts` (uses `zod()` helper for Schema→Zod interop) -- [x] `Bus` — `bus/index.ts` -- [x] `Command` — `command/index.ts` -- [x] `Config` — `config/config.ts` -- [x] `Discovery` — `skill/discovery.ts` (dependency-only layer, no standalone runtime) -- [x] `File` — `file/index.ts` -- [x] `FileWatcher` — `file/watcher.ts` -- [x] `Format` — `format/index.ts` -- [x] `Installation` — `installation/index.ts` -- [x] `LSP` — `lsp/index.ts` -- [x] `MCP` — `mcp/index.ts` -- [x] `McpAuth` — `mcp/auth.ts` -- [x] `Permission` — `permission/index.ts` -- [x] `Plugin` — `plugin/index.ts` -- [x] `Project` — `project/project.ts` -- [x] `ProviderAuth` — `provider/auth.ts` -- [x] `Pty` — `pty/index.ts` -- [x] `Question` — `question/index.ts` -- [x] `SessionStatus` — `session/status.ts` -- [x] `Skill` — `skill/index.ts` -- [x] `Snapshot` — `snapshot/index.ts` -- [x] `ToolRegistry` — `tool/registry.ts` -- [x] `Truncate` — `tool/truncate.ts` -- [x] `Vcs` — `project/vcs.ts` -- [x] `Worktree` — `worktree/index.ts` - -- [x] `Session` — `session/index.ts` -- [x] `SessionProcessor` — `session/processor.ts` -- [x] `SessionPrompt` — `session/prompt.ts` -- [x] `SessionCompaction` — `session/compaction.ts` -- [x] `SessionSummary` — `session/summary.ts` -- [x] `SessionRevert` — `session/revert.ts` -- [x] `Instruction` — `session/instruction.ts` -- [x] `SystemPrompt` — `session/system.ts` -- [x] `Provider` — `provider/provider.ts` -- [x] `Storage` — `storage/storage.ts` -- [x] `ShareNext` — `share/share-next.ts` -- [x] `SessionTodo` — `session/todo.ts` - -Still open at the service-shape level: - -- [ ] `SyncEvent` — `sync/index.ts` (deferred pending sync with James) -- [ ] `Workspace` — `control-plane/workspace.ts` (deferred pending sync with James) - -## Tool migration - -Tool-specific migration guidance and checklist live in `tools.md`. - -## Effect service adoption in already-migrated code - -Some already-effectified areas still use raw `Filesystem.*` or `Process.spawn` in their implementation or helper modules. These are low-hanging fruit — the layers already exist, they just need the dependency swap. - -### `Filesystem.*` → `AppFileSystem.Service` (yield in layer) - -- [x] `config/config.ts` — `installDependencies()` now uses `AppFileSystem` -- [x] `provider/provider.ts` — recent model state now reads via `AppFileSystem.Service` - -### `Process.spawn` → `ChildProcessSpawner` (yield in layer) - -- [x] `format/formatter.ts` — direct `Process.spawn()` checks removed (`air`, `uv`) -- [ ] `lsp/server.ts` — multiple `Process.spawn()` installs/download helpers - -## Filesystem consolidation - -`util/filesystem.ts` is still used widely across `src/`, and raw `fs` / `fs/promises` imports still exist in multiple tooling and infrastructure files. As services and tools are effectified, they should switch from `Filesystem.*` to yielding `AppFileSystem.Service` where possible — this should happen naturally during each migration, not as a separate sweep. - -Tool-specific filesystem cleanup notes live in `tools.md`. - -## Primitives & utilities - -- [ ] `util/lock.ts` — reader-writer lock → Effect Semaphore/Permit -- [ ] `util/flock.ts` — file-based distributed lock with heartbeat → Effect.repeat + addFinalizer -- [ ] `util/process.ts` — child process spawn wrapper → return Effect instead of Promise -- [ ] `util/lazy.ts` — replace uses in Effect code with Effect.cached; keep for sync-only code - -## Destroying the facades - -This phase is no longer broadly open. There are 5 `makeRuntime(...)` call sites under `src/`, and only a small subset are still ordinary facade-removal targets. The live checklist now lives in `facades.md`. - -These facades exist because cyclic imports used to force each service to build its own independent runtime. Now that the layer DAG is acyclic and `AppRuntime` (`src/effect/app-runtime.ts`) composes everything into one `ManagedRuntime`, we're removing them. - -### Process - -For each service, the migration is roughly: - -1. **Find callers.** `grep -n "Namespace\.(methodA|methodB|...)"` across `src/` and `test/`. Skip the service file itself. -2. **Migrate production callers.** For each effectful caller that does `Effect.tryPromise(() => Namespace.method(...))`: - - Add the service to the caller's layer R type (`Layer.Layer`) - - Yield it at the top of the layer: `const ns = yield* Namespace.Service` - - Replace `Effect.tryPromise(() => Namespace.method(...))` with `yield* ns.method(...)` (or `ns.method(...).pipe(Effect.orElseSucceed(...))` for the common fallback case) - - Add `Layer.provide(Namespace.defaultLayer)` to the caller's own `defaultLayer` chain -3. **Fix tests that used the caller's raw `.layer`.** Any test that composes `Caller.layer` (not `defaultLayer`) needs to also provide the newly-required service tag. The fastest fix is usually switching to `Caller.defaultLayer` since it now pulls in the new dependency. -4. **Migrate test callers of the facade.** Tests calling `Namespace.method(...)` directly get converted to full effectful style using `testEffect(Namespace.defaultLayer)` + `it.live` / `it.effect` + `yield* svc.method(...)`. Don't wrap the test body in `Effect.promise(async () => {...})` — do the whole thing in `Effect.gen` and use `AppFileSystem.Service` / `tmpdirScoped` / `Effect.addFinalizer` for what used to be raw `fs` / `Bun.write` / `try/finally`. -5. **Delete the facades.** Once `grep` shows zero callers, remove the `export async function` block AND the `makeRuntime(...)` line from the service namespace. Also remove the now-unused `import { makeRuntime }`. - -### Pitfalls - -- **Layer caching inside tests.** `testEffect(layer)` constructs the Storage (or whatever) service once and memoizes it. If a test then tries `inner.pipe(Effect.provide(customStorage))` to swap in a differently-configured Storage, the outer cached one wins and the inner provision is a no-op. Fix: wrap the overriding layer in `Layer.fresh(...)`, which forces a new instance to be built instead of hitting the memoMap cache. This lets a single `testEffect(...)` serve both simple and per-test-customized cases. -- **`Effect.tryPromise` → `yield*` drops the Promise layer.** The old code was `Effect.tryPromise(() => Storage.read(...))` — a `tryPromise` wrapper because the facade returned a Promise. The new code is `yield* storage.read(...)` directly — the service method already returns an Effect, so no wrapper is needed. Don't reach for `Effect.promise` or `Effect.tryPromise` during migration; if you're using them on a service method call, you're doing it wrong. -- **Raw `.layer` test callers break silently in the type checker.** When you add a new R requirement to a service's `.layer`, any test that composes it raw (not `defaultLayer`) becomes under-specified. `tsgo` will flag this — the error looks like `Type 'Storage.Service' is not assignable to type '... | Service | TestConsole'`. Usually the fix is to switch that composition to `defaultLayer`, or add `Layer.provide(NewDep.defaultLayer)` to the custom composition. -- **Tests that do async setup with `fs`, `Bun.write`, `tmpdir`.** Convert these to `AppFileSystem.Service` calls inside `Effect.gen`, and use `tmpdirScoped()` instead of `tmpdir()` so cleanup happens via the scope finalizer. For file operations on the actual filesystem (not via a service), a small helper like `const writeJson = Effect.fnUntraced(function* (file, value) { const fs = yield* AppFileSystem.Service; yield* fs.makeDirectory(path.dirname(file), { recursive: true }); yield* fs.writeFileString(file, JSON.stringify(value, null, 2)) })` keeps the migration tests clean. - -### Migration log - -- `SessionStatus` — migrated 2026-04-11. Replaced the last route and retry-policy callers with `AppRuntime.runPromise(SessionStatus.Service.use(...))` and removed the `makeRuntime(...)` facade. -- `ShareNext` — migrated 2026-04-11. Swapped remaining async callers to `AppRuntime.runPromise(ShareNext.Service.use(...))`, removed the `makeRuntime(...)` facade, and kept instance bootstrap on the shared app runtime. -- `SessionTodo` — migrated 2026-04-10. Already matched the target service shape in `session/todo.ts`: single namespace, traced Effect methods, and no `makeRuntime(...)` facade remained; checklist updated to reflect the completed migration. -- `Storage` — migrated 2026-04-10. One production caller (`Session.diff`) and all storage.test.ts tests converted to effectful style. Facades and `makeRuntime` removed. -- `SessionRunState` — migrated 2026-04-11. Single caller in `server/routes/instance/session.ts` converted; facade removed. -- `Account` — migrated 2026-04-11. Callers in `server/routes/instance/experimental.ts` and `cli/cmd/account.ts` converted; facade removed. -- `Instruction` — migrated 2026-04-11. Test-only callers converted; facade removed. -- `FileWatcher` — migrated 2026-04-11. Callers in `project/bootstrap.ts` and test converted; facade removed. -- `Question` — migrated 2026-04-11. Callers in `server/routes/instance/question.ts` and test converted; facade removed. -- `Truncate` — migrated 2026-04-11. Caller in `tool/tool.ts` and test converted; facade removed. - -## Route handler effectification - -Route-handler migration guidance and checklist live in `routes.md`. +- [ ] The code has a single Effect body instead of Promise wrappers around + service calls. +- [ ] Expected failures are typed errors, not thrown exceptions or defects. +- [ ] Layer requirements are explicit. +- [ ] Tests use Effect-aware fixtures and focused layers. +- [ ] Public behavior and wire shapes are preserved unless intentionally + changed. diff --git a/packages/opencode/specs/effect/routes.md b/packages/opencode/specs/effect/routes.md index 8066bda34656..7dcd80ce96b8 100644 --- a/packages/opencode/specs/effect/routes.md +++ b/packages/opencode/specs/effect/routes.md @@ -1,57 +1,61 @@ -# Route handler effectification +# HTTP Route Patterns -Practical reference for converting server route handlers in `packages/opencode` to a single `AppRuntime.runPromise(Effect.gen(...))` body. +Current guidance for `packages/opencode/src/server/routes/instance/httpapi`. -## Goal +## Handler Shape -Route handlers should wrap their entire body in a single `AppRuntime.runPromise(Effect.gen(...))` call, yielding services from context rather than calling facades one-by-one. - -This eliminates multiple `runPromise` round-trips and lets handlers compose naturally. +Use `HttpApiBuilder.group(...)` for normal JSON and streaming HTTP API +endpoints. Yield stable services once while building the handler layer, +then close over those services in endpoint implementations. ```ts -// Before - one facade call per service -;async (c) => { - await SessionRunState.assertNotBusy(id) - await Session.removeMessage({ sessionID: id, messageID }) - return c.json(true) -} - -// After - one Effect.gen, yield services from context -;async (c) => { - await AppRuntime.runPromise( - Effect.gen(function* () { - const state = yield* SessionRunState.Service - const session = yield* Session.Service - yield* state.assertNotBusy(id) - yield* session.removeMessage({ sessionID: id, messageID }) - }), - ) - return c.json(true) -} +export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", (handlers) => + Effect.gen(function* () { + const session = yield* Session.Service + + return handlers.handle("list", () => session.list()) + }), +) ``` -## Rules +Use raw `HttpRouter` only for routes that do not fit the request/response +HttpApi model, such as WebSocket upgrades or catch-all fallback routes. + +Do not rebuild stable layers inside request handlers. Provide stable +services at the route/layer boundary and use request-level provisioning +only for request-derived context. + +## Error Boundaries + +Expected service errors should be mapped at the handler boundary to +endpoint-declared public HTTP errors. Keep one-off mappings inline. Extract +small helpers when the same mapping repeats. + +Generic middleware should not become a domain-error mapper. It should +handle cross-cutting concerns and final unknown-defect fallback. + +Public JSON errors should be explicit schema contracts declared on each +endpoint or group. Built-in `HttpApiError.*` is fine only when its generated +body is intentionally the public wire shape. -- Wrap the whole handler body in one `AppRuntime.runPromise(Effect.gen(...))` call when the handler is service-heavy. -- Yield services from context instead of calling async facades repeatedly. -- When independent service calls can run in parallel, use `Effect.all(..., { concurrency: "unbounded" })`. -- Prefer one composed Effect body over multiple separate `runPromise(...)` calls in the same handler. +Preserve existing `{ name, data }` error bodies until a deliberate breaking +API change. -## Current route files +## OpenAPI Compatibility -Current instance route files live under `src/server/routes/instance/httpapi`. -Most handlers already yield stable services at route-layer construction and then -close over those services in endpoint implementations. +`public.ts` still owns SDK/OpenAPI compatibility transforms. Shrink those +transforms by tightening source schemas one workaround at a time. -Files still worth tracking here: +When an OpenAPI-visible source schema changes: -- [ ] `handlers/session.ts` — still the heaviest mixed file; some paths keep compatibility translations and direct event publication -- [ ] `handlers/experimental.ts` — mixed state; some handlers still rely on request-local context reads -- [ ] `middleware/*` — still contains compatibility policy for auth, compression, errors, instance context, and workspace routing -- [ ] `public.ts` — still owns SDK/OpenAPI compatibility translation shims -- [ ] raw route modules — WebSocket and catch-all routes should stay explicit and avoid rebuilding stable layers per request +- verify the generated SDK diff is intentional +- preserve legacy compatibility unless the PR explicitly changes it +- prefer source-schema fixes over new post-processing rules -## Notes +## Checklist For Route PRs -- Route conversion is now less about backend migration and more about removing the remaining direct `Instance.*` reads, request-local service plumbing, and OpenAPI compatibility shims. -- Prefer route-layer service capture over rebuilding or providing stable layers inside individual handlers. +- [ ] Stable services are yielded at handler-layer construction. +- [ ] Expected domain errors are translated at the route boundary. +- [ ] Endpoint/group error schemas describe the public body and status. +- [ ] Middleware does not gain new domain-specific name checks. +- [ ] Raw routes are used only when HttpApi is the wrong abstraction. diff --git a/packages/opencode/specs/effect/schema.md b/packages/opencode/specs/effect/schema.md index 20b3e70e7be3..12ac267048dc 100644 --- a/packages/opencode/specs/effect/schema.md +++ b/packages/opencode/specs/effect/schema.md @@ -1,49 +1,34 @@ -# Schema migration +# Schema Migration -Practical reference for migrating data types in `packages/opencode` from -Zod-first definitions to Effect Schema with Zod compatibility shims. +Use Effect Schema as the source of truth for domain models, DTOs, IDs, +inputs, outputs, and typed errors. -## Goal +This is guidance, not an inventory. Do not use this file to track which +schema modules are complete; verify current state with `git grep` before +starting a migration. -Use Effect Schema as the source of truth for domain models, IDs, inputs, -outputs, and typed errors. Keep Zod available at existing HTTP, tool, and -compatibility boundaries by exposing a `.zod` static derived from the Effect -schema via `@opencode-ai/core/effect-zod`. +## Preferred Shapes -The long-term driver is `specs/effect/http-api.md` — once the HTTP server -moves to `@effect/platform`, every Schema-first DTO can flow through -`HttpApi` / `HttpRouter` without a zod translation layer, and the entire -`effect-zod` walker plus every `.zod` static can be deleted. - -## Preferred shapes - -### Data objects - -Use `Schema.Class` for structured data. +Use `Schema.Class` for exported data objects with a clear domain identity: ```ts export class Info extends Schema.Class("Foo.Info")({ id: FooID, name: Schema.String, enabled: Schema.Boolean, -}) { - static readonly zod = zod(Info) -} +}) {} ``` -If the class cannot reference itself cleanly during initialization, use the -two-step `withStatics` pattern: +Use `Schema.Struct` for local shapes and simple nested objects: ```ts -export const Info = Schema.Struct({ +const Payload = Schema.Struct({ id: FooID, - name: Schema.String, -}).pipe(withStatics((s) => ({ zod: zod(s) }))) + value: Schema.String, +}) ``` -### Errors - -Use `Schema.TaggedErrorClass` for domain errors. +Use `Schema.TaggedErrorClass` for expected domain errors: ```ts export class NotFoundError extends Schema.TaggedErrorClass()("FooNotFoundError", { @@ -51,329 +36,53 @@ export class NotFoundError extends Schema.TaggedErrorClass()("Foo }) {} ``` -### IDs and branded leaf types - -Keep branded/schema-backed IDs as Effect schemas and expose -`static readonly zod` for compatibility when callers still expect Zod. - -### Refinements - -Reuse named refinements instead of re-spelling `z.number().int().positive()` -in every schema. The `effect-zod` walker translates the Effect versions into -the corresponding zod methods, so JSON Schema output (`type: integer`, -`exclusiveMinimum`, `pattern`, `format: uuid`, …) is preserved. - -```ts -const PositiveInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)) -const NonNegativeInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)) -const HexColor = Schema.String.check(Schema.isPattern(/^#[0-9a-fA-F]{6}$/)) -``` - -See `test/util/effect-zod.test.ts` for the full set of translated checks. - -## Compatibility rule - -During migration, route validators, tool parameters, and any existing -Zod-based boundary should consume the derived `.zod` schema instead of -maintaining a second hand-written Zod schema. - -The default should be: - -- Effect Schema owns the type -- `.zod` exists only as a compatibility surface -- new domain models should not start Zod-first unless there is a concrete - boundary-specific need - -## When Zod can stay - -It is fine to keep a Zod-native schema temporarily when: - -- the type is only used at an HTTP or tool boundary and is not reused elsewhere -- the validator depends on Zod-only transforms or behavior not yet covered by `zod()` -- the migration would force unrelated churn across a large call graph - -When this happens, prefer leaving a short note or TODO rather than silently -creating a parallel schema source of truth. - -## Escape hatches - -The walker in `@opencode-ai/core/effect-zod` exposes two explicit escape hatches for -cases the pure-Schema path cannot express. Each one stays in the codebase -only as long as its upstream or local dependency requires it — inline -comments document when each can be deleted. - -### `ZodOverride` annotation - -Replaces the entire derivation with a hand-crafted zod schema. Used when: - -- the target carries external `$ref` metadata (e.g. - `config/model-id.ts` points at `https://models.dev/...`) -- the target is a zod-only schema that cannot yet be expressed as Schema - (e.g. `ConfigAgent.Info`, `Log.Level`) - -### Local `DeepMutable` in `config/config.ts` - -`Schema.Struct` produces `readonly` types. Some consumer code (notably the -`Config` service) mutates `Info` objects directly, so a readonly-stripping -utility is needed when casting the derived zod schema's output type. - -`Types.DeepMutable` from effect-smol would be a drop-in, but it widens -`unknown` to `{}` in the fallback branch — a bug that affects any schema -using `Schema.Record(String, Schema.Unknown)`. - -Tracked upstream as `effect:core/x228my`: "Types.DeepMutable widens unknown -to `{}`." Once that lands, the local `DeepMutable` copy can be deleted and -`Types.DeepMutable` used directly. +Use branded schema-backed IDs for single-value domain identifiers. -## Ordering +## Boundary Rule -Migrate in this order: +Effect Schema should own the type. Boundaries should consume Effect Schema +directly or use narrow boundary-specific helpers. Avoid reintroducing a +generic Effect Schema -> Zod bridge. -1. Shared leaf models and `schema.ts` files -2. Exported `Info`, `Input`, `Output`, and DTO types -3. Tagged domain errors -4. Service-local internal models -5. Route and tool boundary validators that can switch to `.zod` +Current intentional boundaries: -This keeps shared types canonical first and makes boundary updates mostly -mechanical. +- Public plugin tools still expose Zod through `tool.schema = z`. +- Tool parameters use tool-specific JSON Schema helpers. +- Public config and TUI schema generation goes through the schema script. +- AI SDK object generation uses Standard Schema / JSON Schema helpers. -## Progress tracker +When Zod must stay temporarily, leave a short note explaining the boundary +or compatibility reason. -### `src/config/` ✅ complete +## Refinements -All of `packages/opencode/src/config/` has been migrated. Files that still -import `z` do so only for local `ZodOverride` bridges or for `z.ZodType` -type annotations — the `export const ` values are all Effect -Schema at source. +Reuse named refinements instead of re-spelling constraints: -A file is considered "done" when: - -- its exported schema values (`Info`, `Input`, `Event`, `Definition`, etc.) - are authored as Effect Schema -- any remaining zod is either a derived compat bridge (via `zod()` / - `zodObject()`), a `z.ZodType` type annotation, or a documented - `ZodOverride` escape hatch — never a hand-written parallel source of truth - -Files that meet this bar but still carry a compat bridge are checked off -with an inline note describing the bridge and what unblocks its removal. - -- [x] skills, formatter, console-state, mcp, lsp, permission (leaves), model-id, command, plugin, provider -- [x] server, layout -- [x] keybinds -- [x] permission#Info -- [x] agent -- [x] config.ts root - -### `src/*/schema.ts` leaf modules - -These are the highest-priority next targets. Each is a small, self-contained -schema module with a clear domain. - -- [x] `src/account/schema.ts` -- [x] `src/control-plane/schema.ts` -- [x] `src/permission/schema.ts` -- [x] `src/project/schema.ts` -- [x] `src/provider/schema.ts` -- [x] `src/pty/schema.ts` -- [x] `src/question/schema.ts` -- [x] `src/session/schema.ts` -- [x] `src/storage/schema.ts` -- [x] `src/sync/schema.ts` -- [x] `src/tool/schema.ts` -- [x] `src/util/schema.ts` - -### Session domain - -Major cluster. Message + event types flow through the SSE API and every SDK -output, so byte-identical SDK surface is critical. - -Suggested order for this cluster, starting from the leaves that `session.ts` -and the SSE/event surface depend on: - -1. `src/session/schema.ts` ✅ already migrated -2. `src/provider/schema.ts` if `message-v2.ts` still relies on zod-first IDs -3. `src/lsp/*` schema leaves needed by `LSP.Range` -4. `src/snapshot/*` leaves used by `Snapshot.FileDiff` -5. `src/session/message-v2.ts` -6. `src/session/message.ts` -7. `src/session/prompt.ts` -8. `src/session/revert.ts` -9. `src/session/summary.ts` -10. `src/session/status.ts` -11. `src/session/todo.ts` -12. `src/session/session.ts` -13. `src/session/compaction.ts` - -Dependency sketch: - -```text -session.ts -|- project/schema.ts -|- control-plane/schema.ts -|- permission/schema.ts -|- snapshot/* -|- message-v2.ts -| |- provider/schema.ts -| |- lsp/* -| |- snapshot/* -| |- sync/index.ts -| `- bus/bus-event.ts -|- sync/index.ts -|- bus/bus-event.ts -`- util/update-schema.ts +```ts +const PositiveInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)) +const NonNegativeInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)) ``` -Working rule for this cluster: - -- migrate reusable leaf schemas and nested payload objects first -- migrate aggregate DTOs like `Session.Info` after their nested pieces exist as - named Schema values -- leave zod-only event/update helpers in place temporarily when converting - them would force unrelated churn across sync/bus boundaries - -`message-v2.ts` first-pass outline: - -1. Schema-backed imports already available - - `SessionID`, `MessageID`, `PartID` - - `ProviderID`, `ModelID` -2. Local leaf objects to extract and migrate first - - output format payloads - - common part bases like `PartBase` - - timestamp/range helper objects like `time.start/end` - - file/source helper objects - - token/cost/model helper objects -3. Part variants built from those leaves - - `SnapshotPart`, `PatchPart`, `TextPart`, `ReasoningPart` - - `FilePart`, `AgentPart`, `CompactionPart`, `SubtaskPart` - - retry/step/tool related parts -4. Higher-level unions and DTOs - - `FilePartSource` - - part unions - - message unions and assistant/user payloads -5. Errors and event payloads last - - `NamedError.create(...)` shapes can stay temporarily if converting them to - `Schema.TaggedErrorClass` would force unrelated churn - - `SyncEvent.define(...)` and `BusEvent.define(...)` payloads can use - derived `.zod` at remaining zod-based HTTP/OpenAPI boundaries - -Possible later tightening after the Schema-first migration is stable: - -- promote repeated opaque strings and timestamp numbers into branded/newtype - leaf schemas where that adds domain value without changing the wire format - -- [x] `src/session/compaction.ts` -- [x] `src/session/message-v2.ts` -- [x] `src/session/message.ts` -- [x] `src/session/prompt.ts` -- [x] `src/session/revert.ts` -- [x] `src/session/session.ts` -- [x] `src/session/status.ts` -- [x] `src/session/summary.ts` -- [x] `src/session/todo.ts` - -### Provider domain - -- [x] `src/provider/auth.ts` -- [x] `src/provider/models.ts` -- [x] `src/provider/provider.ts` - -### Tool schemas - -Each tool declares its parameters via a zod schema. Tools are consumed by -both the in-process runtime and the AI SDK's tool-calling layer, so the -emitted JSON Schema must stay byte-identical. - -- [x] `src/tool/apply_patch.ts` -- [x] `src/tool/bash.ts` -- [x] `src/tool/edit.ts` -- [x] `src/tool/glob.ts` -- [x] `src/tool/grep.ts` -- [x] `src/tool/invalid.ts` -- [x] `src/tool/lsp.ts` -- [x] `src/tool/plan.ts` -- [x] `src/tool/question.ts` -- [x] `src/tool/read.ts` -- [x] `src/tool/registry.ts` -- [x] `src/tool/skill.ts` -- [x] `src/tool/task.ts` -- [x] `src/tool/todo.ts` -- [x] `src/tool/tool.ts` -- [x] `src/tool/webfetch.ts` -- [x] `src/tool/websearch.ts` -- [x] `src/tool/write.ts` - -### HTTP route boundaries - -The server route tree now lives under `src/server/routes/instance/httpapi` and -uses Effect HttpApi contracts for request and response schemas. Remaining schema -work is no longer a Hono route migration; it is compatibility cleanup around -derived `.zod` statics, OpenAPI translation shims, and route groups that still -need explicit SDK-visible error contracts. - -Good follow-up targets: - -- shrink `public.ts` legacy OpenAPI translation shims one SDK-compatible slice at a time -- replace production `.zod.safeParse(...)` call sites with Effect Schema decoders -- remove derived `.zod` statics after their production consumers are gone -- declare route-group errors directly instead of relying on compatibility middleware - -### Everything else +Prefer domain-named leaf schemas when the name improves callers or error +messages. Avoid adding brands purely for novelty. -Small / shared / control-plane / CLI. Mostly independent; can be done -piecewise. +## Migration Order -- [ ] `src/acp/agent.ts` -- [ ] `src/agent/agent.ts` -- [x] `src/bus/bus-event.ts` -- [ ] `src/bus/index.ts` -- [ ] `src/cli/cmd/tui/config/tui-migrate.ts` -- [ ] `src/cli/cmd/tui/config/tui-schema.ts` -- [ ] `src/cli/cmd/tui/config/tui.ts` -- [ ] `src/cli/cmd/tui/event.ts` -- [ ] `src/cli/ui.ts` -- [ ] `src/command/index.ts` -- [x] `src/control-plane/adapters/worktree.ts` -- [x] `src/control-plane/types.ts` -- [x] `src/control-plane/workspace.ts` -- [ ] `src/file/index.ts` -- [ ] `src/file/ripgrep.ts` -- [ ] `src/file/watcher.ts` -- [ ] `src/format/index.ts` -- [ ] `src/id/id.ts` -- [ ] `src/ide/index.ts` -- [ ] `src/installation/index.ts` -- [ ] `src/lsp/client.ts` -- [ ] `src/lsp/lsp.ts` -- [ ] `src/mcp/auth.ts` -- [ ] `src/patch/index.ts` -- [ ] `src/plugin/github-copilot/models.ts` -- [ ] `src/project/project.ts` -- [ ] `src/project/vcs.ts` -- [ ] `src/pty/index.ts` -- [ ] `src/skill/index.ts` -- [ ] `src/snapshot/index.ts` -- [ ] `src/storage/db.ts` -- [ ] `src/storage/storage.ts` -- [x] `src/sync/index.ts` — public API (`SyncEvent.define`) is Schema-first; `payloads()` still derives zod for the remaining HTTP/OpenAPI boundary -- [ ] `src/util/fn.ts` -- [ ] `src/util/log.ts` -- [ ] `src/util/update-schema.ts` -- [ ] `src/worktree/index.ts` +For a domain that still has mixed schemas: -### Do-not-migrate +1. Shared leaf models and branded IDs. +2. Exported `Info`, `Input`, `Output`, and event payload types. +3. Expected domain errors. +4. Service-local internal models. +5. HTTP/tool/AI boundary validators. -- `src/util/effect-zod.ts` — the walker itself. Stays zod-importing forever - (it's what emits zod from Schema). Goes away only when the `.zod` - compatibility layer is no longer needed anywhere. +Keep public wire shapes stable unless the PR is explicitly a breaking API +change. -## Notes +## Checklist For A PR -- Use `@opencode-ai/core/effect-zod` for all Schema → Zod conversion. -- Prefer one canonical schema definition. Avoid maintaining parallel Zod and - Effect definitions for the same domain type. -- Keep the migration incremental. Converting the domain model first is more - valuable than converting every boundary in the same change. -- Every migrated file should leave the generated SDK output (`packages/sdk/ -openapi.json` and `packages/sdk/js/src/v2/gen/types.gen.ts`) byte-identical - unless the change is deliberately user-visible. +- [ ] There is one schema source of truth for each migrated type. +- [ ] Remaining Zod is an intentional boundary choice. +- [ ] Public JSON/OpenAPI output is unchanged or intentionally updated. +- [ ] Derived helpers are narrow and boundary-specific. +- [ ] Tests assert behavior, not duplicated schema implementation details. diff --git a/packages/opencode/specs/effect/todo.md b/packages/opencode/specs/effect/todo.md new file mode 100644 index 000000000000..092e80b767b3 --- /dev/null +++ b/packages/opencode/specs/effect/todo.md @@ -0,0 +1,304 @@ +# Effect TODO + +Short roadmap for Effect cleanup in `packages/opencode`. + +Current patterns and examples live in [`guide.md`](./guide.md). Error +boundary migration details live in +[`error-boundaries-plan.md`](./error-boundaries-plan.md). Test migration rules live in +[`test/EFFECT_TEST_MIGRATION.md`](../../test/EFFECT_TEST_MIGRATION.md). +Older deep-dive notes in this directory may still be useful, but treat +this roadmap and the guide as the current entry points. + +This is a planning map, not a verified inventory. Before starting a task, +re-run a targeted `git grep` from current `dev` and update this file if +the inventory changed. + +## Priorities + +```text +P0 ERR + RENDER + HTTP + Make expected failures typed, render them well, and stop relying on + generic HTTP error guesswork. + +P1 TEST + Convert touched tests to the ideal Effect test patterns from the guide. + +P2 RF + Move mutable runtime flags into typed runtime/config services. + +P3 GLOBAL + Make global paths explicit and remove import-time side effects. + +P4 INST + BRIDGE + Remove ambient Instance coupling while keeping Promise/callback interop. + +P5 PROC + FS + Replace raw process/filesystem edges with typed Effect services. + +P6 OA + Shrink OpenAPI compatibility shims as source schemas improve. +``` + +## Work Paths + +- `ERR` Typed errors — replace legacy `NamedError.create(...)` and + `Effect.die(...)` for expected service failures with + `Schema.TaggedErrorClass` errors on the Effect error channel. + Shrinks: [`NamedError`](../../../core/src/util/error.ts) usage. +- `RENDER` User-visible error rendering — preserve structured typed-error + details at CLI, HTTP, and tool boundaries. + Shrinks: opaque `Error: Name` rendering. +- `HTTP` HTTP route cleanup — make route errors explicit instead of + relying on generic middleware to guess status/body from error names. + Shrinks: [`middleware/error.ts`](../../src/server/routes/instance/httpapi/middleware/error.ts) + and route-level compatibility shims. +- `TEST` Effect test migration — use `testEffect`, `it.live`, and + `it.instance` with explicit layers. + Shrinks: Promise-style tests, sleeps, mutable global test flags. +- `RF` RuntimeFlags / Flag deletion — move mutable + [`Flag`](../../../core/src/flag/flag.ts) reads into typed runtime/config + services. + Shrinks: [`flag.ts`](../../../core/src/flag/flag.ts), + [`test/fixture/flag.ts`](../../test/fixture/flag.ts). +- `GLOBAL` Global paths / import side effects — make global path state + explicit and testable instead of mutable module state. + Shrinks: [`global.ts`](../../../core/src/global.ts) import-time side + effects, mutable `Global.Path` overrides, and its `Flag` dependency. +- `INST` Instance shim — remove ambient `Instance` usage and old ALS + access patterns. + Shrinks: [`src/project/instance.ts`](../../src/project/instance.ts). +- `BRIDGE` Promise/callback interop — keep bridge helpers, but reduce + legacy ALS coupling. + Shrinks: [`src/effect/bridge.ts`](../../src/effect/bridge.ts) + dependency on [`project/instance.ts`](../../src/project/instance.ts). +- `PROC` AppProcess migration — prefer `AppProcess.Service` over raw + process wrappers. + Shrinks: direct spawn callsites and legacy process helpers. +- `FS` AppFileSystem migration — prefer `AppFileSystem.Service` over raw + filesystem APIs. + Shrinks: direct `fs` / `Bun.file` service callsites where inappropriate. +- `RT` Runtime/facade cleanup — remove service-local `makeRuntime` + facades when not intentional. + Shrinks: async facade exports around services and + [`run-service.ts`](../../src/effect/run-service.ts) usage. +- `OA` OpenAPI compatibility — tighten source schemas instead of + post-processing generated OpenAPI. + Shrinks: schema workaround blocks in + [`public.ts`](../../src/server/routes/instance/httpapi/public.ts). + +## P0: Errors, Rendering, And HTTP + +This should be the next big cleanup theme. The codebase is moving toward +typed Effect failures, but the user-facing boundaries still leak old +shapes and sometimes collapse rich errors into opaque strings. + +### Problems + +- Some expected service failures still use `NamedError.create(...)` or + collapse to `Effect.die(...)`. The storage/worktree/provider-auth + conversions are done; an inventory sweep is needed for the rest. +- HTTP error middleware still guesses status codes from error names — + some entries (e.g. storage `NotFound`, provider auth) can now be + removed, but the middleware overall has not shrunk. +- Route handlers and route groups do not consistently declare the public + error body they intend to expose. +- Repeated route error translations do not yet have a clear home: some + should stay inline, some deserve tiny shared mapper helpers. + +### Target Shape + +- Services define expected failures with `Schema.TaggedErrorClass`. +- Services export an `Error` union and include it in method return types. +- Expected failures stay on the Effect error channel. +- `Effect.die(...)` is reserved for defects: bugs, impossible states, + violated invariants, or final unknown-boundary fallbacks. +- Inside `Effect.gen` / `Effect.fn`, use `yield* new MyError(...)` for + direct expected failures. +- Domain services do not import HTTP status codes, `HttpApiError`, or + route-specific error schemas. +- HTTP route groups make their public error contracts obvious. +- Handlers map service errors to declared HTTP errors at the boundary. +- Shared mapper helpers are only for repeated translations, not a giant + central registry of every domain error. +- Generic HTTP middleware should shrink; it should not accumulate more + name-based domain knowledge. + +### Recently completed + +- [x] `RENDER-1` CLI tagged config error rendering (#27256, tests #27257). +- [x] `ERR-1` [`storage/storage.ts`](../../src/storage/storage.ts) typed + `NotFoundError` (#27265) and removal of the server defect fallback + (#27287). +- [x] `ERR-2` [`worktree/index.ts`](../../src/worktree/index.ts) typed + errors (#27296). +- [x] `ERR-3` [`provider/auth.ts`](../../src/provider/auth.ts) typed + validation/oauth errors (#27301). +- [x] `HTTP-1` Unknown-500 details no longer leaked (#27251); follow-up + to stop exposing named defects (#27471). +- [x] Session message reads typed and made effectful (#27269, #27275, + #27280, #27291). +- [x] Session HTTP error contracts tightened (#27308); busy-session + mapping centralized (#27375, #27473). +- [x] Provider init (#27484) and LSP init (#27494) errors typed. + +### First PR Candidates + +- [ ] `HTTP-2` Audit one route group for explicit error contracts and + decide which mappings stay inline vs. shared helper. +- [ ] `ERR-4` Sweep remaining `NamedError.create(...)` and + `Effect.die(...)` callsites for expected failures — re-run `git +grep` to build a current inventory. +- [ ] `RENDER-2` Audit CLI and TUI surfaces for any remaining opaque + `Error: Name` rendering of typed errors. + +## P1: Tests + +When touching tests, migrate them toward the ideal patterns in +[`test/EFFECT_TEST_MIGRATION.md`](../../test/EFFECT_TEST_MIGRATION.md): + +- Use `testEffect(...)` with explicit layers. +- Prefer `it.instance(...)` for service tests that need an instance. +- Prefer `it.live(...)` for real timers, filesystem mtimes, child + processes, git, locks, or other live integration behavior. +- Avoid sleeps; wait on real events or deterministic state transitions. +- Do not mutate `process.env` or mutable globals after layers are built. +- Use explicit layer variants, such as `RuntimeFlags.layer(...)`, for + behavior changes. + +## P2: RuntimeFlags / Flag Deletion + +Recently completed: + +- [x] Plugin/pure-mode flags moved to RuntimeFlags. +- [x] Tool visibility flags moved to RuntimeFlags. +- [x] Built-in websearch provider selection uses the same runtime flags as + tool visibility. +- [x] Removed global default-plugin disabling from test preload. +- [x] `RF-1` Scout reads routed through runtime flags (#27318). +- [x] `RF-2` Plan-mode prompt read routed through runtime flags (#27320). +- [x] `RF-3` Event-system reads routed through runtime flags (#27323). +- [x] `RF-4` Workspaces reads routed through runtime flags for session + (#27335), sync (#27336), and control-plane (#27337). +- [x] LLM client (#27368) and installation client (#27369) routed + through runtime flags. +- [x] TUI plugin runtime flags simplified (#27506). +- [x] Background-subagents flag moved to RuntimeFlags, then removed + (`refactor(task): use runtime flag for background subagents`, + `refactor(flags): remove background subagents flag`). + +Remaining cleanup: + +- [ ] Sweep lingering `Flag.*` reads — many CLI/TUI/config/observability + callsites still import [`flag.ts`](../../../core/src/flag/flag.ts). + Decide per-callsite whether to route through RuntimeFlags, accept + as legitimate env/config boundary, or migrate to typed `Config`. +- [ ] Delete [`test/fixture/flag.ts`](../../test/fixture/flag.ts) once + tests no longer mutate `Flag`. +- [ ] Delete [`flag.ts`](../../../core/src/flag/flag.ts) once no packages + import it. + +## P3: Global Paths + +[`global.ts`](../../../core/src/global.ts) is real connective tissue, not +just cosmetic ugliness. It currently mixes path calculation, import-time +directory creation, `Flock` setup, mutable exported `Path` state, and a +`Flag` dependency. + +Problems to reduce: + +- Importing the module creates directories. +- Tests override `Global.Path` by mutating exported module state. +- Most callers use `Global.Path` directly instead of the Effect service. +- `Global.make()` still reads mutable `Flag.OPENCODE_CONFIG_DIR`. + +Next PR candidates: + +- [ ] Replace mutable `Global.Path` test overrides with explicit test + layers or scoped helpers. +- [ ] Move directory creation and `Flock` setup behind an explicit init + boundary where possible. +- [ ] Remove the `Flag` dependency from global path resolution. + +## P4: Instance And Bridge + +[`project/instance.ts`](../../src/project/instance.ts) is the deletion +target. [`effect/bridge.ts`](../../src/effect/bridge.ts) is not a near-term +deletion target; Promise/callback interop will continue to exist. + +Goal: + +- Keep a sanctioned bridge for Promise/callback boundaries. +- Reduce bridge dependence on legacy `Instance.restore` / `Instance.current`. +- Move callers toward `InstanceRef`, `WorkspaceRef`, `InstanceState`, or + explicit context where practical. +- Delete `project/instance.ts` only after ambient Instance coupling is gone. + +Important distinction: + +- `InstanceState.context`, `InstanceState.directory`, and + `InstanceState.workspaceID` are acceptable inside normal Effect service + code when `InstanceRef` / `WorkspaceRef` are provided by the runtime. +- The deletion blockers are the fallback and callback paths that rely on + ambient ALS: direct `Instance.*` reads, `InstanceState.bind(...)`, + `AppRuntime.runPromise(...)` re-entry from plain JS, and bridge restore + code that installs legacy ALS before invoking callbacks. + +Current bottom-up inventory from `dev`: + +- Direct `Instance.*` value readers: + [`tool/repo_overview.ts`](../../src/tool/repo_overview.ts), + [`control-plane/adapters/worktree.ts`](../../src/control-plane/adapters/worktree.ts), + [`cli/bootstrap.ts`](../../src/cli/bootstrap.ts). +- `InstanceState.bind(...)` callback boundaries: + [`file/watcher.ts`](../../src/file/watcher.ts) native watcher callback, + [`storage/db.ts`](../../src/storage/db.ts) transaction/effect callbacks, + [`session/llm.ts`](../../src/session/llm.ts) workflow approval callback. +- `AppRuntime.runPromise(...)` / re-entry from plain JS: + [`project/with-instance.ts`](../../src/project/with-instance.ts), + [`project/instance-runtime.ts`](../../src/project/instance-runtime.ts), + [`control-plane/adapters/worktree.ts`](../../src/control-plane/adapters/worktree.ts), + [`cli/effect-cmd.ts`](../../src/cli/effect-cmd.ts), plus global/non-instance + callsites such as CLI upgrade and ACP agent defaults. +- Intentional bridge users to classify, not delete blindly: + workspace adapters in [`control-plane/workspace.ts`](../../src/control-plane/workspace.ts), + MCP, command execution, plugins, pty lifecycle, bus scope cleanup, task + cancellation, and HTTP lifecycle reload/dispose paths. +- Core fallback layer to shrink last: + [`effect/run-service.ts`](../../src/effect/run-service.ts), + [`effect/bridge.ts`](../../src/effect/bridge.ts), and + [`effect/instance-state.ts`](../../src/effect/instance-state.ts). + +Recommended PR order: + +- [ ] `INST-1` Remove direct `Instance.*` value readers. Start with + `repo_overview`, `worktree` adapter, and `cli/bootstrap`; pass context + explicitly or obtain it from an Effect boundary. +- [ ] `INST-2` Move type-only `InstanceContext` imports from + [`project/instance.ts`](../../src/project/instance.ts) to + [`project/instance-context.ts`](../../src/project/instance-context.ts). +- [ ] `INST-3` Audit each `InstanceState.bind(...)` callback from the inside + out: list what the callback calls (`Bus.publish`, database effects, + permission/session services), then replace ambient capture with explicit + `InstanceRef` / `WorkspaceRef` provision or an `EffectBridge` call. +- [ ] `INST-4` Classify `AppRuntime.runPromise(...)` callsites as global, + instance-scoped with explicit refs, or bridge-required. Eliminate the + instance-scoped callsites that rely on `run-service.attach()` falling + back to `Instance.current`. +- [ ] `INST-5` After consumers are explicit, remove `Instance.current` fallback + from `InstanceState.context` and `run-service.attach()`. +- [ ] `INST-6` Move any remaining `restore` / `bind` compatibility helpers to + the boundary that still needs them, then delete + [`project/instance.ts`](../../src/project/instance.ts). + +## Lower Priority Tracks + +- `PROC` / `FS` — continue AppProcess and AppFileSystem migrations as + focused PRs when touching relevant files. +- `RT` — remove service-local runtime facades only when they are not an + intentional boundary. +- `OA` — shrink [`public.ts`](../../src/server/routes/instance/httpapi/public.ts) + by tightening source schemas one workaround at a time. +- `fetch` → `HttpClient` — migrate raw fetch callsites when the caller is + already effectful or being effectified. +- `Tools` — remaining tool cleanup is narrow: `webfetch` HTML extraction + and `shell` raw stream/promise edges. diff --git a/packages/opencode/specs/effect/tools.md b/packages/opencode/specs/effect/tools.md index 37a76e948794..b8c851aa3d9d 100644 --- a/packages/opencode/specs/effect/tools.md +++ b/packages/opencode/specs/effect/tools.md @@ -67,11 +67,11 @@ Most exported tools are already on the intended Effect-native shape. The remaini Current spot cleanups worth tracking: -- [ ] `read.ts` — still bridges to Node stream / `readline` helpers and Promise-based binary detection +- [x] `read.ts` — streams through `AppFileSystem.Service.stream` with `Stream.splitLines`; the legacy Node stream / `readline` helper is gone - [ ] `bash.ts` — already uses Effect child-process primitives; only keep tracking shell-specific platform bridges and parser/loading details as they come up - [ ] `webfetch.ts` — already uses `HttpClient`; remaining work is limited to smaller boundary helpers like HTML text extraction - [ ] `file/ripgrep.ts` — adjacent to tool migration; still has raw fs/process usage that affects `grep.ts` and file-search routes -- [ ] `patch/index.ts` — adjacent to tool migration; still has raw fs usage behind patch application +- [x] `patch/index.ts` — apply path now returns `Effect` over `AppFileSystem.Service`; the parser and chunk replacer stay pure Notable items that are already effectively on the target path and do not need separate migration bullets right now: @@ -85,6 +85,4 @@ Notable items that are already effectively on the target path and do not need se Current raw fs users that still appear relevant here: -- `tool/read.ts` — `fs.createReadStream`, `readline` - `file/ripgrep.ts` — `fs/promises` -- `patch/index.ts` — `fs`, `fs/promises` diff --git a/packages/opencode/specs/openapi-translation-cleanup.md b/packages/opencode/specs/openapi-translation-cleanup.md index 255c09644f82..5be155d1b860 100644 --- a/packages/opencode/specs/openapi-translation-cleanup.md +++ b/packages/opencode/specs/openapi-translation-cleanup.md @@ -100,7 +100,7 @@ Verification: - Audit `PathParameterSchemas` and `pathParameterSchema()` in `public.ts`. - Check source schemas in files like `packages/opencode/src/session/schema.ts`, `packages/opencode/src/permission/schema.ts`, and pty schema definitions. -- Add or fix `ZodOverride` / OpenAPI-compatible annotations on branded ID schemas so generated path params include the same patterns without `public.ts` overrides. +- Add or fix OpenAPI-compatible annotations on branded ID schemas so generated path params include the same patterns without `public.ts` overrides. - Delete one path override only after generated OpenAPI is unchanged for that param. Concrete first targets: diff --git a/packages/opencode/specs/tui-plugins.md b/packages/opencode/specs/tui-plugins.md index c1a9b271c1d9..e9ece6c0a22b 100644 --- a/packages/opencode/specs/tui-plugins.md +++ b/packages/opencode/specs/tui-plugins.md @@ -29,6 +29,16 @@ Example: "plugin": ["@acme/opencode-plugin@1.2.3", ["./plugins/demo.tsx", { "label": "demo" }]], "plugin_enabled": { "acme.demo": false + }, + "attention": { + "enabled": true, + "notifications": true, + "sound": true, + "volume": 0.4, + "sound_pack": "opencode.default", + "sounds": { + "error": "/Users/me/sounds/error.mp3" + } } } ``` @@ -45,6 +55,11 @@ Example: - Internal plugins can declare `enabled: false` to be registered but inactive by default; `plugin_enabled` and runtime KV can still enable them by id. - `plugin_enabled` is merged across config layers. - Runtime enable/disable state is also stored in KV under `plugin_enabled`; that KV state overrides config on startup. +- `attention.enabled` defaults to `false`; when `false`, it disables all `api.attention.notify(...)` delivery. +- `attention.notifications` and `attention.sound` independently control terminal-mediated desktop notifications and built-in sounds. +- `attention.volume` sets the default built-in sound volume from `0` to `1`. +- `attention.sound_pack` selects the initial semantic sound pack. Persisted runtime selection in KV can override it. +- `attention.sounds` overrides individual semantic sound slots such as `error`, `done`, or `subagent_done`. - `leader_timeout` is a top-level TUI setting. - `keybinds` is a flat object keyed by command id; values are key binding values (`false`, `"none"`, a key string/object, a binding object, or an array of key strings/objects/binding objects). - `keybinds.leader` sets the key used by `` shortcuts. @@ -212,6 +227,7 @@ That is what makes local config-scoped plugins able to import `@opencode-ai/plug Top-level API groups exposed to `tui(api, options, meta)`: - `api.app.version` +- `api.attention.notify(input)` - `api.keys.formatSequence(parts)`, `formatBindings(bindings)` - `api.keymap` - `api.route.register(routes)` / `api.route.navigate(name, params?)` / `api.route.current` @@ -246,6 +262,24 @@ Top-level API groups exposed to `tui(api, options, meta)`: - `formatBindings(bindings)` formats binding lists and returns `undefined` when there is nothing to show. - For generic config-to-bindings helpers, import `createBindingLookup` from `@opencode-ai/plugin/tui`. +### Attention + +- `api.attention.notify({ title?, message, notification?, sound? })` requests user attention while keeping terminal focus, notifications, and audio owned by the host. +- `message` is required; `title` defaults to `"opencode"`; `notification` defaults to enabled with `when: "blurred"`; `sound` defaults to enabled with `when: "always"`. +- `when: "always"` requests delivery regardless of terminal focus state. +- `when: "focused"` only requests delivery after the terminal is known focused; `when: "blurred"` only requests delivery after the terminal is known blurred. +- Example: `notification: { when: "blurred" }, sound: { name: "question", when: "always" }` plays sound while focused but only triggers system notifications when blurred. +- Semantic sound names are `"default"`, `"question"`, `"permission"`, `"error"`, `"done"`, and `"subagent_done"`. +- `sound: true` plays the `"default"` sound; `sound: { name: "question" }` plays a named semantic sound. +- `sound: { volume }` overrides volume for that call; `sound: false` disables sound for that call; `notification: false` disables system notification for that call. +- `api.attention.soundboard.registerPack({ id, name?, sounds })` registers a sound pack and returns a disposer. Relative paths resolve from the plugin root and are cleaned up on plugin deactivation. +- `api.attention.soundboard.activate(id, { persist })` selects the active pack. `persist: true` writes the selected pack id to TUI KV state, not `tui.json`. +- `api.attention.soundboard.current()` and `list()` expose the active/registered packs for plugin UX. +- Config `attention.sounds` overrides active-pack sounds by slot. Failed loads fall back to the active pack and then `opencode.default`. +- The host strips ANSI/control characters and collapses newlines before sending text to the terminal notification API. +- Terminal and OS settings decide whether a requested notification is visibly displayed. +- Prefer privacy-safe messages such as `"A question needs your input"`; avoid full commands, paths, prompts, errors, secrets, or file contents unless the plugin intentionally exposes them. + ### Routes - Reserved route names: `home` and `session`. diff --git a/packages/opencode/specs/v2/notifications.md b/packages/opencode/specs/v2/notifications.md new file mode 100644 index 000000000000..96018f994435 --- /dev/null +++ b/packages/opencode/specs/v2/notifications.md @@ -0,0 +1,13 @@ +# TUI Notifications Default + +Problem: + +- v1 defaults `attention.enabled` to `false` +- users can opt in with `attention.enabled = true` +- v2 should make core TUI notifications a default behavior + +## v2 Target + +Flip `attention.enabled` to `true` by default in v2. + +Keep `attention.enabled = false` as the explicit opt-out. diff --git a/packages/opencode/src/acp/agent.ts b/packages/opencode/src/acp/agent.ts index 867b830cf279..aa123d5991c1 100644 --- a/packages/opencode/src/acp/agent.ts +++ b/packages/opencode/src/acp/agent.ts @@ -1094,8 +1094,8 @@ export class Agent implements ACPAgent { const currentModeId = await (async () => { if (!availableModes.length) return undefined - const defaultAgentName = await AppRuntime.runPromise(AgentModule.Service.use((svc) => svc.defaultAgent())) - const resolvedModeId = availableModes.find((mode) => mode.name === defaultAgentName)?.id ?? availableModes[0].id + const defaultAgent = await AppRuntime.runPromise(AgentModule.Service.use((svc) => svc.defaultInfo())) + const resolvedModeId = availableModes.find((mode) => mode.name === defaultAgent.name)?.id ?? availableModes[0].id this.sessionManager.setMode(sessionId, resolvedModeId) return resolvedModeId })() @@ -1328,7 +1328,8 @@ export class Agent implements ACPAgent { if (!current) { this.sessionManager.setModel(session.id, model) } - const agent = session.modeId ?? (await AppRuntime.runPromise(AgentModule.Service.use((svc) => svc.defaultAgent()))) + const agent = + session.modeId ?? (await AppRuntime.runPromise(AgentModule.Service.use((svc) => svc.defaultInfo()))).name const parts: Array< | { type: "text"; text: string; synthetic?: boolean; ignored?: boolean } diff --git a/packages/opencode/src/agent/agent.ts b/packages/opencode/src/agent/agent.ts index d96e508c9d02..ce6cf30b6d55 100644 --- a/packages/opencode/src/agent/agent.ts +++ b/packages/opencode/src/agent/agent.ts @@ -1,5 +1,4 @@ import { Config } from "@/config/config" -import z from "zod" import { Provider } from "@/provider/provider" import { ModelID, ProviderID } from "../provider/schema" import { generateObject, streamObject, type ModelMessage } from "ai" @@ -16,12 +15,12 @@ import PROMPT_TITLE from "./prompt/title.txt" import { Permission } from "@/permission" import { mergeDeep, pipe, sortBy, values } from "remeda" import { Global } from "@opencode-ai/core/global" -import { Flag } from "@opencode-ai/core/flag/flag" import path from "path" import { Plugin } from "@/plugin" import { Skill } from "../skill" import { Effect, Context, Layer, Schema } from "effect" import { InstanceState } from "@/effect/instance-state" +import { RuntimeFlags } from "@/effect/runtime-flags" import * as Option from "effect/Option" import * as OtelTracer from "@effect/opentelemetry/Tracer" import { type DeepMutable } from "@opencode-ai/core/schema" @@ -49,18 +48,28 @@ export const Info = Schema.Struct({ }).annotate({ identifier: "Agent" }) export type Info = DeepMutable> +const GeneratedAgent = Schema.Struct({ + identifier: Schema.String, + whenToUse: Schema.String, + systemPrompt: Schema.String, +}) + export interface Interface { readonly get: (agent: string) => Effect.Effect readonly list: () => Effect.Effect + readonly defaultInfo: () => Effect.Effect readonly defaultAgent: () => Effect.Effect readonly generate: (input: { description: string model?: { providerID: ProviderID; modelID: ModelID } - }) => Effect.Effect<{ - identifier: string - whenToUse: string - systemPrompt: string - }> + }) => Effect.Effect< + { + identifier: string + whenToUse: string + systemPrompt: string + }, + Provider.ModelNotFoundError + > } type State = Omit @@ -75,6 +84,7 @@ export const layer = Layer.effect( const plugin = yield* Plugin.Service const skill = yield* Skill.Service const provider = yield* Provider.Service + const flags = yield* RuntimeFlags.Service const state = yield* InstanceState.make( Effect.fn("Agent.state")(function* (ctx) { @@ -189,7 +199,7 @@ export const layer = Layer.effect( mode: "subagent", native: true, }, - ...(Flag.OPENCODE_EXPERIMENTAL_SCOUT + ...(flags.experimentalScout ? { scout: { name: "scout", @@ -201,7 +211,6 @@ export const layer = Layer.effect( glob: "allow", webfetch: "allow", websearch: "allow", - codesearch: "allow", read: "allow", repo_clone: "allow", repo_overview: "allow", @@ -329,23 +338,28 @@ export const layer = Layer.effect( ) }) - const defaultAgent = Effect.fnUntraced(function* () { + const defaultInfo = Effect.fnUntraced(function* () { const c = yield* config.get() if (c.default_agent) { const agent = agents[c.default_agent] if (!agent) throw new Error(`default agent "${c.default_agent}" not found`) if (agent.mode === "subagent") throw new Error(`default agent "${c.default_agent}" is a subagent`) if (agent.hidden === true) throw new Error(`default agent "${c.default_agent}" is hidden`) - return agent.name + return agent } const visible = Object.values(agents).find((a) => a.mode !== "subagent" && a.hidden !== true) if (!visible) throw new Error("no primary visible agent found") - return visible.name + return visible + }) + + const defaultAgent = Effect.fnUntraced(function* () { + return (yield* defaultInfo()).name }) return { get, list, + defaultInfo, defaultAgent, } satisfies State }), @@ -358,6 +372,9 @@ export const layer = Layer.effect( list: Effect.fn("Agent.list")(function* () { return yield* InstanceState.useEffect(state, (s) => s.list()) }), + defaultInfo: Effect.fn("Agent.defaultInfo")(function* () { + return yield* InstanceState.useEffect(state, (s) => s.defaultInfo()) + }), defaultAgent: Effect.fn("Agent.defaultAgent")(function* () { return yield* InstanceState.useEffect(state, (s) => s.defaultAgent()) }), @@ -405,11 +422,10 @@ export const layer = Layer.effect( }, ], model: language, - schema: z.object({ - identifier: z.string(), - whenToUse: z.string(), - systemPrompt: z.string(), - }), + schema: Object.assign( + Schema.toStandardSchemaV1(GeneratedAgent), + Schema.toStandardJSONSchemaV1(GeneratedAgent), + ), } satisfies Parameters[0] if (isOpenaiOauth) { @@ -441,6 +457,7 @@ export const defaultLayer = layer.pipe( Layer.provide(Auth.defaultLayer), Layer.provide(Config.defaultLayer), Layer.provide(Skill.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), ) export * as Agent from "./agent" diff --git a/packages/opencode/src/agent/subagent-permissions.ts b/packages/opencode/src/agent/subagent-permissions.ts index 1174ec31adef..051f42e37bb3 100644 --- a/packages/opencode/src/agent/subagent-permissions.ts +++ b/packages/opencode/src/agent/subagent-permissions.ts @@ -5,10 +5,10 @@ import type { Agent } from "./agent" * Build the `permission` ruleset for a subagent's session when it's spawned * via the task tool. Combines: * - * 1. The parent **agent's** deny rules — Plan Mode and other agent-level - * restrictions live on the agent ruleset, not on the session, so a + * 1. The parent **agent's** edit-class deny rules — Plan Mode's file-edit + * restriction lives on the agent ruleset, not on the session, so a * subagent that only inherited the parent SESSION's permission would - * silently bypass them. (#26514) + * silently bypass it. (#26514) * 2. The parent **session's** deny rules and external_directory rules — * same forwarding the original code already did. * 3. Default `todowrite` and `task` denies if the subagent's own ruleset @@ -21,7 +21,8 @@ export function deriveSubagentSessionPermission(input: { }): Permission.Ruleset { const canTask = input.subagent.permission.some((rule) => rule.permission === "task") const canTodo = input.subagent.permission.some((rule) => rule.permission === "todowrite") - const parentAgentDenies = input.parentAgent?.permission.filter((rule) => rule.action === "deny") ?? [] + const parentAgentDenies = + input.parentAgent?.permission.filter((rule) => rule.action === "deny" && rule.permission === "edit") ?? [] return [ ...parentAgentDenies, ...input.parentSessionPermission.filter( diff --git a/packages/opencode/src/audio.d.ts b/packages/opencode/src/audio.d.ts index c7c947450dcf..7b99d097a33f 100644 --- a/packages/opencode/src/audio.d.ts +++ b/packages/opencode/src/audio.d.ts @@ -3,6 +3,11 @@ declare module "*.wav" { export default file } +declare module "*.mp3" { + const file: string + export default file +} + declare module "*.wasm" { const file: string export default file diff --git a/packages/opencode/src/background/job.ts b/packages/opencode/src/background/job.ts new file mode 100644 index 000000000000..3ea228f048c5 --- /dev/null +++ b/packages/opencode/src/background/job.ts @@ -0,0 +1,200 @@ +import { InstanceState } from "@/effect/instance-state" +import { Identifier } from "@/id/id" +import { Cause, Clock, Context, Deferred, Effect, Fiber, Layer, Scope, SynchronizedRef } from "effect" + +export type Status = "running" | "completed" | "error" | "cancelled" + +export type Info = { + id: string + type: string + title?: string + status: Status + started_at: number + completed_at?: number + output?: string + error?: string + metadata?: Record +} + +type Active = { + info: Info + done: Deferred.Deferred + fiber?: Fiber.Fiber +} + +type State = { + jobs: SynchronizedRef.SynchronizedRef> + scope: Scope.Scope +} + +type FinishResult = { + info?: Info + done?: Deferred.Deferred +} + +export type StartInput = { + id?: string + type: string + title?: string + metadata?: Record + run: Effect.Effect +} + +export type WaitInput = { + id: string + timeout?: number +} + +export type WaitResult = { + info?: Info + timedOut: boolean +} + +export interface Interface { + readonly list: () => Effect.Effect + readonly get: (id: string) => Effect.Effect + readonly start: (input: StartInput) => Effect.Effect + readonly wait: (input: WaitInput) => Effect.Effect + readonly cancel: (id: string) => Effect.Effect +} + +export class Service extends Context.Service()("@opencode/BackgroundJob") {} + +function snapshot(job: Active): Info { + return { + ...job.info, + ...(job.info.metadata ? { metadata: { ...job.info.metadata } } : {}), + } +} + +function errorText(error: unknown) { + if (error instanceof Error) return error.message + return String(error) +} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const state = yield* InstanceState.make( + Effect.fn("BackgroundJob.state")(function* () { + return { + jobs: yield* SynchronizedRef.make(new Map()), + scope: yield* Scope.Scope, + } + }), + ) + + const finish = Effect.fn("BackgroundJob.finish")(function* ( + id: string, + status: Exclude, + data?: { output?: string; error?: string }, + ) { + const completed_at = yield* Clock.currentTimeMillis + const result = yield* SynchronizedRef.modify( + (yield* InstanceState.get(state)).jobs, + (jobs): readonly [FinishResult, Map] => { + const job = jobs.get(id) + if (!job) return [{}, jobs] + if (job.info.status !== "running") return [{ info: snapshot(job) }, jobs] + const next = { + ...job, + fiber: undefined, + info: { + ...job.info, + status, + completed_at, + ...(data?.output !== undefined ? { output: data.output } : {}), + ...(data?.error !== undefined ? { error: data.error } : {}), + }, + } + return [{ info: snapshot(next), done: job.done }, new Map(jobs).set(id, next)] + }, + ) + if (result.info && result.done) yield* Deferred.succeed(result.done, result.info).pipe(Effect.ignore) + return result.info + }) + + const list: Interface["list"] = Effect.fn("BackgroundJob.list")(function* () { + return Array.from((yield* SynchronizedRef.get((yield* InstanceState.get(state)).jobs)).values()) + .map(snapshot) + .toSorted((a, b) => a.started_at - b.started_at) + }) + + const get: Interface["get"] = Effect.fn("BackgroundJob.get")(function* (id) { + const job = (yield* SynchronizedRef.get((yield* InstanceState.get(state)).jobs)).get(id) + if (!job) return + return snapshot(job) + }) + + const start: Interface["start"] = Effect.fn("BackgroundJob.start")(function* (input) { + return yield* Effect.uninterruptibleMask((restore) => + Effect.gen(function* () { + const s = yield* InstanceState.get(state) + const id = input.id ?? Identifier.ascending("job") + const started_at = yield* Clock.currentTimeMillis + const done = yield* Deferred.make() + return yield* SynchronizedRef.modifyEffect( + s.jobs, + Effect.fnUntraced(function* (jobs) { + const existing = jobs.get(id) + if (existing?.info.status === "running") return [snapshot(existing), jobs] as const + const fiber = yield* restore(input.run).pipe( + Effect.matchCauseEffect({ + onSuccess: (output) => finish(id, "completed", { output }), + onFailure: (cause) => + finish(id, Cause.hasInterruptsOnly(cause) ? "cancelled" : "error", { + error: errorText(Cause.squash(cause)), + }), + }), + Effect.asVoid, + Effect.forkIn(s.scope, { startImmediately: true }), + ) + const job = { + info: { + id, + type: input.type, + title: input.title, + status: "running" as const, + started_at, + metadata: input.metadata, + }, + done, + fiber, + } + return [snapshot(job), new Map(jobs).set(id, job)] as const + }), + ) + }), + ) + }) + + const wait: Interface["wait"] = Effect.fn("BackgroundJob.wait")(function* (input) { + const job = (yield* SynchronizedRef.get((yield* InstanceState.get(state)).jobs)).get(input.id) + if (!job) return { timedOut: false } + if (job.info.status !== "running") return { info: snapshot(job), timedOut: false } + if (input.timeout === undefined) return { info: yield* Deferred.await(job.done), timedOut: false } + if (input.timeout <= 0) return { info: snapshot(job), timedOut: true } + const info = yield* Deferred.await(job.done).pipe(Effect.timeoutOption(input.timeout)) + if (info._tag === "Some") return { info: info.value, timedOut: false } + return { info: snapshot(job), timedOut: true } + }) + + const cancel: Interface["cancel"] = Effect.fn("BackgroundJob.cancel")(function* (id) { + const job = (yield* SynchronizedRef.get((yield* InstanceState.get(state)).jobs)).get(id) + if (!job) return + if (job.info.status !== "running") return snapshot(job) + if (job.fiber) { + yield* Fiber.interrupt(job.fiber).pipe(Effect.ignore) + yield* Fiber.await(job.fiber).pipe(Effect.ignore) + } + const info = yield* finish(id, "cancelled") + return info + }) + + return Service.of({ list, get, start, wait, cancel }) + }), +) + +export const defaultLayer = layer + +export * as BackgroundJob from "./job" diff --git a/packages/opencode/src/bus/bus-event.ts b/packages/opencode/src/bus/bus-event.ts index 353370631859..5a9e52ef0735 100644 --- a/packages/opencode/src/bus/bus-event.ts +++ b/packages/opencode/src/bus/bus-event.ts @@ -1,4 +1,5 @@ import { Schema } from "effect" +import { EventV2 } from "@opencode-ai/core/event" export type Definition = { type: Type @@ -17,16 +18,28 @@ export function define( } export function effectPayloads() { - return registry - .entries() - .map(([type, def]) => - Schema.Struct({ - id: Schema.String, - type: Schema.Literal(type), - properties: def.properties, - }).annotate({ identifier: `Event.${type}` }), - ) - .toArray() + return [ + ...registry + .entries() + .map(([type, def]) => + Schema.Struct({ + id: Schema.String, + type: Schema.Literal(type), + properties: def.properties, + }).annotate({ identifier: `Event.${type}` }), + ) + .toArray(), + ...EventV2.registry + .values() + .map((definition) => + Schema.Struct({ + id: Schema.String, + type: Schema.Literal(definition.type), + properties: definition.data, + }).annotate({ identifier: `Event.${definition.type}` }), + ) + .toArray(), + ] } export * as BusEvent from "./bus-event" diff --git a/packages/opencode/src/cli/bootstrap.ts b/packages/opencode/src/cli/bootstrap.ts index fa39ecb177b5..2308c29199ba 100644 --- a/packages/opencode/src/cli/bootstrap.ts +++ b/packages/opencode/src/cli/bootstrap.ts @@ -1,17 +1,11 @@ -import { Instance } from "../project/instance" import { InstanceRuntime } from "../project/instance-runtime" -import { WithInstance } from "../project/with-instance" +import { context } from "../project/instance-context" export async function bootstrap(directory: string, cb: () => Promise) { - return WithInstance.provide({ - directory, - fn: async () => { - try { - const result = await cb() - return result - } finally { - await InstanceRuntime.disposeInstance(Instance.current) - } - }, - }) + const ctx = await InstanceRuntime.load({ directory }) + try { + return await context.provide(ctx, cb) + } finally { + await InstanceRuntime.disposeInstance(ctx) + } } diff --git a/packages/opencode/src/cli/cmd/db.ts b/packages/opencode/src/cli/cmd/db.ts index 2aa5caf10aa5..b113455f3b97 100644 --- a/packages/opencode/src/cli/cmd/db.ts +++ b/packages/opencode/src/cli/cmd/db.ts @@ -28,7 +28,7 @@ const QueryCommand = cmd({ handler: async (args: { query?: string; format: string }) => { const query = args.query as string | undefined if (query) { - const db = new BunDatabase(Database.Path, { readonly: true }) + const db = new BunDatabase(Database.getPath(), { readonly: true }) try { const result = db.query(query).all() as Record[] if (args.format === "json") { @@ -47,7 +47,7 @@ const QueryCommand = cmd({ db.close() return } - const child = spawn("sqlite3", [Database.Path], { + const child = spawn("sqlite3", [Database.getPath()], { stdio: "inherit", }) await new Promise((resolve) => child.on("close", resolve)) @@ -58,7 +58,7 @@ const PathCommand = cmd({ command: "path", describe: "print the database path", handler: () => { - console.log(Database.Path) + console.log(Database.getPath()) }, }) @@ -66,7 +66,7 @@ const MigrateCommand = cmd({ command: "migrate", describe: "migrate JSON data to SQLite (merges with existing data)", handler: async () => { - const sqlite = new BunDatabase(Database.Path) + const sqlite = new BunDatabase(Database.getPath()) const tty = process.stderr.isTTY const width = 36 const orange = "\x1b[38;5;214m" diff --git a/packages/opencode/src/cli/cmd/debug/agent.ts b/packages/opencode/src/cli/cmd/debug/agent.ts index 1a3f79396c00..ac9879ff8912 100644 --- a/packages/opencode/src/cli/cmd/debug/agent.ts +++ b/packages/opencode/src/cli/cmd/debug/agent.ts @@ -11,7 +11,7 @@ import { Permission } from "../../../permission" import { iife } from "../../../util/iife" import { effectCmd, fail } from "../../effect-cmd" import { InstanceRef } from "@/effect/instance-ref" -import type { InstanceContext } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" export const AgentCommand = effectCmd({ command: "agent ", diff --git a/packages/opencode/src/cli/cmd/debug/index.ts b/packages/opencode/src/cli/cmd/debug/index.ts index 6e2643f68896..67ea51af6d9b 100644 --- a/packages/opencode/src/cli/cmd/debug/index.ts +++ b/packages/opencode/src/cli/cmd/debug/index.ts @@ -16,6 +16,7 @@ import { SkillCommand } from "./skill" import { SnapshotCommand } from "./snapshot" import { AgentCommand } from "./agent" import { StartupCommand } from "./startup" +import { V2Command } from "./v2" export const DebugCommand = cmd({ command: "debug", @@ -31,6 +32,7 @@ export const DebugCommand = cmd({ .command(SnapshotCommand) .command(StartupCommand) .command(AgentCommand) + .command(V2Command) .command(InfoCommand) .command(PathsCommand) .command(WaitCommand) diff --git a/packages/opencode/src/cli/cmd/debug/v2.ts b/packages/opencode/src/cli/cmd/debug/v2.ts new file mode 100644 index 000000000000..836f5813672e --- /dev/null +++ b/packages/opencode/src/cli/cmd/debug/v2.ts @@ -0,0 +1,46 @@ +import { EOL } from "os" +import { Effect, Layer, Option } from "effect" +import { Catalog } from "@opencode-ai/core/catalog" +import { LocationServiceMap } from "@opencode-ai/core/location-layer" +import { PluginBoot } from "@opencode-ai/core/plugin/boot" +import { effectCmd } from "../../effect-cmd" + +const Runtime = Layer.mergeAll(LocationServiceMap.layer) + +export const V2Command = effectCmd({ + command: "v2", + describe: "debug v2 catalog and built-in plugins", + instance: false, + handler: Effect.fn("Cli.debug.v2")( + function* () { + yield* PluginBoot.Service.use((service) => service.wait()) + const catalog = yield* Catalog.Service + const providers = (yield* catalog.provider.available()).sort((a, b) => a.id.localeCompare(b.id)) + const all = (yield* catalog.provider.all()).sort((a, b) => a.id.localeCompare(b.id)) + const result = { + providers, + default: catalog.model + .default() + .pipe(Effect.map(Option.map((item) => item.id)), Effect.map(Option.getOrUndefined)), + small: Object.fromEntries( + yield* Effect.all( + all.map((provider) => + Effect.map( + catalog.model.small(provider.id), + (model) => [provider.id, Option.getOrUndefined(Option.map(model, (item) => item.id))] as const, + ), + ), + { concurrency: "unbounded" }, + ), + ), + } + process.stdout.write(JSON.stringify(result, null, 2) + EOL) + }, + Effect.provide( + LocationServiceMap.get({ + directory: process.cwd(), + }), + ), + Effect.provide(Runtime), + ), +}) diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index a6754ec2df63..e501f0903c81 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -19,7 +19,7 @@ import type { import { UI } from "../ui" import { cmd } from "./cmd" import { effectCmd } from "../effect-cmd" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { InstanceRef } from "@/effect/instance-ref" import { SessionShare } from "@/share/session" import { Session } from "@/session/session" diff --git a/packages/opencode/src/cli/cmd/import.ts b/packages/opencode/src/cli/cmd/import.ts index 419e81379b32..2fcf286f4670 100644 --- a/packages/opencode/src/cli/cmd/import.ts +++ b/packages/opencode/src/cli/cmd/import.ts @@ -7,7 +7,7 @@ import { SessionTable, MessageTable, PartTable } from "../../session/session.sql import { InstanceRef } from "@/effect/instance-ref" import { ShareNext } from "@/share/share-next" import { EOL } from "os" -import { Filesystem } from "@/util/filesystem" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Effect, Schema } from "effect" const decodeMessageInfo = Schema.decodeUnknownSync(MessageV2.Info) @@ -95,6 +95,7 @@ export const ImportCommand = effectCmd({ const runImport = Effect.fn("Cli.import.body")(function* (file: string, projectID: string) { const share = yield* ShareNext.Service + const fs = yield* AppFileSystem.Service let exportData: ExportData | undefined @@ -149,9 +150,9 @@ const runImport = Effect.fn("Cli.import.body")(function* (file: string, projectI exportData = transformed } else { - exportData = yield* Effect.promise(() => - Filesystem.readJson>(file).catch(() => undefined), - ) + exportData = (yield* fs.readJson(file).pipe(Effect.orElseSucceed(() => undefined))) as + | NonNullable + | undefined if (!exportData) { process.stdout.write(`File not found: ${file}`) process.stdout.write(EOL) diff --git a/packages/opencode/src/cli/cmd/models.ts b/packages/opencode/src/cli/cmd/models.ts index 183b1816d293..08203ba21e6b 100644 --- a/packages/opencode/src/cli/cmd/models.ts +++ b/packages/opencode/src/cli/cmd/models.ts @@ -2,7 +2,7 @@ import { EOL } from "os" import { Effect } from "effect" import { Provider } from "@/provider/provider" import { ProviderID } from "../../provider/schema" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { effectCmd, fail } from "../effect-cmd" import { UI } from "../ui" diff --git a/packages/opencode/src/cli/cmd/prompt-display.ts b/packages/opencode/src/cli/cmd/prompt-display.ts new file mode 100644 index 000000000000..7ec4bc0af55e --- /dev/null +++ b/packages/opencode/src/cli/cmd/prompt-display.ts @@ -0,0 +1,39 @@ +const graphemes = new Intl.Segmenter(undefined, { granularity: "grapheme" }) + +function displayOffsetIndex(value: string, offset: number) { + if (offset <= 0) return 0 + + let width = 0 + for (const part of graphemes.segment(value)) { + const next = width + Bun.stringWidth(part.segment) + if (next > offset) return part.index + width = next + } + + return value.length +} + +export function displaySlice(value: string, start = 0, end = Bun.stringWidth(value)) { + return value.slice(displayOffsetIndex(value, start), displayOffsetIndex(value, end)) +} + +export function displayCharAt(value: string, offset: number) { + let width = 0 + for (const part of graphemes.segment(value)) { + const next = width + Bun.stringWidth(part.segment) + if (offset === width || offset < next) return part.segment + width = next + } +} + +export function mentionTriggerIndex(value: string, offset = Bun.stringWidth(value)) { + const text = displaySlice(value, 0, offset) + const index = text.lastIndexOf("@") + if (index === -1) return + + const before = index === 0 ? undefined : text[index - 1] + const query = text.slice(index) + if ((before === undefined || /\s/.test(before)) && !/\s/.test(query)) { + return Bun.stringWidth(text.slice(0, index)) + } +} diff --git a/packages/opencode/src/cli/cmd/providers.ts b/packages/opencode/src/cli/cmd/providers.ts index 749139e2dcd6..25f1bf968c30 100644 --- a/packages/opencode/src/cli/cmd/providers.ts +++ b/packages/opencode/src/cli/cmd/providers.ts @@ -3,7 +3,7 @@ import { cmd } from "./cmd" import { CliError, effectCmd, fail } from "../effect-cmd" import { UI } from "../ui" import * as Prompt from "../effect/prompt" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { map, pipe, sortBy, values } from "remeda" import path from "path" @@ -124,6 +124,7 @@ const handlePluginAuth = Effect.fn("Cli.providers.pluginAuth")(function* ( yield* put(saveProvider, { type: "api", key: result.key, + ...(result.metadata ? { metadata: result.metadata } : {}), }) } yield* spinner.stop("Login successful") @@ -156,6 +157,7 @@ const handlePluginAuth = Effect.fn("Cli.providers.pluginAuth")(function* ( yield* put(saveProvider, { type: "api", key: result.key, + ...(result.metadata ? { metadata: result.metadata } : {}), }) } yield* Prompt.log.success("Login successful") @@ -191,10 +193,11 @@ const handlePluginAuth = Effect.fn("Cli.providers.pluginAuth")(function* ( } if (result.type === "success") { const saveProvider = result.provider ?? provider + const merged = { ...(metadata.metadata ?? {}), ...(result.metadata ?? {}) } yield* put(saveProvider, { type: "api", key: result.key ?? apiKey, - ...metadata, + ...(Object.keys(merged).length ? { metadata: merged } : {}), }) yield* Prompt.log.success("Login successful") } diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts index bca89c3cabdb..9487d6d82659 100644 --- a/packages/opencode/src/cli/cmd/run.ts +++ b/packages/opencode/src/cli/cmd/run.ts @@ -17,13 +17,14 @@ import { pathToFileURL } from "url" import { Effect } from "effect" import { UI } from "../ui" import { effectCmd } from "../effect-cmd" -import { Flag } from "@opencode-ai/core/flag/flag" import { ServerAuth } from "@/server/auth" import { EOL } from "os" import { Filesystem } from "@/util/filesystem" import { createOpencodeClient, type OpencodeClient, type ToolPart } from "@opencode-ai/sdk/v2" import { Agent } from "@/agent/agent" import { Permission } from "@/permission" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { FormatError, FormatUnknownError } from "../error" import { INTERACTIVE_INPUT_ERROR, resolveInteractiveStdin } from "./run/runtime.stdin" const runtimeTask = import("./run/runtime") @@ -82,6 +83,10 @@ function block(info: Inline, output?: string) { UI.empty() } +function formatRunError(error: unknown) { + return FormatError(error) ?? FormatUnknownError(error) +} + async function tool(part: ToolPart) { try { const { toolInlineInfo } = await import("./run/tool") @@ -230,6 +235,7 @@ export const RunCommand = effectCmd({ }), handler: Effect.fn("Cli.run")(function* (args) { const agentSvc = yield* Agent.Service + const flags = yield* RuntimeFlags.Service yield* Effect.promise(async () => { const rawMessage = [...args.message, ...(args["--"] || [])].join(" ") const thinking = args.interactive ? (args.thinking ?? true) : (args.thinking ?? false) @@ -441,7 +447,7 @@ export const RunCommand = effectCmd({ async function share(sdk: OpencodeClient, sessionID: string) { const cfg = await sdk.config.get() if (!cfg.data) return - if (cfg.data.share !== "auto" && !Flag.OPENCODE_AUTO_SHARE && !args.share) return + if (cfg.data.share !== "auto" && !flags.autoShare && !args.share) return const res = await sdk.session.share({ sessionID }).catch((error) => { if (error instanceof Error && error.message.includes("disabled")) { UI.println(UI.Style.TEXT_DANGER_BOLD + "! " + error.message) @@ -719,6 +725,7 @@ export const RunCommand = effectCmd({ } } } + return error } const cwd = args.attach ? (directory ?? sess.directory ?? (await current(sdk))) : (directory ?? root) const client = args.attach ? attachSDK(cwd) : sdk @@ -736,7 +743,7 @@ export const RunCommand = effectCmd({ }) if (args.command) { - await client.session.command({ + const result = await client.session.command({ sessionID, agent, model: args.model, @@ -744,17 +751,25 @@ export const RunCommand = effectCmd({ arguments: message, variant: args.variant, }) + if (result.error) { + if (!emit("error", { error: result.error })) UI.error(formatRunError(result.error)) + process.exitCode = 1 + } return } const model = pick(args.model) - await client.session.prompt({ + const result = await client.session.prompt({ sessionID, agent, model, variant: args.variant, parts: [...files, { type: "text", text: message }], }) + if (result.error) { + if (!emit("error", { error: result.error })) UI.error(formatRunError(result.error)) + process.exitCode = 1 + } return } diff --git a/packages/opencode/src/cli/cmd/run/footer.prompt.tsx b/packages/opencode/src/cli/cmd/run/footer.prompt.tsx index 8cd4fbfcf586..54f20dbc07fc 100644 --- a/packages/opencode/src/cli/cmd/run/footer.prompt.tsx +++ b/packages/opencode/src/cli/cmd/run/footer.prompt.tsx @@ -14,7 +14,10 @@ import { createEffect, createMemo, createResource, createSignal, onCleanup, onMo import * as Locale from "@/util/locale" import { createPromptHistory, + displayCharAt, + displaySlice, isExitCommand, + mentionTriggerIndex, isNewCommand, movePromptHistory, promptCycle, @@ -537,7 +540,7 @@ export function createPromptState(input: PromptInput): PromptState { }) } - const restore = (value: RunPrompt, cursor = value.text.length) => { + const restore = (value: RunPrompt, cursor = Bun.stringWidth(value.text)) => { draft = clonePrompt(value) if (!area || area.isDestroyed) { return @@ -546,7 +549,7 @@ export function createPromptState(input: PromptInput): PromptState { hide() area.setText(value.text) restoreParts(value.parts) - area.cursorOffset = Math.min(cursor, area.plainText.length) + area.cursorOffset = Math.min(cursor, Bun.stringWidth(area.plainText)) scheduleRows() area.focus() } @@ -577,7 +580,7 @@ export function createPromptState(input: PromptInput): PromptState { area.setText(text) clearParts() draft = { text: area.plainText, parts: [] } - area.cursorOffset = Math.min(text.length, area.plainText.length) + area.cursorOffset = Math.min(Bun.stringWidth(text), Bun.stringWidth(area.plainText)) scheduleRows() area.focus() } @@ -610,12 +613,13 @@ export function createPromptState(input: PromptInput): PromptState { } if (visible() && mode() === "mention") { - if (cursor <= at() || /\s/.test(text.slice(at(), cursor))) { + const query = displaySlice(text, at(), cursor) + if (cursor <= at() || /\s/.test(query)) { hide() return } - setQuery(text.slice(at() + 1, cursor)) + setQuery(displaySlice(text, at() + 1, cursor)) return } @@ -623,19 +627,12 @@ export function createPromptState(input: PromptInput): PromptState { return } - const head = text.slice(0, cursor) - const idx = head.lastIndexOf("@") - if (idx === -1) { - return - } - - const before = idx === 0 ? undefined : head[idx - 1] - const tail = head.slice(idx) - if ((before === undefined || /\s/.test(before)) && !/\s/.test(tail)) { + const idx = mentionTriggerIndex(text, cursor) + if (idx !== undefined) { setAt(idx) menu.reset() setMode("mention") - setQuery(head.slice(idx + 1)) + setQuery(displaySlice(text, idx + 1, cursor)) } } @@ -782,7 +779,7 @@ export function createPromptState(input: PromptInput): PromptState { } const cursor = area.cursorOffset - const tail = area.plainText.at(cursor) + const tail = displayCharAt(area.plainText, cursor) const append = "@" + next.value + (tail === " " ? "" : " ") area.cursorOffset = at() const start = area.logicalCursor @@ -941,7 +938,8 @@ export function createPromptState(input: PromptInput): PromptState { } const dir = up ? -1 : 1 - if ((dir === -1 && area.cursorOffset === 0) || (dir === 1 && area.cursorOffset === area.plainText.length)) { + const endOffset = Bun.stringWidth(area.plainText) + if ((dir === -1 && area.cursorOffset === 0) || (dir === 1 && area.cursorOffset === endOffset)) { move(dir, event) return } @@ -955,7 +953,7 @@ export function createPromptState(input: PromptInput): PromptState { ? area.height - 1 : Math.max(0, (area.virtualLineCount ?? 1) - 1) if (dir === 1 && area.visualCursor.visualRow === end) { - area.cursorOffset = area.plainText.length + area.cursorOffset = endOffset } } diff --git a/packages/opencode/src/cli/cmd/run/prompt.shared.ts b/packages/opencode/src/cli/cmd/run/prompt.shared.ts index 1b639e6e7e29..0da787cb3c8e 100644 --- a/packages/opencode/src/cli/cmd/run/prompt.shared.ts +++ b/packages/opencode/src/cli/cmd/run/prompt.shared.ts @@ -12,6 +12,7 @@ // The leader-key cycle (promptCycle) uses a two-step pattern: first press // arms the leader, second press within the timeout fires the action. import type { KeyBinding } from "@opentui/core" +export { displayCharAt, displaySlice, mentionTriggerIndex } from "../prompt-display" import { formatBinding, parseBindings } from "./keymap.shared" import type { FooterKeybinds, RunPrompt } from "./types" @@ -275,7 +276,7 @@ export function movePromptHistory(state: PromptHistoryState, dir: -1 | 1, text: return { state, apply: false } } - if (dir === 1 && cursor !== text.length) { + if (dir === 1 && cursor !== Bun.stringWidth(text)) { return { state, apply: false } } @@ -309,7 +310,7 @@ export function movePromptHistory(state: PromptHistoryState, dir: -1 | 1, text: index: null, }, text: state.draft, - cursor: state.draft.length, + cursor: Bun.stringWidth(state.draft), apply: true, } } @@ -320,7 +321,7 @@ export function movePromptHistory(state: PromptHistoryState, dir: -1 | 1, text: index: idx, }, text: state.items[idx].text, - cursor: dir === -1 ? 0 : state.items[idx].text.length, + cursor: dir === -1 ? 0 : Bun.stringWidth(state.items[idx].text), apply: true, } } diff --git a/packages/opencode/src/cli/cmd/stats.ts b/packages/opencode/src/cli/cmd/stats.ts index 0124a26932d6..7ee16c2e219a 100644 --- a/packages/opencode/src/cli/cmd/stats.ts +++ b/packages/opencode/src/cli/cmd/stats.ts @@ -1,6 +1,7 @@ import { Effect } from "effect" import { effectCmd } from "../effect-cmd" import { Session } from "@/session/session" +import { NotFoundError } from "@/storage/storage" import { Database } from "@/storage/db" import { SessionTable } from "../../session/session.sql" import { Project } from "@/project/project" @@ -162,10 +163,12 @@ const aggregateSessionStats = Effect.fn("Cli.stats.aggregate")(function* ( filteredSessions, (session) => Effect.gen(function* () { - const messages = yield* svc.messages({ sessionID: session.id }) + const messages = yield* svc + .messages({ sessionID: session.id }) + .pipe(Effect.catchIf(NotFoundError.isInstance, () => Effect.succeed([]))) - let sessionCost = 0 - let sessionTokens = { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } } + const sessionCost = session.cost ?? 0 + const sessionTokens = session.tokens ?? { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } } let sessionToolUsage: Record = {} let sessionModelUsage: Record< string, @@ -178,8 +181,6 @@ const aggregateSessionStats = Effect.fn("Cli.stats.aggregate")(function* ( for (const message of messages) { if (message.info.role === "assistant") { - sessionCost += message.info.cost || 0 - const modelKey = `${message.info.providerID}/${message.info.modelID}` if (!sessionModelUsage[modelKey]) { sessionModelUsage[modelKey] = { @@ -192,12 +193,6 @@ const aggregateSessionStats = Effect.fn("Cli.stats.aggregate")(function* ( sessionModelUsage[modelKey].cost += message.info.cost || 0 if (message.info.tokens) { - sessionTokens.input += message.info.tokens.input || 0 - sessionTokens.output += message.info.tokens.output || 0 - sessionTokens.reasoning += message.info.tokens.reasoning || 0 - sessionTokens.cache.read += message.info.tokens.cache?.read || 0 - sessionTokens.cache.write += message.info.tokens.cache?.write || 0 - sessionModelUsage[modelKey].tokens.input += message.info.tokens.input || 0 sessionModelUsage[modelKey].tokens.output += (message.info.tokens.output || 0) + (message.info.tokens.reasoning || 0) diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index d7f2cd14b0ee..29cca133bbfd 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -2,6 +2,7 @@ import { render, TimeToFirstDraw, useRenderer, useTerminalDimensions } from "@op import { createDefaultOpenTuiKeymap } from "@opentui/keymap/opentui" import * as Clipboard from "@tui/util/clipboard" import * as Selection from "@tui/util/selection" +import * as TuiAudio from "@tui/util/audio" import { createCliRenderer, MouseButton, type CliRendererConfig } from "@opentui/core" import { RouteProvider, useRoute } from "@tui/context/route" import { @@ -63,6 +64,7 @@ import { TuiConfig } from "@/cli/cmd/tui/config/tui" import { TuiPluginRuntime } from "@/cli/cmd/tui/plugin/runtime" import { createTuiApi } from "@/cli/cmd/tui/plugin/api" import type { RouteMap } from "@/cli/cmd/tui/plugin/api" +import { createTuiAttention } from "@/cli/cmd/tui/attention" import { FormatError, FormatUnknownError } from "@/cli/error" import { CommandPaletteProvider, useCommandPalette } from "./context/command-palette" import { OpencodeKeymapProvider, registerOpencodeKeymap, useBindings, useOpencodeKeymap } from "./keymap" @@ -176,10 +178,10 @@ export function tui(input: { unguard?.() resolve() } - const onBeforeExit = async () => { offKeymap() await TuiPluginRuntime.dispose() + TuiAudio.dispose() } const renderer = await createCliRenderer(rendererConfig(input.config)) @@ -283,6 +285,7 @@ function App(props: { onSnapshot?: () => Promise }) { routeRev() return routes.get(name)?.at(-1)?.render } + const attention = createTuiAttention({ renderer, config: tuiConfig, kv }) const api = createTuiApi({ tuiConfig, @@ -298,11 +301,13 @@ function App(props: { onSnapshot?: () => Promise }) { theme: themeState, toast, renderer, + attention, }) const [ready, setReady] = createSignal(false) TuiPluginRuntime.init({ api, config: tuiConfig, + dispose: () => attention.dispose(), }) .catch((error) => { console.error("Failed to load TUI plugins", error) @@ -320,7 +325,10 @@ function App(props: { onSnapshot?: () => Promise }) { }, { priority: 1 }, ) - onCleanup(offSelectionKeys) + onCleanup(() => { + offSelectionKeys() + attention.dispose() + }) // Wire up console copy-to-clipboard via opentui's onCopySelection callback renderer.console.onCopySelection = async (text: string) => { diff --git a/packages/opencode/src/cli/cmd/tui/asset/charge.wav b/packages/opencode/src/cli/cmd/tui/asset/charge.wav deleted file mode 100644 index d9597899cd98..000000000000 Binary files a/packages/opencode/src/cli/cmd/tui/asset/charge.wav and /dev/null differ diff --git a/packages/opencode/src/cli/cmd/tui/asset/pulse-a.wav b/packages/opencode/src/cli/cmd/tui/asset/pulse-a.wav deleted file mode 100644 index 2ebb6a38bcf4..000000000000 Binary files a/packages/opencode/src/cli/cmd/tui/asset/pulse-a.wav and /dev/null differ diff --git a/packages/opencode/src/cli/cmd/tui/asset/pulse-b.wav b/packages/opencode/src/cli/cmd/tui/asset/pulse-b.wav deleted file mode 100644 index 4e1b59c96466..000000000000 Binary files a/packages/opencode/src/cli/cmd/tui/asset/pulse-b.wav and /dev/null differ diff --git a/packages/opencode/src/cli/cmd/tui/asset/pulse-c.wav b/packages/opencode/src/cli/cmd/tui/asset/pulse-c.wav deleted file mode 100644 index feb56cacdacb..000000000000 Binary files a/packages/opencode/src/cli/cmd/tui/asset/pulse-c.wav and /dev/null differ diff --git a/packages/opencode/src/cli/cmd/tui/attention.ts b/packages/opencode/src/cli/cmd/tui/attention.ts new file mode 100644 index 000000000000..f6480961dc00 --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/attention.ts @@ -0,0 +1,262 @@ +import type { + TuiAttention, + TuiAttentionNotifyInput, + TuiAttentionNotifyResult, + TuiAttentionNotifySkipReason, + TuiAttentionWhen, + TuiKV, + TuiAttentionSoundName, + TuiAttentionSoundPack, + TuiAttentionSoundPackInfo, +} from "@opencode-ai/plugin/tui" +import stripAnsi from "strip-ansi" +import type { TuiConfig } from "./config/tui" +import { isAttentionSoundName } from "./config/tui-schema" +import * as TuiAudio from "@tui/util/audio" +import defaultSoundPath from "@opencode-ai/ui/audio/bip-bop-01.mp3" with { type: "file" } +import questionSoundPath from "@opencode-ai/ui/audio/bip-bop-03.mp3" with { type: "file" } +import permissionSoundPath from "@opencode-ai/ui/audio/staplebops-06.mp3" with { type: "file" } +import errorSoundPath from "@opencode-ai/ui/audio/nope-03.mp3" with { type: "file" } +import doneSoundPath from "@opencode-ai/ui/audio/bip-bop-01.mp3" with { type: "file" } +import subagentDoneSoundPath from "@opencode-ai/ui/audio/yup-01.mp3" with { type: "file" } +import * as Log from "@opencode-ai/core/util/log" + +type FocusState = "unknown" | "focused" | "blurred" + +type AttentionRenderer = { + readonly isDestroyed: boolean + on(event: "focus" | "blur", listener: () => void): unknown + off(event: "focus" | "blur", listener: () => void): unknown + triggerNotification(message: string, title?: string): boolean +} + +type RegisteredSoundPack = TuiAttentionSoundPack & { + builtin: boolean +} + +type TuiAttentionHost = TuiAttention & { + dispose(): void +} + +const log = Log.create({ service: "tui.attention" }) + +const DEFAULT_TITLE = "opencode" +const DEFAULT_PACK_ID = "opencode.default" +const KV_SOUND_PACK = "attention_sound_pack" +const TITLE_LIMIT = 80 +const MESSAGE_LIMIT = 240 +const BUILTIN_PACK: RegisteredSoundPack = { + id: DEFAULT_PACK_ID, + name: "OpenCode Default", + builtin: true, + sounds: { + default: defaultSoundPath, + question: questionSoundPath, + permission: permissionSoundPath, + error: errorSoundPath, + done: doneSoundPath, + subagent_done: subagentDoneSoundPath, + }, +} + +function skipped(reason: TuiAttentionNotifySkipReason): TuiAttentionNotifyResult { + return { + ok: false, + notification: false, + sound: false, + skipped: reason, + } +} + +function normalizeText(input: string | undefined, fallback: string, limit: number) { + const text = stripAnsi(input ?? "") + .replace(/[ \t]*[\r\n]+[ \t]*/g, " ") + .replace(/[\u0000-\u0009\u000B\u000C\u000E-\u001F\u007F-\u009F]/g, "") + .trim() + const normalized = text.length ? text : fallback + return Array.from(normalized).slice(0, limit).join("") +} + +function clampVolume(volume: number) { + if (!Number.isFinite(volume)) return 0 + return Math.min(1, Math.max(0, volume)) +} + +function soundVolume(input: TuiAttentionNotifyInput, config: Pick) { + if (!config.attention.sound) return + if (input.sound === false) return + if (input.sound === undefined) return clampVolume(config.attention.volume) + if (input.sound === true) return clampVolume(config.attention.volume) + return clampVolume(input.sound.volume ?? config.attention.volume) +} + +function normalizePack(pack: TuiAttentionSoundPack): RegisteredSoundPack | undefined { + const id = pack.id.trim() + if (!id) return + return { + id, + name: pack.name?.trim() || undefined, + builtin: false, + sounds: Object.fromEntries( + Object.entries(pack.sounds).filter( + (item): item is [TuiAttentionSoundName, string] => + isAttentionSoundName(item[0]) && typeof item[1] === "string" && item[1].trim().length > 0, + ), + ), + } +} + +function focusSkip(when: TuiAttentionWhen, focus: FocusState) { + if (when === "always") return + if (focus === "unknown") return "focus_unknown" + if (when === "blurred" && focus === "focused") return "focused" + if (when === "focused" && focus === "blurred") return "blurred" +} + +export function createTuiAttention(input: { + renderer: AttentionRenderer + config: Pick + kv?: TuiKV + audio?: Pick +}): TuiAttentionHost { + let focus: FocusState = "unknown" + let disposed = false + let activePackID: string | undefined + const packs = new Map([[BUILTIN_PACK.id, BUILTIN_PACK]]) + const audio = input.audio ?? TuiAudio + + const onFocus = () => { + focus = "focused" + } + const onBlur = () => { + focus = "blurred" + } + + input.renderer.on("focus", onFocus) + input.renderer.on("blur", onBlur) + + function configuredPackID() { + const stored = input.kv?.get(KV_SOUND_PACK, undefined) + return activePackID ?? stored ?? input.config.attention.sound_pack + } + + function currentPack() { + return packs.get(configuredPackID()) ?? BUILTIN_PACK + } + + function soundCandidates(name: TuiAttentionSoundName) { + return [input.config.attention.sounds[name], currentPack().sounds[name], BUILTIN_PACK.sounds[name]].filter( + (item, index, list): item is string => typeof item === "string" && list.indexOf(item) === index, + ) + } + + async function playSound(name: TuiAttentionSoundName, volume: number) { + try { + for (const file of soundCandidates(name)) { + const current = await audio.loadSoundFile(file).catch((error) => { + log.debug("failed to load attention sound", { file, error }) + return null + }) + if (disposed) return false + if (current == null) continue + if (audio.play(current, { volume }) != null) return true + } + return false + } catch (error) { + log.debug("failed to play attention sound", { error }) + return false + } + } + + return { + async notify(request) { + try { + if (!input.config.attention.enabled) return skipped("attention_disabled") + if (disposed || input.renderer.isDestroyed) return skipped("renderer_destroyed") + + const message = normalizeText(request.message, "", MESSAGE_LIMIT) + if (!message) return skipped("empty_message") + + const requestedNotification = typeof request.notification === "object" ? request.notification : undefined + const notificationSkip = focusSkip(requestedNotification?.when ?? "blurred", focus) + const notificationRequested = input.config.attention.notifications && request.notification !== false + const shouldNotify = notificationRequested && !notificationSkip + const notification = shouldNotify + ? (() => { + try { + return input.renderer.triggerNotification( + message, + normalizeText(request.title, DEFAULT_TITLE, TITLE_LIMIT), + ) + } catch (error) { + log.debug("failed to trigger attention notification", { error }) + return false + } + })() + : false + const volume = soundVolume(request, input.config) + const requestedSound = typeof request.sound === "object" ? request.sound : undefined + const soundSkip = volume === undefined ? undefined : focusSkip(requestedSound?.when ?? "always", focus) + const soundName = + requestedSound?.name && isAttentionSoundName(requestedSound.name) ? requestedSound.name : "default" + const sound = volume === undefined || soundSkip ? false : await playSound(soundName, volume) + + if (!notification && !sound) { + if (notificationRequested && notificationSkip) return skipped(notificationSkip) + if (soundSkip) return skipped(soundSkip) + } + + return { + ok: notification || sound, + notification, + sound, + } + } catch (error) { + log.debug("failed to handle attention notification", { error }) + return { + ok: false, + notification: false, + sound: false, + } + } + }, + soundboard: { + registerPack(pack) { + const next = normalizePack(pack) + if (!next) return () => {} + packs.set(next.id, next) + let disposed = false + return () => { + if (disposed) return + disposed = true + if (packs.get(next.id) === next) packs.delete(next.id) + } + }, + activate(id, options) { + const pack = packs.get(id) + if (!pack) return false + activePackID = pack.id + if (options?.persist) input.kv?.set(KV_SOUND_PACK, pack.id) + return true + }, + current() { + return currentPack().id + }, + list(): TuiAttentionSoundPackInfo[] { + const current = currentPack().id + return Array.from(packs.values()).map((pack) => ({ + id: pack.id, + name: pack.name, + active: pack.id === current, + builtin: pack.builtin, + })) + }, + }, + dispose() { + if (disposed) return + disposed = true + input.renderer.off("focus", onFocus) + input.renderer.off("blur", onBlur) + }, + } +} diff --git a/packages/opencode/src/cli/cmd/tui/component/logo.tsx b/packages/opencode/src/cli/cmd/tui/component/logo.tsx index e3e8074cd12a..557b86877482 100644 --- a/packages/opencode/src/cli/cmd/tui/component/logo.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/logo.tsx @@ -2,7 +2,6 @@ import { BoxRenderable, MouseButton, MouseEvent, RGBA, TextAttributes } from "@o import { useRenderer } from "@opentui/solid" import { For, createMemo, createSignal, onCleanup, onMount, type JSX } from "solid-js" import { useTheme, tint } from "@tui/context/theme" -import * as Sound from "@tui/util/sound" import { go, logo } from "@/cli/logo" export type LogoShape = { @@ -563,7 +562,6 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = const [now, setNow] = createSignal(0) let box: BoxRenderable | undefined let timer: ReturnType | undefined - let hum = false const stop = () => { if (!timer) return @@ -575,10 +573,6 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = const t = performance.now() setNow(t) const item = hold() - if (item && !hum && t - item.at >= HOLD) { - hum = true - Sound.start() - } if (item && t - item.at >= CHARGE) { burst(item.x, item.y) } @@ -605,8 +599,6 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = onCleanup(() => { stop() - hum = false - Sound.dispose() }) onMount(() => { @@ -626,14 +618,12 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = setNow(t) if (!last) setRelease(undefined) setHold({ x, y, at: t, glyph: select(x, y, ctx) }) - hum = false start() } const burst = (x: number, y: number) => { const item = hold() if (!item) return - hum = false const t = performance.now() const age = t - item.at const rise = ramp(age, HOLD, CHARGE) @@ -655,7 +645,6 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = ]) setNow(t) start() - Sound.pulse(lerp(0.8, 1, level)) } const frame = createMemo(() => { diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx index 3242de94d671..3f7604653c56 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx @@ -20,6 +20,7 @@ import { useFrecency } from "./frecency" import { useBindings } from "../../keymap" import { Reference } from "@/reference/reference" import type { Config } from "@/config/config" +import { displayCharAt, mentionTriggerIndex } from "@/cli/cmd/prompt-display" function removeLineRange(input: string) { const hashIndex = input.lastIndexOf("#") @@ -159,7 +160,7 @@ export function Autocomplete(props: { const input = props.input() const currentCursorOffset = input.cursorOffset - const charAfterCursor = props.value.at(currentCursorOffset) + const charAfterCursor = displayCharAt(props.value, currentCursorOffset) const needsSpace = charAfterCursor !== " " const append = "@" + text + (needsSpace ? " " : "") @@ -787,13 +788,8 @@ export function Autocomplete(props: { } // Check for "@" trigger - find the nearest "@" before cursor with no whitespace between - const text = value.slice(0, offset) - const idx = text.lastIndexOf("@") - if (idx === -1) return - - const between = text.slice(idx) - const before = idx === 0 ? undefined : value[idx - 1] - if ((before === undefined || /\s/.test(before)) && !between.match(/\s/)) { + const idx = mentionTriggerIndex(value, offset) + if (idx !== undefined) { show("@") setStore("index", idx) } diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index f3217fcbabdd..d2c54d2c7d28 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -62,6 +62,9 @@ import { type WorkspaceStatus } from "../workspace-label" import { useCommandPalette } from "../../context/command-palette" import { useBindings, useCommandShortcut, useLeaderActive, useOpencodeKeymap } from "../../keymap" import { useTuiConfig } from "../../context/tui-config" +import { errorMessage } from "@/util/error" + +const GOAL_OBJECTIVE_MAX_LENGTH = 4000 export type PromptProps = { sessionID?: string @@ -337,6 +340,7 @@ export function Prompt(props: PromptProps) { const usage = createMemo(() => { if (!props.sessionID) return + const session = sync.session.get(props.sessionID) const msg = sync.data.message[props.sessionID] ?? [] const last = msg.findLast((item): item is AssistantMessage => item.role === "assistant" && item.tokens.output > 0) if (!last) return @@ -347,7 +351,7 @@ export function Prompt(props: PromptProps) { const model = sync.data.provider.find((item) => item.id === last.providerID)?.models[last.modelID] const pct = model?.limit.context ? `${Math.round((tokens / model.limit.context) * 100)}%` : undefined - const cost = msg.reduce((sum, item) => sum + (item.role === "assistant" ? item.cost : 0), 0) + const cost = session?.cost ?? 0 return { context: pct ? `${Locale.number(tokens)} (${pct})` : Locale.number(tokens), cost: cost > 0 ? money.format(cost) : undefined, @@ -989,7 +993,24 @@ export function Prompt(props: PromptProps) { } }) + let submitting = false async function submit() { + // Prevent overlapping invocations (e.g. a double-pressed Enter, or the + // input's native onSubmit racing another dispatch). Without this guard, + // a second call slips past the empty-input check before the first call + // clears `store.prompt.input`, then awaits its own `session.create` and + // ultimately reads the now-empty store — sending a phantom empty prompt + // to a freshly created session. + if (submitting) return false + submitting = true + try { + return await submitInner() + } finally { + submitting = false + } + } + + async function submitInner() { setWarpNotice(undefined) // IME: double-defer may fire before onContentChange flushes the last @@ -1118,6 +1139,8 @@ export function Prompt(props: PromptProps) { ] : [] + const goalCommandText = inputText.trim() + if (store.mode === "shell") { void sdk.client.session.shell({ sessionID, @@ -1129,6 +1152,84 @@ export function Prompt(props: PromptProps) { command: inputText, }) setStore("mode", "normal") + } else if (goalCommandText === "/goal" || goalCommandText.startsWith("/goal ")) { + const arg = goalCommandText.slice("/goal".length).trim() + const show = (message: string, variant: "success" | "error" = "success") => toast.show({ message, variant }) + const control = !arg || arg === "pause" || arg === "resume" || arg === "clear" || arg === "edit" + if (!control && arg.length > GOAL_OBJECTIVE_MAX_LENGTH) { + show( + `Goal objective is too long (${arg.length}/${GOAL_OBJECTIVE_MAX_LENGTH} characters). Shorten the /goal objective and put extra details in a normal follow-up prompt.`, + "error", + ) + return true + } + const current = await sdk.client.session.goal.get({ sessionID }) + const runGoalMutation = async (request: Promise<{ error?: unknown }>, message: string) => { + const result = await request + if (result.error) { + show(errorMessage(result.error), "error") + return false + } + show(message) + return true + } + if (current.error) { + show(errorMessage(current.error), "error") + return true + } + if (!arg) { + const goal = current.data + show( + goal + ? [ + `Goal ${goal.status}: ${goal.objective}`, + `tokens ${goal.tokens.used}${goal.tokens.budget === undefined ? "" : `/${goal.tokens.budget}`}`, + `time ${formatDuration(goal.time.used * 1000)}`, + "commands /goal edit, /goal pause, /goal resume, /goal clear", + ].join(" | ") + : "No goal set. Use /goal .", + ) + } else if (arg === "pause") { + if (!current.data) show("No goal to pause.", "error") + else { + if (!(await runGoalMutation(sdk.client.session.goal.update({ sessionID, status: "paused" }), "Goal paused."))) + return true + } + } else if (arg === "resume") { + if (!current.data) show("No goal to resume.", "error") + else { + const result = await sdk.client.session.goal.update({ sessionID, status: "active" }) + if (result.error) { + show(errorMessage(result.error), "error") + return true + } + if (result.data?.status === "budget_limited") { + show("Goal still budget-limited. Increase or clear the token budget to resume.", "error") + return true + } + show("Goal resumed.") + } + } else if (arg === "clear") { + if (!(await runGoalMutation(sdk.client.session.goal.clear({ sessionID }), "Goal cleared."))) return true + } else if (arg === "edit") { + if (!current.data) show("No goal to edit. Use /goal .", "error") + else { + input.setText(`/goal ${current.data.objective}`) + setStore("prompt", "input", `/goal ${current.data.objective}`) + return true + } + } else if (current.data) { + if ( + !(await runGoalMutation( + sdk.client.session.goal.update({ sessionID, objective: arg, status: "active" }), + "Goal updated.", + )) + ) + return true + } else { + if (!(await runGoalMutation(sdk.client.session.goal.create({ sessionID, objective: arg }), "Goal set."))) + return true + } } else if ( inputText.startsWith("/") && iife(() => { diff --git a/packages/opencode/src/cli/cmd/tui/config/tui-schema.ts b/packages/opencode/src/cli/cmd/tui/config/tui-schema.ts index 80765da3c7f3..2c99f2a5ef61 100644 --- a/packages/opencode/src/cli/cmd/tui/config/tui-schema.ts +++ b/packages/opencode/src/cli/cmd/tui/config/tui-schema.ts @@ -1,12 +1,47 @@ import { ConfigPlugin } from "@/config/plugin" import { TuiKeybind } from "./keybind" import { Schema } from "effect" +import { isRecord } from "@/util/record" +import { Filesystem } from "@/util/filesystem" +import { TuiAttentionSoundNames, type TuiAttentionSoundName } from "@opencode-ai/plugin/tui" + +export type TuiAttentionSoundPaths = Partial> + +export function isAttentionSoundName(value: string): value is TuiAttentionSoundName { + return TuiAttentionSoundNames.includes(value as TuiAttentionSoundName) +} + +export function resolveAttentionSoundPaths( + root: string, + sounds: unknown, + options?: { trim?: boolean }, +): TuiAttentionSoundPaths { + if (!isRecord(sounds)) return {} + return Object.fromEntries( + Object.entries(sounds).flatMap(([name, file]) => { + if (!isAttentionSoundName(name)) return [] + if (typeof file !== "string") return [] + const value = options?.trim ? file.trim() : file + if (!value) return [] + return [[name, Filesystem.resolveFilePath(root, value)]] + }), + ) +} export const KeymapLeaderTimeoutDefault = 2000 const KeymapLeaderTimeout = Schema.Int.check(Schema.isGreaterThan(0)).annotate({ description: "Leader key timeout in milliseconds", }) +const TuiAttentionSounds = Schema.Struct({ + default: Schema.optional(Schema.String), + question: Schema.optional(Schema.String), + permission: Schema.optional(Schema.String), + error: Schema.optional(Schema.String), + done: Schema.optional(Schema.String), + subagent_done: Schema.optional(Schema.String), +}) + export const ScrollSpeed = Schema.Number.check(Schema.isGreaterThanOrEqualTo(0.001)) export const ScrollAcceleration = Schema.Struct({ @@ -17,6 +52,15 @@ export const DiffStyle = Schema.Literals(["auto", "stacked"]).annotate({ description: "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column", }) +export const Attention = Schema.Struct({ + enabled: Schema.optional(Schema.Boolean), + notifications: Schema.optional(Schema.Boolean), + sound: Schema.optional(Schema.Boolean), + volume: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(1))), + sound_pack: Schema.optional(Schema.String), + sounds: Schema.optional(TuiAttentionSounds), +}).annotate({ description: "Attention notification and sound settings" }) + export const TuiInfo = Schema.Struct({ $schema: Schema.optional(Schema.String), theme: Schema.optional(Schema.String), @@ -24,6 +68,7 @@ export const TuiInfo = Schema.Struct({ plugin: Schema.optional(Schema.Array(ConfigPlugin.Spec)), plugin_enabled: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)), leader_timeout: Schema.optional(KeymapLeaderTimeout), + attention: Schema.optional(Attention), scroll_speed: Schema.optional(ScrollSpeed).annotate({ description: "TUI scroll speed", }), diff --git a/packages/opencode/src/cli/cmd/tui/config/tui.ts b/packages/opencode/src/cli/cmd/tui/config/tui.ts index e53e20d3435e..0d4be41dfc0d 100644 --- a/packages/opencode/src/cli/cmd/tui/config/tui.ts +++ b/packages/opencode/src/cli/cmd/tui/config/tui.ts @@ -1,13 +1,13 @@ export * as TuiConfig from "./tui" +import path from "path" import { createBindingLookup } from "@opentui/keymap/extras" import { mergeDeep, unique } from "remeda" -import { Context, Effect, Fiber, Layer, Schema } from "effect" +import { Cause, Context, Effect, Fiber, Layer, Schema } from "effect" import { ConfigParse } from "@/config/parse" -import { InvalidError } from "@/config/error" import * as ConfigPaths from "@/config/paths" import { migrateTuiConfig } from "./tui-migrate" -import { KeymapLeaderTimeoutDefault, TuiInfo } from "./tui-schema" +import { KeymapLeaderTimeoutDefault, resolveAttentionSoundPaths, TuiInfo } from "./tui-schema" import { Flag } from "@opencode-ai/core/flag/flag" import { isRecord } from "@/util/record" import { Global } from "@opencode-ai/core/global" @@ -22,6 +22,8 @@ import * as Log from "@opencode-ai/core/util/log" import { ConfigVariable } from "@/config/variable" import { Npm } from "@opencode-ai/core/npm" import type { DeepMutable } from "@opencode-ai/core/schema" +import type { TuiAttentionSoundName } from "@opencode-ai/plugin/tui" +import { FormatError, FormatUnknownError } from "@/cli/error" const log = Log.create({ service: "tui.config" }) @@ -33,7 +35,15 @@ type Acc = { plugin_origins: ConfigPlugin.Origin[] } -export type Resolved = Omit & { +export type Resolved = Omit & { + attention: { + enabled: boolean + notifications: boolean + sound: boolean + volume: number + sound_pack: string + sounds: Partial> + } keybinds: TuiKeybind.BindingLookupView leader_timeout: number // Internal resolved plugin list used by runtime loading. @@ -69,8 +79,26 @@ function normalize(raw: Record) { } } +function dropUnknownKeybinds(input: Record, configFilepath: string) { + if (!isRecord(input.keybinds)) return input + + const invalid = TuiKeybind.unknownKeys(input.keybinds) + if (!invalid.length) return input + + log.warn("ignored unknown tui keybinds", { + path: configFilepath, + keybinds: invalid, + hint: "Remove these entries or rename them to keys from the tui.json schema.", + }) + return { + ...input, + keybinds: Object.fromEntries(Object.entries(input.keybinds).filter(([key]) => !invalid.includes(key))), + } +} + const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory: string }) { const afs = yield* AppFileSystem.Service + let appliedOrder = 0 const resolvePlugins = (config: Info, configFilepath: string): Effect.Effect => Effect.gen(function* () { @@ -91,24 +119,29 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory: if (!isRecord(data)) return {} as Info // Flatten a nested "tui" key so users who wrote `{ "tui": { ... } }` inside tui.json // (mirroring the old opencode.json shape) still get their settings applied. - const normalized = normalize(data) - if (isRecord(normalized.keybinds)) { - const invalid = TuiKeybind.unknownKeys(normalized.keybinds) - if (invalid.length) { - throw new InvalidError({ - path: configFilepath, - message: `Unrecognized keybind${invalid.length === 1 ? "" : "s"}: ${invalid.join(", ")}`, - }) - } - } - const validated = ConfigParse.schema(Info, normalized, configFilepath) + const normalized = dropUnknownKeybinds(normalize(data), configFilepath) + const parsed = ConfigParse.schema(Info, normalized, configFilepath) + const validated = parsed.attention?.sounds + ? { + ...parsed, + attention: { + ...parsed.attention, + sounds: resolveAttentionSoundPaths(path.dirname(configFilepath), parsed.attention.sounds), + }, + } + : parsed return yield* resolvePlugins(validated, configFilepath) }).pipe( // catchCause (not tapErrorCause + orElseSucceed) because JSONC parsing and validation // can sync-throw — those become defects, which orElseSucceed wouldn't catch. Effect.catchCause((cause) => Effect.sync(() => { - log.warn("invalid tui config", { path: configFilepath, cause }) + const error = Cause.squash(cause) + const reason = FormatError(error) ?? FormatUnknownError(error) + log.warn("skipping invalid tui config", { + path: configFilepath, + reason, + }) return {} as Info }), ), @@ -122,18 +155,28 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory: const text = yield* afs.readFileStringSafe(filepath).pipe( Effect.catchCause((cause) => Effect.sync(() => { - log.warn("failed to read tui config", { path: filepath, cause }) + const error = Cause.squash(cause) + const reason = FormatError(error) ?? FormatUnknownError(error) + log.warn("failed to read tui config", { + path: filepath, + reason, + }) return undefined }), ), ) if (!text) return {} as Info + log.info("loading tui config", { path: filepath }) return yield* load(text, filepath) }) const mergeFile = (acc: Acc, file: string) => Effect.gen(function* () { const data = yield* loadFile(file) + if (Object.keys(data).length) { + appliedOrder += 1 + log.info("applying tui config", { path: file, order: appliedOrder }) + } acc.result = mergeDeep(acc.result, data) if (!data.plugin?.length) return @@ -197,6 +240,14 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory: const parsedKeybinds = TuiKeybind.parse(keybinds) const result: Resolved = { ...acc.result, + attention: { + enabled: acc.result.attention?.enabled ?? false, + notifications: acc.result.attention?.notifications ?? true, + sound: acc.result.attention?.sound ?? true, + volume: acc.result.attention?.volume ?? 0.4, + sound_pack: acc.result.attention?.sound_pack ?? "opencode.default", + sounds: acc.result.attention?.sounds ?? {}, + }, keybinds: createBindingLookup(TuiKeybind.toBindingConfig(parsedKeybinds), { commandMap: TuiKeybind.CommandMap, bindingDefaults: TuiKeybind.bindingDefaults(), diff --git a/packages/opencode/src/cli/cmd/tui/context/editor-zed.ts b/packages/opencode/src/cli/cmd/tui/context/editor-zed.ts index 6805f0b66650..611db406b50f 100644 --- a/packages/opencode/src/cli/cmd/tui/context/editor-zed.ts +++ b/packages/opencode/src/cli/cmd/tui/context/editor-zed.ts @@ -1,33 +1,36 @@ import { Database } from "bun:sqlite" import os from "node:os" import path from "node:path" -import z from "zod" +import { Option, Schema } from "effect" import { Filesystem } from "@/util/filesystem" import type { EditorSelection } from "./editor" -const ZedEditorRowSchema = z.object({ - item_kind: z.string(), - editor_id: z.number().nullable(), - workspace_id: z.number(), - workspace_paths: z.string().nullable(), - timestamp: z.string(), - buffer_path: z.string().nullable(), +const ZedEditorRowSchema = Schema.Struct({ + item_kind: Schema.String, + editor_id: Schema.NullOr(Schema.Number), + workspace_id: Schema.Number, + workspace_paths: Schema.NullOr(Schema.String), + timestamp: Schema.String, + buffer_path: Schema.NullOr(Schema.String), }) -const ZedSelectionRowSchema = z.object({ - selection_start: z.number().nullable(), - selection_end: z.number().nullable(), +const ZedSelectionRowSchema = Schema.Struct({ + selection_start: Schema.NullOr(Schema.Number), + selection_end: Schema.NullOr(Schema.Number), }) -const ZedEditorContentsSchema = z.object({ - contents: z.string().nullable(), +const ZedEditorContentsSchema = Schema.Struct({ + contents: Schema.NullOr(Schema.String), }) +const decodeZedEditorRow = Schema.decodeUnknownOption(ZedEditorRowSchema) +const decodeZedSelectionRow = Schema.decodeUnknownOption(ZedSelectionRowSchema) +const decodeZedEditorContents = Schema.decodeUnknownOption(ZedEditorContentsSchema) + const utf8 = new TextEncoder() -type ZedEditorRow = z.infer +type ZedEditorRow = Schema.Schema.Type type ZedActiveEditorRow = ZedEditorRow & { item_kind: "Editor"; editor_id: number } -type ZedSelectionRow = z.infer export type ZedSelectionResult = | { type: "selection"; selection: EditorSelection } @@ -107,8 +110,8 @@ function queryZedActiveEditor(dbPath: string, cwd: string) { .all() const rows = raw.flatMap((row) => { - const parsed = ZedEditorRowSchema.safeParse(row) - return parsed.success ? [parsed.data] : [] + const parsed = decodeZedEditorRow(row) + return Option.isSome(parsed) ? [parsed.value] : [] }) if (raw.length > 0 && rows.length === 0) return { type: "unavailable" as const } @@ -143,8 +146,8 @@ function queryZedEditorSelections(dbPath: string, row: ZedActiveEditorRow) { .all({ $editorID: row.editor_id, $workspaceID: row.workspace_id }) const selections = raw.flatMap((selection) => { - const parsed = ZedSelectionRowSchema.safeParse(selection) - return parsed.success ? [parsed.data] : [] + const parsed = decodeZedSelectionRow(selection) + return Option.isSome(parsed) ? [parsed.value] : [] }) if (raw.length > 0 && selections.length === 0) return { type: "unavailable" as const } @@ -160,7 +163,7 @@ function queryZedEditorContents(dbPath: string, row: ZedActiveEditorRow) { let db: Database | undefined try { db = new Database(dbPath, { readonly: true }) - const parsed = ZedEditorContentsSchema.safeParse( + const parsed = decodeZedEditorContents( db .query( `select contents @@ -169,8 +172,8 @@ function queryZedEditorContents(dbPath: string, row: ZedActiveEditorRow) { ) .get({ $editorID: row.editor_id, $workspaceID: row.workspace_id }), ) - if (!parsed.success) return { type: "unavailable" as const } - return { type: "contents" as const, contents: parsed.data.contents } + if (Option.isNone(parsed)) return { type: "unavailable" as const } + return { type: "contents" as const, contents: parsed.value.contents } } catch { return { type: "unavailable" as const } } finally { diff --git a/packages/opencode/src/cli/cmd/tui/context/editor.ts b/packages/opencode/src/cli/cmd/tui/context/editor.ts index 6d9e04cf8425..ea7fd5810b1d 100644 --- a/packages/opencode/src/cli/cmd/tui/context/editor.ts +++ b/packages/opencode/src/cli/cmd/tui/context/editor.ts @@ -3,92 +3,102 @@ import os from "node:os" import path from "node:path" import { onCleanup, onMount } from "solid-js" import { createStore } from "solid-js/store" -import z from "zod" +import { Option, Schema, SchemaGetter } from "effect" import { isRecord } from "@/util/record" import { createSimpleContext } from "./helper" import { resolveZedDbPath, resolveZedSelection } from "./editor-zed" const MCP_PROTOCOL_VERSION = "2025-11-25" -const JsonRpcMessageSchema = z.object({ - id: z.union([z.number(), z.string(), z.null()]).optional(), - method: z.string().optional(), - params: z.unknown().optional(), - result: z.unknown().optional(), - error: z - .object({ - code: z.number().optional(), - message: z.string().optional(), - }) - .optional(), +const JsonRpcMessageSchema = Schema.Struct({ + id: Schema.optional(Schema.Union([Schema.Number, Schema.String, Schema.Null])), + method: Schema.optional(Schema.String), + params: Schema.optional(Schema.Unknown), + result: Schema.optional(Schema.Unknown), + error: Schema.optional( + Schema.Struct({ + code: Schema.optional(Schema.Number), + message: Schema.optional(Schema.String), + }), + ), }) -const PositionSchema = z.object({ - line: z.number(), - character: z.number(), +const PositionSchema = Schema.Struct({ + line: Schema.Number, + character: Schema.Number, }) -const EditorSelectionRangeSchema = z.object({ - text: z.string(), - selection: z.object({ +const EditorSelectionRangeSchema = Schema.Struct({ + text: Schema.String, + selection: Schema.Struct({ start: PositionSchema, end: PositionSchema, }), }) -const EditorSelectionSchema = z - .union([ - z.object({ - filePath: z.string(), - source: z.enum(["websocket", "zed"]).optional(), - ranges: z.array(EditorSelectionRangeSchema).min(1), - }), - z.object({ - text: z.string(), - filePath: z.string(), - source: z.enum(["websocket", "zed"]).optional(), - selection: z.object({ - start: PositionSchema, - end: PositionSchema, - }), +const EditorSelectionRangesSchema = Schema.Struct({ + filePath: Schema.String, + source: Schema.optional(Schema.Literals(["websocket", "zed"])), + ranges: Schema.mutable(Schema.Array(EditorSelectionRangeSchema).check(Schema.isMinLength(1))), +}) + +const EditorSelectionSchema = Schema.Union([ + EditorSelectionRangesSchema, + Schema.Struct({ + text: Schema.String, + filePath: Schema.String, + source: Schema.optional(Schema.Literals(["websocket", "zed"])), + selection: Schema.Struct({ + start: PositionSchema, + end: PositionSchema, }), - ]) - .transform((value) => - "ranges" in value - ? value - : { - filePath: value.filePath, - source: value.source, - ranges: [ - { - text: value.text, - selection: value.selection, - }, - ], - }, - ) - -const EditorMentionSchema = z.object({ - filePath: z.string(), - lineStart: z.number(), - lineEnd: z.number(), + }), +]).pipe( + Schema.decodeTo(EditorSelectionRangesSchema, { + decode: SchemaGetter.transform((value) => + "ranges" in value + ? value + : { + filePath: value.filePath, + source: value.source, + ranges: [ + { + text: value.text, + selection: value.selection, + }, + ], + }, + ), + encode: SchemaGetter.passthrough({ strict: false }), + }), +) + +const EditorMentionSchema = Schema.Struct({ + filePath: Schema.String, + lineStart: Schema.Number, + lineEnd: Schema.Number, }) -const EditorServerInfoSchema = z.object({ - protocolVersion: z.string().optional(), - serverInfo: z - .object({ - name: z.string().optional(), - version: z.string().optional(), - }) - .optional(), +const EditorServerInfoSchema = Schema.Struct({ + protocolVersion: Schema.optional(Schema.String), + serverInfo: Schema.optional( + Schema.Struct({ + name: Schema.optional(Schema.String), + version: Schema.optional(Schema.String), + }), + ), }) -type JsonRpcMessage = z.infer -export type EditorSelection = z.infer -export type EditorMention = z.infer +const decodeJsonRpcMessage = Schema.decodeUnknownOption(JsonRpcMessageSchema) +const decodeEditorSelection = Schema.decodeUnknownOption(EditorSelectionSchema) +const decodeEditorMention = Schema.decodeUnknownOption(EditorMentionSchema) +const decodeEditorServerInfo = Schema.decodeUnknownOption(EditorServerInfoSchema) + +type JsonRpcMessage = Schema.Schema.Type +export type EditorSelection = Schema.Schema.Type +export type EditorMention = Schema.Schema.Type export type EditorLabelState = "pending" | "sent" | "none" -type EditorServerInfo = z.infer +type EditorServerInfo = Schema.Schema.Type type EditorConnection = { url: string @@ -214,16 +224,15 @@ export const { use: useEditorContext, provider: EditorContextProvider } = create const message = parseMessage(event.data) if (!message) return - const selection = - message.method === "selection_changed" ? EditorSelectionSchema.safeParse(message.params) : undefined - if (selection?.success) { - setSelection({ ...selection.data, source: "websocket" }) + const selection = message.method === "selection_changed" ? decodeEditorSelection(message.params) : Option.none() + if (Option.isSome(selection)) { + setSelection({ ...selection.value, source: "websocket" }) return } - const mention = message.method === "at_mentioned" ? EditorMentionSchema.safeParse(message.params) : undefined - if (mention?.success) { - mentionListeners.forEach((listener) => listener(mention.data)) + const mention = message.method === "at_mentioned" ? decodeEditorMention(message.params) : Option.none() + if (Option.isSome(mention)) { + mentionListeners.forEach((listener) => listener(mention.value)) return } @@ -235,9 +244,9 @@ export const { use: useEditorContext, provider: EditorContextProvider } = create pending.delete(message.id) if (message.error) return - const initialize = method === "initialize" ? EditorServerInfoSchema.safeParse(message.result) : undefined - if (initialize?.success) { - setStore("server", initialize.data) + const initialize = method === "initialize" ? decodeEditorServerInfo(message.result) : Option.none() + if (Option.isSome(initialize)) { + setStore("server", initialize.value) send({ method: "notifications/initialized" }) return } @@ -447,7 +456,7 @@ function parseMessage(value: unknown) { if (typeof value !== "string") return try { - return JsonRpcMessageSchema.parse(JSON.parse(value)) + return Option.getOrUndefined(decodeJsonRpcMessage(JSON.parse(value))) } catch { return } diff --git a/packages/opencode/src/cli/cmd/tui/context/event.ts b/packages/opencode/src/cli/cmd/tui/context/event.ts index 156f9c94768a..5d814ecdcaab 100644 --- a/packages/opencode/src/cli/cmd/tui/context/event.ts +++ b/packages/opencode/src/cli/cmd/tui/context/event.ts @@ -2,39 +2,33 @@ import type { Event } from "@opencode-ai/sdk/v2" import { useProject } from "./project" import { useSDK } from "./sdk" +type EventMetadata = { + workspace: string | undefined +} + export function useEvent() { const project = useProject() const sdk = useSDK() - function subscribe(handler: (event: Event) => void) { + function subscribe(handler: (event: Event, metadata: EventMetadata) => void) { return sdk.event.on("event", (event) => { if (event.payload.type === "sync") { return } - // Special hack for truly global events - if (event.directory === "global") { - handler(event.payload) - } - - if (project.workspace.current()) { - if (event.workspace === project.workspace.current()) { - handler(event.payload) - } - - return - } - - if (event.directory === project.instance.directory()) { - handler(event.payload) + if (event.directory === "global" || event.project === project.project()) { + handler(event.payload, { workspace: event.workspace }) } }) } - function on(type: T, handler: (event: Extract) => void) { - return subscribe((event) => { + function on( + type: T, + handler: (event: Extract, metadata: EventMetadata) => void, + ) { + return subscribe((event: Event, metadata: EventMetadata) => { if (event.type !== type) return - handler(event as Extract) + handler(event as Extract, metadata) }) } diff --git a/packages/opencode/src/cli/cmd/tui/context/sync.tsx b/packages/opencode/src/cli/cmd/tui/context/sync.tsx index 0d4cb2e6e285..79fac3df9c46 100644 --- a/packages/opencode/src/cli/cmd/tui/context/sync.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/sync.tsx @@ -14,6 +14,7 @@ import type { McpResource, FormatterStatus, SessionStatus, + SessionGoal, ProviderListResponse, ProviderAuthMethod, VcsInfo, @@ -57,6 +58,9 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ session_status: { [sessionID: string]: SessionStatus } + session_goal: { + [sessionID: string]: SessionGoal | undefined + } session_diff: { [sessionID: string]: Snapshot.FileDiff[] } @@ -96,6 +100,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ provider_default: {}, session: [], session_status: {}, + session_goal: {}, session_diff: {}, todo: {}, message: {}, @@ -113,7 +118,6 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ const kv = useKV() const fullSyncedSessions = new Set() - let syncedWorkspace = project.workspace.current() function sessionListQuery(): { scope?: "project"; path?: string } { if (!kv.get("session_directory_filter_enabled", true)) return { scope: "project" } @@ -131,7 +135,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ .then((x) => (x.data ?? []).toSorted((a, b) => a.id.localeCompare(b.id))) } - event.subscribe((event) => { + event.subscribe((event, { workspace }) => { switch (event.type) { case "server.instance.disposed": void bootstrap() @@ -251,6 +255,16 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ break } + case "session.goal.updated": { + setStore("session_goal", event.properties.sessionID, reconcile(event.properties.goal)) + break + } + + case "session.goal.cleared": { + setStore("session_goal", event.properties.sessionID, undefined) + break + } + case "message.updated": { const messages = store.message[event.properties.info.sessionID] if (!messages) { @@ -346,7 +360,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ case "message.part.removed": { const parts = store.part[event.properties.messageID] const result = Binary.search(parts, event.properties.partID, (p) => p.id) - if (result.found) + if (result.found) { setStore( "part", event.properties.messageID, @@ -354,6 +368,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ draft.splice(result.index, 1) }), ) + } break } @@ -364,7 +379,9 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ } case "vcs.branch.updated": { - setStore("vcs", { branch: event.properties.branch }) + if (workspace === project.workspace.current()) { + setStore("vcs", { branch: event.properties.branch }) + } break } } @@ -376,10 +393,6 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ async function bootstrap(input: { fatal?: boolean } = {}) { const fatal = input.fatal ?? true const workspace = project.workspace.current() - if (workspace !== syncedWorkspace) { - fullSyncedSessions.clear() - syncedWorkspace = workspace - } const projectPromise = project.sync() const sessionListPromise = projectPromise.then(() => listSessions()) @@ -522,11 +535,12 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ }, async sync(sessionID: string) { if (fullSyncedSessions.has(sessionID)) return - const [session, messages, todo, diff] = await Promise.all([ + const [session, messages, todo, diff, goal] = await Promise.all([ sdk.client.session.get({ sessionID }, { throwOnError: true }), sdk.client.session.messages({ sessionID, limit: 100 }), sdk.client.session.todo({ sessionID }), sdk.client.session.diff({ sessionID }), + sdk.client.session.goal.get({ sessionID }), ]) setStore( produce((draft) => { @@ -534,6 +548,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ if (match.found) draft.session[match.index] = session.data! if (!match.found) draft.session.splice(match.index, 0, session.data!) draft.todo[sessionID] = todo.data ?? [] + draft.session_goal[sessionID] = goal.data ?? undefined const infos: (typeof draft.message)[string] = [] for (const message of messages.data ?? []) { infos.push(message.info) diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx index 07a2844e937d..8c50914df378 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx @@ -1,11 +1,52 @@ -import { createMemo, For } from "solid-js" +import type { TuiPluginApi } from "@opencode-ai/plugin/tui" +import { createMemo, For, type Accessor } from "solid-js" import { DEFAULT_THEMES, useTheme } from "@tui/context/theme" import { Flag } from "@opencode-ai/core/flag/flag" +import { useCommandShortcut } from "../../keymap" const themeCount = Object.keys(DEFAULT_THEMES).length -const themeTip = `Use {highlight}/themes{/highlight} or {highlight}Ctrl+X T{/highlight} to switch between ${themeCount} built-in themes` type TipPart = { text: string; highlight: boolean } +type TipShortcut = Accessor +type Shortcuts = { + agentCycle: TipShortcut + childFirst: TipShortcut + childNext: TipShortcut + childPrevious: TipShortcut + commandList: TipShortcut + editorOpen: TipShortcut + helpShow: TipShortcut + inputClear: TipShortcut + inputNewline: TipShortcut + inputPaste: TipShortcut + inputUndo: TipShortcut + leader: TipShortcut + messagesCopy: TipShortcut + messagesFirst: TipShortcut + messagesLast: TipShortcut + messagesPageDown: TipShortcut + messagesPageUp: TipShortcut + messagesToggleConceal: TipShortcut + modelCycleRecent: TipShortcut + modelList: TipShortcut + sessionCycleRecent: TipShortcut + sessionCycleRecentReverse: TipShortcut + sessionExport: TipShortcut + sessionInterrupt: TipShortcut + sessionList: TipShortcut + sessionNew: TipShortcut + sessionParent: TipShortcut + sessionPinToggle: TipShortcut + sessionQuickSwitch1: TipShortcut + sessionQuickSwitch9: TipShortcut + sessionSidebarToggle: TipShortcut + sessionTimeline: TipShortcut + sessionToggleRecent: TipShortcut + statusView: TipShortcut + terminalSuspend: TipShortcut + themeList: TipShortcut +} +type Tip = string | ((shortcuts: Shortcuts) => string | undefined) function parse(tip: string): TipPart[] { const parts: TipPart[] = [] @@ -33,17 +74,86 @@ function parse(tip: string): TipPart[] { const NO_MODELS_TIP = "Run {highlight}/connect{/highlight} to add an AI provider and start coding" -export function Tips(props: { connected?: boolean }) { +function shortcutText(value: string) { + return `{highlight}${value}{/highlight}` +} + +function commandText(command: string, shortcut: string) { + if (!shortcut) return shortcutText(command) + return `${shortcutText(command)} or ${shortcutText(shortcut)}` +} + +function press(shortcut: string, text: string) { + if (!shortcut) return undefined + return `Press ${shortcutText(shortcut)} ${text}` +} + +function configShortcut(api: TuiPluginApi, command: string): TipShortcut { + return () => + api.tuiConfig.keybinds + .get(command) + .map((binding) => api.keys.formatSequence(Array.from(api.keymap.parseKeySequence(binding.key)))) + .filter(Boolean) + .join(", ") +} + +export function Tips(props: { api: TuiPluginApi; connected?: boolean }) { const theme = useTheme().theme - const randomTip = TIPS[Math.floor(Math.random() * TIPS.length)] - const parts = createMemo(() => parse(props.connected === false ? NO_MODELS_TIP : randomTip)) + const tipOffset = Math.random() + const shortcuts: Shortcuts = { + agentCycle: useCommandShortcut("agent.cycle"), + childFirst: configShortcut(props.api, "session.child.first"), + childNext: configShortcut(props.api, "session.child.next"), + childPrevious: configShortcut(props.api, "session.child.previous"), + commandList: useCommandShortcut("command.palette.show"), + editorOpen: useCommandShortcut("prompt.editor"), + helpShow: useCommandShortcut("help.show"), + inputClear: useCommandShortcut("prompt.clear"), + inputNewline: useCommandShortcut("input.newline"), + inputPaste: useCommandShortcut("prompt.paste"), + inputUndo: useCommandShortcut("input.undo"), + leader: configShortcut(props.api, "leader"), + messagesCopy: configShortcut(props.api, "messages.copy"), + messagesFirst: configShortcut(props.api, "session.first"), + messagesLast: configShortcut(props.api, "session.last"), + messagesPageDown: configShortcut(props.api, "session.page.down"), + messagesPageUp: configShortcut(props.api, "session.page.up"), + messagesToggleConceal: configShortcut(props.api, "session.toggle.conceal"), + modelCycleRecent: useCommandShortcut("model.cycle_recent"), + modelList: useCommandShortcut("model.list"), + sessionCycleRecent: useCommandShortcut("session.cycle_recent"), + sessionCycleRecentReverse: useCommandShortcut("session.cycle_recent_reverse"), + sessionExport: configShortcut(props.api, "session.export"), + sessionInterrupt: configShortcut(props.api, "session.interrupt"), + sessionList: useCommandShortcut("session.list"), + sessionNew: useCommandShortcut("session.new"), + sessionParent: configShortcut(props.api, "session.parent"), + sessionPinToggle: configShortcut(props.api, "session.pin.toggle"), + sessionQuickSwitch1: useCommandShortcut("session.quick_switch.1"), + sessionQuickSwitch9: useCommandShortcut("session.quick_switch.9"), + sessionSidebarToggle: configShortcut(props.api, "session.sidebar.toggle"), + sessionTimeline: configShortcut(props.api, "session.timeline"), + sessionToggleRecent: configShortcut(props.api, "session.toggle.recent"), + statusView: useCommandShortcut("opencode.status"), + terminalSuspend: useCommandShortcut("terminal.suspend"), + themeList: useCommandShortcut("theme.switch"), + } + const tip = createMemo(() => { + if (props.connected === false) return NO_MODELS_TIP + const tips = TIPS.flatMap((item) => { + const value = typeof item === "string" ? item : item(shortcuts) + return value ? [value] : [] + }) + return tips[Math.floor(tipOffset * tips.length)] ?? NO_MODELS_TIP + }) + const parts = createMemo(() => parse(tip())) return ( ● Tip{" "} - + {(part) => {part.text}} @@ -52,46 +162,66 @@ export function Tips(props: { connected?: boolean }) { ) } -const TIPS = [ +const TIPS: Tip[] = [ "Type {highlight}@{/highlight} followed by a filename to fuzzy search and attach files", "Start a message with {highlight}!{/highlight} to run shell commands directly (e.g., {highlight}!ls -la{/highlight})", - "Press {highlight}Tab{/highlight} to cycle between Build and Plan agents", + (shortcuts) => press(shortcuts.agentCycle(), "to cycle between Build and Plan agents"), "Use {highlight}/undo{/highlight} to revert the last message and file changes", "Use {highlight}/redo{/highlight} to restore previously undone messages and file changes", "Run {highlight}/share{/highlight} to create a public link to your conversation at opencode.ai", "Drag and drop images or PDFs into the terminal to add them as context", - "Press {highlight}Ctrl+V{/highlight} to paste images from your clipboard into the prompt", - "Press {highlight}Ctrl+X E{/highlight} or {highlight}/editor{/highlight} to compose messages in your external editor", + (shortcuts) => press(shortcuts.inputPaste(), "to paste images from your clipboard into the prompt"), + (shortcuts) => `Use ${commandText("/editor", shortcuts.editorOpen())} to compose messages in your external editor`, "Run {highlight}/init{/highlight} to auto-generate project rules based on your codebase", - "Run {highlight}/models{/highlight} or {highlight}Ctrl+X M{/highlight} to see and switch between available AI models", - themeTip, - "Press {highlight}Ctrl+X N{/highlight} or {highlight}/new{/highlight} to start a fresh conversation session", - "Use {highlight}/sessions{/highlight} or {highlight}Ctrl+X L{/highlight} to list and continue previous conversations", + (shortcuts) => `Use ${commandText("/models", shortcuts.modelList())} to see and switch between available AI models`, + (shortcuts) => `Use ${commandText("/themes", shortcuts.themeList())} to switch between ${themeCount} built-in themes`, + (shortcuts) => `Use ${commandText("/new", shortcuts.sessionNew())} to start a fresh conversation session`, + (shortcuts) => `Use ${commandText("/sessions", shortcuts.sessionList())} to list and continue previous conversations`, ...(Flag.OPENCODE_EXPERIMENTAL_SESSION_SWITCHING - ? [ - "Press {highlight}Ctrl+F{/highlight} in the session list to pin a session so it stays at the top", - "Pinned and recent sessions are bound to {highlight}Ctrl+X 1{/highlight} through {highlight}Ctrl+X 9{/highlight} for one-press switching", - "Press {highlight}Ctrl+X ]{/highlight} / {highlight}Ctrl+X [{/highlight} to cycle through recently visited sessions", - "Press {highlight}Ctrl+H{/highlight} in the session list to show or hide a session in the Recent group", - ] + ? ([ + (shortcuts) => + press(shortcuts.sessionPinToggle(), "in the session list to pin a session so it stays at the top"), + (shortcuts) => + shortcuts.sessionQuickSwitch1() && shortcuts.sessionQuickSwitch9() + ? `Pinned and recent sessions are bound to ${shortcutText(shortcuts.sessionQuickSwitch1())} through ${shortcutText(shortcuts.sessionQuickSwitch9())} for one-press switching` + : undefined, + (shortcuts) => + shortcuts.sessionCycleRecent() && shortcuts.sessionCycleRecentReverse() + ? `Press ${shortcutText(shortcuts.sessionCycleRecent())} / ${shortcutText(shortcuts.sessionCycleRecentReverse())} to cycle through recently visited sessions` + : undefined, + (shortcuts) => + press(shortcuts.sessionToggleRecent(), "in the session list to show or hide a session in the Recent group"), + ] satisfies Tip[]) : []), "Run {highlight}/compact{/highlight} to summarize long sessions near context limits", - "Press {highlight}Ctrl+X X{/highlight} or {highlight}/export{/highlight} to save the conversation as Markdown", - "Press {highlight}Ctrl+X Y{/highlight} to copy the assistant's last message to clipboard", - "Press {highlight}Ctrl+P{/highlight} to see all available actions and commands", + (shortcuts) => `Use ${commandText("/export", shortcuts.sessionExport())} to save the conversation as Markdown`, + (shortcuts) => press(shortcuts.messagesCopy(), "to copy the assistant's last message to clipboard"), + (shortcuts) => press(shortcuts.commandList(), "to see all available actions and commands"), "Run {highlight}/connect{/highlight} to add API keys for 75+ supported LLM providers", - "The leader key is {highlight}Ctrl+X{/highlight}; combine with other keys for quick actions", - "Press {highlight}F2{/highlight} to quickly switch between recently used models", - "Press {highlight}Ctrl+X B{/highlight} to show/hide the sidebar panel", - "Use {highlight}PageUp{/highlight}/{highlight}PageDown{/highlight} to navigate through conversation history", - "Press {highlight}Ctrl+G{/highlight} or {highlight}Home{/highlight} to jump to the beginning of the conversation", - "Press {highlight}Ctrl+Alt+G{/highlight} or {highlight}End{/highlight} to jump to the most recent message", - "Press {highlight}Shift+Enter{/highlight} or {highlight}Ctrl+J{/highlight} to add newlines in your prompt", - "Press {highlight}Ctrl+C{/highlight} when typing to clear the input field", - "Press {highlight}Escape{/highlight} to stop the AI mid-response", + (shortcuts) => `The leader key is ${shortcutText(shortcuts.leader())}; combine with other keys for quick actions`, + (shortcuts) => press(shortcuts.modelCycleRecent(), "to quickly switch between recently used models"), + (shortcuts) => press(shortcuts.sessionSidebarToggle(), "in a session to show or hide the sidebar panel"), + (shortcuts) => + shortcuts.messagesPageUp() && shortcuts.messagesPageDown() + ? `Use ${shortcutText(shortcuts.messagesPageUp())}/${shortcutText(shortcuts.messagesPageDown())} to navigate through conversation history` + : undefined, + (shortcuts) => press(shortcuts.messagesFirst(), "to jump to the beginning of the conversation"), + (shortcuts) => press(shortcuts.messagesLast(), "to jump to the most recent message"), + (shortcuts) => press(shortcuts.inputNewline(), "to add newlines in your prompt"), + (shortcuts) => press(shortcuts.inputClear(), "when typing to clear the input field"), + (shortcuts) => press(shortcuts.sessionInterrupt(), "to stop the AI mid-response"), "Switch to {highlight}Plan{/highlight} agent to get suggestions without making actual changes", "Use {highlight}@agent-name{/highlight} in prompts to invoke specialized subagents", - "Press {highlight}Ctrl+X Right/Left{/highlight} to cycle through parent and child sessions", + (shortcuts) => { + const items = [ + shortcuts.sessionParent(), + shortcuts.childFirst(), + shortcuts.childPrevious(), + shortcuts.childNext(), + ].filter(Boolean) + if (!items.length) return undefined + return `Use ${items.map(shortcutText).join(" / ")} to move between parent and child sessions` + }, "Create {highlight}opencode.json{/highlight} for server settings and {highlight}tui.json{/highlight} for TUI settings", "Place TUI settings in {highlight}~/.config/opencode/tui.json{/highlight} for global config", "Add {highlight}$schema{/highlight} to your config for autocomplete in your editor", @@ -99,22 +229,21 @@ const TIPS = [ "Override any keybind in {highlight}tui.json{/highlight} via the {highlight}keybinds{/highlight} section", "Set any keybind to {highlight}none{/highlight} to disable it completely", "Configure local or remote MCP servers in the {highlight}mcp{/highlight} config section", - "OpenCode auto-handles OAuth for remote MCP servers requiring auth", - "Add {highlight}.md{/highlight} files to {highlight}.opencode/command/{/highlight} to define reusable custom prompts", + "Add {highlight}.md{/highlight} files to {highlight}.opencode/commands/{/highlight} to define reusable custom prompts", "Use {highlight}$ARGUMENTS{/highlight}, {highlight}$1{/highlight}, {highlight}$2{/highlight} in custom commands for dynamic input", "Use backticks in commands to inject shell output (e.g., {highlight}`git status`{/highlight})", - "Add {highlight}.md{/highlight} files to {highlight}.opencode/agent/{/highlight} for specialized AI personas", + "Add {highlight}.md{/highlight} files to {highlight}.opencode/agents/{/highlight} for specialized AI personas", "Configure per-agent permissions for {highlight}edit{/highlight}, {highlight}bash{/highlight}, and {highlight}webfetch{/highlight} tools", 'Use patterns like {highlight}"git *": "allow"{/highlight} for granular bash permissions', 'Set {highlight}"rm -rf *": "deny"{/highlight} to block destructive commands', 'Configure {highlight}"git push": "ask"{/highlight} to require approval before pushing', - "OpenCode auto-formats files using prettier, gofmt, ruff, and more", - 'Set {highlight}"formatter": false{/highlight} in config to disable all auto-formatting', + 'Set {highlight}"formatter": true{/highlight} in config to enable built-in formatters like prettier, gofmt, and ruff', + 'Set {highlight}"formatter": false{/highlight} in config to disable formatters enabled by another config layer', "Define custom formatter commands with file extensions in config", - "OpenCode uses LSP servers for intelligent code analysis", + 'Set {highlight}"lsp": true{/highlight} in config to enable built-in LSP servers for code analysis', "Create {highlight}.ts{/highlight} files in {highlight}.opencode/tools/{/highlight} to define new LLM tools", "Tool definitions can invoke scripts written in Python, Go, etc", - "Add {highlight}.ts{/highlight} files to {highlight}.opencode/plugin/{/highlight} for event hooks", + "Add {highlight}.ts{/highlight} files to {highlight}.opencode/plugins/{/highlight} for event hooks", "Use plugins to send OS notifications when sessions complete", "Create a plugin to prevent OpenCode from reading sensitive files", "Use {highlight}opencode run{/highlight} for non-interactive scripting", @@ -133,7 +262,7 @@ const TIPS = [ 'Use {highlight}"theme": "system"{/highlight} to match your terminal\'s colors', "Create JSON theme files in {highlight}.opencode/themes/{/highlight} directory", "Themes support dark/light variants for both modes", - "Reference ANSI colors 0-255 in custom themes", + "Use numeric xterm color codes 0-255 in custom theme JSON", "Use {highlight}{env:VAR_NAME}{/highlight} syntax to reference environment variables in config", "Use {highlight}{file:path}{/highlight} to include file contents in config values", "Use {highlight}instructions{/highlight} in config to load additional rules files", @@ -149,18 +278,23 @@ const TIPS = [ "Permission {highlight}external_directory{/highlight} protects files outside project", "Run {highlight}opencode debug config{/highlight} to troubleshoot configuration", "Use {highlight}--print-logs{/highlight} flag to see detailed logs in stderr", - "Press {highlight}Ctrl+X G{/highlight} or {highlight}/timeline{/highlight} to jump to specific messages", - "Press {highlight}Ctrl+X H{/highlight} to toggle code block visibility in messages", - "Press {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight} to see system status info", + (shortcuts) => `Use ${commandText("/timeline", shortcuts.sessionTimeline())} to jump to specific messages`, + (shortcuts) => press(shortcuts.messagesToggleConceal(), "to toggle code block visibility in messages"), + (shortcuts) => `Use ${commandText("/status", shortcuts.statusView())} to see system status info`, "Enable {highlight}scroll_acceleration{/highlight} in {highlight}tui.json{/highlight} for smooth macOS-style scrolling", - "Toggle username display in chat via command palette ({highlight}Ctrl+P{/highlight})", + (shortcuts) => + shortcuts.commandList() + ? `Toggle username display in chat via the command palette (${shortcutText(shortcuts.commandList())})` + : "Toggle username display in chat via the command palette", "Run {highlight}docker run -it --rm ghcr.io/anomalyco/opencode{/highlight} for containerized use", "Use {highlight}/connect{/highlight} with OpenCode Zen for curated, tested models", "Commit your project's {highlight}AGENTS.md{/highlight} file to Git for team sharing", "Use {highlight}/review{/highlight} to review uncommitted changes, branches, or PRs", - "Run {highlight}/help{/highlight} or {highlight}Ctrl+X H{/highlight} to show the help dialog", + (shortcuts) => `Use ${commandText("/help", shortcuts.helpShow())} to show the help dialog`, "Use {highlight}/rename{/highlight} to rename the current session", ...(process.platform === "win32" - ? ["Press {highlight}Ctrl+Z{/highlight} to undo changes in your prompt"] - : ["Press {highlight}Ctrl+Z{/highlight} to suspend the terminal and return to your shell"]), + ? ([(shortcuts) => press(shortcuts.inputUndo(), "to undo changes in your prompt")] satisfies Tip[]) + : ([ + (shortcuts) => press(shortcuts.terminalSuspend(), "to suspend the terminal and return to your shell"), + ] satisfies Tip[])), ] diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips.tsx index 69071b1f7c50..598366c08cd4 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips.tsx @@ -24,9 +24,9 @@ function View(props: { api: TuiPluginApi; hidden: boolean; show: boolean; connec })) return ( - + - + ) diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/sidebar/context.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/sidebar/context.tsx index b3cf2beb4420..405e8c1458a5 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/sidebar/context.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/sidebar/context.tsx @@ -13,7 +13,8 @@ const money = new Intl.NumberFormat("en-US", { function View(props: { api: TuiPluginApi; session_id: string }) { const theme = () => props.api.theme.current const msg = createMemo(() => props.api.state.session.messages(props.session_id)) - const cost = createMemo(() => msg().reduce((sum, item) => sum + (item.role === "assistant" ? item.cost : 0), 0)) + const session = createMemo(() => props.api.state.session.get(props.session_id)) + const cost = createMemo(() => session()?.cost ?? 0) const state = createMemo(() => { const last = msg().findLast((item): item is AssistantMessage => item.role === "assistant" && item.tokens.output > 0) diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/notifications.ts b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/notifications.ts new file mode 100644 index 000000000000..cda815f5fc14 --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/notifications.ts @@ -0,0 +1,94 @@ +import type { Event } from "@opencode-ai/sdk/v2" +import type { TuiAttentionSoundName, TuiPlugin, TuiPluginApi } from "@opencode-ai/plugin/tui" +import type { InternalTuiPlugin } from "../../plugin/internal" + +const id = "internal:notifications" + +type SessionError = Extract["properties"]["error"] + +function notify(api: TuiPluginApi, sessionID: string | undefined, message: string, sound: TuiAttentionSoundName) { + const session = sessionID ? api.state.session.get(sessionID) : undefined + const isSubagent = session?.parentID !== undefined + void api.attention.notify({ + title: session?.title, + message, + notification: isSubagent ? false : { when: "blurred" }, + sound: { name: sound, when: "always" }, + }) +} + +function sessionErrorMessage(error: SessionError) { + if (error?.name === "MessageAbortedError") return "Session aborted" + const data = error?.data + if (data && typeof data === "object" && "message" in data && data.message === "SSE read timed out") { + return "Model stopped responding" + } + return "Session error" +} + +const tui: TuiPlugin = async (api) => { + const active = new Set() + const errored = new Set() + const questions = new Set() + const permissions = new Set() + + api.event.on("question.asked", (event) => { + if (questions.has(event.properties.id)) return + questions.add(event.properties.id) + notify(api, event.properties.sessionID, "Question needs input", "question") + }) + + api.event.on("question.replied", (event) => { + questions.delete(event.properties.requestID) + }) + + api.event.on("question.rejected", (event) => { + questions.delete(event.properties.requestID) + }) + + api.event.on("permission.asked", (event) => { + if (permissions.has(event.properties.id)) return + permissions.add(event.properties.id) + notify(api, event.properties.sessionID, "Permission needs input", "permission") + }) + + api.event.on("permission.replied", (event) => { + permissions.delete(event.properties.requestID) + }) + + api.event.on("session.status", (event) => { + const sessionID = event.properties.sessionID + if (event.properties.status.type === "busy" || event.properties.status.type === "retry") { + active.add(sessionID) + errored.delete(sessionID) + return + } + + if (event.properties.status.type !== "idle") return + if (!active.has(sessionID)) return + active.delete(sessionID) + + if (errored.has(sessionID)) { + errored.delete(sessionID) + return + } + + const session = api.state.session.get(sessionID) + notify(api, sessionID, "Session done", session?.parentID ? "subagent_done" : "done") + }) + + api.event.on("session.error", (event) => { + const sessionID = event.properties.sessionID + if (!sessionID) return + if (!active.has(sessionID)) return + errored.add(sessionID) + notify(api, sessionID, sessionErrorMessage(event.properties.error), "error") + }) +} + +const plugin: InternalTuiPlugin = { + id, + tui, +} + +export default plugin diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx index 8b741ccb4993..bcf3032ea359 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx @@ -438,9 +438,6 @@ function AssistantTool(props: { part: SessionMessageAssistantTool; sessionID: st - - - @@ -773,15 +770,6 @@ function WebFetch(props: ToolProps) { ) } -function CodeSearch(props: ToolProps) { - return ( - - Exa Code Search "{stringValue(props.input.query) ?? pendingInput(props.part)}"{" "} - {(results) => <>({results()} results)} - - ) -} - function WebSearch(props: ToolProps) { const label = createMemo(() => webSearchProviderLabel(props.metadata.provider)) return ( diff --git a/packages/opencode/src/cli/cmd/tui/plugin/api.tsx b/packages/opencode/src/cli/cmd/tui/plugin/api.tsx index 54059f4a2da2..05bfa31d1415 100644 --- a/packages/opencode/src/cli/cmd/tui/plugin/api.tsx +++ b/packages/opencode/src/cli/cmd/tui/plugin/api.tsx @@ -40,6 +40,7 @@ type Input = { theme: ReturnType toast: ReturnType renderer: TuiPluginApi["renderer"] + attention: TuiPluginApi["attention"] } function routeRegister(routes: RouteMap, list: TuiRouteDefinition[], bump: () => void) { @@ -147,6 +148,9 @@ function stateApi(sync: ReturnType): TuiPluginApi["state"] { count() { return sync.data.session.length }, + get(sessionID) { + return sync.session.get(sessionID) + }, diff(sessionID) { return (sync.data.session_diff[sessionID] ?? []).flatMap((item) => item.file === undefined ? [] : [{ ...item, file: item.file }], @@ -203,6 +207,7 @@ export function createTuiApi(input: Input): TuiPluginApi { } return { app: appApi(), + attention: input.attention, // Keep deprecated `api.command` working for v1 plugins; remove in v2. command: createCommandShim(input.keymap, input.dialog, input.tuiConfig.keybinds), keys: { diff --git a/packages/opencode/src/cli/cmd/tui/plugin/internal.ts b/packages/opencode/src/cli/cmd/tui/plugin/internal.ts index 664b5c1ac1b3..5e0aec3ba137 100644 --- a/packages/opencode/src/cli/cmd/tui/plugin/internal.ts +++ b/packages/opencode/src/cli/cmd/tui/plugin/internal.ts @@ -7,10 +7,11 @@ import SidebarTodo from "../feature-plugins/sidebar/todo" import SidebarFiles from "../feature-plugins/sidebar/files" import SidebarFooter from "../feature-plugins/sidebar/footer" import PluginManager from "../feature-plugins/system/plugins" +import Notifications from "../feature-plugins/system/notifications" import SessionV2Debug from "../feature-plugins/system/session-v2" import WhichKey from "../feature-plugins/system/which-key" import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui" -import { Flag } from "@opencode-ai/core/flag/flag" +import type { RuntimeFlags } from "@/effect/runtime-flags" export type InternalTuiPlugin = Omit & { id: string @@ -18,16 +19,19 @@ export type InternalTuiPlugin = Omit & { enabled?: boolean } -export const INTERNAL_TUI_PLUGINS: InternalTuiPlugin[] = [ - HomeFooter, - HomeTips, - SidebarContext, - SidebarMcp, - SidebarLsp, - SidebarTodo, - SidebarFiles, - SidebarFooter, - PluginManager, - WhichKey, - ...(Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM ? [SessionV2Debug] : []), -] +export function internalTuiPlugins(flags: Pick): InternalTuiPlugin[] { + return [ + HomeFooter, + HomeTips, + SidebarContext, + SidebarMcp, + SidebarLsp, + SidebarTodo, + SidebarFiles, + SidebarFooter, + Notifications, + PluginManager, + WhichKey, + ...(flags.experimentalEventSystem ? [SessionV2Debug] : []), + ] +} diff --git a/packages/opencode/src/cli/cmd/tui/plugin/runtime.ts b/packages/opencode/src/cli/cmd/tui/plugin/runtime.ts index dad4595e7f06..2a9ebc4ed2bc 100644 --- a/packages/opencode/src/cli/cmd/tui/plugin/runtime.ts +++ b/packages/opencode/src/cli/cmd/tui/plugin/runtime.ts @@ -17,6 +17,7 @@ import { TuiConfig } from "@/cli/cmd/tui/config/tui" import * as Log from "@opencode-ai/core/util/log" import { errorData, errorMessage } from "@/util/error" import { isRecord } from "@/util/record" +import { resolveAttentionSoundPaths } from "../config/tui-schema" import { readPackageThemes, readPluginId, @@ -34,11 +35,13 @@ import { Filesystem } from "@/util/filesystem" import { Process } from "@/util/process" import { Flock } from "@opencode-ai/core/util/flock" import { Flag } from "@opencode-ai/core/flag/flag" -import { INTERNAL_TUI_PLUGINS, type InternalTuiPlugin } from "./internal" +import { internalTuiPlugins, type InternalTuiPlugin } from "./internal" import { setupSlots, Slot as View } from "./slots" import type { HostPluginApi, HostSlots } from "./slots" import { ConfigPlugin } from "@/config/plugin" import { createCommandShim } from "./command-shim" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { Effect } from "effect" ensureRuntimePluginSupport({ additional: keymapRuntimeModules }) @@ -51,7 +54,7 @@ type PluginLoad = { id: string module: TuiPluginModule origin: ConfigPlugin.Origin - theme_root: string + plugin_root: string theme_files: string[] } @@ -106,6 +109,7 @@ const ScopedKeymapMethods = new Set([ type RuntimeState = { directory: string api: Api + dispose?: () => void slots: HostSlots plugins: PluginEntry[] plugins_by_id: Map @@ -156,6 +160,37 @@ function createScopedKeymap(keymap: TuiPluginApi["keymap"], scope: PluginScope): }) } +function createScopedAttention( + attention: TuiPluginApi["attention"], + scope: PluginScope, + root: string, +): TuiPluginApi["attention"] { + return { + notify(input) { + return attention.notify(input) + }, + soundboard: { + registerPack(pack) { + return scope.track( + attention.soundboard.registerPack({ + ...pack, + sounds: resolveAttentionSoundPaths(root, pack.sounds, { trim: true }), + }), + ) + }, + activate(id, options) { + return attention.soundboard.activate(id, options) + }, + current() { + return attention.soundboard.current() + }, + list() { + return attention.soundboard.list() + }, + }, + } +} + type CleanupResult = { type: "ok" } | { type: "error"; error: unknown } | { type: "timeout" } function runCleanup(fn: () => unknown, ms: number): Promise { @@ -204,8 +239,7 @@ function createThemeInstaller( plugin: PluginEntry, ): TuiTheme["install"] { return async (file) => { - const raw = file.startsWith("file://") ? fileURLToPath(file) : file - const src = path.isAbsolute(raw) ? raw : path.resolve(root, raw) + const src = Filesystem.resolveFilePath(root, file) const name = path.basename(src, path.extname(src)) const source_dir = path.dirname(meta.source) const local_dir = @@ -330,7 +364,7 @@ function loadInternalPlugin(item: InternalTuiPlugin): PluginLoad { scope: "global", source: target, }, - theme_root: process.cwd(), + plugin_root: process.cwd(), theme_files: [], } } @@ -352,7 +386,7 @@ async function readThemeFiles(spec: string, pkg?: PluginPackage) { async function syncPluginThemes(plugin: PluginEntry) { if (!plugin.load.theme_files.length) return if (plugin.meta.state === "same") return - const install = createThemeInstaller(plugin.load.origin, plugin.load.theme_root, plugin.load.spec, plugin) + const install = createThemeInstaller(plugin.load.origin, plugin.load.plugin_root, plugin.load.spec, plugin) for (const file of plugin.load.theme_files) { await install(file).catch((error) => { warn("failed to sync tui plugin oc-themes", { path: plugin.load.spec, id: plugin.id, theme: file, error }) @@ -552,7 +586,7 @@ function pluginApi(runtime: RuntimeState, plugin: PluginEntry, scope: PluginScop } const theme: TuiPluginApi["theme"] = Object.assign(Object.create(api.theme), { - install: createThemeInstaller(load.origin, load.theme_root, load.spec, plugin), + install: createThemeInstaller(load.origin, load.plugin_root, load.spec, plugin), }) const event: TuiPluginApi["event"] = { @@ -576,6 +610,7 @@ function pluginApi(runtime: RuntimeState, plugin: PluginEntry, scope: PluginScop return { app: api.app, + attention: createScopedAttention(api.attention, scope, load.plugin_root), // Keep deprecated `api.command` working for v1 plugins; remove in v2. command: createCommandShim(keymap, api.ui.dialog, api.tuiConfig.keybinds), keys: api.keys, @@ -682,7 +717,7 @@ async function resolveExternalPlugins(list: ConfigPlugin.Origin[], wait: () => P id, module: mod, origin, - theme_root: loaded.pkg?.dir ?? resolveRoot(loaded.target), + plugin_root: loaded.pkg?.dir ?? resolveRoot(loaded.target), theme_files, } }, @@ -709,7 +744,7 @@ async function resolveExternalPlugins(list: ConfigPlugin.Origin[], wait: () => P id, module: EMPTY_TUI, origin, - theme_root: loaded.pkg?.dir ?? resolveRoot(loaded.target), + plugin_root: loaded.pkg?.dir ?? resolveRoot(loaded.target), theme_files, } }, @@ -967,7 +1002,7 @@ let loaded: Promise | undefined let runtime: RuntimeState | undefined export const Slot = View -export async function init(input: { api: HostPluginApi; config: TuiConfig.Resolved }) { +export async function init(input: { api: HostPluginApi; config: TuiConfig.Resolved; dispose?: () => void }) { const cwd = process.cwd() if (loaded) { if (dir !== cwd) { @@ -1014,15 +1049,17 @@ export async function dispose() { for (const plugin of queue) { await deactivatePluginEntry(state, plugin, false) } + state.dispose?.() } -async function load(input: { api: Api; config: TuiConfig.Resolved }) { +async function load(input: { api: Api; config: TuiConfig.Resolved; dispose?: () => void }) { const { api, config } = input const cwd = process.cwd() const slots = setupSlots(api) const next: RuntimeState = { directory: cwd, api, + dispose: input.dispose, slots, plugins: [], plugins_by_id: new Map(), @@ -1030,12 +1067,17 @@ async function load(input: { api: Api; config: TuiConfig.Resolved }) { } runtime = next try { + const flags = await Effect.runPromise( + Effect.gen(function* () { + return yield* RuntimeFlags.Service + }).pipe(Effect.provide(RuntimeFlags.defaultLayer)), + ) const records = Flag.OPENCODE_PURE ? [] : (config.plugin_origins ?? []) if (Flag.OPENCODE_PURE && config.plugin_origins?.length) { log.info("skipping external tui plugins in pure mode", { count: config.plugin_origins.length }) } - for (const item of INTERNAL_TUI_PLUGINS) { + for (const item of internalTuiPlugins(flags)) { log.info("loading internal tui plugin", { id: item.id }) const entry = loadInternalPlugin(item) const meta = createMeta(entry.source, entry.spec, entry.target, undefined, entry.id) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx index c3a96254e98b..d04957e428a1 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx @@ -17,6 +17,10 @@ export function Footer() { if (route.data.type !== "session") return [] return sync.data.permission[route.data.sessionID] ?? [] }) + const goal = createMemo(() => { + if (route.data.type !== "session") return + return sync.data.session_goal[route.data.sessionID] + }) const directory = useDirectory() const connected = useConnected() @@ -66,6 +70,13 @@ export function Footer() { {permissions().length > 1 ? "s" : ""} + + {(item) => ( + + goal {item().status} + + )} + 0 ? theme.success : theme.textMuted }}>• {lsp().length} LSP diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index b2ee3af622bc..4978fe80acfe 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -10,6 +10,7 @@ import { onMount, Show, Switch, + untrack, useContext, } from "solid-js" import { Dynamic } from "solid-js/web" @@ -63,7 +64,6 @@ import { DialogForkFromTimeline } from "./dialog-fork-from-timeline" import { DialogSessionRename } from "../../component/dialog-session-rename" import { Sidebar } from "./sidebar" import { SubagentFooter } from "./subagent-footer.tsx" -import { Flag } from "@opencode-ai/core/flag/flag" import { LANGUAGE_EXTENSIONS } from "@/lsp/language" import parsers from "../../../../../../parsers-config.ts" import * as Clipboard from "../../util/clipboard" @@ -242,7 +242,7 @@ export function Session() { createEffect(() => { const sessionID = route.sessionID void (async () => { - const previousWorkspace = project.workspace.current() + const previousWorkspace = untrack(() => project.workspace.current()) const result = await sdk.client.session.get({ sessionID }, { throwOnError: true }) if (!result.data) { toast.show({ @@ -441,6 +441,25 @@ export function Session() { } const sessionCommandList = createMemo(() => [ + { + title: "Goal", + value: "session.goal", + suggested: route.type === "session", + category: "Session", + slash: { + name: "goal", + }, + run: async () => { + const goal = sync.data.session_goal[route.sessionID] + toast.show({ + message: goal + ? `Goal ${goal.status}: ${goal.objective} | tokens ${goal.tokens.used}${goal.tokens.budget === undefined ? "" : `/${goal.tokens.budget}`} | ${goal.time.used}s | /goal edit, pause, resume, clear` + : "No goal set. Use /goal .", + variant: "success", + }) + dialog.clear() + }, + }, { title: session()?.share?.url ? "Copy share link" : "Share session", value: "session.share", @@ -1528,29 +1547,15 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess return ( - - - - - - - - + ) @@ -1984,11 +1989,11 @@ function WebFetch(props: ToolProps) { } function WebSearch(props: ToolProps) { - const metadata = props.metadata as { numResults?: number; provider?: unknown } + const metadata = () => props.metadata as { numResults?: number; provider?: unknown } return ( - {webSearchProviderLabel(metadata.provider)} "{props.input.query}"{" "} - ({metadata.numResults} results) + {webSearchProviderLabel(metadata().provider)} "{props.input.query}"{" "} + ({metadata().numResults} results) ) } @@ -2027,7 +2032,9 @@ function Task(props: ToolProps) { const content = createMemo(() => { if (!props.input.description) return "" - let content = [`${Locale.titlecase(props.input.subagent_type ?? "General")} Task — ${props.input.description}`] + const description = + props.metadata.background === true ? `${props.input.description} (background)` : props.input.description + let content = [`${Locale.titlecase(props.input.subagent_type ?? "General")} Task — ${description}`] if (isRunning() && tools().length > 0) { // content[0] += ` · ${tools().length} toolcalls` @@ -2039,7 +2046,11 @@ function Task(props: ToolProps) { } if (props.part.state.status === "completed") { - content.push(`└ ${tools().length} toolcalls · ${Locale.duration(duration())}`) + content.push( + props.metadata.background === true + ? `└ ${tools().length} toolcalls` + : `└ ${tools().length} toolcalls · ${Locale.duration(duration())}`, + ) } return content.join("\n") diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx index e690f6f327de..46fc220bdc63 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx @@ -1,5 +1,6 @@ import { createStore } from "solid-js/store" import { createMemo, createSignal, For, Show } from "solid-js" +import { useRenderer } from "@opentui/solid" import type { TextareaRenderable } from "@opentui/core" import { selectedForeground, tint, useTheme } from "../../context/theme" import type { QuestionAnswer, QuestionRequest } from "@opencode-ai/sdk/v2" @@ -12,6 +13,7 @@ import { useBindings } from "../../keymap" export function QuestionPrompt(props: { request: QuestionRequest }) { const sdk = useSDK() const { theme } = useTheme() + const renderer = useRenderer() const tuiConfig = useTuiConfig() const questions = createMemo(() => props.request.questions) @@ -302,7 +304,10 @@ export function QuestionPrompt(props: { request: QuestionRequest }) { } onMouseOver={() => setTabHover(index())} onMouseOut={() => setTabHover(null)} - onMouseUp={() => selectTab(index())} + onMouseUp={() => { + if (renderer.getSelection()?.getSelectedText()) return + selectTab(index()) + }} > setTabHover("confirm")} onMouseOut={() => setTabHover(null)} - onMouseUp={() => selectTab(questions().length)} + onMouseUp={() => { + if (renderer.getSelection()?.getSelectedText()) return + selectTab(questions().length) + }} > Confirm @@ -351,7 +359,10 @@ export function QuestionPrompt(props: { request: QuestionRequest }) { moveTo(i())} onMouseDown={() => moveTo(i())} - onMouseUp={() => selectOption()} + onMouseUp={() => { + if (renderer.getSelection()?.getSelectedText()) return + selectOption() + }} > @@ -380,7 +391,10 @@ export function QuestionPrompt(props: { request: QuestionRequest }) { moveTo(options().length)} onMouseDown={() => moveTo(options().length)} - onMouseUp={() => selectOption()} + onMouseUp={() => { + if (renderer.getSelection()?.getSelectedText()) return + selectOption() + }} > diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/subagent-footer.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/subagent-footer.tsx index 2a6813ffbedd..f4a458b63dfe 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/subagent-footer.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/subagent-footer.tsx @@ -42,7 +42,7 @@ export function SubagentFooter() { const model = sync.data.provider.find((item) => item.id === last.providerID)?.models[last.modelID] const pct = model?.limit.context ? `${Math.round((tokens / model.limit.context) * 100)}%` : undefined - const cost = msg.reduce((sum, item) => sum + (item.role === "assistant" ? item.cost : 0), 0) + const cost = session()?.cost ?? 0 const money = new Intl.NumberFormat("en-US", { style: "currency", diff --git a/packages/opencode/src/cli/cmd/tui/util/audio.ts b/packages/opencode/src/cli/cmd/tui/util/audio.ts new file mode 100644 index 000000000000..7d7c3d5a4227 --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/util/audio.ts @@ -0,0 +1,58 @@ +import { Audio, type AudioErrorContext, type AudioPlayOptions, type AudioSound, type AudioVoice } from "@opentui/core" +import * as Log from "@opencode-ai/core/util/log" + +const log = Log.create({ service: "tui.audio" }) + +let audio: Audio | null | undefined +const sounds = new Map>() + +function getAudio() { + if (audio !== undefined) return audio + try { + const next = Audio.create({ autoStart: false }) + next.on("error", (error: Error, context: AudioErrorContext) => { + log.debug("tui audio error", { error, context }) + }) + audio = next + return next + } catch (error) { + log.debug("failed to create tui audio", { error }) + audio = null + return null + } +} + +export function loadSoundFile(file: string) { + const current = getAudio() + if (!current) return Promise.resolve(null) + const cached = sounds.get(file) + if (cached) return cached + const task = Bun.file(file) + .bytes() + .then((bytes) => current.loadSound(bytes)) + .catch((error) => { + log.debug("failed to load tui sound", { file, error }) + return null + }) + sounds.set(file, task) + return task +} + +export function play(sound: AudioSound, options?: AudioPlayOptions) { + const current = getAudio() + if (!current) return null + if (!current.isStarted() && !current.start()) return null + return current.play(sound, options) +} + +export function stopVoice(voice: AudioVoice) { + return audio?.stopVoice(voice) ?? false +} + +export function dispose() { + audio?.dispose() + audio = undefined + sounds.clear() +} + +export * as TuiAudio from "./audio" diff --git a/packages/opencode/src/cli/cmd/tui/util/clipboard.ts b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts index 3a9996902ddf..be3cec14c6a2 100644 --- a/packages/opencode/src/cli/cmd/tui/util/clipboard.ts +++ b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts @@ -3,9 +3,21 @@ import { lazy } from "../../../../util/lazy.js" import { tmpdir } from "os" import path from "path" import fs from "fs/promises" +import { Effect } from "effect" +import { ChildProcess } from "effect/unstable/process" +import { AppProcess } from "@opencode-ai/core/process" import * as Filesystem from "../../../../util/filesystem" import * as Process from "../../../../util/process" +const writeWithStdin = (cmd: string[], text: string): Promise => + Effect.runPromise( + AppProcess.Service.use((svc) => svc.run(ChildProcess.make(cmd[0]!, cmd.slice(1)), { stdin: text })).pipe( + Effect.provide(AppProcess.defaultLayer), + Effect.catch(() => Effect.void), + Effect.asVoid, + ), + ).catch(() => undefined) + // Lazy load which and clipboardy to avoid expensive execa/which/isexe chain at startup const getWhich = lazy(async () => { const { which } = await import("../../../../util/which") @@ -125,49 +137,23 @@ const getCopyMethod = lazy(async () => { if (os === "linux") { if (process.env["WAYLAND_DISPLAY"] && which("wl-copy")) { console.log("clipboard: using wl-copy") - return async (text: string) => { - const proc = Process.spawn(["wl-copy"], { stdin: "pipe", stdout: "ignore", stderr: "ignore" }) - if (!proc.stdin) return - proc.stdin.write(text) - proc.stdin.end() - await proc.exited.catch(() => {}) - } + return (text: string) => writeWithStdin(["wl-copy"], text) } if (which("xclip")) { console.log("clipboard: using xclip") - return async (text: string) => { - const proc = Process.spawn(["xclip", "-selection", "clipboard"], { - stdin: "pipe", - stdout: "ignore", - stderr: "ignore", - }) - if (!proc.stdin) return - proc.stdin.write(text) - proc.stdin.end() - await proc.exited.catch(() => {}) - } + return (text: string) => writeWithStdin(["xclip", "-selection", "clipboard"], text) } if (which("xsel")) { console.log("clipboard: using xsel") - return async (text: string) => { - const proc = Process.spawn(["xsel", "--clipboard", "--input"], { - stdin: "pipe", - stdout: "ignore", - stderr: "ignore", - }) - if (!proc.stdin) return - proc.stdin.write(text) - proc.stdin.end() - await proc.exited.catch(() => {}) - } + return (text: string) => writeWithStdin(["xsel", "--clipboard", "--input"], text) } } if (os === "win32") { console.log("clipboard: using powershell") - return async (text: string) => { + return (text: string) => // Pipe via stdin to avoid PowerShell string interpolation ($env:FOO, $(), etc.) - const proc = Process.spawn( + writeWithStdin( [ "powershell.exe", "-NonInteractive", @@ -175,18 +161,8 @@ const getCopyMethod = lazy(async () => { "-Command", "[Console]::InputEncoding = [System.Text.Encoding]::UTF8; Set-Clipboard -Value ([Console]::In.ReadToEnd())", ], - { - stdin: "pipe", - stdout: "ignore", - stderr: "ignore", - }, + text, ) - - if (!proc.stdin) return - proc.stdin.write(text) - proc.stdin.end() - await proc.exited.catch(() => {}) - } } console.log("clipboard: no native support") diff --git a/packages/opencode/src/cli/cmd/tui/util/sound.ts b/packages/opencode/src/cli/cmd/tui/util/sound.ts deleted file mode 100644 index df8b4dc2d6e9..000000000000 --- a/packages/opencode/src/cli/cmd/tui/util/sound.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { Player } from "cli-sound" -import { mkdirSync } from "node:fs" -import { tmpdir } from "node:os" -import { basename, join } from "node:path" -import { Process } from "@/util/process" -import { which } from "@/util/which" -import pulseA from "../asset/pulse-a.wav" with { type: "file" } -import pulseB from "../asset/pulse-b.wav" with { type: "file" } -import pulseC from "../asset/pulse-c.wav" with { type: "file" } -import charge from "../asset/charge.wav" with { type: "file" } - -const FILE = [pulseA, pulseB, pulseC] - -const HUM = charge -const DIR = join(tmpdir(), "opencode-sfx") - -const LIST = [ - "ffplay", - "mpv", - "mpg123", - "mpg321", - "mplayer", - "afplay", - "play", - "omxplayer", - "aplay", - "cmdmp3", - "cvlc", - "powershell.exe", -] as const - -type Kind = (typeof LIST)[number] - -function args(kind: Kind, file: string, volume: number) { - if (kind === "ffplay") return [kind, "-autoexit", "-nodisp", "-af", `volume=${volume}`, file] - if (kind === "mpv") - return [kind, "--no-video", "--audio-display=no", "--volume", String(Math.round(volume * 100)), file] - if (kind === "mpg123" || kind === "mpg321") return [kind, "-g", String(Math.round(volume * 100)), file] - if (kind === "mplayer") return [kind, "-vo", "null", "-volume", String(Math.round(volume * 100)), file] - if (kind === "afplay" || kind === "omxplayer" || kind === "aplay" || kind === "cmdmp3") return [kind, file] - if (kind === "play") return [kind, "-v", String(volume), file] - if (kind === "cvlc") return [kind, `--gain=${volume}`, "--play-and-exit", file] - return [kind, "-c", `(New-Object Media.SoundPlayer '${file.replace(/'/g, "''")}').PlaySync()`] -} - -let item: Player | null | undefined -let kind: Kind | null | undefined -let proc: Process.Child | undefined -let tail: ReturnType | undefined -let cache: Promise<{ hum: string; pulse: string[] }> | undefined -let seq = 0 -let shot = 0 - -function load() { - if (item !== undefined) return item - try { - item = new Player({ volume: 0.35 }) - } catch { - item = null - } - return item -} - -async function file(path: string) { - mkdirSync(DIR, { recursive: true }) - const next = join(DIR, basename(path)) - const out = Bun.file(next) - if (await out.exists()) return next - await Bun.write(out, Bun.file(path)) - return next -} - -function asset() { - cache ??= Promise.all([file(HUM), Promise.all(FILE.map(file))]).then(([hum, pulse]) => ({ hum, pulse })) - return cache -} - -function pick() { - if (kind !== undefined) return kind - kind = LIST.find((item) => which(item)) ?? null - return kind -} - -function run(file: string, volume: number) { - const kind = pick() - if (!kind) return - return Process.spawn(args(kind, file, volume), { - stdin: "ignore", - stdout: "ignore", - stderr: "ignore", - }) -} - -function clear() { - if (!tail) return - clearTimeout(tail) - tail = undefined -} - -function play(file: string, volume: number) { - const item = load() - if (!item) return run(file, volume)?.exited - return item.play(file, { volume }).catch(() => run(file, volume)?.exited) -} - -export function start() { - stop() - const id = ++seq - void asset().then(({ hum }) => { - if (id !== seq) return - const next = run(hum, 0.24) - if (!next) return - proc = next - void next.exited.then( - () => { - if (id !== seq) return - if (proc === next) proc = undefined - }, - () => { - if (id !== seq) return - if (proc === next) proc = undefined - }, - ) - }) -} - -export function stop(delay = 0) { - seq++ - clear() - if (!proc) return - const next = proc - if (delay <= 0) { - proc = undefined - void Process.stop(next).catch(() => undefined) - return - } - tail = setTimeout(() => { - tail = undefined - if (proc === next) proc = undefined - void Process.stop(next).catch(() => undefined) - }, delay) -} - -export function pulse(scale = 1) { - stop(140) - const index = shot++ % FILE.length - void asset() - .then(({ pulse }) => play(pulse[index], 0.26 + 0.14 * scale)) - .catch(() => undefined) -} - -export function dispose() { - stop() -} - -export * as Sound from "./sound" diff --git a/packages/opencode/src/cli/error.ts b/packages/opencode/src/cli/error.ts index 628aa95696aa..c92369b0af4d 100644 --- a/packages/opencode/src/cli/error.ts +++ b/packages/opencode/src/cli/error.ts @@ -1,17 +1,42 @@ import { NamedError } from "@opencode-ai/core/util/error" import { errorFormat } from "@/util/error" +import { isRecord } from "@/util/record" interface ErrorLike { name?: string _tag?: string message?: string - data?: Record + data?: Record } +type ConfigIssue = { message: string; path: string[] } + function isTaggedError(error: unknown, tag: string): boolean { - return ( - typeof error === "object" && error !== null && "_tag" in error && (error as Record)._tag === tag - ) + return isRecord(error) && error._tag === tag +} + +function configData(input: unknown, tag: string): Record | undefined { + if (!isRecord(input)) return undefined + if (input.name === tag && isRecord(input.data)) return input.data + if (input._tag === tag) return input + return undefined +} + +function stringField(input: Record, key: string): string | undefined { + return typeof input[key] === "string" ? input[key] : undefined +} + +function configIssues(input: Record): ConfigIssue[] { + return Array.isArray(input.issues) + ? input.issues.filter((issue): issue is ConfigIssue => { + if (!isRecord(issue)) return false + return ( + typeof issue.message === "string" && + Array.isArray(issue.path) && + issue.path.every((x) => typeof x === "string") + ) + }) + : [] } export function FormatError(input: unknown) { @@ -33,11 +58,13 @@ export function FormatError(input: unknown) { } // ProviderModelNotFoundError: { providerID: string, modelID: string, suggestions?: string[] } - if (NamedError.hasName(input, "ProviderModelNotFoundError")) { - const data = (input as ErrorLike).data - const suggestions: string[] = Array.isArray(data?.suggestions) ? data.suggestions : [] + const providerModelNotFound = configData(input, "ProviderModelNotFoundError") + if (providerModelNotFound) { + const suggestions = Array.isArray(providerModelNotFound.suggestions) + ? providerModelNotFound.suggestions.filter((x) => typeof x === "string") + : [] return [ - `Model not found: ${data?.providerID}/${data?.modelID}`, + `Model not found: ${providerModelNotFound.providerID}/${providerModelNotFound.modelID}`, ...(suggestions.length ? ["Did you mean: " + suggestions.join(", ")] : []), `Try: \`opencode models\` to list available models`, `Or check your config (opencode.json) provider/model names`, @@ -45,41 +72,44 @@ export function FormatError(input: unknown) { } // ProviderInitError: { providerID: string } - if (NamedError.hasName(input, "ProviderInitError")) { - return `Failed to initialize provider "${(input as ErrorLike).data?.providerID}". Check credentials and configuration.` + const providerInit = configData(input, "ProviderInitError") + if (providerInit) { + return `Failed to initialize provider "${stringField(providerInit, "providerID")}". Check credentials and configuration.` } // ConfigJsonError: { path: string, message?: string } - if (NamedError.hasName(input, "ConfigJsonError")) { - const data = (input as ErrorLike).data - return `Config file at ${data?.path} is not valid JSON(C)` + (data?.message ? `: ${data.message}` : "") + const configJson = configData(input, "ConfigJsonError") + if (configJson) { + const message = stringField(configJson, "message") + return `Config file at ${stringField(configJson, "path")} is not valid JSON(C)` + (message ? `: ${message}` : "") } // ConfigDirectoryTypoError: { dir: string, path: string, suggestion: string } - if (NamedError.hasName(input, "ConfigDirectoryTypoError")) { - const data = (input as ErrorLike).data - return `Directory "${data?.dir}" in ${data?.path} is not valid. Rename the directory to "${data?.suggestion}" or remove it. This is a common typo.` + const configDirectoryTypo = configData(input, "ConfigDirectoryTypoError") + if (configDirectoryTypo) { + return `Directory "${stringField(configDirectoryTypo, "dir")}" in ${stringField(configDirectoryTypo, "path")} is not valid. Rename the directory to "${stringField(configDirectoryTypo, "suggestion")}" or remove it. This is a common typo.` } // ConfigFrontmatterError: { message: string } - if (NamedError.hasName(input, "ConfigFrontmatterError")) { - return (input as ErrorLike).data?.message ?? "" + const configFrontmatter = configData(input, "ConfigFrontmatterError") + if (configFrontmatter) { + return stringField(configFrontmatter, "message") ?? "" } // ConfigInvalidError: { path?: string, message?: string, issues?: Array<{ message: string, path: string[] }> } - if (NamedError.hasName(input, "ConfigInvalidError")) { - const data = (input as ErrorLike).data - const path = data?.path - const message = data?.message - const issues: Array<{ message: string; path: string[] }> = Array.isArray(data?.issues) ? data.issues : [] + const configInvalid = configData(input, "ConfigInvalidError") + if (configInvalid) { + const path = stringField(configInvalid, "path") + const message = stringField(configInvalid, "message") + const issues = configIssues(configInvalid) return [ `Configuration is invalid${path && path !== "config" ? ` at ${path}` : ""}` + (message ? `: ${message}` : ""), ...issues.map((issue) => "↳ " + issue.message + " " + issue.path.join(".")), ].join("\n") } - // UICancelledError: void (no data) - if (NamedError.hasName(input, "UICancelledError")) { + // UICancelledError: user cancelled an interactive CLI prompt + if (isTaggedError(input, "UICancelledError") || NamedError.hasName(input, "UICancelledError")) { return "" } } diff --git a/packages/opencode/src/cli/ui.ts b/packages/opencode/src/cli/ui.ts index 7b4cf7f3452a..6ad6495cf10b 100644 --- a/packages/opencode/src/cli/ui.ts +++ b/packages/opencode/src/cli/ui.ts @@ -1,6 +1,5 @@ -import z from "zod" import { EOL } from "os" -import { NamedError } from "@opencode-ai/core/util/error" +import { Schema } from "effect" import { logo as glyphs } from "./logo" const wordmark = [ @@ -10,7 +9,7 @@ const wordmark = [ `▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀`, ] -export const CancelledError = NamedError.create("UICancelledError", z.void()) +export class CancelledError extends Schema.TaggedErrorClass()("UICancelledError", {}) {} export const Style = { TEXT_HIGHLIGHT: "\x1b[96m", diff --git a/packages/opencode/src/command/index.ts b/packages/opencode/src/command/index.ts index 54cfe4fcc5bd..96e171733df0 100644 --- a/packages/opencode/src/command/index.ts +++ b/packages/opencode/src/command/index.ts @@ -1,11 +1,9 @@ import { BusEvent } from "@/bus/bus-event" import { InstanceState } from "@/effect/instance-state" import { EffectBridge } from "@/effect/bridge" -import type { InstanceContext } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import { SessionID, MessageID } from "@/session/schema" import { Effect, Layer, Context, Schema } from "effect" -import z from "zod" -import { ZodOverride } from "@opencode-ai/core/effect-zod" import { Config } from "@/config/config" import { MCP } from "../mcp" import { Skill } from "../skill" @@ -35,12 +33,11 @@ export const Info = Schema.Struct({ model: Schema.optional(Schema.String), source: Schema.optional(Schema.Literals(["command", "mcp", "skill"])), // Some command templates are lazy promises from MCP prompt resolution. - template: Schema.Unknown.annotate({ [ZodOverride]: z.promise(z.string()).or(z.string()) }), + template: Schema.Unknown, subtask: Schema.optional(Schema.Boolean), hints: Schema.Array(Schema.String), }).annotate({ identifier: "Command" }) -// for some reason zod is inferring `string` for z.promise(z.string()).or(z.string()) so we have to manually override it export type Info = Omit, "template"> & { template: Promise | string } export function hints(template: string) { diff --git a/packages/opencode/src/config/attachment.ts b/packages/opencode/src/config/attachment.ts index a5fc599738dd..80e44bc2e4fa 100644 --- a/packages/opencode/src/config/attachment.ts +++ b/packages/opencode/src/config/attachment.ts @@ -14,7 +14,7 @@ export const Image = Schema.Struct({ description: "Maximum image height before resizing or rejecting the attachment (default: 2000)", }), max_base64_bytes: Schema.optional(PositiveInt).annotate({ - description: "Maximum base64 payload bytes for an image attachment (default: 4718592)", + description: "Maximum base64 payload bytes for an image attachment (default: 5242880)", }), }).annotate({ identifier: "ImageAttachmentConfig" }) export type Image = Schema.Schema.Type diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 4b10665aca9b..b13d3a8c8131 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -2,7 +2,6 @@ import * as Log from "@opencode-ai/core/util/log" import path from "path" import { pathToFileURL } from "url" import os from "os" -import z from "zod" import { mergeDeep } from "remeda" import { Global } from "@opencode-ai/core/global" import fsNode from "fs/promises" @@ -11,7 +10,6 @@ import { Flag } from "@opencode-ai/core/flag/flag" import { Auth } from "../auth" import { Env } from "../env" import { applyEdits, modify } from "jsonc-parser" -import { type InstanceContext } from "../project/instance" import { InstallationLocal, InstallationVersion } from "@opencode-ai/core/installation/version" import { existsSync } from "fs" import { Account } from "@/account/account" @@ -21,7 +19,7 @@ import { AppFileSystem } from "@opencode-ai/core/filesystem" import { InstanceState } from "@/effect/instance-state" import { Context, Duration, Effect, Exit, Fiber, Layer, Option, Schema } from "effect" import { EffectFlock } from "@opencode-ai/core/util/effect-flock" -import { containsPath } from "../project/instance-context" +import { containsPath, type InstanceContext } from "../project/instance-context" import { NonNegativeInt, PositiveInt, type DeepMutable } from "@opencode-ai/core/schema" import { ConfigAgent } from "./agent" import { ConfigAttachment } from "./attachment" @@ -262,10 +260,10 @@ export const Info = Schema.Struct({ }), tail_turns: Schema.optional(NonNegativeInt).annotate({ description: - "Number of recent user turns, including their following assistant/tool responses, to serialize into the compaction summary (default: 2)", + "Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)", }), preserve_recent_tokens: Schema.optional(NonNegativeInt).annotate({ - description: "Maximum number of tokens from recent turns to serialize into the compaction summary", + description: "Maximum number of tokens from recent turns to preserve verbatim after compaction", }), reserved: Schema.optional(NonNegativeInt).annotate({ description: "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.", @@ -357,14 +355,11 @@ function writableGlobal(info: Info) { return next } -export const ConfigDirectoryTypoError = NamedError.create( - "ConfigDirectoryTypoError", - z.object({ - path: z.string(), - dir: z.string(), - suggestion: z.string(), - }), -) +export const ConfigDirectoryTypoError = NamedError.create("ConfigDirectoryTypoError", { + path: Schema.String, + dir: Schema.String, + suggestion: Schema.String, +}) export const layer = Layer.effect( Service, @@ -409,6 +404,16 @@ export const layer = Layer.effect( const loadGlobal = Effect.fnUntraced(function* () { let result: Info = {} + // Seed the default global config with the schema for editor completion, but avoid writing when the user + // explicitly routes config through env-provided paths or content. + if (!Flag.OPENCODE_CONFIG && !Flag.OPENCODE_CONFIG_DIR && !Flag.OPENCODE_CONFIG_CONTENT) { + const file = globalConfigFile() + if (!existsSync(file)) { + yield* fs + .writeWithDirs(file, JSON.stringify({ $schema: "https://opencode.ai/config.json" }, null, 2)) + .pipe(Effect.catch(() => Effect.void)) + } + } result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "config.json"))) result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "opencode.json"))) result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "opencode.jsonc"))) diff --git a/packages/opencode/src/config/error.ts b/packages/opencode/src/config/error.ts index c43598048a54..17d74fc1c3ea 100644 --- a/packages/opencode/src/config/error.ts +++ b/packages/opencode/src/config/error.ts @@ -1,21 +1,23 @@ export * as ConfigError from "./error" -import z from "zod" import { NamedError } from "@opencode-ai/core/util/error" +import { Schema } from "effect" -export const JsonError = NamedError.create( - "ConfigJsonError", - z.object({ - path: z.string(), - message: z.string().optional(), +const Issue = Schema.StructWithRest( + Schema.Struct({ + message: Schema.String, + path: Schema.Array(Schema.String), }), + [Schema.Record(Schema.String, Schema.Unknown)], ) -export const InvalidError = NamedError.create( - "ConfigInvalidError", - z.object({ - path: z.string(), - issues: z.custom().optional(), - message: z.string().optional(), - }), -) +export const JsonError = NamedError.create("ConfigJsonError", { + path: Schema.String, + message: Schema.optional(Schema.String), +}) + +export const InvalidError = NamedError.create("ConfigInvalidError", { + path: Schema.String, + issues: Schema.optional(Schema.Array(Issue)), + message: Schema.optional(Schema.String), +}) diff --git a/packages/opencode/src/config/markdown.ts b/packages/opencode/src/config/markdown.ts index 390f7f8b06ac..820f4bf642d9 100644 --- a/packages/opencode/src/config/markdown.ts +++ b/packages/opencode/src/config/markdown.ts @@ -1,6 +1,6 @@ import { NamedError } from "@opencode-ai/core/util/error" import matter from "gray-matter" -import { z } from "zod" +import { Schema } from "effect" import { Filesystem } from "@/util/filesystem" export const FILE_REGEX = /(? diff --git a/packages/opencode/src/config/parse.ts b/packages/opencode/src/config/parse.ts index d4048cf17edf..90e96334fc9f 100644 --- a/packages/opencode/src/config/parse.ts +++ b/packages/opencode/src/config/parse.ts @@ -2,7 +2,6 @@ export * as ConfigParse from "./parse" import { type ParseError as JsoncParseError, parse as parseJsoncImpl, printParseErrorCode } from "jsonc-parser" import { Cause, Exit, Schema as EffectSchema, SchemaIssue } from "effect" -import type z from "zod" import type { DeepMutable } from "@opencode-ai/core/schema" import { InvalidError, JsonError } from "./error" @@ -48,7 +47,7 @@ export function schema>( keys: extra, path: [], message: `Unrecognized key${extra.length === 1 ? "" : "s"}: ${extra.join(", ")}`, - } as z.core.$ZodIssue, + }, ], }) } @@ -61,8 +60,12 @@ export function schema>( { path: source, issues: EffectSchema.isSchemaError(error) - ? (SchemaIssue.makeFormatterStandardSchemaV1()(error.issue).issues as z.core.$ZodIssue[]) - : ([{ code: "custom", message: String(error), path: [] }] as z.core.$ZodIssue[]), + ? SchemaIssue.makeFormatterStandardSchemaV1()(error.issue).issues.map((issue) => ({ + ...issue, + message: issue.message, + path: issue.path?.map(String) ?? [], + })) + : [{ message: String(error), path: [] }], }, { cause: error }, ) diff --git a/packages/opencode/src/config/permission.ts b/packages/opencode/src/config/permission.ts index a04b404e86d4..1092ae2b7e14 100644 --- a/packages/opencode/src/config/permission.ts +++ b/packages/opencode/src/config/permission.ts @@ -27,7 +27,6 @@ const InputObject = Schema.StructWithRest( question: Schema.optional(Action), webfetch: Schema.optional(Action), websearch: Schema.optional(Action), - codesearch: Schema.optional(Action), repo_clone: Schema.optional(Rule), repo_overview: Schema.optional(Rule), lsp: Schema.optional(Rule), diff --git a/packages/opencode/src/control-plane/workspace.ts b/packages/opencode/src/control-plane/workspace.ts index e7e65f8901dc..5b7f867ca91f 100644 --- a/packages/opencode/src/control-plane/workspace.ts +++ b/packages/opencode/src/control-plane/workspace.ts @@ -10,9 +10,9 @@ import { GlobalBus } from "@/bus/global" import { Auth } from "@/auth" import { SyncEvent } from "@/sync" import { EventSequenceTable, EventTable } from "@/sync/event.sql" -import { Flag } from "@opencode-ai/core/flag/flag" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import * as Log from "@opencode-ai/core/util/log" -import { Filesystem } from "@/util/filesystem" +import { RuntimeFlags } from "@/effect/runtime-flags" import { ProjectID } from "@/project/schema" import { Slug } from "@opencode-ai/core/util/slug" import { WorkspaceTable } from "./workspace.sql" @@ -175,6 +175,8 @@ export const layer = Layer.effect( const http = yield* HttpClient.HttpClient const sync = yield* SyncEvent.Service const vcs = yield* Vcs.Service + const flags = yield* RuntimeFlags.Service + const fs = yield* AppFileSystem.Service const connections = new Map() const syncFibers = yield* FiberMap.make() @@ -482,7 +484,7 @@ export const layer = Layer.effect( }) const startSync = Effect.fn("Workspace.startSync")(function* (space: Info) { - if (!Flag.OPENCODE_EXPERIMENTAL_WORKSPACES) return + if (!flags.experimentalWorkspaces) return const adapter = getAdapter(space.projectID, space.type) const target = yield* EffectBridge.fromPromise(() => adapter.target(space)).pipe( @@ -500,7 +502,7 @@ export const layer = Layer.effect( if (!target) return if (target.type === "local") { - setStatus(space.id, (yield* Effect.promise(() => Filesystem.exists(target.directory))) ? "connected" : "error") + setStatus(space.id, (yield* fs.existsSafe(target.directory)) ? "connected" : "error") return } @@ -1039,7 +1041,9 @@ export const defaultLayer = layer.pipe( Layer.provide(SessionPrompt.defaultLayer), Layer.provide(Project.defaultLayer), Layer.provide(Vcs.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), Layer.provide(FetchHttpClient.layer), + Layer.provide(RuntimeFlags.defaultLayer), ) const TIMEOUT = 5000 diff --git a/packages/opencode/src/data-migration.ts b/packages/opencode/src/data-migration.ts index 0a2973de5d03..b6956032a411 100644 --- a/packages/opencode/src/data-migration.ts +++ b/packages/opencode/src/data-migration.ts @@ -2,7 +2,9 @@ import { Context, Effect, Layer } from "effect" import { Database } from "./storage/db" import { DataMigrationTable } from "./data-migration.sql" import * as Log from "@opencode-ai/core/util/log" -import { eq } from "drizzle-orm" +import { and, asc, eq, gt, inArray, sql } from "drizzle-orm" +import { MessageTable, SessionTable } from "./session/session.sql" +import type { SessionID } from "./session/schema" export type Migration = { name: string @@ -18,7 +20,105 @@ export class Service extends Context.Service()("@opencode/Da export const layer = Layer.effect( Service, Effect.gen(function* () { - const migrations: Migration[] = [] + const migrations: Migration[] = [ + { + name: "session_usage_from_messages", + run: Effect.gen(function* () { + type Usage = { + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + } + + for (let cursor: SessionID | undefined, page = 1; ; page++) { + const next = yield* Effect.gen(function* () { + const sessions = yield* Effect.sync(() => + Database.use((db) => + db + .select({ id: SessionTable.id }) + .from(SessionTable) + .where(cursor ? gt(SessionTable.id, cursor) : undefined) + .orderBy(asc(SessionTable.id)) + .limit(100) + .all(), + ), + ) + if (sessions.length === 0) return + + yield* Effect.sync(() => + Database.transaction((db) => { + const usageBySession = new Map( + sessions.map((session) => [ + session.id, + { cost: 0, tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } } }, + ]), + ) + + for (const row of db + .select({ + session_id: MessageTable.session_id, + cost: sql`coalesce(sum(coalesce(json_extract(${MessageTable.data}, '$.cost'), 0)), 0)`, + tokens_input: sql`coalesce(sum(coalesce(json_extract(${MessageTable.data}, '$.tokens.input'), 0)), 0)`, + tokens_output: sql`coalesce(sum(coalesce(json_extract(${MessageTable.data}, '$.tokens.output'), 0)), 0)`, + tokens_reasoning: sql`coalesce(sum(coalesce(json_extract(${MessageTable.data}, '$.tokens.reasoning'), 0)), 0)`, + tokens_cache_read: sql`coalesce(sum(coalesce(json_extract(${MessageTable.data}, '$.tokens.cache.read'), 0)), 0)`, + tokens_cache_write: sql`coalesce(sum(coalesce(json_extract(${MessageTable.data}, '$.tokens.cache.write'), 0)), 0)`, + }) + .from(MessageTable) + .where( + and( + inArray( + MessageTable.session_id, + sessions.map((session) => session.id), + ), + sql`json_extract(${MessageTable.data}, '$.role') = 'assistant'`, + ), + ) + .groupBy(MessageTable.session_id) + .all()) { + const current = usageBySession.get(row.session_id) + if (!current) continue + current.cost = row.cost + current.tokens.input = row.tokens_input + current.tokens.output = row.tokens_output + current.tokens.reasoning = row.tokens_reasoning + current.tokens.cache.read = row.tokens_cache_read + current.tokens.cache.write = row.tokens_cache_write + } + + for (const [sessionID, value] of usageBySession) { + db.update(SessionTable) + .set({ + cost: value.cost, + tokens_input: value.tokens.input, + tokens_output: value.tokens.output, + tokens_reasoning: value.tokens.reasoning, + tokens_cache_read: value.tokens.cache.read, + tokens_cache_write: value.tokens.cache.write, + time_updated: sql`${SessionTable.time_updated}`, + }) + .where(eq(SessionTable.id, sessionID)) + .run() + } + }), + ) + + return sessions.at(-1)?.id + }).pipe( + Effect.withSpan("DataMigration.sessionUsage.page", { + attributes: { + "data_migration.name": "session_usage_from_messages", + "data_migration.page": page, + "data_migration.cursor": cursor ?? "", + }, + }), + ) + if (!next) return + cursor = next + yield* Effect.sleep("10 millis") + } + }), + }, + ] yield* Effect.gen(function* () { if (migrations.length === 0) return @@ -46,7 +146,9 @@ export const layer = Layer.effect( ) } }).pipe( - Effect.tapCause((cause) => Effect.logError("failed to run data migrations", { cause })), + Effect.tapCause((cause) => + Effect.logError("failed to run data migrations").pipe(Effect.annotateLogs("cause", cause)), + ), Effect.ignore, Effect.forkScoped, ) diff --git a/packages/opencode/src/effect/app-runtime.ts b/packages/opencode/src/effect/app-runtime.ts index 4c1637006c92..a035cabe1059 100644 --- a/packages/opencode/src/effect/app-runtime.ts +++ b/packages/opencode/src/effect/app-runtime.ts @@ -14,7 +14,7 @@ import { FileWatcher } from "@/file/watcher" import { Storage } from "@/storage/storage" import { Snapshot } from "@/snapshot" import { Plugin } from "@/plugin" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { Provider } from "@/provider/provider" import { ProviderAuth } from "@/provider/auth" import { Agent } from "@/agent/agent" @@ -24,6 +24,7 @@ import { Question } from "@/question" import { Permission } from "@/permission" import { Todo } from "@/session/todo" import { Session } from "@/session/session" +import { SessionGoal } from "@/session/goal" import { SessionStatus } from "@/session/status" import { SessionRunState } from "@/session/run-state" import { SessionProcessor } from "@/session/processor" @@ -55,6 +56,9 @@ import { SyncEvent } from "@/sync" import { Npm } from "@opencode-ai/core/npm" import { memoMap } from "@opencode-ai/core/effect/memo-map" import { DataMigration } from "@/data-migration" +import { BackgroundJob } from "@/background/job" +import { EventV2Bridge } from "@/event-v2-bridge" +import { RuntimeFlags } from "@/effect/runtime-flags" export const AppLayer = Layer.mergeAll( Npm.defaultLayer, @@ -80,7 +84,10 @@ export const AppLayer = Layer.mergeAll( Permission.defaultLayer, Todo.defaultLayer, Session.defaultLayer, + SessionGoal.defaultLayer, SessionStatus.defaultLayer, + BackgroundJob.defaultLayer, + RuntimeFlags.defaultLayer, SessionRunState.defaultLayer, SessionProcessor.defaultLayer, SessionCompaction.defaultLayer, @@ -107,6 +114,7 @@ export const AppLayer = Layer.mergeAll( ShareNext.defaultLayer, SessionShare.defaultLayer, SyncEvent.defaultLayer, + EventV2Bridge.defaultLayer, DataMigration.defaultLayer, ).pipe(Layer.provideMerge(InstanceLayer.layer), Layer.provideMerge(Observability.layer)) diff --git a/packages/opencode/src/effect/bridge.ts b/packages/opencode/src/effect/bridge.ts index 16d8f93669c6..e987c901316f 100644 --- a/packages/opencode/src/effect/bridge.ts +++ b/packages/opencode/src/effect/bridge.ts @@ -1,6 +1,7 @@ import { Effect, Exit, Fiber } from "effect" import { WorkspaceContext } from "@/control-plane/workspace-context" -import { Instance, type InstanceContext } from "@/project/instance" +import { Instance } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import type { WorkspaceID } from "@/control-plane/schema" import { LocalContext } from "@/util/local-context" import { InstanceRef, WorkspaceRef } from "./instance-ref" diff --git a/packages/opencode/src/effect/instance-ref.ts b/packages/opencode/src/effect/instance-ref.ts index effc560c5801..d95932c2de67 100644 --- a/packages/opencode/src/effect/instance-ref.ts +++ b/packages/opencode/src/effect/instance-ref.ts @@ -1,5 +1,5 @@ import { Context } from "effect" -import type { InstanceContext } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import type { WorkspaceID } from "@/control-plane/schema" export const InstanceRef = Context.Reference("~opencode/InstanceRef", { diff --git a/packages/opencode/src/effect/instance-state.ts b/packages/opencode/src/effect/instance-state.ts index e467b6ef28b3..5c95e0128215 100644 --- a/packages/opencode/src/effect/instance-state.ts +++ b/packages/opencode/src/effect/instance-state.ts @@ -1,6 +1,7 @@ import { Effect, Fiber, ScopedCache, Scope, Context } from "effect" import * as EffectLogger from "@opencode-ai/core/effect/logger" -import { Instance, type InstanceContext } from "@/project/instance" +import { Instance } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import { LocalContext } from "@/util/local-context" import { InstanceRef, WorkspaceRef } from "./instance-ref" import { registerDisposer } from "./instance-registry" diff --git a/packages/opencode/src/effect/promise.ts b/packages/opencode/src/effect/promise.ts new file mode 100644 index 000000000000..d7918796ad89 --- /dev/null +++ b/packages/opencode/src/effect/promise.ts @@ -0,0 +1,17 @@ +import { Cause, Effect } from "effect" + +export function refineRejection( + evaluate: (signal: AbortSignal) => PromiseLike, + refine: (cause: unknown) => E | undefined, +) { + return Effect.tryPromise(evaluate).pipe( + Effect.catch((error) => { + const cause = Cause.isUnknownError(error) ? error.cause : error + const refined = refine(cause) + if (refined !== undefined) return Effect.fail(refined) + return Effect.die(cause) + }), + ) +} + +export * as EffectPromise from "./promise" diff --git a/packages/opencode/src/effect/run-service.ts b/packages/opencode/src/effect/run-service.ts index 1f3802e80c4a..75cc0d58b7c6 100644 --- a/packages/opencode/src/effect/run-service.ts +++ b/packages/opencode/src/effect/run-service.ts @@ -5,7 +5,7 @@ import { LocalContext } from "@/util/local-context" import { InstanceRef, WorkspaceRef } from "./instance-ref" import * as Observability from "@opencode-ai/core/effect/observability" import { WorkspaceContext } from "@/control-plane/workspace-context" -import type { InstanceContext } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import { memoMap } from "@opencode-ai/core/effect/memo-map" type Refs = { diff --git a/packages/opencode/src/effect/runner.ts b/packages/opencode/src/effect/runner.ts index 1e7d4c2966c7..f21a61c97e57 100644 --- a/packages/opencode/src/effect/runner.ts +++ b/packages/opencode/src/effect/runner.ts @@ -4,11 +4,12 @@ export interface Runner { readonly state: State readonly busy: boolean readonly ensureRunning: (work: Effect.Effect) => Effect.Effect - readonly startShell: (work: Effect.Effect, ready?: Latch.Latch) => Effect.Effect + readonly startShell: (work: Effect.Effect, ready?: Latch.Latch) => Effect.Effect readonly cancel: Effect.Effect } export class Cancelled extends Schema.TaggedErrorClass()("RunnerCancelled", {}) {} +export class Busy extends Schema.TaggedErrorClass()("RunnerBusy", {}) {} interface RunHandle { id: number @@ -41,12 +42,11 @@ export const make = ( onIdle?: Effect.Effect onBusy?: Effect.Effect onInterrupt?: Effect.Effect - busy?: () => never }, ): Runner => { const ref = SynchronizedRef.makeUnsafe>({ _tag: "Idle" }) const idle = opts?.onIdle ?? Effect.void - const busy = opts?.onBusy ?? Effect.void + const onBusy = opts?.onBusy ?? Effect.void const onInterrupt = opts?.onInterrupt let ids = 0 @@ -137,20 +137,15 @@ export const make = ( }), ).pipe(Effect.flatten) - const startShell = (work: Effect.Effect, ready?: Latch.Latch) => + const startShell = (work: Effect.Effect, ready?: Latch.Latch): Effect.Effect => SynchronizedRef.modifyEffect( ref, Effect.fnUntraced(function* (st) { if (st._tag !== "Idle") { - return [ - Effect.sync(() => { - if (opts?.busy) opts.busy() - throw new Error("Runner is busy") - }), - st, - ] as const + const reject: Effect.Effect = Effect.fail(new Busy()) + return [reject, st] as const } - yield* busy + yield* onBusy const id = next() const cancelled = yield* Deferred.make() const fiber = yield* work.pipe(Effect.ensuring(finishShell(id)), Effect.forkChild) @@ -181,7 +176,7 @@ export const make = ( return [ Effect.gen(function* () { yield* Fiber.interrupt(st.run.fiber) - yield* Deferred.await(st.run.done).pipe(Effect.exit, Effect.asVoid) + yield* Deferred.fail(st.run.done, new Cancelled()).pipe(Effect.asVoid) yield* idleIfCurrent() }), { _tag: "Idle" } as const, diff --git a/packages/opencode/src/effect/runtime-flags.ts b/packages/opencode/src/effect/runtime-flags.ts new file mode 100644 index 000000000000..0b5939cd7d50 --- /dev/null +++ b/packages/opencode/src/effect/runtime-flags.ts @@ -0,0 +1,74 @@ +import { Config, ConfigProvider, Context, Effect, Layer } from "effect" +import { ConfigService } from "@/effect/config-service" + +const bool = (name: string) => Config.boolean(name).pipe(Config.withDefault(false)) +const positiveInteger = (name: string) => + Config.number(name).pipe( + Config.map((value) => (Number.isInteger(value) && value > 0 ? value : undefined)), + Config.orElse(() => Config.succeed(undefined)), + ) +const experimental = bool("OPENCODE_EXPERIMENTAL") +const enabledByExperimental = (name: string) => + Config.all({ experimental, enabled: bool(name) }).pipe(Config.map((flags) => flags.experimental || flags.enabled)) + +export class Service extends ConfigService.Service()("@opencode/RuntimeFlags", { + autoShare: bool("OPENCODE_AUTO_SHARE"), + pure: bool("OPENCODE_PURE"), + disableDefaultPlugins: bool("OPENCODE_DISABLE_DEFAULT_PLUGINS"), + disableChannelDb: bool("OPENCODE_DISABLE_CHANNEL_DB"), + disableEmbeddedWebUi: bool("OPENCODE_DISABLE_EMBEDDED_WEB_UI"), + disableExternalSkills: bool("OPENCODE_DISABLE_EXTERNAL_SKILLS"), + disableLspDownload: bool("OPENCODE_DISABLE_LSP_DOWNLOAD"), + skipMigrations: bool("OPENCODE_SKIP_MIGRATIONS"), + disableClaudeCodePrompt: Config.all({ + broad: bool("OPENCODE_DISABLE_CLAUDE_CODE"), + direct: bool("OPENCODE_DISABLE_CLAUDE_CODE_PROMPT"), + }).pipe(Config.map((flags) => flags.broad || flags.direct)), + disableClaudeCodeSkills: Config.all({ + broad: bool("OPENCODE_DISABLE_CLAUDE_CODE"), + direct: bool("OPENCODE_DISABLE_CLAUDE_CODE_SKILLS"), + }).pipe(Config.map((flags) => flags.broad || flags.direct)), + enableExa: Config.all({ + experimental, + enabled: bool("OPENCODE_ENABLE_EXA"), + legacy: bool("OPENCODE_EXPERIMENTAL_EXA"), + }).pipe(Config.map((flags) => flags.experimental || flags.enabled || flags.legacy)), + enableParallel: Config.all({ + enabled: bool("OPENCODE_ENABLE_PARALLEL"), + legacy: bool("OPENCODE_EXPERIMENTAL_PARALLEL"), + }).pipe(Config.map((flags) => flags.enabled || flags.legacy)), + enableExperimentalModels: bool("OPENCODE_ENABLE_EXPERIMENTAL_MODELS"), + enableQuestionTool: bool("OPENCODE_ENABLE_QUESTION_TOOL"), + experimentalScout: enabledByExperimental("OPENCODE_EXPERIMENTAL_SCOUT"), + experimentalBackgroundSubagents: enabledByExperimental("OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS"), + experimentalLspTy: bool("OPENCODE_EXPERIMENTAL_LSP_TY"), + experimentalLspTool: enabledByExperimental("OPENCODE_EXPERIMENTAL_LSP_TOOL"), + experimentalOxfmt: enabledByExperimental("OPENCODE_EXPERIMENTAL_OXFMT"), + experimentalPlanMode: enabledByExperimental("OPENCODE_EXPERIMENTAL_PLAN_MODE"), + experimentalEventSystem: enabledByExperimental("OPENCODE_EXPERIMENTAL_EVENT_SYSTEM"), + experimentalWorkspaces: enabledByExperimental("OPENCODE_EXPERIMENTAL_WORKSPACES"), + experimentalIconDiscovery: enabledByExperimental("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY"), + outputTokenMax: positiveInteger("OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX"), + bashDefaultTimeoutMs: positiveInteger("OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS"), + client: Config.string("OPENCODE_CLIENT").pipe(Config.withDefault("cli")), +}) {} + +export type Info = Context.Service.Shape + +const emptyConfigLayer = Service.defaultLayer.pipe( + Layer.provide(ConfigProvider.layer(ConfigProvider.fromUnknown({}))), + Layer.orDie, +) + +export const layer = (overrides: Partial = {}) => + Layer.effect( + Service, + Effect.gen(function* () { + const flags = yield* Service + return Service.of({ ...flags, ...overrides }) + }), + ).pipe(Layer.provide(emptyConfigLayer)) + +export const defaultLayer = Service.defaultLayer.pipe(Layer.orDie) + +export * as RuntimeFlags from "./runtime-flags" diff --git a/packages/opencode/src/event-v2-bridge.ts b/packages/opencode/src/event-v2-bridge.ts new file mode 100644 index 000000000000..c8213254a5e0 --- /dev/null +++ b/packages/opencode/src/event-v2-bridge.ts @@ -0,0 +1,89 @@ +// Temporary V2 bridge: core events are the publish path, but the rest of +// opencode and the HTTP event stream still expect legacy bus/sync payloads. +// This layer goes away once consumers subscribe to core EventV2 directly. +import { Bus as ProjectBus } from "@/bus" +import { GlobalBus } from "@/bus/global" +import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref" +import { InstanceStore } from "@/project/instance-store" +import { SyncEvent } from "@/sync" +import { EventV2 } from "@opencode-ai/core/event" +import "@opencode-ai/core/catalog" +import "@opencode-ai/core/session-event" +import { Context, Effect, Layer, Option } from "effect" + +export function toSyncDefinition(definition: D) { + const result = { + type: definition.type, + version: definition.version, + aggregate: definition.aggregate, + schema: definition.data, + properties: definition.data, + } + return result as SyncEvent.Definition +} + +export class Service extends Context.Service()("@opencode/EventV2Bridge") {} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const events = yield* EventV2.Service + const bus = yield* ProjectBus.Service + const sync = yield* SyncEvent.Service + + const publishGlobal = (event: EventV2.Payload) => + Effect.sync(() => { + GlobalBus.emit("event", { + workspace: event.location?.workspaceID, + payload: { + id: event.id, + type: event.type, + properties: event.data, + }, + }) + }) + + const provideEventLocation = (event: EventV2.Payload, effect: Effect.Effect) => { + return Effect.gen(function* () { + const ctx = yield* InstanceRef + if (ctx) return yield* effect + const store = Option.getOrUndefined(yield* Effect.serviceOption(InstanceStore.Service)) + if (!event.location?.directory || !store) return yield* publishGlobal(event) + return yield* store.load({ directory: event.location.directory }).pipe( + Effect.flatMap((ctx) => { + const withInstance = effect.pipe(Effect.provideService(InstanceRef, ctx)) + if (!event.location?.workspaceID) return withInstance + return withInstance.pipe(Effect.provideService(WorkspaceRef, event.location.workspaceID)) + }), + ) + }) + } + + const unsubscribe = yield* events.sync((event) => { + const definition = EventV2.registry.get(event.type) + if (!definition) return Effect.void + const aggregateID = definition.aggregate + ? (event.data as Record)[definition.aggregate] + : undefined + + if (definition.version !== undefined && typeof aggregateID === "string") { + return provideEventLocation(event, sync.run(toSyncDefinition(definition), event.data)) + } + + return provideEventLocation( + event, + bus.publish({ type: definition.type, properties: definition.data }, event.data, { id: event.id }), + ) + }) + yield* Effect.addFinalizer(() => unsubscribe) + return Service.of(events) + }), +) + +export const defaultLayer = layer.pipe( + Layer.provideMerge(EventV2.defaultLayer), + Layer.provide(SyncEvent.defaultLayer), + Layer.provide(ProjectBus.defaultLayer), +) + +export * as EventV2Bridge from "./event-v2-bridge" diff --git a/packages/opencode/src/file/watcher.ts b/packages/opencode/src/file/watcher.ts index 146d7b4d0758..d940c7c4228f 100644 --- a/packages/opencode/src/file/watcher.ts +++ b/packages/opencode/src/file/watcher.ts @@ -2,9 +2,8 @@ import { Cause, Effect, Layer, Context, Schema } from "effect" // @ts-ignore import { createWrapper } from "@parcel/watcher/wrapper" import type ParcelWatcher from "@parcel/watcher" -import { readdir } from "fs/promises" +import { readdir, realpath } from "fs/promises" import path from "path" -import z from "zod" import { Bus } from "@/bus" import { BusEvent } from "@/bus/bus-event" import { InstanceState } from "@/effect/instance-state" @@ -132,8 +131,14 @@ export const layer = Layer.effect( const result = yield* git.run(["rev-parse", "--git-dir"], { cwd: ctx.worktree, }) - const vcsDir = result.exitCode === 0 ? path.resolve(ctx.worktree, result.text().trim()) : undefined - if (vcsDir && !cfgIgnores.includes(".git") && !cfgIgnores.includes(vcsDir)) { + const resolved = result.exitCode === 0 ? path.resolve(ctx.worktree, result.text().trim()) : undefined + const vcsDir = resolved ? yield* Effect.promise(() => realpath(resolved).catch(() => resolved)) : undefined + if ( + vcsDir && + !cfgIgnores.includes(".git") && + !cfgIgnores.includes(vcsDir) && + (!resolved || !cfgIgnores.includes(resolved)) + ) { const ignore = (yield* Effect.promise(() => readdir(vcsDir).catch(() => []))).filter( (entry) => entry !== "HEAD", ) diff --git a/packages/opencode/src/format/formatter.ts b/packages/opencode/src/format/formatter.ts index dbc132601730..27b28c37bcf6 100644 --- a/packages/opencode/src/format/formatter.ts +++ b/packages/opencode/src/format/formatter.ts @@ -1,11 +1,12 @@ import { Npm } from "@opencode-ai/core/npm" -import type { InstanceContext } from "../project/instance" +import type { InstanceContext } from "../project/instance-context" import { Filesystem } from "@/util/filesystem" import { Process } from "@/util/process" import { which } from "../util/which" -import { Flag } from "@opencode-ai/core/flag/flag" -export interface Context extends Pick {} +export interface Context extends Pick { + experimentalOxfmt: boolean +} export interface Info { name: string @@ -90,7 +91,7 @@ export const oxfmt: Info = { }, extensions: [".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts"], async enabled(context) { - if (!Flag.OPENCODE_EXPERIMENTAL_OXFMT) return false + if (!context.experimentalOxfmt) return false const items = await Filesystem.findUp("package.json", context.directory, context.worktree) for (const item of items) { const json = await Filesystem.readJson<{ diff --git a/packages/opencode/src/format/index.ts b/packages/opencode/src/format/index.ts index b6eb9dfd0e5b..50abba0ff9e3 100644 --- a/packages/opencode/src/format/index.ts +++ b/packages/opencode/src/format/index.ts @@ -1,10 +1,12 @@ import { Effect, Layer, Context, Schema } from "effect" -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" -import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { ChildProcess } from "effect/unstable/process" +import { AppProcess } from "@opencode-ai/core/process" import { InstanceState } from "@/effect/instance-state" import path from "path" import { mergeDeep } from "remeda" import { Config } from "@/config/config" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { errorMessage } from "@/util/error" import * as Log from "@opencode-ai/core/util/log" import * as Formatter from "./formatter" @@ -29,7 +31,8 @@ export const layer = Layer.effect( Service, Effect.gen(function* () { const config = yield* Config.Service - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner + const appProcess = yield* AppProcess.Service + const flags = yield* RuntimeFlags.Service const state = yield* InstanceState.make( Effect.fn("Format.state")(function* (ctx) { @@ -39,7 +42,7 @@ export const layer = Layer.effect( async function getCommand(item: Formatter.Info) { let cmd = commands[item.name] if (cmd === false || cmd === undefined) { - cmd = await item.enabled(ctx) + cmd = await item.enabled({ ...ctx, experimentalOxfmt: flags.experimentalOxfmt }) commands[item.name] = cmd } return cmd @@ -81,8 +84,8 @@ export const layer = Layer.effect( log.info("running", { command: cmd }) const replaced = cmd.map((x) => x.replace("$FILE", filepath)) const dir = yield* InstanceState.directory - const code = yield* spawner - .spawn( + const result = yield* appProcess + .run( ChildProcess.make(replaced[0]!, replaced.slice(1), { cwd: dir, env: item.environment, @@ -93,21 +96,20 @@ export const layer = Layer.effect( }), ) .pipe( - Effect.flatMap((handle) => handle.exitCode), - Effect.scoped, - Effect.catch(() => + Effect.catch((error) => Effect.sync(() => { log.error("failed to format file", { error: "spawn failed", command: cmd, ...item.environment, file: filepath, + cause: errorMessage(error.cause ?? error), }) - return ChildProcessSpawner.ExitCode(1) + return undefined }), ), ) - if (code !== 0) { + if (result && result.exitCode !== 0) { log.error("failed", { command: cmd, ...item.environment, @@ -200,7 +202,8 @@ export const layer = Layer.effect( export const defaultLayer = layer.pipe( Layer.provide(Config.defaultLayer), - Layer.provide(CrossSpawnSpawner.defaultLayer), + Layer.provide(AppProcess.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), ) export * as Format from "." diff --git a/packages/opencode/src/git/index.ts b/packages/opencode/src/git/index.ts index 349bbad466ec..5e76b7f7313a 100644 --- a/packages/opencode/src/git/index.ts +++ b/packages/opencode/src/git/index.ts @@ -1,6 +1,6 @@ -import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppProcess } from "@opencode-ai/core/process" import { Effect, Layer, Context, Stream } from "effect" -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" +import { ChildProcess } from "effect/unstable/process" const cfg = [ "--no-optional-locks", @@ -102,49 +102,31 @@ export class Service extends Context.Service()("@opencode/Gi export const layer = Layer.effect( Service, Effect.gen(function* () { - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner + const appProcess = yield* AppProcess.Service const encoder = new TextEncoder() const stdin = (text: string) => Stream.make(encoder.encode(text)) const run = Effect.fn("Git.run")( function* (args: string[], opts: Options) { - const proc = ChildProcess.make("git", [...cfg, ...args], { - cwd: opts.cwd, - env: opts.env, - extendEnv: true, - stdin: opts.stdin ?? "ignore", - stdout: "pipe", - stderr: "pipe", - }) - const handle = yield* spawner.spawn(proc) - const collect = (stream: typeof handle.stdout) => - Stream.runFold( - stream, - () => ({ chunks: [] as Uint8Array[], bytes: 0, truncated: false }), - (acc, chunk) => { - if (opts.maxOutputBytes === undefined) { - acc.chunks.push(chunk) - acc.bytes += chunk.length - return acc - } - - const remaining = opts.maxOutputBytes - acc.bytes - if (remaining > 0) acc.chunks.push(remaining >= chunk.length ? chunk : chunk.slice(0, remaining)) - acc.bytes += chunk.length - acc.truncated = acc.truncated || acc.bytes > opts.maxOutputBytes - return acc - }, - ).pipe(Effect.map((x) => ({ buffer: Buffer.concat(x.chunks), truncated: x.truncated }))) - const [stdout, stderr] = yield* Effect.all([collect(handle.stdout), collect(handle.stderr)], { concurrency: 2 }) + const result = yield* appProcess.run( + ChildProcess.make("git", [...cfg, ...args], { + cwd: opts.cwd, + env: opts.env, + extendEnv: true, + stdin: opts.stdin ?? "ignore", + stdout: "pipe", + stderr: "pipe", + }), + { maxOutputBytes: opts.maxOutputBytes }, + ) return { - exitCode: yield* handle.exitCode, - text: () => stdout.buffer.toString("utf8"), - stdout: stdout.buffer, - stderr: stderr.buffer, - truncated: stdout.truncated || stderr.truncated, + exitCode: result.exitCode, + text: () => result.stdout.toString("utf8"), + stdout: result.stdout, + stderr: result.stderr, + truncated: result.stdoutTruncated || result.stderrTruncated, } satisfies Result }, - Effect.scoped, Effect.catch((err) => Effect.succeed(fail(err))), ) @@ -360,6 +342,6 @@ export const layer = Layer.effect( }), ) -export const defaultLayer = layer.pipe(Layer.provide(CrossSpawnSpawner.defaultLayer)) +export const defaultLayer = layer.pipe(Layer.provide(AppProcess.defaultLayer)) export * as Git from "." diff --git a/packages/opencode/src/id/id.ts b/packages/opencode/src/id/id.ts index 9e163cd6b8c6..dd22f9634c47 100644 --- a/packages/opencode/src/id/id.ts +++ b/packages/opencode/src/id/id.ts @@ -1,12 +1,14 @@ import { randomBytes } from "crypto" const prefixes = { + job: "job", event: "evt", session: "ses", message: "msg", permission: "per", question: "que", part: "prt", + goal: "goal", pty: "pty", tool: "tool", workspace: "wrk", diff --git a/packages/opencode/src/ide/index.ts b/packages/opencode/src/ide/index.ts index 2df293f1638a..a31c5bd05729 100644 --- a/packages/opencode/src/ide/index.ts +++ b/packages/opencode/src/ide/index.ts @@ -1,5 +1,4 @@ import { BusEvent } from "@/bus/bus-event" -import z from "zod" import { Schema } from "effect" import { NamedError } from "@opencode-ai/core/util/error" import * as Log from "@opencode-ai/core/util/log" @@ -24,14 +23,11 @@ export const Event = { ), } -export const AlreadyInstalledError = NamedError.create("AlreadyInstalledError", z.object({})) +export const AlreadyInstalledError = NamedError.create("AlreadyInstalledError", {}) -export const InstallFailedError = NamedError.create( - "InstallFailedError", - z.object({ - stderr: z.string(), - }), -) +export const InstallFailedError = NamedError.create("InstallFailedError", { + stderr: Schema.String, +}) export function ide() { if (process.env["TERM_PROGRAM"] === "vscode") { diff --git a/packages/opencode/src/image/image.ts b/packages/opencode/src/image/image.ts index 2115e19198b7..2a3c4fa5c009 100644 --- a/packages/opencode/src/image/image.ts +++ b/packages/opencode/src/image/image.ts @@ -1,21 +1,24 @@ import { Config } from "@/config/config" import type { MessageV2 } from "@/session/message-v2" import * as Log from "@opencode-ai/core/util/log" +import photonWasm from "@silvia-odwyer/photon-node/photon_rs_bg.wasm" with { type: "file" } import { Context, Effect, Layer, Schema } from "effect" +import path from "node:path" +import { fileURLToPath } from "node:url" -const MAX_BASE64_BYTES = 4.5 * 1024 * 1024 +const MAX_BASE64_BYTES = 5 * 1024 * 1024 const MAX_WIDTH = 2000 const MAX_HEIGHT = 2000 const AUTO_RESIZE = true const JPEG_QUALITIES = [80, 85, 70, 55, 40] const log = Log.create({ service: "image" }) -export class PhotonUnavailableError extends Schema.TaggedErrorClass()( - "ImagePhotonUnavailableError", +export class ResizerUnavailableError extends Schema.TaggedErrorClass()( + "ImageResizerUnavailableError", {}, ) { override get message() { - return "Photon image processor is unavailable" + return "Image resizer is unavailable" } } @@ -46,7 +49,7 @@ export class SizeError extends Schema.TaggedErrorClass()("ImageSizeEr } } -export type Error = PhotonUnavailableError | InvalidDataUrlError | DecodeError | SizeError +export type Error = ResizerUnavailableError | InvalidDataUrlError | DecodeError | SizeError export interface Interface { readonly normalize: (input: MessageV2.FilePart) => Effect.Effect @@ -59,18 +62,15 @@ export const layer = Layer.effect( Effect.gen(function* () { const config = yield* Config.Service const loadPhoton = yield* Effect.cached( - Effect.promise(async () => { - try { - const photonWasm = (await import("@silvia-odwyer/photon-node/photon_rs_bg.wasm", { with: { type: "file" } })) - .default - // Patched photon-node reads this during module init so Bun compiled binaries use the embedded wasm path. - ;(globalThis as typeof globalThis & { __OPENCODE_PHOTON_WASM_PATH?: string }).__OPENCODE_PHOTON_WASM_PATH = - photonWasm - return await import("@silvia-odwyer/photon-node") - } catch { - return null - } - }), + Effect.sync(() => { + // Patched photon-node reads this during module init so Bun compiled binaries use the embedded wasm path. + ;(globalThis as typeof globalThis & { __OPENCODE_PHOTON_WASM_PATH?: string }).__OPENCODE_PHOTON_WASM_PATH = + path.isAbsolute(photonWasm) ? photonWasm : fileURLToPath(new URL(photonWasm, import.meta.url)) + }).pipe( + Effect.andThen(() => Effect.tryPromise(() => import("@silvia-odwyer/photon-node"))), + Effect.tapError((error) => Effect.sync(() => log.warn("failed to load photon", { error }))), + Effect.mapError(() => new ResizerUnavailableError()), + ), ) const normalize = Effect.fn("Image.normalize")(function* (input: MessageV2.FilePart) { @@ -85,30 +85,26 @@ export const layer = Layer.effect( return yield* new InvalidDataUrlError({ url: input.url }) const base64 = input.url.slice(input.url.indexOf(";base64,") + ";base64,".length) + const bytes = Buffer.byteLength(base64, "utf8") + const photon = yield* loadPhoton - if (!photon) return yield* new PhotonUnavailableError() - const decoded = yield* Effect.sync(() => { - try { - return photon.PhotonImage.new_from_byteslice(Buffer.from(base64, "base64")) - } catch { - return undefined - } + const decoded = yield* Effect.try({ + try: () => photon.PhotonImage.new_from_byteslice(Buffer.from(base64, "base64")), + catch: (error) => { + log.warn("failed to decode image", { error }) + return new DecodeError() + }, }) - if (!decoded) return yield* new DecodeError() try { const originalWidth = decoded.get_width() const originalHeight = decoded.get_height() - if ( - originalWidth <= info.maxWidth && - originalHeight <= info.maxHeight && - Buffer.byteLength(base64, "utf8") <= info.maxBase64Bytes - ) + if (originalWidth <= info.maxWidth && originalHeight <= info.maxHeight && bytes <= info.maxBase64Bytes) return input if (!info.autoResize) return yield* new SizeError({ - bytes: Buffer.byteLength(base64, "utf8"), + bytes, max: info.maxBase64Bytes, width: originalWidth, height: originalHeight, @@ -159,7 +155,7 @@ export const layer = Layer.effect( } return yield* new SizeError({ - bytes: Buffer.byteLength(base64, "utf8"), + bytes, max: info.maxBase64Bytes, width: originalWidth, height: originalHeight, diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 4c8e447041c0..d20f29dd4d2f 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -39,6 +39,7 @@ import { PluginCommand } from "./cli/cmd/plug" import { Heap } from "./cli/heap" import { drizzle } from "drizzle-orm/bun-sqlite" import { ensureProcessMetadata } from "@opencode-ai/core/util/opencode-process" +import { isRecord } from "@/util/record" const processMetadata = ensureProcessMetadata("main") @@ -203,13 +204,6 @@ try { } } catch (e) { let data: Record = {} - if (e instanceof NamedError) { - const obj = e.toObject() - Object.assign(data, { - ...obj.data, - }) - } - if (e instanceof Error) { Object.assign(data, { name: e.name, @@ -219,6 +213,16 @@ try { }) } + if (e instanceof NamedError) { + const obj = e.toObject() + if (isRecord(obj.data)) { + for (const [key, value] of Object.entries(obj.data)) { + if (key === "name" || key === "stack" || key === "cause") continue + data[key] = value + } + } + } + if (e instanceof ResolveMessage) { Object.assign(data, { name: e.name, diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts index be3bc47693a3..9b0e06c4af57 100644 --- a/packages/opencode/src/installation/index.ts +++ b/packages/opencode/src/installation/index.ts @@ -1,12 +1,11 @@ import { Effect, Layer, Schema, Context, Stream } from "effect" import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http" -import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { withTransientReadRetry } from "@/util/effect-http-client" -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" +import { errorMessage } from "@/util/error" +import { ChildProcess } from "effect/unstable/process" +import { AppProcess } from "@opencode-ai/core/process" import path from "path" -import z from "zod" import { BusEvent } from "@/bus/bus-event" -import { Flag } from "@opencode-ai/core/flag/flag" import * as Log from "@opencode-ai/core/util/log" import { makeRuntime } from "@opencode-ai/core/effect/runtime" import semver from "semver" @@ -45,17 +44,17 @@ export function getReleaseType(current: string, latest: string): ReleaseType { return "patch" } -export const Info = z - .object({ - version: z.string(), - latest: z.string(), - }) - .meta({ - ref: "InstallationInfo", - }) -export type Info = z.infer +export const Info = Schema.Struct({ + version: Schema.String, + latest: Schema.String, +}).annotate({ identifier: "InstallationInfo" }) +export type Info = Schema.Schema.Type -export const USER_AGENT = `opencode/${InstallationChannel}/${InstallationVersion}/${Flag.OPENCODE_CLIENT}` +export function userAgent(client = "cli") { + return `opencode/${InstallationChannel}/${InstallationVersion}/${client}` +} + +export const USER_AGENT = userAgent() export function isPreview() { return InstallationChannel !== "latest" @@ -90,246 +89,235 @@ export interface Interface { export class Service extends Context.Service()("@opencode/Installation") {} -export const layer: Layer.Layer = - Layer.effect( - Service, - Effect.gen(function* () { - const http = yield* HttpClient.HttpClient - const httpOk = HttpClient.filterStatusOk(withTransientReadRetry(http)) - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner - - const text = Effect.fnUntraced( - function* (cmd: string[], opts?: { cwd?: string; env?: Record }) { - const proc = ChildProcess.make(cmd[0], cmd.slice(1), { +export const layer: Layer.Layer = Layer.effect( + Service, + Effect.gen(function* () { + const http = yield* HttpClient.HttpClient + const httpOk = HttpClient.filterStatusOk(withTransientReadRetry(http)) + const appProcess = yield* AppProcess.Service + + const text = Effect.fnUntraced( + function* (cmd: string[], opts?: { cwd?: string; env?: Record }) { + const result = yield* appProcess.run( + ChildProcess.make(cmd[0], cmd.slice(1), { cwd: opts?.cwd, env: opts?.env, extendEnv: true, - }) - const handle = yield* spawner.spawn(proc) - const out = yield* Stream.mkString(Stream.decodeText(handle.stdout)) - yield* handle.exitCode - return out - }, - Effect.scoped, - Effect.catch(() => Effect.succeed("")), - ) - - const run = Effect.fnUntraced( - function* (cmd: string[], opts?: { cwd?: string; env?: Record }) { - const proc = ChildProcess.make(cmd[0], cmd.slice(1), { + }), + ) + return result.stdout.toString("utf8") + }, + Effect.catch(() => Effect.succeed("")), + ) + + const run = Effect.fnUntraced( + function* (cmd: string[], opts?: { cwd?: string; env?: Record }) { + const result = yield* appProcess.run( + ChildProcess.make(cmd[0], cmd.slice(1), { cwd: opts?.cwd, env: opts?.env, extendEnv: true, - }) - const handle = yield* spawner.spawn(proc) - const [stdout, stderr] = yield* Effect.all( - [Stream.mkString(Stream.decodeText(handle.stdout)), Stream.mkString(Stream.decodeText(handle.stderr))], - { concurrency: 2 }, - ) - const code = yield* handle.exitCode - return { code, stdout, stderr } - }, - Effect.scoped, - Effect.catch(() => Effect.succeed({ code: ChildProcessSpawner.ExitCode(1), stdout: "", stderr: "" })), - ) - - const getBrewFormula = Effect.fnUntraced(function* () { - const tapFormula = yield* text(["brew", "list", "--formula", "anomalyco/tap/opencode"]) - if (tapFormula.includes("opencode")) return "anomalyco/tap/opencode" - const coreFormula = yield* text(["brew", "list", "--formula", "opencode"]) - if (coreFormula.includes("opencode")) return "opencode" - return "opencode" - }) - - const upgradeCurl = Effect.fnUntraced( - function* (target: string) { - const response = yield* httpOk.execute(HttpClientRequest.get("https://opencode.ai/install")) - const body = yield* response.text - const bodyBytes = new TextEncoder().encode(body) - const proc = ChildProcess.make("bash", [], { - stdin: Stream.make(bodyBytes), - env: { VERSION: target }, - extendEnv: true, - }) - const handle = yield* spawner.spawn(proc) - const [stdout, stderr] = yield* Effect.all( - [Stream.mkString(Stream.decodeText(handle.stdout)), Stream.mkString(Stream.decodeText(handle.stderr))], - { concurrency: 2 }, - ) - const code = yield* handle.exitCode - return { code, stdout, stderr } - }, - Effect.scoped, - Effect.orDie, - ) - - const result: Interface = { - info: Effect.fn("Installation.info")(function* () { - return { - version: InstallationVersion, - latest: yield* result.latest(), - } + }), + ) + return { + code: result.exitCode, + stdout: result.stdout.toString("utf8"), + stderr: result.stderr.toString("utf8"), + } + }, + Effect.catch((err) => Effect.succeed({ code: 1, stdout: "", stderr: errorMessage(err) })), + ) + + const getBrewFormula = Effect.fnUntraced(function* () { + const tapFormula = yield* text(["brew", "list", "--formula", "anomalyco/tap/opencode"]) + if (tapFormula.includes("opencode")) return "anomalyco/tap/opencode" + const coreFormula = yield* text(["brew", "list", "--formula", "opencode"]) + if (coreFormula.includes("opencode")) return "opencode" + return "opencode" + }) + + const upgradeCurl = Effect.fnUntraced(function* (target: string) { + const response = yield* httpOk.execute(HttpClientRequest.get("https://opencode.ai/install")) + const body = yield* response.text + const bodyBytes = new TextEncoder().encode(body) + const result = yield* appProcess.run( + ChildProcess.make("bash", [], { + stdin: Stream.make(bodyBytes), + env: { VERSION: target }, + extendEnv: true, }), - method: Effect.fn("Installation.method")(function* () { - if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl" as Method - if (process.execPath.includes(path.join(".local", "bin"))) return "curl" as Method - const exec = process.execPath.toLowerCase() - - const checks: Array<{ name: Method; command: () => Effect.Effect }> = [ - { name: "npm", command: () => text(["npm", "list", "-g", "--depth=0"]) }, - { name: "yarn", command: () => text(["yarn", "global", "list"]) }, - { name: "pnpm", command: () => text(["pnpm", "list", "-g", "--depth=0"]) }, - { name: "bun", command: () => text(["bun", "pm", "ls", "-g"]) }, - { name: "brew", command: () => text(["brew", "list", "--formula", "opencode"]) }, - { name: "scoop", command: () => text(["scoop", "list", "opencode"]) }, - { name: "choco", command: () => text(["choco", "list", "--limit-output", "opencode"]) }, - ] - - checks.sort((a, b) => { - const aMatches = exec.includes(a.name) - const bMatches = exec.includes(b.name) - if (aMatches && !bMatches) return -1 - if (!aMatches && bMatches) return 1 - return 0 - }) - - for (const check of checks) { - const output = yield* check.command() - const installedName = - check.name === "brew" || check.name === "choco" || check.name === "scoop" ? "opencode" : "opencode-ai" - if (output.includes(installedName)) { - return check.name - } - } - - return "unknown" as Method - }), - latest: Effect.fn("Installation.latest")(function* (installMethod?: Method) { - const detectedMethod = installMethod || (yield* result.method()) - - if (detectedMethod === "brew") { - const formula = yield* getBrewFormula() - if (formula.includes("/")) { - const infoJson = yield* text(["brew", "info", "--json=v2", formula]) - const info = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(BrewInfoV2))(infoJson) - return info.formulae[0].versions.stable - } - const response = yield* httpOk.execute( - HttpClientRequest.get("https://formulae.brew.sh/api/formula/opencode.json").pipe( - HttpClientRequest.acceptJson, - ), - ) - const data = yield* HttpClientResponse.schemaBodyJson(BrewFormula)(response) - return data.versions.stable + ) + return { + code: result.exitCode, + stdout: result.stdout.toString("utf8"), + stderr: result.stderr.toString("utf8"), + } + }, Effect.orDie) + + const result: Interface = { + info: Effect.fn("Installation.info")(function* () { + return { + version: InstallationVersion, + latest: yield* result.latest(), + } + }), + method: Effect.fn("Installation.method")(function* () { + if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl" as Method + if (process.execPath.includes(path.join(".local", "bin"))) return "curl" as Method + const exec = process.execPath.toLowerCase() + + const checks: Array<{ name: Method; command: () => Effect.Effect }> = [ + { name: "npm", command: () => text(["npm", "list", "-g", "--depth=0"]) }, + { name: "yarn", command: () => text(["yarn", "global", "list"]) }, + { name: "pnpm", command: () => text(["pnpm", "list", "-g", "--depth=0"]) }, + { name: "bun", command: () => text(["bun", "pm", "ls", "-g"]) }, + { name: "brew", command: () => text(["brew", "list", "--formula", "opencode"]) }, + { name: "scoop", command: () => text(["scoop", "list", "opencode"]) }, + { name: "choco", command: () => text(["choco", "list", "--limit-output", "opencode"]) }, + ] + + checks.sort((a, b) => { + const aMatches = exec.includes(a.name) + const bMatches = exec.includes(b.name) + if (aMatches && !bMatches) return -1 + if (!aMatches && bMatches) return 1 + return 0 + }) + + for (const check of checks) { + const output = yield* check.command() + const installedName = + check.name === "brew" || check.name === "choco" || check.name === "scoop" ? "opencode" : "opencode-ai" + if (output.includes(installedName)) { + return check.name } - - if (detectedMethod === "npm" || detectedMethod === "bun" || detectedMethod === "pnpm") { - const response = yield* httpOk.execute( - HttpClientRequest.get( - `${yield* NpmConfig.registry(process.cwd())}/opencode-ai/${InstallationChannel}`, - ).pipe(HttpClientRequest.acceptJson), - ) - const data = yield* HttpClientResponse.schemaBodyJson(NpmPackage)(response) - return data.version + } + + return "unknown" as Method + }), + latest: Effect.fn("Installation.latest")(function* (installMethod?: Method) { + const detectedMethod = installMethod || (yield* result.method()) + + if (detectedMethod === "brew") { + const formula = yield* getBrewFormula() + if (formula.includes("/")) { + const infoJson = yield* text(["brew", "info", "--json=v2", formula]) + const info = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(BrewInfoV2))(infoJson) + return info.formulae[0].versions.stable } + const response = yield* httpOk.execute( + HttpClientRequest.get("https://formulae.brew.sh/api/formula/opencode.json").pipe( + HttpClientRequest.acceptJson, + ), + ) + const data = yield* HttpClientResponse.schemaBodyJson(BrewFormula)(response) + return data.versions.stable + } - if (detectedMethod === "choco") { - const response = yield* httpOk.execute( - HttpClientRequest.get( - "https://community.chocolatey.org/api/v2/Packages?$filter=Id%20eq%20%27opencode%27%20and%20IsLatestVersion&$select=Version", - ).pipe(HttpClientRequest.setHeaders({ Accept: "application/json;odata=verbose" })), - ) - const data = yield* HttpClientResponse.schemaBodyJson(ChocoPackage)(response) - return data.d.results[0].Version - } + if (detectedMethod === "npm" || detectedMethod === "bun" || detectedMethod === "pnpm") { + const response = yield* httpOk.execute( + HttpClientRequest.get( + `${yield* NpmConfig.registry(process.cwd())}/opencode-ai/${InstallationChannel}`, + ).pipe(HttpClientRequest.acceptJson), + ) + const data = yield* HttpClientResponse.schemaBodyJson(NpmPackage)(response) + return data.version + } - if (detectedMethod === "scoop") { - const response = yield* httpOk.execute( - HttpClientRequest.get( - "https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/opencode.json", - ).pipe(HttpClientRequest.setHeaders({ Accept: "application/json" })), - ) - const data = yield* HttpClientResponse.schemaBodyJson(ScoopManifest)(response) - return data.version - } + if (detectedMethod === "choco") { + const response = yield* httpOk.execute( + HttpClientRequest.get( + "https://community.chocolatey.org/api/v2/Packages?$filter=Id%20eq%20%27opencode%27%20and%20IsLatestVersion&$select=Version", + ).pipe(HttpClientRequest.setHeaders({ Accept: "application/json;odata=verbose" })), + ) + const data = yield* HttpClientResponse.schemaBodyJson(ChocoPackage)(response) + return data.d.results[0].Version + } + if (detectedMethod === "scoop") { const response = yield* httpOk.execute( - HttpClientRequest.get("https://api.github.com/repos/anomalyco/opencode/releases/latest").pipe( - HttpClientRequest.acceptJson, - ), + HttpClientRequest.get( + "https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/opencode.json", + ).pipe(HttpClientRequest.setHeaders({ Accept: "application/json" })), ) - const data = yield* HttpClientResponse.schemaBodyJson(GitHubRelease)(response) - return data.tag_name.replace(/^v/, "") - }, Effect.orDie), - upgrade: Effect.fn("Installation.upgrade")(function* (m: Method, target: string) { - let upgradeResult: { code: ChildProcessSpawner.ExitCode; stdout: string; stderr: string } | undefined - switch (m) { - case "curl": - upgradeResult = yield* upgradeCurl(target) - break - case "npm": - upgradeResult = yield* run(["npm", "install", "-g", `opencode-ai@${target}`]) - break - case "pnpm": - upgradeResult = yield* run(["pnpm", "install", "-g", `opencode-ai@${target}`]) - break - case "bun": - upgradeResult = yield* run(["bun", "install", "-g", `opencode-ai@${target}`]) - break - case "brew": { - const formula = yield* getBrewFormula() - const env = { HOMEBREW_NO_AUTO_UPDATE: "1" } - if (formula.includes("/")) { - const tap = yield* run(["brew", "tap", "anomalyco/tap"], { env }) - if (tap.code !== 0) { - upgradeResult = tap + const data = yield* HttpClientResponse.schemaBodyJson(ScoopManifest)(response) + return data.version + } + + const response = yield* httpOk.execute( + HttpClientRequest.get("https://api.github.com/repos/anomalyco/opencode/releases/latest").pipe( + HttpClientRequest.acceptJson, + ), + ) + const data = yield* HttpClientResponse.schemaBodyJson(GitHubRelease)(response) + return data.tag_name.replace(/^v/, "") + }, Effect.orDie), + upgrade: Effect.fn("Installation.upgrade")(function* (m: Method, target: string) { + let upgradeResult: { code: number; stdout: string; stderr: string } | undefined + switch (m) { + case "curl": + upgradeResult = yield* upgradeCurl(target) + break + case "npm": + upgradeResult = yield* run(["npm", "install", "-g", `opencode-ai@${target}`]) + break + case "pnpm": + upgradeResult = yield* run(["pnpm", "install", "-g", `opencode-ai@${target}`]) + break + case "bun": + upgradeResult = yield* run(["bun", "install", "-g", `opencode-ai@${target}`]) + break + case "brew": { + const formula = yield* getBrewFormula() + const env = { HOMEBREW_NO_AUTO_UPDATE: "1" } + if (formula.includes("/")) { + const tap = yield* run(["brew", "tap", "anomalyco/tap"], { env }) + if (tap.code !== 0) { + upgradeResult = tap + break + } + const repo = yield* text(["brew", "--repo", "anomalyco/tap"]) + const dir = repo.trim() + if (dir) { + const pull = yield* run(["git", "pull", "--ff-only"], { cwd: dir, env }) + if (pull.code !== 0) { + upgradeResult = pull break } - const repo = yield* text(["brew", "--repo", "anomalyco/tap"]) - const dir = repo.trim() - if (dir) { - const pull = yield* run(["git", "pull", "--ff-only"], { cwd: dir, env }) - if (pull.code !== 0) { - upgradeResult = pull - break - } - } } - upgradeResult = yield* run(["brew", "upgrade", formula], { env }) - break } - case "choco": - upgradeResult = yield* run(["choco", "upgrade", "opencode", `--version=${target}`, "-y"]) - break - case "scoop": - upgradeResult = yield* run(["scoop", "install", `opencode@${target}`]) - break - default: - return yield* new UpgradeFailedError({ stderr: `Unknown method: ${m}` }) - } - if (!upgradeResult || upgradeResult.code !== 0) { - const stderr = m === "choco" ? "not running from an elevated command shell" : upgradeResult?.stderr || "" - return yield* new UpgradeFailedError({ stderr }) + upgradeResult = yield* run(["brew", "upgrade", formula], { env }) + break } - log.info("upgraded", { - method: m, - target, - stdout: upgradeResult.stdout, - stderr: upgradeResult.stderr, - }) - yield* text([process.execPath, "--version"]) - }), - } - - return Service.of(result) - }), - ) - -export const defaultLayer = layer.pipe( - Layer.provide(FetchHttpClient.layer), - Layer.provide(CrossSpawnSpawner.defaultLayer), + case "choco": + upgradeResult = yield* run(["choco", "upgrade", "opencode", `--version=${target}`, "-y"]) + break + case "scoop": + upgradeResult = yield* run(["scoop", "install", `opencode@${target}`]) + break + default: + return yield* new UpgradeFailedError({ stderr: `Unknown method: ${m}` }) + } + if (!upgradeResult || upgradeResult.code !== 0) { + const stderr = m === "choco" ? "not running from an elevated command shell" : upgradeResult?.stderr || "" + return yield* new UpgradeFailedError({ stderr }) + } + log.info("upgraded", { + method: m, + target, + stdout: upgradeResult.stdout, + stderr: upgradeResult.stderr, + }) + yield* text([process.execPath, "--version"]) + }), + } + + return Service.of(result) + }), ) +export const defaultLayer = layer.pipe(Layer.provide(FetchHttpClient.layer), Layer.provide(AppProcess.defaultLayer)) + const { runPromise } = makeRuntime(Service, defaultLayer) export const latest = (...args: Parameters) => runPromise((s) => s.latest(...args)) diff --git a/packages/opencode/src/lsp/client.ts b/packages/opencode/src/lsp/client.ts index 809ea95091b6..30577a8f1168 100644 --- a/packages/opencode/src/lsp/client.ts +++ b/packages/opencode/src/lsp/client.ts @@ -7,10 +7,8 @@ import type { Diagnostic as VSCodeDiagnostic } from "vscode-languageserver-types import * as Log from "@opencode-ai/core/util/log" import { Process } from "@/util/process" import { LANGUAGE_EXTENSIONS } from "./language" -import z from "zod" import { Schema } from "effect" import type * as LSPServer from "./server" -import { NamedError } from "@opencode-ai/core/util/error" import { withTimeout } from "../util/timeout" import { Filesystem } from "@/util/filesystem" @@ -32,12 +30,10 @@ export type Info = NonNullable>> export type Diagnostic = VSCodeDiagnostic -export const InitializeError = NamedError.create( - "LSPInitializeError", - z.object({ - serverID: z.string(), - }), -) +export class InitializeError extends Schema.TaggedErrorClass()("LSPInitializeError", { + serverID: Schema.String, + cause: Schema.optional(Schema.Defect), +}) {} export const Event = { Diagnostics: BusEvent.define( @@ -279,12 +275,7 @@ export async function create(input: { serverID: string; server: LSPServer.Handle INITIALIZE_TIMEOUT_MS, ).catch((err) => { logger.error("initialize error", { error: err }) - throw new InitializeError( - { serverID: input.serverID }, - { - cause: err, - }, - ) + throw new InitializeError({ serverID: input.serverID, cause: err }) }) const syncKind = getSyncKind(initialized.capabilities) diff --git a/packages/opencode/src/lsp/lsp.ts b/packages/opencode/src/lsp/lsp.ts index 12ce5f58118a..d74bbae93353 100644 --- a/packages/opencode/src/lsp/lsp.ts +++ b/packages/opencode/src/lsp/lsp.ts @@ -5,16 +5,14 @@ import * as LSPClient from "./client" import path from "path" import { pathToFileURL, fileURLToPath } from "url" import * as LSPServer from "./server" -import z from "zod" import { Config } from "@/config/config" -import { Flag } from "@opencode-ai/core/flag/flag" import { Process } from "@/util/process" import { spawn as lspspawn } from "./launch" import { Effect, Layer, Context, Schema } from "effect" import { InstanceState } from "@/effect/instance-state" import { containsPath } from "@/project/instance-context" import { NonNegativeInt } from "@opencode-ai/core/schema" -import { ZodOverride } from "@opencode-ai/core/effect-zod" +import { RuntimeFlags } from "@/effect/runtime-flags" const log = Log.create({ service: "lsp" }) @@ -56,9 +54,7 @@ export const Status = Schema.Struct({ id: Schema.String, name: Schema.String, root: Schema.String, - status: Schema.Literals(["connected", "error"]).annotate({ - [ZodOverride]: z.union([z.literal("connected"), z.literal("error")]), - }), + status: Schema.Literals(["connected", "error"]), }).annotate({ identifier: "LSPStatus" }) export type Status = typeof Status.Type @@ -102,8 +98,8 @@ const kinds = [ SymbolKind.Enum, ] -const filterExperimentalServers = (servers: Record) => { - if (Flag.OPENCODE_EXPERIMENTAL_LSP_TY) { +const filterExperimentalServers = (servers: Record, flags: RuntimeFlags.Info) => { + if (flags.experimentalLspTy) { if (servers["pyright"]) { log.info("LSP server pyright is disabled because OPENCODE_EXPERIMENTAL_LSP_TY is enabled") delete servers["pyright"] @@ -147,6 +143,7 @@ export const layer = Layer.effect( Service, Effect.gen(function* () { const config = yield* Config.Service + const flags = yield* RuntimeFlags.Service const state = yield* InstanceState.make( Effect.fn("LSP.state")(function* (ctx) { @@ -161,7 +158,7 @@ export const layer = Layer.effect( servers[server.id] = server } - filterExperimentalServers(servers) + filterExperimentalServers(servers, flags) if (cfg.lsp !== true) { for (const [name, item] of Object.entries(cfg.lsp)) { @@ -221,7 +218,7 @@ export const layer = Layer.effect( async function schedule(server: LSPServer.Info, root: string, key: string) { const handle = await server - .spawn(root, ctx) + .spawn(root, ctx, flags) .then((value) => { if (!value) s.broken.add(key) return value @@ -502,7 +499,7 @@ export const layer = Layer.effect( }), ) -export const defaultLayer = layer.pipe(Layer.provide(Config.defaultLayer)) +export const defaultLayer = layer.pipe(Layer.provide(Config.defaultLayer), Layer.provide(RuntimeFlags.defaultLayer)) export * as Diagnostic from "./diagnostic" diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index b8861d1f8167..ad90ef5c786b 100644 --- a/packages/opencode/src/lsp/server.ts +++ b/packages/opencode/src/lsp/server.ts @@ -6,14 +6,14 @@ import * as Log from "@opencode-ai/core/util/log" import { text } from "node:stream/consumers" import fs from "fs/promises" import { Filesystem } from "@/util/filesystem" -import type { InstanceContext } from "../project/instance" -import { Flag } from "@opencode-ai/core/flag/flag" +import type { InstanceContext } from "../project/instance-context" import { Archive } from "@/util/archive" import { Process } from "@/util/process" import { which } from "../util/which" import { Module } from "@opencode-ai/core/util/module" import { spawn } from "./launch" import { Npm } from "@opencode-ai/core/npm" +import type { RuntimeFlags } from "@/effect/runtime-flags" const log = Log.create({ service: "lsp.server" }) const pathExists = async (p: string) => @@ -60,7 +60,7 @@ export interface Info { extensions: string[] global?: boolean root: RootFunction - spawn(root: string, ctx: InstanceContext): Promise + spawn(root: string, ctx: InstanceContext, flags: RuntimeFlags.Info): Promise } export const Deno: Info = { @@ -125,11 +125,11 @@ export const Vue: Info = { id: "vue", extensions: [".vue"], root: NearestRoot(["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("vue-language-server") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("@vue/language-server") if (!resolved) return binary = resolved @@ -154,13 +154,13 @@ export const ESLint: Info = { id: "eslint", root: NearestRoot(["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"]), extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue"], - async spawn(root, ctx) { + async spawn(root, ctx, flags) { const eslint = Module.resolve("eslint", ctx.directory) if (!eslint) return log.info("spawning eslint server") const serverPath = path.join(Global.Path.bin, "vscode-eslint", "server", "out", "eslintServer.js") if (!(await Filesystem.exists(serverPath))) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading and building VS Code ESLint server") const response = await fetch("https://github.com/microsoft/vscode-eslint/archive/refs/heads/main.zip") if (!response.ok) return @@ -350,11 +350,11 @@ export const Gopls: Info = { return NearestRoot(["go.mod", "go.sum"])(file, ctx) }, extensions: [".go"], - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("gopls") if (!bin) { if (!which("go")) return - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("installing gopls") const proc = Process.spawn(["go", "install", "golang.org/x/tools/gopls@latest"], { @@ -385,7 +385,7 @@ export const Rubocop: Info = { id: "ruby-lsp", root: NearestRoot(["Gemfile"]), extensions: [".rb", ".rake", ".gemspec", ".ru"], - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("rubocop") if (!bin) { const ruby = which("ruby") @@ -394,7 +394,7 @@ export const Rubocop: Info = { log.info("Ruby not found, please install Ruby first") return } - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("installing rubocop") const proc = Process.spawn(["gem", "install", "rubocop", "--bindir", Global.Path.bin], { stdout: "pipe", @@ -431,8 +431,8 @@ export const Ty: Info = { "Pipfile", "pyrightconfig.json", ]), - async spawn(root) { - if (!Flag.OPENCODE_EXPERIMENTAL_LSP_TY) { + async spawn(root, _ctx, flags) { + if (!flags.experimentalLspTy) { return undefined } @@ -485,11 +485,11 @@ export const Pyright: Info = { id: "pyright", extensions: [".py", ".pyi"], root: NearestRoot(["pyproject.toml", "setup.py", "setup.cfg", "requirements.txt", "Pipfile", "pyrightconfig.json"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("pyright-langserver") const args = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("pyright", "pyright-langserver") if (!resolved) return binary = resolved @@ -529,7 +529,7 @@ export const ElixirLS: Info = { id: "elixir-ls", extensions: [".ex", ".exs"], root: NearestRoot(["mix.exs", "mix.lock"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("elixir-ls") if (!binary) { const elixirLsPath = path.join(Global.Path.bin, "elixir-ls") @@ -547,7 +547,7 @@ export const ElixirLS: Info = { return } - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading elixir-ls from GitHub releases") const response = await fetch("https://github.com/elixir-lsp/elixir-ls/archive/refs/heads/master.zip") @@ -592,7 +592,7 @@ export const Zls: Info = { id: "zls", extensions: [".zig", ".zon"], root: NearestRoot(["build.zig"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("zls") if (!bin) { @@ -602,7 +602,7 @@ export const Zls: Info = { return } - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading zls from GitHub releases") const releaseResponse = await fetch("https://api.github.com/repos/zigtools/zls/releases/latest") @@ -704,8 +704,8 @@ export const CSharp: Info = { id: "csharp", root: NearestRoot([".slnx", ".sln", ".csproj", "global.json"]), extensions: [".cs", ".csx"], - async spawn(root) { - const bin = await getRoslynLanguageServer() + async spawn(root, _ctx, flags) { + const bin = await getRoslynLanguageServer(flags.disableLspDownload) if (!bin) return return { @@ -720,8 +720,8 @@ export const Razor: Info = { id: "razor", root: NearestRoot([".slnx", ".sln", ".csproj", "global.json"]), extensions: [".razor", ".cshtml"], - async spawn(root) { - const bin = await getRoslynLanguageServer() + async spawn(root, _ctx, flags) { + const bin = await getRoslynLanguageServer(flags.disableLspDownload) if (!bin) return const razor = await findVscodeRazorExtension() @@ -752,26 +752,26 @@ export const Razor: Info = { let roslynLanguageServerInstall: Promise | undefined -async function getRoslynLanguageServer() { +async function getRoslynLanguageServer(disableLspDownload: boolean) { const existing = which("roslyn-language-server") if (existing) return existing const global = await roslynLanguageServerGlobalPath() if (global) return global - roslynLanguageServerInstall ||= installRoslynLanguageServer().finally(() => { + roslynLanguageServerInstall ||= installRoslynLanguageServer(disableLspDownload).finally(() => { roslynLanguageServerInstall = undefined }) return roslynLanguageServerInstall } -async function installRoslynLanguageServer() { +async function installRoslynLanguageServer(disableLspDownload: boolean) { if (!which("dotnet")) { log.error(".NET SDK is required to install roslyn-language-server") return } - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (disableLspDownload) return log.info("installing roslyn-language-server via dotnet tool") const proc = Process.spawn(["dotnet", "tool", "install", "--global", "roslyn-language-server", "--prerelease"], { stdout: "pipe", @@ -849,7 +849,7 @@ export const FSharp: Info = { id: "fsharp", root: NearestRoot([".slnx", ".sln", ".fsproj", "global.json"]), extensions: [".fs", ".fsi", ".fsx", ".fsscript"], - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("fsautocomplete") if (!bin) { if (!which("dotnet")) { @@ -857,7 +857,7 @@ export const FSharp: Info = { return } - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("installing fsautocomplete via dotnet tool") const proc = Process.spawn(["dotnet", "tool", "install", "fsautocomplete", "--tool-path", Global.Path.bin], { stdout: "pipe", @@ -966,7 +966,7 @@ export const Clangd: Info = { id: "clangd", root: NearestRoot(["compile_commands.json", "compile_flags.txt", ".clangd"]), extensions: [".c", ".cpp", ".cc", ".cxx", ".c++", ".h", ".hpp", ".hh", ".hxx", ".h++"], - async spawn(root) { + async spawn(root, _ctx, flags) { const args = ["--background-index", "--clang-tidy"] const fromPath = which("clangd") if (fromPath) { @@ -1001,7 +1001,7 @@ export const Clangd: Info = { } } - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading clangd from GitHub releases") const releaseResponse = await fetch("https://api.github.com/repos/clangd/clangd/releases/latest") @@ -1112,11 +1112,11 @@ export const Svelte: Info = { id: "svelte", extensions: [".svelte"], root: NearestRoot(["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("svelteserver") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("svelte-language-server") if (!resolved) return binary = resolved @@ -1139,7 +1139,7 @@ export const Astro: Info = { id: "astro", extensions: [".astro"], root: NearestRoot(["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"]), - async spawn(root, ctx) { + async spawn(root, ctx, flags) { const tsserver = Module.resolve("typescript/lib/tsserver.js", ctx.directory) if (!tsserver) { log.info("typescript not found, required for Astro language server") @@ -1150,7 +1150,7 @@ export const Astro: Info = { let binary = which("astro-ls") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("@astrojs/language-server") if (!resolved) return binary = resolved @@ -1200,7 +1200,7 @@ export const JDTLS: Info = { if (settingsRoot) return settingsRoot }, extensions: [".java"], - async spawn(root) { + async spawn(root, _ctx, flags) { const java = which("java") if (!java) { log.error("Java 21 or newer is required to run the JDTLS. Please install it first.") @@ -1218,7 +1218,7 @@ export const JDTLS: Info = { const launcherDir = path.join(distPath, "plugins") const installed = await pathExists(launcherDir) if (!installed) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("Downloading JDTLS LSP server.") await fs.mkdir(distPath, { recursive: true }) const releaseURL = @@ -1310,13 +1310,13 @@ export const KotlinLS: Info = { // 4) Maven fallback return NearestRoot(["pom.xml"])(file, ctx) }, - async spawn(root) { + async spawn(root, _ctx, flags) { const distPath = path.join(Global.Path.bin, "kotlin-ls") const launcherScript = process.platform === "win32" ? path.join(distPath, "kotlin-lsp.cmd") : path.join(distPath, "kotlin-lsp.sh") const installed = await Filesystem.exists(launcherScript) if (!installed) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("Downloading Kotlin Language Server from GitHub.") const releaseResponse = await fetch("https://api.github.com/repos/Kotlin/kotlin-lsp/releases/latest") @@ -1397,11 +1397,11 @@ export const YamlLS: Info = { id: "yaml-ls", extensions: [".yaml", ".yml"], root: NearestRoot(["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("yaml-language-server") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("yaml-language-server") if (!resolved) return binary = resolved @@ -1431,11 +1431,11 @@ export const LuaLS: Info = { "selene.yml", ]), extensions: [".lua"], - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("lua-language-server") if (!bin) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading lua-language-server from GitHub releases") const releaseResponse = await fetch("https://api.github.com/repos/LuaLS/lua-language-server/releases/latest") @@ -1564,11 +1564,11 @@ export const PHPIntelephense: Info = { id: "php intelephense", extensions: [".php"], root: NearestRoot(["composer.json", "composer.lock", ".php-version"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("intelephense") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("intelephense") if (!resolved) return binary = resolved @@ -1648,11 +1648,11 @@ export const BashLS: Info = { id: "bash", extensions: [".sh", ".bash", ".zsh", ".ksh"], root: async (_file, ctx) => ctx.directory, - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("bash-language-server") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("bash-language-server") if (!resolved) return binary = resolved @@ -1674,11 +1674,11 @@ export const TerraformLS: Info = { id: "terraform", extensions: [".tf", ".tfvars"], root: NearestRoot([".terraform.lock.hcl", "terraform.tfstate", "*.tf"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("terraform-ls") if (!bin) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading terraform-ls from HashiCorp releases") const releaseResponse = await fetch("https://api.releases.hashicorp.com/v1/releases/terraform-ls/latest") @@ -1755,11 +1755,11 @@ export const TexLab: Info = { id: "texlab", extensions: [".tex", ".bib"], root: NearestRoot([".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("texlab") if (!bin) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading texlab from GitHub releases") const response = await fetch("https://api.github.com/repos/latex-lsp/texlab/releases/latest") @@ -1843,11 +1843,11 @@ export const DockerfileLS: Info = { id: "dockerfile", extensions: [".dockerfile", "Dockerfile"], root: async (_file, ctx) => ctx.directory, - async spawn(root) { + async spawn(root, _ctx, flags) { let binary = which("docker-langserver") const args: string[] = [] if (!binary) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return const resolved = await Npm.which("dockerfile-language-server-nodejs") if (!resolved) return binary = resolved @@ -1939,11 +1939,11 @@ export const Tinymist: Info = { id: "tinymist", extensions: [".typ", ".typc"], root: NearestRoot(["typst.toml"]), - async spawn(root) { + async spawn(root, _ctx, flags) { let bin = which("tinymist") if (!bin) { - if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return + if (flags.disableLspDownload) return log.info("downloading tinymist from GitHub releases") const response = await fetch("https://api.github.com/repos/Myriad-Dreamin/tinymist/releases/latest") diff --git a/packages/opencode/src/mcp/auth.ts b/packages/opencode/src/mcp/auth.ts index b07d59870bcb..be19be0af04e 100644 --- a/packages/opencode/src/mcp/auth.ts +++ b/packages/opencode/src/mcp/auth.ts @@ -1,33 +1,35 @@ import path from "path" -import z from "zod" import { Global } from "@opencode-ai/core/global" -import { Effect, Layer, Context } from "effect" +import { Effect, Layer, Context, Option, Schema } from "effect" import { AppFileSystem } from "@opencode-ai/core/filesystem" -export const Tokens = z.object({ - accessToken: z.string(), - refreshToken: z.string().optional(), - expiresAt: z.number().optional(), - scope: z.string().optional(), +export const Tokens = Schema.Struct({ + accessToken: Schema.mutableKey(Schema.String), + refreshToken: Schema.mutableKey(Schema.optional(Schema.String)), + expiresAt: Schema.mutableKey(Schema.optional(Schema.Number)), + scope: Schema.mutableKey(Schema.optional(Schema.String)), }) -export type Tokens = z.infer +export type Tokens = Schema.Schema.Type -export const ClientInfo = z.object({ - clientId: z.string(), - clientSecret: z.string().optional(), - clientIdIssuedAt: z.number().optional(), - clientSecretExpiresAt: z.number().optional(), +export const ClientInfo = Schema.Struct({ + clientId: Schema.mutableKey(Schema.String), + clientSecret: Schema.mutableKey(Schema.optional(Schema.String)), + clientIdIssuedAt: Schema.mutableKey(Schema.optional(Schema.Number)), + clientSecretExpiresAt: Schema.mutableKey(Schema.optional(Schema.Number)), }) -export type ClientInfo = z.infer - -export const Entry = z.object({ - tokens: Tokens.optional(), - clientInfo: ClientInfo.optional(), - codeVerifier: z.string().optional(), - oauthState: z.string().optional(), - serverUrl: z.string().optional(), +export type ClientInfo = Schema.Schema.Type + +export const Entry = Schema.Struct({ + tokens: Schema.mutableKey(Schema.optional(Tokens)), + clientInfo: Schema.mutableKey(Schema.optional(ClientInfo)), + codeVerifier: Schema.mutableKey(Schema.optional(Schema.String)), + oauthState: Schema.mutableKey(Schema.optional(Schema.String)), + serverUrl: Schema.mutableKey(Schema.optional(Schema.String)), }) -export type Entry = z.infer +export type Entry = Schema.Schema.Type + +const decodeAuthData = Schema.decodeUnknownOption(Schema.Record(Schema.String, Entry)) +type AuthData = Record const filepath = path.join(Global.Path.data, "mcp-auth.json") @@ -56,8 +58,8 @@ export const layer = Layer.effect( const all = Effect.fn("McpAuth.all")(function* () { return yield* fs.readJson(filepath).pipe( - Effect.map((data) => data as Record), - Effect.catch(() => Effect.succeed({} as Record)), + Effect.map((data): AuthData => Option.getOrElse(decodeAuthData(data), () => ({}) as AuthData) as AuthData), + Effect.catch(() => Effect.succeed({} as AuthData)), ) }) @@ -93,7 +95,7 @@ export const layer = Layer.effect( yield* set(mcpName, entry, serverUrl) }) - const clearField = (field: K, spanName: string) => + const clearField = (field: keyof Entry, spanName: string) => Effect.fn(`McpAuth.${spanName}`)(function* (mcpName: string) { const entry = yield* get(mcpName) if (entry) { diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts index db43412f73d2..832811b281a5 100644 --- a/packages/opencode/src/mcp/index.ts +++ b/packages/opencode/src/mcp/index.ts @@ -6,6 +6,7 @@ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js" import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js" import { CallToolResultSchema, + ListToolsResultSchema, ToolSchema, type Tool as MCPToolDef, ToolListChangedNotificationSchema, @@ -14,7 +15,6 @@ import { Config } from "@/config/config" import { ConfigMCP } from "../config/mcp" import * as Log from "@opencode-ai/core/util/log" import { NamedError } from "@opencode-ai/core/util/error" -import z from "zod/v4" import { Installation } from "../installation" import { InstallationVersion } from "@opencode-ai/core/installation/version" import { withTimeout } from "@/util/timeout" @@ -35,13 +35,8 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" const log = Log.create({ service: "mcp" }) const DEFAULT_TIMEOUT = 30_000 -const TolerantToolSchema = ToolSchema.extend({ - outputSchema: z.unknown().optional(), -}) - -const TolerantListToolsResultSchema = z.looseObject({ - tools: z.array(TolerantToolSchema), - nextCursor: z.string().optional(), +const TolerantListToolsResultSchema = ListToolsResultSchema.extend({ + tools: ToolSchema.omit({ outputSchema: true }).array(), }) export const Resource = Schema.Struct({ @@ -68,12 +63,9 @@ export const BrowserOpenFailed = BusEvent.define( }), ) -export const Failed = NamedError.create( - "MCPFailed", - z.object({ - name: z.string(), - }), -) +export const Failed = NamedError.create("MCPFailed", { + name: Schema.String, +}) type MCPClient = Client @@ -140,7 +132,10 @@ function listTools(key: string, client: MCPClient, timeout: number) { log.warn("failed to validate MCP tool output schemas, retrying without output schema validation", { key, error }) return Effect.tryPromise({ - try: () => client.request({ method: "tools/list" }, TolerantListToolsResultSchema, { timeout }), + try: () => + client.request({ method: "tools/list" }, TolerantListToolsResultSchema, { + timeout, + }), catch: (err) => (err instanceof Error ? err : new Error(String(err))), }).pipe( Effect.map((result) => diff --git a/packages/opencode/src/patch/index.ts b/packages/opencode/src/patch/index.ts index fd5fff5625bd..42b26fe96309 100644 --- a/packages/opencode/src/patch/index.ts +++ b/packages/opencode/src/patch/index.ts @@ -1,18 +1,16 @@ -import z from "zod" +import { Effect, Schema } from "effect" import * as path from "path" -import * as fs from "fs/promises" -import { readFileSync } from "fs" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import * as Log from "@opencode-ai/core/util/log" import * as Bom from "../util/bom" const log = Log.create({ service: "patch" }) -// Schema definitions -export const PatchSchema = z.object({ - patchText: z.string().describe("The full patch text that describes all changes to be made"), +export const PatchSchema = Schema.Struct({ + patchText: Schema.String.annotate({ description: "The full patch text that describes all changes to be made" }), }) -export type PatchParams = z.infer +export type PatchParams = Schema.Schema.Type // Core types matching the Rust implementation export interface ApplyPatchArgs { @@ -309,14 +307,12 @@ interface ApplyPatchFileUpdate { bom: boolean } -export function deriveNewContentsFromChunks(filePath: string, chunks: UpdateFileChunk[]): ApplyPatchFileUpdate { - // Read original file content - let originalContent: ReturnType - try { - originalContent = Bom.split(readFileSync(filePath, "utf-8")) - } catch (error) { - throw new Error(`Failed to read file ${filePath}: ${error}`, { cause: error }) - } +export function deriveNewContentsFromChunks( + filePath: string, + chunks: UpdateFileChunk[], + originalText: string, +): ApplyPatchFileUpdate { + const originalContent = Bom.split(originalText) let originalLines = originalContent.text.split("\n") @@ -424,11 +420,11 @@ function applyReplacements(lines: string[], replacements: Array<[number, number, // Normalize Unicode punctuation to ASCII equivalents (like Rust's normalize_unicode) function normalizeUnicode(str: string): string { return str - .replace(/[\u2018\u2019\u201A\u201B]/g, "'") // single quotes - .replace(/[\u201C\u201D\u201E\u201F]/g, '"') // double quotes - .replace(/[\u2010\u2011\u2012\u2013\u2014\u2015]/g, "-") // dashes - .replace(/\u2026/g, "...") // ellipsis - .replace(/\u00A0/g, " ") // non-breaking space + .replace(/[‘’‚‛]/g, "'") // single quotes + .replace(/[“”„‟]/g, '"') // double quotes + .replace(/[‐‑‒–—―]/g, "-") // dashes + .replace(/…/g, "...") // ellipsis + .replace(/ /g, " ") // non-breaking space } type Comparator = (a: string, b: string) => boolean @@ -518,77 +514,71 @@ function generateUnifiedDiff(oldContent: string, newContent: string): string { } // Apply hunks to filesystem -export async function applyHunksToFiles(hunks: Hunk[]): Promise { +export const applyHunksToFiles = Effect.fn("Patch.applyHunksToFiles")(function* (hunks: Hunk[]) { if (hunks.length === 0) { - throw new Error("No files were modified.") + return yield* Effect.fail(new Error("No files were modified.")) } + const fs = yield* AppFileSystem.Service + const added: string[] = [] const modified: string[] = [] const deleted: string[] = [] for (const hunk of hunks) { switch (hunk.type) { - case "add": - // Create parent directories - const addDir = path.dirname(hunk.path) - if (addDir !== "." && addDir !== "/") { - await fs.mkdir(addDir, { recursive: true }) - } - - await fs.writeFile(hunk.path, hunk.contents, "utf-8") + case "add": { + yield* fs.writeWithDirs(hunk.path, hunk.contents) added.push(hunk.path) log.info(`Added file: ${hunk.path}`) break + } - case "delete": - await fs.unlink(hunk.path) + case "delete": { + yield* fs.remove(hunk.path) deleted.push(hunk.path) log.info(`Deleted file: ${hunk.path}`) break + } - case "update": - const fileUpdate = deriveNewContentsFromChunks(hunk.path, hunk.chunks) + case "update": { + const originalText = yield* fs.readFileString(hunk.path) + const fileUpdate = deriveNewContentsFromChunks(hunk.path, hunk.chunks, originalText) if (hunk.move_path) { - // Handle file move - const moveDir = path.dirname(hunk.move_path) - if (moveDir !== "." && moveDir !== "/") { - await fs.mkdir(moveDir, { recursive: true }) - } - - await fs.writeFile(hunk.move_path, Bom.join(fileUpdate.content, fileUpdate.bom), "utf-8") - await fs.unlink(hunk.path) + yield* fs.writeWithDirs(hunk.move_path, Bom.join(fileUpdate.content, fileUpdate.bom)) + yield* fs.remove(hunk.path) modified.push(hunk.move_path) log.info(`Moved file: ${hunk.path} -> ${hunk.move_path}`) } else { - // Regular update - await fs.writeFile(hunk.path, Bom.join(fileUpdate.content, fileUpdate.bom), "utf-8") + yield* fs.writeWithDirs(hunk.path, Bom.join(fileUpdate.content, fileUpdate.bom)) modified.push(hunk.path) log.info(`Updated file: ${hunk.path}`) } break + } } } - return { added, modified, deleted } -} + return { added, modified, deleted } satisfies AffectedPaths +}) // Main patch application function -export async function applyPatch(patchText: string): Promise { +export const applyPatch = Effect.fn("Patch.applyPatch")(function* (patchText: string) { const { hunks } = parsePatch(patchText) - return applyHunksToFiles(hunks) -} + return yield* applyHunksToFiles(hunks) +}) -// Async version of maybeParseApplyPatchVerified -export async function maybeParseApplyPatchVerified( - argv: string[], - cwd: string, -): Promise< +type MaybeApplyPatchVerifiedResult = | { type: MaybeApplyPatchVerified.Body; action: ApplyPatchAction } | { type: MaybeApplyPatchVerified.CorrectnessError; error: Error } | { type: MaybeApplyPatchVerified.NotApplyPatch } -> { + +// Effectful verified-parse: needs AppFileSystem.Service to read existing files +export const maybeParseApplyPatchVerified = Effect.fn("Patch.maybeParseApplyPatchVerified")(function* ( + argv: string[], + cwd: string, +) { // Detect implicit patch invocation (raw patch without apply_patch command) if (argv.length === 1) { try { @@ -596,7 +586,7 @@ export async function maybeParseApplyPatchVerified( return { type: MaybeApplyPatchVerified.CorrectnessError, error: new Error(ApplyPatchError.ImplicitInvocation), - } + } satisfies MaybeApplyPatchVerifiedResult } catch { // Not a patch, continue } @@ -605,8 +595,9 @@ export async function maybeParseApplyPatchVerified( const result = maybeParseApplyPatch(argv) switch (result.type) { - case MaybeApplyPatch.Body: - const { args } = result + case MaybeApplyPatch.Body: { + const fs = yield* AppFileSystem.Service + const args = result.args const effectiveCwd = args.workdir ? path.resolve(cwd, args.workdir) : cwd const changes = new Map() @@ -624,27 +615,39 @@ export async function maybeParseApplyPatchVerified( }) break - case "delete": - // For delete, we need to read the current content + case "delete": { const deletePath = path.resolve(effectiveCwd, hunk.path) - try { - const content = await fs.readFile(deletePath, "utf-8") - changes.set(resolvedPath, { - type: "delete", - content, - }) - } catch { + const content = yield* fs.readFileString(deletePath).pipe(Effect.catch(() => Effect.succeed(undefined))) + if (content === undefined) { return { type: MaybeApplyPatchVerified.CorrectnessError, error: new Error(`Failed to read file for deletion: ${deletePath}`), - } + } satisfies MaybeApplyPatchVerifiedResult } + changes.set(resolvedPath, { + type: "delete", + content, + }) break + } - case "update": + case "update": { const updatePath = path.resolve(effectiveCwd, hunk.path) + const originalText = yield* fs + .readFileString(updatePath) + .pipe( + Effect.catch((cause) => + Effect.succeed(new Error(`Failed to read file ${updatePath}: ${cause}`, { cause })), + ), + ) + if (originalText instanceof Error) { + return { + type: MaybeApplyPatchVerified.CorrectnessError, + error: originalText, + } satisfies MaybeApplyPatchVerifiedResult + } try { - const fileUpdate = deriveNewContentsFromChunks(updatePath, hunk.chunks) + const fileUpdate = deriveNewContentsFromChunks(updatePath, hunk.chunks, originalText) changes.set(resolvedPath, { type: "update", unified_diff: fileUpdate.unified_diff, @@ -655,9 +658,10 @@ export async function maybeParseApplyPatchVerified( return { type: MaybeApplyPatchVerified.CorrectnessError, error: error as Error, - } + } satisfies MaybeApplyPatchVerifiedResult } break + } } } @@ -668,17 +672,18 @@ export async function maybeParseApplyPatchVerified( patch: args.patch, cwd: effectiveCwd, }, - } + } satisfies MaybeApplyPatchVerifiedResult + } case MaybeApplyPatch.PatchParseError: return { type: MaybeApplyPatchVerified.CorrectnessError, error: result.error, - } + } satisfies MaybeApplyPatchVerifiedResult case MaybeApplyPatch.NotApplyPatch: - return { type: MaybeApplyPatchVerified.NotApplyPatch } + return { type: MaybeApplyPatchVerified.NotApplyPatch } satisfies MaybeApplyPatchVerifiedResult } -} +}) export * as Patch from "." diff --git a/packages/opencode/src/plugin/digitalocean.ts b/packages/opencode/src/plugin/digitalocean.ts new file mode 100644 index 000000000000..19d1364875d9 --- /dev/null +++ b/packages/opencode/src/plugin/digitalocean.ts @@ -0,0 +1,411 @@ +import type { Hooks, PluginInput } from "@opencode-ai/plugin" +import type { Model } from "@opencode-ai/sdk/v2" +import * as Log from "@opencode-ai/core/util/log" +import { InstallationVersion } from "@opencode-ai/core/installation/version" +import { createServer } from "http" + +const log = Log.create({ service: "plugin.digitalocean" }) + +const DO_OAUTH_CLIENT_ID = "b1a6c5158156caac821fd1b30253ca8acb52454a48fa744420e41889cb589f82" +const DO_AUTHORIZE_URL = "https://cloud.digitalocean.com/v1/oauth/authorize" +const DO_API_BASE = "https://api.digitalocean.com" +const DO_INFERENCE_BASE = "https://inference.do-ai.run/v1" +const OAUTH_PORT = 1456 +const OAUTH_REDIRECT_PATH = "/auth/callback" +const OAUTH_TOKEN_PATH = "/auth/token" +const ROUTER_REFRESH_INTERVAL_MS = 5 * 60 * 1000 +const MAK_NAME_PREFIX = "opencode-oauth" + +interface ImplicitTokenPayload { + access_token: string + expires_in: number + state: string +} + +interface PendingOAuth { + state: string + resolve: (tokens: ImplicitTokenPayload) => void + reject: (error: Error) => void +} + +interface ApiKeyInfo { + uuid: string + name: string + secret_key: string +} + +interface RouterEntry { + name: string + uuid?: string + description?: string +} + +let oauthServer: ReturnType | undefined +let pendingOAuth: PendingOAuth | undefined + +function generateState(): string { + const bytes = crypto.getRandomValues(new Uint8Array(32)) + return Array.from(bytes) + .map((b) => b.toString(16).padStart(2, "0")) + .join("") +} + +function redirectUri(): string { + return `http://localhost:${OAUTH_PORT}${OAUTH_REDIRECT_PATH}` +} + +function buildAuthorizeUrl(state: string): string { + const params = new URLSearchParams({ + response_type: "token", + client_id: DO_OAUTH_CLIENT_ID, + redirect_uri: redirectUri(), + scope: "genai:create genai:read", + state, + }) + return `${DO_AUTHORIZE_URL}?${params.toString()}` +} + +const HTML_CALLBACK = ` + + + + OpenCode - DigitalOcean Authorization + + + +
+

Finishing sign-in...

+

You can close this window once it says you're signed in.

+
+ + +` + +async function startOAuthServer(): Promise { + if (oauthServer) return + oauthServer = createServer((req, res) => { + const url = new URL(req.url || "/", `http://localhost:${OAUTH_PORT}`) + + if (req.method === "GET" && url.pathname === OAUTH_REDIRECT_PATH) { + res.writeHead(200, { "Content-Type": "text/html" }) + res.end(HTML_CALLBACK) + return + } + + if (req.method === "POST" && url.pathname === OAUTH_TOKEN_PATH) { + const chunks: Buffer[] = [] + req.on("data", (chunk: Buffer) => chunks.push(chunk)) + req.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8") + let body: Record = {} + try { + body = raw ? JSON.parse(raw) : {} + } catch { + body = {} + } + if (!pendingOAuth) { + res.writeHead(409, { "Content-Type": "application/json" }) + res.end(JSON.stringify({ error: "no_pending_oauth" })) + return + } + if (body.error) { + const message = body.error_description || body.error || "OAuth error" + pendingOAuth.reject(new Error(String(message))) + pendingOAuth = undefined + res.writeHead(200, { "Content-Type": "application/json" }) + res.end(JSON.stringify({ ok: true })) + return + } + if (!body.access_token) { + pendingOAuth.reject(new Error("Missing access_token in callback")) + pendingOAuth = undefined + res.writeHead(400, { "Content-Type": "application/json" }) + res.end(JSON.stringify({ error: "missing_access_token" })) + return + } + if (body.state !== pendingOAuth.state) { + pendingOAuth.reject(new Error("Invalid state - potential CSRF attack")) + pendingOAuth = undefined + res.writeHead(400, { "Content-Type": "application/json" }) + res.end(JSON.stringify({ error: "invalid_state" })) + return + } + const expires = parseInt(body.expires_in || "0", 10) + pendingOAuth.resolve({ + access_token: body.access_token, + expires_in: Number.isFinite(expires) && expires > 0 ? expires : 60 * 60 * 24 * 30, + state: body.state, + }) + pendingOAuth = undefined + res.writeHead(200, { "Content-Type": "application/json" }) + res.end(JSON.stringify({ ok: true })) + }) + return + } + + res.writeHead(404) + res.end("Not found") + }) + + await new Promise((resolve, reject) => { + oauthServer!.listen(OAUTH_PORT, () => { + log.info("digitalocean oauth server started", { port: OAUTH_PORT }) + resolve() + }) + oauthServer!.on("error", reject) + }) +} + +function stopOAuthServer() { + if (!oauthServer) return + oauthServer.close(() => log.info("digitalocean oauth server stopped")) + oauthServer = undefined +} + +function waitForOAuthCallback(state: string): Promise { + return new Promise((resolve, reject) => { + const timeout = setTimeout( + () => { + if (pendingOAuth) { + pendingOAuth = undefined + reject(new Error("OAuth callback timeout - authorization took too long")) + } + }, + 5 * 60 * 1000, + ) + pendingOAuth = { + state, + resolve: (tokens) => { + clearTimeout(timeout) + resolve(tokens) + }, + reject: (error) => { + clearTimeout(timeout) + reject(error) + }, + } + }) +} + +async function createModelAccessKey(bearer: string): Promise { + // Suffix-on-collision strategy keeps re-`/connect` non-destructive. + const name = `${MAK_NAME_PREFIX}-${Math.floor(Date.now() / 1000)}` + const res = await fetch(`${DO_API_BASE}/v2/gen-ai/models/api_keys`, { + method: "POST", + headers: { + Authorization: `Bearer ${bearer}`, + "Content-Type": "application/json", + "User-Agent": `opencode/${InstallationVersion}`, + }, + body: JSON.stringify({ name }), + }) + if (!res.ok) { + const body = await res.text().catch(() => "") + throw new Error(`Failed to create Model Access Key (${res.status}): ${body}`) + } + const data = (await res.json()) as { api_key_info?: ApiKeyInfo } + if (!data.api_key_info?.secret_key) throw new Error("Model Access Key response missing secret_key") + return data.api_key_info +} + +async function listRouters( + bearer: string, +): Promise<{ ok: true; routers: RouterEntry[] } | { ok: false; status: number }> { + const res = await fetch(`${DO_API_BASE}/v2/gen-ai/models/routers`, { + headers: { + Authorization: `Bearer ${bearer}`, + Accept: "application/json", + "User-Agent": `opencode/${InstallationVersion}`, + }, + signal: AbortSignal.timeout(10_000), + }).catch(() => undefined) + if (!res) return { ok: false, status: 0 } + if (!res.ok) return { ok: false, status: res.status } + const body = (await res.json().catch(() => undefined)) as { model_routers?: RouterEntry[] } | undefined + return { ok: true, routers: body?.model_routers ?? [] } +} + +function routerModel(router: RouterEntry, providerID: string): Model { + const id = `router:${router.name}` + return { + id, + providerID, + name: router.name, + family: "digitalocean-inference-routers", + api: { id, url: DO_INFERENCE_BASE, npm: "@ai-sdk/openai-compatible" }, + status: "active", + headers: {}, + options: {}, + cost: { input: 0, output: 0, cache: { read: 0, write: 0 } }, + limit: { context: 128_000, output: 8_192 }, + capabilities: { + temperature: true, + reasoning: false, + attachment: false, + toolcall: true, + input: { text: true, audio: false, image: false, video: false, pdf: false }, + output: { text: true, audio: false, image: false, video: false, pdf: false }, + interleaved: false, + }, + release_date: "", + variants: {}, + } +} + +function parseRoutersJSON(raw: string | undefined): RouterEntry[] { + if (!raw) return [] + try { + const parsed = JSON.parse(raw) + if (!Array.isArray(parsed)) return [] + return parsed.flatMap((r) => + r && typeof r.name === "string" ? [{ name: r.name, uuid: r.uuid, description: r.description }] : [], + ) + } catch { + return [] + } +} + +export async function DigitalOceanAuthPlugin(input: PluginInput): Promise { + return { + provider: { + id: "digitalocean", + async models(provider, ctx) { + const baseModels = provider.models + if (ctx.auth?.type !== "api") return baseModels + + const metadata = ctx.auth.metadata ?? {} + const oauthAccess = metadata["oauth_access"] + const oauthExpires = parseInt(metadata["oauth_expires"] || "0", 10) + const fetchedAt = parseInt(metadata["routers_fetched_at"] || "0", 10) + const cached = parseRoutersJSON(metadata["routers"]) + + let routers = cached + const stale = Date.now() - fetchedAt > ROUTER_REFRESH_INTERVAL_MS + const bearerValid = oauthAccess && oauthExpires > Date.now() + + if (bearerValid && stale) { + const result = await listRouters(oauthAccess) + if (result.ok) { + routers = result.routers + const updated: Record = { + ...metadata, + routers: JSON.stringify(routers.map((r) => ({ name: r.name, uuid: r.uuid, description: r.description }))), + routers_fetched_at: String(Date.now()), + } + await input.client.auth + .set({ + path: { id: "digitalocean" }, + body: { type: "api", key: ctx.auth.key, metadata: updated }, + }) + .catch((err) => log.warn("failed to persist refreshed routers", { error: err })) + } else if (result.status === 401 || result.status === 403) { + log.warn("digitalocean oauth bearer rejected; using cached routers", { status: result.status }) + } else if (result.status !== 0) { + log.warn("digitalocean router refresh failed", { status: result.status }) + } + } + + const merged: Record = { ...baseModels } + for (const router of routers) { + const id = `router:${router.name}` + if (merged[id]) continue + merged[id] = routerModel(router, "digitalocean") + } + return merged + }, + }, + auth: { + provider: "digitalocean", + methods: [ + { + type: "oauth", + label: "Login with DigitalOcean", + async authorize() { + await startOAuthServer() + const state = generateState() + const callbackPromise = waitForOAuthCallback(state) + return { + url: buildAuthorizeUrl(state), + instructions: + "Sign in to DigitalOcean in your browser. OpenCode will create a Model Access Key named opencode-oauth-* and load your Inference Routers. Re-run /connect to refresh routers later.", + method: "auto" as const, + async callback() { + try { + const tokens = await callbackPromise + const apiKeyInfo = await createModelAccessKey(tokens.access_token) + const routerResult = await listRouters(tokens.access_token) + const routers = routerResult.ok ? routerResult.routers : [] + if (!routerResult.ok) { + log.warn("digitalocean initial router fetch failed", { status: routerResult.status }) + } + return { + type: "success" as const, + provider: "digitalocean", + key: apiKeyInfo.secret_key, + metadata: { + mak_uuid: apiKeyInfo.uuid, + mak_name: apiKeyInfo.name, + oauth_access: tokens.access_token, + oauth_expires: String(Date.now() + tokens.expires_in * 1000), + routers: JSON.stringify( + routers.map((r) => ({ name: r.name, uuid: r.uuid, description: r.description })), + ), + routers_fetched_at: String(Date.now()), + }, + } + } catch (err) { + log.error("digitalocean oauth callback failed", { error: err }) + return { type: "failed" as const } + } finally { + stopOAuthServer() + } + }, + } + }, + }, + { + type: "api", + label: "Paste Model Access Key", + }, + ], + }, + } +} diff --git a/packages/opencode/src/plugin/github-copilot/models.ts b/packages/opencode/src/plugin/github-copilot/models.ts index 8fa8dee763af..a488be4a4853 100644 --- a/packages/opencode/src/plugin/github-copilot/models.ts +++ b/packages/opencode/src/plugin/github-copilot/models.ts @@ -1,50 +1,51 @@ -import { z } from "zod" import type { Model } from "@opencode-ai/sdk/v2" +import { Schema } from "effect" -export const schema = z.object({ - data: z.array( - z.object({ - model_picker_enabled: z.boolean(), - id: z.string(), - name: z.string(), +export const schema = Schema.Struct({ + data: Schema.Array( + Schema.Struct({ + model_picker_enabled: Schema.Boolean, + id: Schema.String, + name: Schema.String, // every version looks like: `{model.id}-YYYY-MM-DD` - version: z.string(), - supported_endpoints: z.array(z.string()).optional(), - policy: z - .object({ - state: z.string().optional(), - }) - .optional(), - capabilities: z.object({ - family: z.string(), - limits: z.object({ - max_context_window_tokens: z.number(), - max_output_tokens: z.number(), - max_prompt_tokens: z.number(), - vision: z - .object({ - max_prompt_image_size: z.number(), - max_prompt_images: z.number(), - supported_media_types: z.array(z.string()), - }) - .optional(), + version: Schema.String, + supported_endpoints: Schema.optional(Schema.Array(Schema.String)), + policy: Schema.optional( + Schema.Struct({ + state: Schema.optional(Schema.String), }), - supports: z.object({ - adaptive_thinking: z.boolean().optional(), - max_thinking_budget: z.number().optional(), - min_thinking_budget: z.number().optional(), - reasoning_effort: z.array(z.string()).optional(), - streaming: z.boolean(), - structured_outputs: z.boolean().optional(), - tool_calls: z.boolean(), - vision: z.boolean().optional(), + ), + capabilities: Schema.Struct({ + family: Schema.String, + limits: Schema.Struct({ + max_context_window_tokens: Schema.Number, + max_output_tokens: Schema.Number, + max_prompt_tokens: Schema.Number, + vision: Schema.optional( + Schema.Struct({ + max_prompt_image_size: Schema.Number, + max_prompt_images: Schema.Number, + supported_media_types: Schema.Array(Schema.String), + }), + ), + }), + supports: Schema.Struct({ + adaptive_thinking: Schema.optional(Schema.Boolean), + max_thinking_budget: Schema.optional(Schema.Number), + min_thinking_budget: Schema.optional(Schema.Number), + reasoning_effort: Schema.optional(Schema.Array(Schema.String)), + streaming: Schema.Boolean, + structured_outputs: Schema.optional(Schema.Boolean), + tool_calls: Schema.Boolean, + vision: Schema.optional(Schema.Boolean), }), }), }), ), }) -type Item = z.infer["data"][number] +type Item = Schema.Schema.Type["data"][number] +const decodeModels = Schema.decodeUnknownSync(schema) function build(key: string, remote: Item, url: string, prev?: Model): Model { const reasoning = @@ -165,7 +166,7 @@ export async function get( if (!res.ok) { throw new Error(`Failed to fetch models: ${res.status}`) } - return schema.parse(await res.json()) + return decodeModels(await res.json()) }) const result = { ...existing } diff --git a/packages/opencode/src/plugin/index.ts b/packages/opencode/src/plugin/index.ts index 7a7f260df897..e87f6db23890 100644 --- a/packages/opencode/src/plugin/index.ts +++ b/packages/opencode/src/plugin/index.ts @@ -9,7 +9,6 @@ import { Config } from "@/config/config" import { Bus } from "../bus" import * as Log from "@opencode-ai/core/util/log" import { createOpencodeClient } from "@opencode-ai/sdk" -import { Flag } from "@opencode-ai/core/flag/flag" import { ServerAuth } from "@/server/auth" import { CodexAuthPlugin } from "./codex" import { Session } from "@/session/session" @@ -19,6 +18,7 @@ import { gitlabAuthPlugin as GitlabAuthPlugin } from "opencode-gitlab-auth" import { PoeAuthPlugin } from "opencode-poe-auth" import { CloudflareAIGatewayAuthPlugin, CloudflareWorkersAuthPlugin } from "./cloudflare" import { AzureAuthPlugin } from "./azure" +import { DigitalOceanAuthPlugin } from "./digitalocean" import { Effect, Layer, Context, Stream } from "effect" import { EffectBridge } from "@/effect/bridge" import { InstanceState } from "@/effect/instance-state" @@ -27,6 +27,7 @@ import { PluginLoader } from "./loader" import { parsePluginSpecifier, readPluginId, readV1Plugin, resolvePluginId } from "./shared" import { registerAdapter } from "@/control-plane/adapters" import type { WorkspaceAdapter } from "@/control-plane/types" +import { RuntimeFlags } from "@/effect/runtime-flags" const log = Log.create({ service: "plugin" }) @@ -64,6 +65,7 @@ const INTERNAL_PLUGINS: PluginInstance[] = [ CloudflareWorkersAuthPlugin, CloudflareAIGatewayAuthPlugin, AzureAuthPlugin, + DigitalOceanAuthPlugin, ] function isServerPlugin(value: unknown): value is PluginInstance { @@ -110,6 +112,7 @@ export const layer = Layer.effect( Effect.gen(function* () { const bus = yield* Bus.Service const config = yield* Config.Service + const flags = yield* RuntimeFlags.Service const state = yield* InstanceState.make( Effect.fn("Plugin.state")(function* (ctx) { @@ -146,7 +149,7 @@ export const layer = Layer.effect( $: typeof Bun === "undefined" ? undefined : Bun.$, } - for (const plugin of INTERNAL_PLUGINS) { + for (const plugin of flags.disableDefaultPlugins ? [] : INTERNAL_PLUGINS) { log.info("loading internal plugin", { name: plugin.name }) const init = yield* Effect.tryPromise({ try: () => plugin(input), @@ -157,8 +160,8 @@ export const layer = Layer.effect( if (init._tag === "Some") hooks.push(init.value) } - const plugins = Flag.OPENCODE_PURE ? [] : (cfg.plugin_origins ?? []) - if (Flag.OPENCODE_PURE && cfg.plugin_origins?.length) { + const plugins = flags.pure ? [] : (cfg.plugin_origins ?? []) + if (flags.pure && cfg.plugin_origins?.length) { log.info("skipping external plugins in pure mode", { count: cfg.plugin_origins.length }) } if (plugins.length) yield* config.waitForDependencies() @@ -283,6 +286,10 @@ export const layer = Layer.effect( }), ) -export const defaultLayer = layer.pipe(Layer.provide(Bus.layer), Layer.provide(Config.defaultLayer)) +export const defaultLayer = layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(Config.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), +) export * as Plugin from "." diff --git a/packages/opencode/src/project/bootstrap.ts b/packages/opencode/src/project/bootstrap.ts index 6103a9efb407..a7e67d45e9b7 100644 --- a/packages/opencode/src/project/bootstrap.ts +++ b/packages/opencode/src/project/bootstrap.ts @@ -37,7 +37,7 @@ export const layer = Layer.effect( const run = Effect.gen(function* () { const ctx = yield* InstanceState.context - yield* Effect.logInfo("bootstrapping", { directory: ctx.directory }) + yield* Effect.logInfo("bootstrapping").pipe(Effect.annotateLogs("directory", ctx.directory)) // everything depends on config so eager load it for nice traces yield* config.get() // Plugin can mutate config so it has to be initialized before anything else. diff --git a/packages/opencode/src/project/instance-store.ts b/packages/opencode/src/project/instance-store.ts index 9707305f93bc..faa56668a793 100644 --- a/packages/opencode/src/project/instance-store.ts +++ b/packages/opencode/src/project/instance-store.ts @@ -156,7 +156,9 @@ export const layer: Layer.Layer = Layer.effect( Service, Effect.gen(function* () { @@ -138,6 +139,7 @@ export const layer: Layer.Layer< const pathSvc = yield* Path.Path const spawner = yield* ChildProcessSpawner.ChildProcessSpawner const bus = yield* Bus.Service + const flags = yield* RuntimeFlags.Service const git = Effect.fnUntraced( function* (args: string[], opts?: { cwd?: string }) { @@ -282,7 +284,7 @@ export const layer: Layer.Layer< time: { created: Date.now(), updated: Date.now() }, } - if (Flag.OPENCODE_EXPERIMENTAL_ICON_DISCOVERY) yield* discover(existing).pipe(Effect.ignore, Effect.forkIn(scope)) + if (flags.experimentalIconDiscovery) yield* discover(existing).pipe(Effect.ignore, Effect.forkIn(scope)) const result: Info = { ...existing, @@ -505,6 +507,7 @@ export const defaultLayer = layer.pipe( Layer.provide(CrossSpawnSpawner.defaultLayer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(NodePath.layer), + Layer.provide(RuntimeFlags.defaultLayer), ) export const use = serviceUse(Service) diff --git a/packages/opencode/src/provider/auth.ts b/packages/opencode/src/provider/auth.ts index 42b94ffcc567..6f857ce522f8 100644 --- a/packages/opencode/src/provider/auth.ts +++ b/packages/opencode/src/provider/auth.ts @@ -1,7 +1,6 @@ import type { AuthOAuthResult, Hooks } from "@opencode-ai/plugin" import { Auth } from "@/auth" import { InstanceState } from "@/effect/instance-state" -import { namedSchemaError } from "@/util/named-schema-error" import { optionalOmitUndefined } from "@opencode-ai/core/schema" import { Plugin } from "../plugin" import { ProviderID } from "./schema" @@ -64,23 +63,25 @@ export const CallbackInput = Schema.Struct({ }) export type CallbackInput = Schema.Schema.Type -export const OauthMissing = namedSchemaError("ProviderAuthOauthMissing", { providerID: ProviderID }) +export class OauthMissing extends Schema.TaggedErrorClass()("ProviderAuthOauthMissing", { + providerID: ProviderID, +}) {} -export const OauthCodeMissing = namedSchemaError("ProviderAuthOauthCodeMissing", { providerID: ProviderID }) +export class OauthCodeMissing extends Schema.TaggedErrorClass()("ProviderAuthOauthCodeMissing", { + providerID: ProviderID, +}) {} -export const OauthCallbackFailed = namedSchemaError("ProviderAuthOauthCallbackFailed", {}) +export class OauthCallbackFailed extends Schema.TaggedErrorClass()( + "ProviderAuthOauthCallbackFailed", + {}, +) {} -export const ValidationFailed = namedSchemaError("ProviderAuthValidationFailed", { +export class ValidationFailed extends Schema.TaggedErrorClass()("ProviderAuthValidationFailed", { field: Schema.String, message: Schema.String, -}) +}) {} -export type Error = - | Auth.AuthError - | InstanceType - | InstanceType - | InstanceType - | InstanceType +export type Error = Auth.AuthError | OauthMissing | OauthCodeMissing | OauthCallbackFailed | ValidationFailed type Hook = NonNullable @@ -166,7 +167,7 @@ export const layer: Layer.Layer = for (const prompt of method.prompts) { if (prompt.type === "text" && prompt.validate && input.inputs[prompt.key] !== undefined) { const error = prompt.validate(input.inputs[prompt.key]) - if (error) return yield* Effect.fail(new ValidationFailed({ field: prompt.key, message: error })) + if (error) return yield* new ValidationFailed({ field: prompt.key, message: error }) } } } @@ -183,20 +184,21 @@ export const layer: Layer.Layer = const callback = Effect.fn("ProviderAuth.callback")(function* (input: { providerID: ProviderID } & CallbackInput) { const pending = (yield* InstanceState.get(state)).pending const match = pending.get(input.providerID) - if (!match) return yield* Effect.fail(new OauthMissing({ providerID: input.providerID })) + if (!match) return yield* new OauthMissing({ providerID: input.providerID }) if (match.method === "code" && !input.code) { - return yield* Effect.fail(new OauthCodeMissing({ providerID: input.providerID })) + return yield* new OauthCodeMissing({ providerID: input.providerID }) } const result = yield* Effect.promise(() => match.method === "code" ? match.callback(input.code!) : match.callback(), ) - if (!result || result.type !== "success") return yield* Effect.fail(new OauthCallbackFailed({})) + if (!result || result.type !== "success") return yield* new OauthCallbackFailed({}) if ("key" in result) { yield* auth.set(input.providerID, { type: "api", key: result.key, + ...(result.metadata ? { metadata: result.metadata } : {}), }) } diff --git a/packages/opencode/src/provider/model-status.ts b/packages/opencode/src/provider/model-status.ts index 468b59ce39d8..7e1ca56e28d3 100644 --- a/packages/opencode/src/provider/model-status.ts +++ b/packages/opencode/src/provider/model-status.ts @@ -1,7 +1,6 @@ import { Schema } from "effect" -export const CatalogModelStatus = Schema.Literals(["alpha", "beta", "deprecated"]) -export type CatalogModelStatus = typeof CatalogModelStatus.Type +export { CatalogModelStatus } from "@opencode-ai/core/models" export const ModelStatus = Schema.Literals(["alpha", "beta", "deprecated", "active"]) export type ModelStatus = typeof ModelStatus.Type diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts index 236f14de7590..063e2800d167 100644 --- a/packages/opencode/src/provider/provider.ts +++ b/packages/opencode/src/provider/provider.ts @@ -8,12 +8,10 @@ import { Npm } from "@opencode-ai/core/npm" import { Hash } from "@opencode-ai/core/util/hash" import { Plugin } from "../plugin" import { type LanguageModelV3 } from "@ai-sdk/provider" -import * as ModelsDev from "./models" +import * as ModelsDev from "@opencode-ai/core/models" import { Auth } from "../auth" import { Env } from "../env" import { InstallationVersion } from "@opencode-ai/core/installation/version" -import { Flag } from "@opencode-ai/core/flag/flag" -import { namedSchemaError } from "@/util/named-schema-error" import { iife } from "@/util/iife" import { Global } from "@opencode-ai/core/global" import path from "path" @@ -21,13 +19,14 @@ import { pathToFileURL } from "url" import { Effect, Layer, Context, Schema, Types } from "effect" import { EffectBridge } from "@/effect/bridge" import { InstanceState } from "@/effect/instance-state" +import { EffectPromise } from "@/effect/promise" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { isRecord } from "@/util/record" import { optionalOmitUndefined } from "@opencode-ai/core/schema" - import * as ProviderTransform from "./transform" import { ModelID, ProviderID } from "./schema" import { ModelStatus } from "./model-status" +import { RuntimeFlags } from "@/effect/runtime-flags" const log = Log.create({ service: "provider" }) @@ -112,7 +111,8 @@ const BUNDLED_PROVIDERS: Record Promise<(opts: any) => BundledSDK> "@ai-sdk/vercel": () => import("@ai-sdk/vercel").then((m) => m.createVercel), "@ai-sdk/alibaba": () => import("@ai-sdk/alibaba").then((m) => m.createAlibaba), "gitlab-ai-provider": () => import("gitlab-ai-provider").then((m) => m.createGitLab), - "@ai-sdk/github-copilot": () => import("./sdk/copilot/copilot-provider").then((m) => m.createOpenaiCompatible), + "@ai-sdk/github-copilot": () => + import("@opencode-ai/core/github-copilot/copilot-provider").then((m) => m.createOpenaiCompatible), "venice-ai-sdk-provider": () => import("venice-ai-sdk-provider").then((m) => m.createVenice), } @@ -427,13 +427,14 @@ function custom(dep: CustomDep): Record { }, }, }), - nvidia: () => + nvidia: (provider) => Effect.succeed({ - autoload: false, + autoload: provider.source === "config", options: { headers: { "HTTP-Referer": "https://opencode.ai/", "X-Title": "opencode", + "X-BILLING-INVOKE-ORIGIN": "OpenCode", }, }, }), @@ -449,8 +450,14 @@ function custom(dep: CustomDep): Record { }), "google-vertex": Effect.fnUntraced(function* (provider: Info) { const env = yield* dep.env() + // models.dev advertises GOOGLE_VERTEX_PROJECT for Vertex; keep the wider + // Google Cloud project env names as fallbacks for existing ADC setups. const project = - provider.options?.project ?? env["GOOGLE_CLOUD_PROJECT"] ?? env["GCP_PROJECT"] ?? env["GCLOUD_PROJECT"] + provider.options?.project ?? + env["GOOGLE_VERTEX_PROJECT"] ?? + env["GOOGLE_CLOUD_PROJECT"] ?? + env["GCP_PROJECT"] ?? + env["GCLOUD_PROJECT"] const location = String( provider.options?.location ?? @@ -739,6 +746,7 @@ function custom(dep: CustomDep): Record { const auth = yield* dep.auth(input.id) const env = yield* dep.env() const accountId = env["CLOUDFLARE_ACCOUNT_ID"] || (auth?.type === "api" ? auth.metadata?.accountId : undefined) + // The Cloudflare auth prompt stores this value as gatewayId metadata. const gateway = env["CLOUDFLARE_GATEWAY_ID"] || (auth?.type === "api" ? auth.metadata?.gatewayId : undefined) if (!accountId || !gateway) { @@ -869,10 +877,21 @@ const ProviderCacheCost = Schema.Struct({ write: Schema.Finite, }) +const ProviderCostTier = Schema.Struct({ + input: Schema.Finite, + output: Schema.Finite, + cache: ProviderCacheCost, + tier: Schema.Struct({ + type: Schema.Literal("context"), + size: Schema.Finite, + }), +}) + const ProviderCost = Schema.Struct({ input: Schema.Finite, output: Schema.Finite, cache: ProviderCacheCost, + tiers: optionalOmitUndefined(Schema.Array(ProviderCostTier)), experimentalOver200K: optionalOmitUndefined( Schema.Struct({ input: Schema.Finite, @@ -945,11 +964,33 @@ export function defaultModelIDs sort(Object.values(item.models))[0].id) } +export class ModelNotFoundError extends Schema.TaggedErrorClass()("ProviderModelNotFoundError", { + providerID: ProviderID, + modelID: ModelID, + suggestions: Schema.optional(Schema.Array(Schema.String)), + cause: Schema.optional(Schema.Defect), +}) { + static isInstance(input: unknown): input is ModelNotFoundError { + return input instanceof ModelNotFoundError + } +} + +export class InitError extends Schema.TaggedErrorClass()("ProviderInitError", { + providerID: ProviderID, + cause: Schema.optional(Schema.Defect), +}) { + static isInstance(input: unknown): input is InitError { + return input instanceof InitError + } +} + +export type Error = ModelNotFoundError | InitError + export interface Interface { readonly list: () => Effect.Effect> readonly getProvider: (providerID: ProviderID) => Effect.Effect - readonly getModel: (providerID: ProviderID, modelID: ModelID) => Effect.Effect - readonly getLanguage: (model: Model) => Effect.Effect + readonly getModel: (providerID: ProviderID, modelID: ModelID) => Effect.Effect + readonly getLanguage: (model: Model) => Effect.Effect readonly closest: ( providerID: ProviderID, query: string[], @@ -961,6 +1002,7 @@ export interface Interface { interface State { models: Map providers: Record + catalog: Record sdk: Map modelLoaders: Record varsLoaders: Record @@ -977,6 +1019,17 @@ function cost(c: ModelsDev.Model["cost"]): Model["cost"] { write: c?.cache_write ?? 0, }, } + if (c?.tiers) { + result.tiers = c.tiers.map((item) => ({ + input: item.input, + output: item.output, + cache: { + read: item.cache_read ?? 0, + write: item.cache_write ?? 0, + }, + tier: item.tier, + })) + } if (c?.context_over_200k) { result.experimentalOver200K = { cache: { @@ -1075,11 +1128,39 @@ export function fromModelsDevProvider(provider: ModelsDev.Provider): Info { } } -const layer: Layer.Layer< - Service, - never, - Config.Service | Auth.Service | Plugin.Service | AppFileSystem.Service | Env.Service | ModelsDev.Service -> = Layer.effect( +function suggestionModelIDs(provider: Info | undefined, enableExperimentalModels: boolean) { + if (!provider) return [] + return Object.keys(provider.models).filter((id) => { + const model = provider.models[id] + if (model.status === "deprecated") return false + if (model.status === "alpha" && !enableExperimentalModels) return false + return true + }) +} + +function modelSuggestions(provider: Info | undefined, modelID: ModelID, enableExperimentalModels: boolean) { + const available = suggestionModelIDs(provider, enableExperimentalModels) + const fuzzy = fuzzysort.go(modelID, available, { limit: 3, threshold: -10000 }).map((m) => m.target) + if (fuzzy.length) return fuzzy + const query = modelID + .toLowerCase() + .split(/[^a-z0-9]+/) + .filter((part) => part.length > 1) + return sortBy( + available + .map((id) => ({ + id, + score: query.filter((part) => id.toLowerCase().includes(part)).length, + })) + .filter((item) => item.score > 0), + [(item) => item.score, "desc"], + [(item) => item.id, "asc"], + ) + .slice(0, 3) + .map((item) => item.id) +} + +export const layer = Layer.effect( Service, Effect.gen(function* () { const fs = yield* AppFileSystem.Service @@ -1088,6 +1169,7 @@ const layer: Layer.Layer< const env = yield* Env.Service const plugin = yield* Plugin.Service const modelsDevSvc = yield* ModelsDev.Service + const runtimeFlags = yield* RuntimeFlags.Service const state = yield* InstanceState.make(() => Effect.gen(function* () { @@ -1095,7 +1177,8 @@ const layer: Layer.Layer< const bridge = yield* EffectBridge.make() const cfg = yield* config.get() const modelsDev = yield* modelsDevSvc.get() - const database = mapValues(modelsDev, fromModelsDevProvider) + const catalog = mapValues(modelsDev, fromModelsDevProvider) + const database = mapValues(catalog, toPublicInfo) const providers: Record = {} as Record const languages = new Map() @@ -1370,11 +1453,16 @@ const layer: Layer.Layer< for (const [modelID, model] of Object.entries(provider.models)) { model.api.id = model.api.id ?? model.id ?? modelID if ( - modelID === "gpt-5-chat-latest" || + // These chat aliases are invalid for the special handling in the + // built-in providers below, but custom providers may support them. + (modelID === "gpt-5-chat-latest" && + (providerID === ProviderID.openai || + providerID === ProviderID.githubCopilot || + providerID === ProviderID.openrouter)) || (providerID === ProviderID.openrouter && modelID === "openai/gpt-5-chat") ) delete provider.models[modelID] - if (model.status === "alpha" && !Flag.OPENCODE_ENABLE_EXPERIMENTAL_MODELS) delete provider.models[modelID] + if (model.status === "alpha" && !runtimeFlags.enableExperimentalModels) delete provider.models[modelID] if (model.status === "deprecated") delete provider.models[modelID] if ( (configProvider?.blacklist && configProvider.blacklist.includes(modelID)) || @@ -1407,6 +1495,7 @@ const layer: Layer.Layer< return { models: languages, providers, + catalog, sdk, modelLoaders, varsLoaders, @@ -1555,7 +1644,7 @@ const layer: Layer.Layer< s.sdk.set(key, loaded) return loaded as SDK } catch (e) { - throw new InitError({ providerID: model.providerID }, { cause: e }) + throw new InitError({ providerID: model.providerID, cause: e }) } } @@ -1567,16 +1656,22 @@ const layer: Layer.Layer< const s = yield* InstanceState.get(state) const provider = s.providers[providerID] if (!provider) { - const available = Object.keys(s.providers) - const matches = fuzzysort.go(providerID, available, { limit: 3, threshold: -10000 }) - throw new ModelNotFoundError({ providerID, modelID, suggestions: matches.map((m) => m.target) }) + const catalogProvider = s.catalog[providerID] + const suggestions = catalogProvider + ? modelSuggestions(catalogProvider, modelID, runtimeFlags.enableExperimentalModels) + : fuzzysort + .go(providerID, Object.keys({ ...s.catalog, ...s.providers }), { limit: 3, threshold: -10000 }) + .map((m) => m.target) + return yield* new ModelNotFoundError({ providerID, modelID, suggestions }) } const info = provider.models[modelID] if (!info) { - const available = Object.keys(provider.models) - const matches = fuzzysort.go(modelID, available, { limit: 3, threshold: -10000 }) - throw new ModelNotFoundError({ providerID, modelID, suggestions: matches.map((m) => m.target) }) + const current = modelSuggestions(provider, modelID, runtimeFlags.enableExperimentalModels) + const suggestions = current.length + ? current + : modelSuggestions(s.catalog[providerID], modelID, runtimeFlags.enableExperimentalModels) + return yield* new ModelNotFoundError({ providerID, modelID, suggestions }) } return info }) @@ -1587,11 +1682,10 @@ const layer: Layer.Layer< const key = `${model.providerID}/${model.id}` if (s.models.has(key)) return s.models.get(key)! - return yield* Effect.promise(async () => { - const provider = s.providers[model.providerID] - const sdk = await resolveSDK(model, s, envs) - - try { + const provider = s.providers[model.providerID] + return yield* EffectPromise.refineRejection( + async () => { + const sdk = await resolveSDK(model, s, envs) const language = s.modelLoaders[model.providerID] ? await s.modelLoaders[model.providerID](sdk, model.api.id, { ...provider.options, @@ -1600,18 +1694,12 @@ const layer: Layer.Layer< : sdk.languageModel(model.api.id) s.models.set(key, language) return language - } catch (e) { - if (e instanceof NoSuchModelError) - throw new ModelNotFoundError( - { - modelID: model.id, - providerID: model.providerID, - }, - { cause: e }, - ) - throw e - } - }) + }, + (cause) => + cause instanceof NoSuchModelError + ? new ModelNotFoundError({ modelID: model.id, providerID: model.providerID, cause }) + : undefined, + ) }) const closest = Effect.fn("Provider.closest")(function* (providerID: ProviderID, query: string[]) { @@ -1631,7 +1719,9 @@ const layer: Layer.Layer< if (cfg.small_model) { const parsed = parseModel(cfg.small_model) - return yield* getModel(parsed.providerID, parsed.modelID) + return yield* getModel(parsed.providerID, parsed.modelID).pipe( + Effect.catchTag("ProviderModelNotFoundError", () => Effect.succeed(undefined)), + ) } const s = yield* InstanceState.get(state) @@ -1659,22 +1749,22 @@ const layer: Layer.Layer< const candidates = Object.keys(provider.models).filter((m) => m.includes(item)) const globalMatch = candidates.find((m) => m.startsWith("global.")) - if (globalMatch) return yield* getModel(providerID, ModelID.make(globalMatch)) + if (globalMatch) return provider.models[globalMatch] const region = provider.options?.region if (region) { const regionPrefix = region.split("-")[0] if (regionPrefix === "us" || regionPrefix === "eu") { const regionalMatch = candidates.find((m) => m.startsWith(`${regionPrefix}.`)) - if (regionalMatch) return yield* getModel(providerID, ModelID.make(regionalMatch)) + if (regionalMatch) return provider.models[regionalMatch] } } const unprefixed = candidates.find((m) => !crossRegionPrefixes.some((p) => m.startsWith(p))) - if (unprefixed) return yield* getModel(providerID, ModelID.make(unprefixed)) + if (unprefixed) return provider.models[unprefixed] } else { for (const model of Object.keys(provider.models)) { - if (model.includes(item)) return yield* getModel(providerID, ModelID.make(model)) + if (model.includes(item)) return provider.models[model] } } } @@ -1728,6 +1818,7 @@ export const defaultLayer = Layer.suspend(() => Layer.provide(Auth.defaultLayer), Layer.provide(Plugin.defaultLayer), Layer.provide(ModelsDev.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), ), ) @@ -1749,14 +1840,4 @@ export function parseModel(model: string) { } } -export const ModelNotFoundError = namedSchemaError("ProviderModelNotFoundError", { - providerID: ProviderID, - modelID: ModelID, - suggestions: Schema.optional(Schema.Array(Schema.String)), -}) - -export const InitError = namedSchemaError("ProviderInitError", { - providerID: ProviderID, -}) - export * as Provider from "./provider" diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index bd778dacc53e..c8dbe6117055 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -1,11 +1,9 @@ import type { ModelMessage, ToolResultPart } from "ai" import { mergeDeep, unique } from "remeda" import type { JSONSchema7 } from "@ai-sdk/provider" -import type { JSONSchema } from "zod/v4/core" import type * as Provider from "./provider" -import type * as ModelsDev from "./models" +import type * as ModelsDev from "@opencode-ai/core/models" import { iife } from "@/util/iife" -import { Flag } from "@opencode-ai/core/flag/flag" type Modality = NonNullable["input"][number] @@ -17,7 +15,7 @@ function mimeToModality(mime: string): Modality | undefined { return undefined } -export const OUTPUT_TOKEN_MAX = Flag.OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX || 32_000 +export const OUTPUT_TOKEN_MAX = 32_000 export function sanitizeSurrogates(content: string) { return content.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?> { if (!model.capabilities.reasoning) return {} @@ -1135,19 +1125,15 @@ export function options(input: { result["enable_thinking"] = true } + if (input.model.api.npm === "@ai-sdk/azure" && input.model.api.id.includes("gpt-5.5")) { + result["reasoningSummary"] = "auto" + return result + } + if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) { if (!input.model.api.id.includes("gpt-5-pro")) { result["reasoningEffort"] = "medium" - // Only inject reasoningSummary for providers that support it natively. - // @ai-sdk/openai-compatible proxies (e.g. LiteLLM) do not understand this - // parameter and return "Unknown parameter: 'reasoningSummary'". - if ( - input.model.api.npm === "@ai-sdk/openai" || - input.model.api.npm === "@ai-sdk/azure" || - input.model.api.npm === "@ai-sdk/github-copilot" - ) { - result["reasoningSummary"] = "auto" - } + result["reasoningSummary"] = "auto" } // Only set textVerbosity for non-chat gpt-5.x models @@ -1185,40 +1171,27 @@ export function options(input: { } export function smallOptions(model: Provider.Model) { + const small = Object.values(model.variants ?? {})[0] ?? {} if ( model.providerID === "openai" || model.api.npm === "@ai-sdk/openai" || model.api.npm === "@ai-sdk/github-copilot" ) { - if (model.api.id.includes("gpt-5")) { - if (model.api.id.includes("-chat")) { - if (gpt5Version(model.api.id) === undefined) return { store: false } - return { store: false, reasoningEffort: "medium" } - } - if (model.api.id.includes("search-api")) return { store: false } - if (model.api.id.includes("5.") || model.api.id.includes("5-mini")) { - return { store: false, reasoningEffort: "low" } - } - return { store: false, reasoningEffort: "minimal" } - } - return { store: false } - } - if (model.providerID === "google") { - // gemini-3 uses thinkingLevel, gemini-2.5 uses thinkingBudget - return { thinkingConfig: googleSmallThinkingConfig(model.api.id) } + const base = { store: false } + return mergeDeep(base, small) } if (model.providerID === "openrouter" || model.providerID === "llmgateway") { - if (model.api.id.includes("google")) { + if (Object.keys(small).length === 0 && model.api.id.includes("google")) { return { reasoning: { enabled: false } } } - return { reasoningEffort: "minimal" } } if (model.providerID === "venice") { + if (Object.keys(small).length > 0) return small return { veniceParameters: { disableThinking: true } } } - return {} + return small } // Maps model ID prefix to provider slug used in providerOptions. @@ -1277,11 +1250,11 @@ export function providerOptions(model: Provider.Model, options: { [x: string]: a return { [key]: options } } -export function maxOutputTokens(model: Provider.Model): number { - return Math.min(model.limit.output, OUTPUT_TOKEN_MAX) || OUTPUT_TOKEN_MAX +export function maxOutputTokens(model: Provider.Model, outputTokenMax = OUTPUT_TOKEN_MAX): number { + return Math.min(model.limit.output, outputTokenMax) || outputTokenMax } -export function schema(model: Provider.Model, schema: JSONSchema.BaseSchema | JSONSchema7): JSONSchema7 { +export function schema(model: Provider.Model, schema: JSONSchema7): JSONSchema7 { /* if (["openai", "azure"].includes(providerID)) { if (schema.type === "object" && schema.properties) { @@ -1312,7 +1285,10 @@ export function schema(model: Provider.Model, schema: JSONSchema.BaseSchema | JS return result } - schema = sanitizeMoonshot(schema) as JSONSchema.BaseSchema | JSONSchema7 + const sanitized = sanitizeMoonshot(schema) + if (typeof sanitized === "object" && sanitized !== null && !Array.isArray(sanitized)) { + schema = sanitized + } } // Convert integer enums to string enums for Google/Gemini @@ -1394,7 +1370,7 @@ export function schema(model: Provider.Model, schema: JSONSchema.BaseSchema | JS schema = sanitizeGemini(schema) } - return schema as JSONSchema7 + return schema } export * as ProviderTransform from "./transform" diff --git a/packages/opencode/src/reference/reference.ts b/packages/opencode/src/reference/reference.ts index 09e0a825d87a..3109c37492ba 100644 --- a/packages/opencode/src/reference/reference.ts +++ b/packages/opencode/src/reference/reference.ts @@ -1,10 +1,10 @@ import path from "path" import { Effect, Context, Layer, Scope } from "effect" import { AppFileSystem } from "@opencode-ai/core/filesystem" -import { Flag } from "@opencode-ai/core/flag/flag" import { Global } from "@opencode-ai/core/global" import { Config } from "@/config/config" import { InstanceState } from "@/effect/instance-state" +import { RuntimeFlags } from "@/effect/runtime-flags" import { Git } from "@/git" import { parseRepositoryReference, repositoryCachePath, type Reference as RepositoryReference } from "@/util/repository" import { RepositoryCache } from "./repository-cache" @@ -143,6 +143,7 @@ export const layer = Layer.effect( const fs = yield* AppFileSystem.Service const git = yield* Git.Service const scope = yield* Scope.Scope + const flags = yield* RuntimeFlags.Service const state = yield* InstanceState.make( Effect.fn("Reference.state")(function* (ctx) { @@ -169,7 +170,9 @@ export const layer = Layer.effect( ).pipe( Effect.asVoid, Effect.catchCause((cause) => - Effect.logWarning("failed to materialize reference repository", { name: reference.name, cause }), + Effect.logWarning("failed to materialize reference repository").pipe( + Effect.annotateLogs({ name: reference.name, cause }), + ), ), ), ) @@ -179,7 +182,7 @@ export const layer = Layer.effect( ) const materializeAll = yield* Effect.cached( - Flag.OPENCODE_EXPERIMENTAL_SCOUT + flags.experimentalScout ? Effect.gen(function* () { yield* Effect.forEach( materializeByPath, @@ -198,7 +201,7 @@ export const layer = Layer.effect( return Service.of({ init: Effect.fn("Reference.init")(function* () { - if (!Flag.OPENCODE_EXPERIMENTAL_SCOUT) return + if (!flags.experimentalScout) return yield* InstanceState.useEffect(state, (s) => s.materializeAll).pipe(Effect.forkIn(scope), Effect.asVoid) }), list: Effect.fn("Reference.list")(function* () { @@ -208,7 +211,7 @@ export const layer = Layer.effect( return yield* InstanceState.use(state, (s) => s.references.find((reference) => reference.name === name)) }), ensure: Effect.fn("Reference.ensure")(function* (target?: string) { - if (!Flag.OPENCODE_EXPERIMENTAL_SCOUT) return + if (!flags.experimentalScout) return const full = normalizedTarget(target) if (!full) return yield* InstanceState.useEffect(state, (s) => s.materializeAll) return yield* InstanceState.useEffect( @@ -217,7 +220,7 @@ export const layer = Layer.effect( ) }), contains: Effect.fn("Reference.contains")(function* (target?: string) { - if (!Flag.OPENCODE_EXPERIMENTAL_SCOUT) return false + if (!flags.experimentalScout) return false const full = normalizedTarget(target) if (!full) return false return yield* InstanceState.use(state, (s) => @@ -232,6 +235,7 @@ export const defaultLayer = layer.pipe( Layer.provide(Config.defaultLayer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(Git.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), ) export * as Reference from "./reference" diff --git a/packages/opencode/src/server/httpapi-server.node.ts b/packages/opencode/src/server/httpapi-server.node.ts deleted file mode 100644 index d6c6cbd2fd2a..000000000000 --- a/packages/opencode/src/server/httpapi-server.node.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { NodeHttpServer } from "@effect/platform-node" -import { Effect, Layer } from "effect" -import { createServer } from "node:http" -import { Service } from "./httpapi-server" - -export { Service } - -export const name = "node-http-server" - -export type Opts = { port: number; hostname: string } - -export const layer = (opts: Opts) => { - const server = createServer() - const serverRef = { closeStarted: false, forceStop: false } - const close = server.close.bind(server) - // Keep shutdown owned by NodeHttpServer, but honor listener.stop(true) by - // force-closing active HTTP sockets when its finalizer calls server.close(). - server.close = ((callback?: Parameters[0]) => { - serverRef.closeStarted = true - const result = close(callback) - if (serverRef.forceStop) server.closeAllConnections() - return result - }) as typeof server.close - return Layer.mergeAll( - NodeHttpServer.layer(() => server, { port: opts.port, host: opts.hostname, gracefulShutdownTimeout: "1 second" }), - Layer.succeed(Service)( - Service.of({ - closeAll: Effect.sync(() => { - serverRef.forceStop = true - if (serverRef.closeStarted) server.closeAllConnections() - }), - }), - ), - ) -} diff --git a/packages/opencode/src/server/httpapi-server.ts b/packages/opencode/src/server/httpapi-server.ts deleted file mode 100644 index 5f3804c1072c..000000000000 --- a/packages/opencode/src/server/httpapi-server.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Context, Effect } from "effect" - -export interface Interface { - readonly closeAll: Effect.Effect -} - -export class Service extends Context.Service()("@opencode/HttpApiServer") {} - -export * as HttpApiServer from "./httpapi-server" diff --git a/packages/opencode/src/server/init-projectors.ts b/packages/opencode/src/server/init-projectors.ts new file mode 100644 index 000000000000..86b66b256f97 --- /dev/null +++ b/packages/opencode/src/server/init-projectors.ts @@ -0,0 +1,3 @@ +import { initProjectors } from "./projectors" + +initProjectors() diff --git a/packages/opencode/src/server/projectors.ts b/packages/opencode/src/server/projectors.ts index 367e3715e5c8..c5fb2420a0ce 100644 --- a/packages/opencode/src/server/projectors.ts +++ b/packages/opencode/src/server/projectors.ts @@ -24,5 +24,3 @@ export function initProjectors() { }, }) } - -initProjectors() diff --git a/packages/opencode/src/server/routes/instance/httpapi/api.ts b/packages/opencode/src/server/routes/instance/httpapi/api.ts index 4c6e46a45569..eff336b3c638 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/api.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/api.ts @@ -4,7 +4,7 @@ import { BusEvent } from "@/bus/bus-event" import { SyncEvent } from "@/sync" import { ConfigApi } from "./groups/config" import { ControlApi } from "./groups/control" -import { EventApi } from "./event" +import { EventApi } from "./groups/event" import { ExperimentalApi } from "./groups/experimental" import { FileApi } from "./groups/file" import { GlobalApi } from "./groups/global" diff --git a/packages/opencode/src/server/routes/instance/httpapi/event.ts b/packages/opencode/src/server/routes/instance/httpapi/event.ts deleted file mode 100644 index 8113c76f51dc..000000000000 --- a/packages/opencode/src/server/routes/instance/httpapi/event.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Bus } from "@/bus" -import * as Log from "@opencode-ai/core/util/log" -import { Effect, Schema } from "effect" -import * as Stream from "effect/Stream" -import { HttpServerResponse } from "effect/unstable/http" -import { HttpApi, HttpApiBuilder, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi" -import * as Sse from "effect/unstable/encoding/Sse" -import { WorkspaceRoutingQuery } from "./middleware/workspace-routing" - -const log = Log.create({ service: "server" }) - -export const EventPaths = { - event: "/event", -} as const - -export const EventApi = HttpApi.make("event").add( - HttpApiGroup.make("event") - .add( - HttpApiEndpoint.get("subscribe", EventPaths.event, { - query: WorkspaceRoutingQuery, - success: Schema.String.pipe(HttpApiSchema.asText({ contentType: "text/event-stream" })), - }).annotateMerge( - OpenApi.annotations({ - identifier: "event.subscribe", - summary: "Subscribe to events", - description: "Get events", - }), - ), - ) - .annotateMerge(OpenApi.annotations({ title: "event", description: "Instance event stream route." })), -) - -function eventData(data: unknown): Sse.Event { - return { - _tag: "Event", - event: "message", - id: undefined, - data: JSON.stringify(data), - } -} - -function eventResponse(bus: Bus.Interface) { - const events = bus.subscribeAll().pipe(Stream.takeUntil((event) => event.type === Bus.InstanceDisposed.type)) - const heartbeat = Stream.tick("10 seconds").pipe( - Stream.drop(1), - Stream.map(() => ({ id: Bus.createID(), type: "server.heartbeat", properties: {} })), - ) - - log.info("event connected") - return HttpServerResponse.stream( - Stream.make({ id: Bus.createID(), type: "server.connected", properties: {} }).pipe( - Stream.concat(events.pipe(Stream.merge(heartbeat, { haltStrategy: "left" }))), - Stream.map(eventData), - Stream.pipeThroughChannel(Sse.encode()), - Stream.encodeText, - Stream.ensuring(Effect.sync(() => log.info("event disconnected"))), - ), - { - contentType: "text/event-stream", - headers: { - "Cache-Control": "no-cache, no-transform", - "X-Accel-Buffering": "no", - "X-Content-Type-Options": "nosniff", - }, - }, - ) -} - -export const eventHandlers = HttpApiBuilder.group(EventApi, "event", (handlers) => - Effect.gen(function* () { - const bus = yield* Bus.Service - return handlers.handleRaw( - "subscribe", - Effect.fn("EventHttpApi.subscribe")(function* () { - return eventResponse(bus) - }), - ) - }), -) diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/event.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/event.ts new file mode 100644 index 000000000000..7ebc229ee5aa --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/event.ts @@ -0,0 +1,24 @@ +import { Schema } from "effect" +import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi" +import { WorkspaceRoutingQuery } from "../middleware/workspace-routing" + +export const EventPaths = { + event: "/event", +} as const + +export const EventApi = HttpApi.make("event").add( + HttpApiGroup.make("event") + .add( + HttpApiEndpoint.get("subscribe", EventPaths.event, { + query: WorkspaceRoutingQuery, + success: Schema.String.pipe(HttpApiSchema.asText({ contentType: "text/event-stream" })), + }).annotateMerge( + OpenApi.annotations({ + identifier: "event.subscribe", + summary: "Subscribe to events", + description: "Get events", + }), + ), + ) + .annotateMerge(OpenApi.annotations({ title: "event", description: "Instance event stream route." })), +) diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts index 99a8a21a9e1c..4cda970e87d5 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts @@ -54,6 +54,22 @@ export const ToolListQuery = Schema.Struct({ }) const WorktreeList = Schema.Array(Schema.String) +const WorktreeErrorName = Schema.Union([ + Schema.Literal("WorktreeNotGitError"), + Schema.Literal("WorktreeNameGenerationFailedError"), + Schema.Literal("WorktreeCreateFailedError"), + Schema.Literal("WorktreeStartCommandFailedError"), + Schema.Literal("WorktreeRemoveFailedError"), + Schema.Literal("WorktreeResetFailedError"), + Schema.Literal("WorktreeListFailedError"), +]) +export class WorktreeApiError extends Schema.ErrorClass("WorktreeError")( + { + name: WorktreeErrorName, + data: Schema.Struct({ message: Schema.String }), + }, + { httpApiStatus: 400 }, +) {} export const SessionListQuery = Schema.Struct({ ...WorkspaceRoutingQueryFields, roots: Schema.optional(QueryBoolean), @@ -141,6 +157,7 @@ export const ExperimentalApi = HttpApi.make("experimental") HttpApiEndpoint.get("worktree", ExperimentalPaths.worktree, { query: WorkspaceRoutingQuery, success: described(WorktreeList, "List of worktree directories"), + error: WorktreeApiError, }).annotateMerge( OpenApi.annotations({ identifier: "worktree.list", @@ -149,10 +166,11 @@ export const ExperimentalApi = HttpApi.make("experimental") }), ), HttpApiEndpoint.post("worktreeCreate", ExperimentalPaths.worktree, { + disableCodecs: true, query: WorkspaceRoutingQuery, - payload: Schema.optional(Worktree.CreateInput), + payload: Schema.UndefinedOr(Worktree.CreateInput), success: described(Worktree.Info, "Worktree created"), - error: HttpApiError.BadRequest, + error: WorktreeApiError, }).annotateMerge( OpenApi.annotations({ identifier: "worktree.create", @@ -164,7 +182,7 @@ export const ExperimentalApi = HttpApi.make("experimental") query: WorkspaceRoutingQuery, payload: Worktree.RemoveInput, success: described(Schema.Boolean, "Worktree removed"), - error: HttpApiError.BadRequest, + error: WorktreeApiError, }).annotateMerge( OpenApi.annotations({ identifier: "worktree.remove", @@ -176,7 +194,7 @@ export const ExperimentalApi = HttpApi.make("experimental") query: WorkspaceRoutingQuery, payload: Worktree.ResetInput, success: described(Schema.Boolean, "Worktree reset"), - error: HttpApiError.BadRequest, + error: WorktreeApiError, }).annotateMerge( OpenApi.annotations({ identifier: "worktree.reset", diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/provider.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/provider.ts index 49792898df39..b6eecff4c0e0 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/groups/provider.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/provider.ts @@ -10,6 +10,26 @@ import { described } from "./metadata" const root = "/provider" +const ProviderAuthErrorName = Schema.Union([ + Schema.Literal("BadRequest"), + Schema.Literal("ProviderAuthOauthMissing"), + Schema.Literal("ProviderAuthOauthCodeMissing"), + Schema.Literal("ProviderAuthOauthCallbackFailed"), + Schema.Literal("ProviderAuthValidationFailed"), +]) +export class ProviderAuthApiError extends Schema.ErrorClass("ProviderAuthError")( + { + name: ProviderAuthErrorName, + data: Schema.Struct({ + providerID: Schema.optional(ProviderID), + field: Schema.optional(Schema.String), + message: Schema.optional(Schema.String), + kind: Schema.optional(Schema.String), + }), + }, + { httpApiStatus: 400 }, +) {} + export const ProviderApi = HttpApi.make("provider") .add( HttpApiGroup.make("provider") @@ -39,7 +59,7 @@ export const ProviderApi = HttpApi.make("provider") query: WorkspaceRoutingQuery, payload: ProviderAuth.AuthorizeInput, success: described(Schema.UndefinedOr(ProviderAuth.Authorization), "Authorization URL and method"), - error: HttpApiError.BadRequest, + error: ProviderAuthApiError, }).annotateMerge( OpenApi.annotations({ identifier: "provider.oauth.authorize", @@ -52,7 +72,7 @@ export const ProviderApi = HttpApi.make("provider") query: WorkspaceRoutingQuery, payload: ProviderAuth.CallbackInput, success: described(Schema.Boolean, "OAuth callback processed successfully"), - error: HttpApiError.BadRequest, + error: ProviderAuthApiError, }).annotateMerge( OpenApi.annotations({ identifier: "provider.oauth.callback", diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/session.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/session.ts index 2053aba3b4bd..488bf2a3ec9b 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/groups/session.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/session.ts @@ -2,6 +2,7 @@ import { Permission } from "@/permission" import { PermissionID } from "@/permission/schema" import { ModelID, ProviderID } from "@/provider/schema" import { Session } from "@/session/session" +import { SessionGoal } from "@/session/goal" import { MessageV2 } from "@/session/message-v2" import { SessionPrompt } from "@/session/prompt" import { SessionRevert } from "@/session/revert" @@ -67,6 +68,8 @@ export const PromptPayload = Schema.Struct(Struct.omit(SessionPrompt.PromptInput export const CommandPayload = Schema.Struct(Struct.omit(SessionPrompt.CommandInput.fields, ["sessionID"])) export const ShellPayload = Schema.Struct(Struct.omit(SessionPrompt.ShellInput.fields, ["sessionID"])) export const RevertPayload = Schema.Struct(Struct.omit(SessionRevert.RevertInput.fields, ["sessionID"])) +export const GoalCreatePayload = Schema.Struct(Struct.omit(SessionGoal.CreateInput.fields, ["sessionID"])) +export const GoalUpdatePayload = Schema.Struct(Struct.omit(SessionGoal.UpdateInput.fields, ["sessionID"])) export const PermissionResponsePayload = Schema.Struct({ response: Permission.Reply, }) @@ -77,6 +80,7 @@ export const SessionPaths = { get: `${root}/:sessionID`, children: `${root}/:sessionID/children`, todo: `${root}/:sessionID/todo`, + goal: `${root}/:sessionID/goal`, diff: `${root}/:sessionID/diff`, messages: `${root}/:sessionID/message`, message: `${root}/:sessionID/message/:messageID`, @@ -141,7 +145,7 @@ export const SessionApi = HttpApi.make("session") params: { sessionID: SessionID }, query: WorkspaceRoutingQuery, success: described(Schema.Array(Session.Info), "List of children"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.children", @@ -153,7 +157,7 @@ export const SessionApi = HttpApi.make("session") params: { sessionID: SessionID }, query: WorkspaceRoutingQuery, success: described(Schema.Array(Todo.Info), "Todo list"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.todo", @@ -161,6 +165,56 @@ export const SessionApi = HttpApi.make("session") description: "Retrieve the todo list associated with a specific session, showing tasks and action items.", }), ), + HttpApiEndpoint.get("goal", SessionPaths.goal, { + params: { sessionID: SessionID }, + query: WorkspaceRoutingQuery, + success: described(Schema.NullOr(SessionGoal.Info), "Session goal"), + error: [HttpApiError.BadRequest, ApiNotFoundError], + }).annotateMerge( + OpenApi.annotations({ + identifier: "session.goal.get", + summary: "Get session goal", + description: "Retrieve the current goal for a session, if one exists.", + }), + ), + HttpApiEndpoint.post("goalCreate", SessionPaths.goal, { + params: { sessionID: SessionID }, + query: WorkspaceRoutingQuery, + payload: GoalCreatePayload, + success: described(SessionGoal.Info, "Created session goal"), + error: [HttpApiError.BadRequest, ApiNotFoundError], + }).annotateMerge( + OpenApi.annotations({ + identifier: "session.goal.create", + summary: "Create session goal", + description: "Create a persistent goal for a session.", + }), + ), + HttpApiEndpoint.patch("goalUpdate", SessionPaths.goal, { + params: { sessionID: SessionID }, + query: WorkspaceRoutingQuery, + payload: GoalUpdatePayload, + success: described(SessionGoal.Info, "Updated session goal"), + error: [HttpApiError.BadRequest, ApiNotFoundError], + }).annotateMerge( + OpenApi.annotations({ + identifier: "session.goal.update", + summary: "Update session goal", + description: "Update goal objective, status, or token budget.", + }), + ), + HttpApiEndpoint.delete("goalClear", SessionPaths.goal, { + params: { sessionID: SessionID }, + query: WorkspaceRoutingQuery, + success: described(Schema.Boolean, "Cleared session goal"), + error: [HttpApiError.BadRequest, ApiNotFoundError], + }).annotateMerge( + OpenApi.annotations({ + identifier: "session.goal.clear", + summary: "Clear session goal", + description: "Clear the current session goal.", + }), + ), HttpApiEndpoint.get("diff", SessionPaths.diff, { params: { sessionID: SessionID }, query: DiffQuery, @@ -250,7 +304,7 @@ export const SessionApi = HttpApi.make("session") params: { sessionID: SessionID }, query: WorkspaceRoutingQuery, success: described(Schema.Boolean, "Aborted session"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: HttpApiError.BadRequest, }).annotateMerge( OpenApi.annotations({ identifier: "session.abort", @@ -263,7 +317,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: InitPayload, success: described(Schema.Boolean, "200"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.init", @@ -314,7 +368,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: PromptPayload, success: described(MessageV2.WithParts, "Created message"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.prompt", @@ -327,7 +381,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: PromptPayload, success: described(HttpApiSchema.NoContent, "Prompt accepted"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.prompt_async", @@ -341,7 +395,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: CommandPayload, success: described(MessageV2.WithParts, "Created message"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.command", @@ -354,7 +408,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: ShellPayload, success: described(MessageV2.WithParts, "Created message"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.shell", @@ -367,7 +421,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: RevertPayload, success: described(Session.Info, "Updated session"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.revert", @@ -380,7 +434,7 @@ export const SessionApi = HttpApi.make("session") params: { sessionID: SessionID }, query: WorkspaceRoutingQuery, success: described(Session.Info, "Updated session"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.unrevert", @@ -393,7 +447,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: PermissionResponsePayload, success: described(Schema.Boolean, "Permission processed successfully"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "permission.respond", @@ -406,7 +460,7 @@ export const SessionApi = HttpApi.make("session") params: { sessionID: SessionID, messageID: MessageID }, query: WorkspaceRoutingQuery, success: described(Schema.Boolean, "Successfully deleted message"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "session.deleteMessage", @@ -419,7 +473,7 @@ export const SessionApi = HttpApi.make("session") params: { sessionID: SessionID, messageID: MessageID, partID: PartID }, query: WorkspaceRoutingQuery, success: described(Schema.Boolean, "Successfully deleted part"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "part.delete", @@ -431,7 +485,7 @@ export const SessionApi = HttpApi.make("session") query: WorkspaceRoutingQuery, payload: MessageV2.Part, success: described(MessageV2.Part, "Successfully updated part"), - error: [HttpApiError.BadRequest, HttpApiError.NotFound], + error: [HttpApiError.BadRequest, ApiNotFoundError], }).annotateMerge( OpenApi.annotations({ identifier: "part.update", diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/v2.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/v2.ts index 05da5b720de2..532ccce51d80 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/groups/v2.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/v2.ts @@ -1,10 +1,14 @@ import { HttpApi, OpenApi } from "effect/unstable/httpapi" import { MessageGroup } from "./v2/message" +import { ModelGroup } from "./v2/model" +import { ProviderGroup } from "./v2/provider" import { SessionGroup } from "./v2/session" export const V2Api = HttpApi.make("v2") .add(SessionGroup) .add(MessageGroup) + .add(ModelGroup) + .add(ProviderGroup) .annotateMerge( OpenApi.annotations({ title: "opencode experimental HttpApi", diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/location.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/location.ts new file mode 100644 index 000000000000..f2a9a33557a5 --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/location.ts @@ -0,0 +1,59 @@ +import { Catalog } from "@opencode-ai/core/catalog" +import { Location } from "@opencode-ai/core/location" +import { LocationServiceMap } from "@opencode-ai/core/location-layer" +import { PluginBoot } from "@opencode-ai/core/plugin/boot" +import { Effect, Layer, Schema } from "effect" +import { HttpServerRequest } from "effect/unstable/http" +import { HttpApiMiddleware, OpenApi } from "effect/unstable/httpapi" + +export const LocationQuery = Schema.Struct({ + location: Schema.optional( + Schema.Struct({ + directory: Schema.optional(Schema.String), + workspace: Schema.optional(Schema.String), + }), + ), +}).annotate({ identifier: "V2LocationQuery" }) + +export const locationQueryOpenApi = OpenApi.annotations({ + transform: (operation) => { + const parameters = operation.parameters + if (!Array.isArray(parameters)) return operation + return { + ...operation, + parameters: parameters.map((parameter) => + parameter?.name === "location" && parameter?.in === "query" + ? { ...parameter, style: "deepObject", explode: true } + : parameter, + ), + } + }, +}) + +export class V2LocationMiddleware extends HttpApiMiddleware.Service< + V2LocationMiddleware, + { + provides: Catalog.Service | PluginBoot.Service + } +>()("@opencode/ExperimentalHttpApiV2Location") {} + +function ref(request: HttpServerRequest.HttpServerRequest): Location.Ref { + const query = new URL(request.url, "http://localhost").searchParams + return { + directory: query.get("location[directory]") || request.headers["x-opencode-directory"] || process.cwd(), + workspaceID: query.get("location[workspace]") || request.headers["x-opencode-workspace"], + } +} + +export const layer = Layer.effect( + V2LocationMiddleware, + Effect.gen(function* () { + const locations = yield* LocationServiceMap + return V2LocationMiddleware.of((effect) => + Effect.gen(function* () { + const request = yield* HttpServerRequest.HttpServerRequest + return yield* effect.pipe(Effect.provide(locations.get(ref(request)))) + }), + ) + }), +).pipe(Layer.provide(LocationServiceMap.layer)) diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/message.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/message.ts index 060c6c8a83ea..131a14258611 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/message.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/message.ts @@ -1,5 +1,5 @@ import { SessionID } from "@/session/schema" -import { SessionMessage } from "@/v2/session-message" +import { SessionMessage } from "@opencode-ai/core/session-message" import { Schema } from "effect" import { HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi" import { Authorization } from "../../middleware/authorization" diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/model.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/model.ts new file mode 100644 index 000000000000..d265ac7fc24e --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/model.ts @@ -0,0 +1,29 @@ +import { ModelV2 } from "@opencode-ai/core/model" +import { Schema } from "effect" +import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi" +import { Authorization } from "../../middleware/authorization" +import { LocationQuery, locationQueryOpenApi, V2LocationMiddleware } from "./location" + +export const ModelGroup = HttpApiGroup.make("v2.model") + .add( + HttpApiEndpoint.get("models", "/api/model", { + query: LocationQuery, + success: Schema.Array(ModelV2.Info), + }) + .annotateMerge(locationQueryOpenApi) + .annotateMerge( + OpenApi.annotations({ + identifier: "v2.model.list", + summary: "List v2 models", + description: "Retrieve available v2 models ordered by release date.", + }), + ), + ) + .annotateMerge( + OpenApi.annotations({ + title: "v2 models", + description: "Experimental v2 model routes.", + }), + ) + .middleware(V2LocationMiddleware) + .middleware(Authorization) diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/provider.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/provider.ts new file mode 100644 index 000000000000..7a482ce11491 --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/provider.ts @@ -0,0 +1,47 @@ +import { ProviderV2 } from "@opencode-ai/core/provider" +import { Schema } from "effect" +import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi" +import { ApiNotFoundError } from "../../errors" +import { Authorization } from "../../middleware/authorization" +import { LocationQuery, locationQueryOpenApi, V2LocationMiddleware } from "./location" + +export const ProviderGroup = HttpApiGroup.make("v2.provider") + .add( + HttpApiEndpoint.get("providers", "/api/provider", { + query: LocationQuery, + success: Schema.Array(ProviderV2.Info), + }) + .annotateMerge(locationQueryOpenApi) + .annotateMerge( + OpenApi.annotations({ + identifier: "v2.provider.list", + summary: "List v2 providers", + description: "Retrieve active v2 AI providers so clients can show provider availability and configuration.", + }), + ), + ) + .add( + HttpApiEndpoint.get("provider", "/api/provider/:providerID", { + params: { providerID: ProviderV2.ID }, + query: LocationQuery, + success: ProviderV2.Info, + error: ApiNotFoundError, + }) + .annotateMerge(locationQueryOpenApi) + .annotateMerge( + OpenApi.annotations({ + identifier: "v2.provider.get", + summary: "Get v2 provider", + description: + "Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.", + }), + ), + ) + .annotateMerge( + OpenApi.annotations({ + title: "v2 providers", + description: "Experimental v2 provider routes.", + }), + ) + .middleware(V2LocationMiddleware) + .middleware(Authorization) diff --git a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/session.ts b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/session.ts index 231f1915bb32..0313b5c09776 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/groups/v2/session.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/groups/v2/session.ts @@ -1,6 +1,6 @@ import { SessionID } from "@/session/schema" -import { SessionMessage } from "@/v2/session-message" -import { Prompt } from "@/v2/session-prompt" +import { SessionMessage } from "@opencode-ai/core/session-message" +import { Prompt } from "@opencode-ai/core/session-prompt" import { SessionV2 } from "@/v2/session" import { Schema } from "effect" import { HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi" diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/event.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/event.ts new file mode 100644 index 000000000000..c0bcbc82c04c --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/event.ts @@ -0,0 +1,65 @@ +import { Bus } from "@/bus" +import * as Log from "@opencode-ai/core/util/log" +import { Effect } from "effect" +import * as Stream from "effect/Stream" +import { HttpServerResponse } from "effect/unstable/http" +import { HttpApiBuilder } from "effect/unstable/httpapi" +import * as Sse from "effect/unstable/encoding/Sse" +import { EventApi } from "../groups/event" + +const log = Log.create({ service: "server" }) + +function eventData(data: unknown): Sse.Event { + return { + _tag: "Event", + event: "message", + id: undefined, + data: JSON.stringify(data), + } +} + +function eventResponse(bus: Bus.Interface) { + return Effect.gen(function* () { + const context = yield* Effect.context() + + const events = bus.subscribeAll().pipe( + Stream.provideContext(context), + Stream.takeUntil((event) => event.type === Bus.InstanceDisposed.type), + ) + const heartbeat = Stream.tick("10 seconds").pipe( + Stream.drop(1), + Stream.map(() => ({ id: Bus.createID(), type: "server.heartbeat", properties: {} })), + ) + + log.info("event connected") + return HttpServerResponse.stream( + Stream.make({ id: Bus.createID(), type: "server.connected", properties: {} }).pipe( + Stream.concat(events.pipe(Stream.merge(heartbeat, { haltStrategy: "left" }))), + Stream.map(eventData), + Stream.pipeThroughChannel(Sse.encode()), + Stream.encodeText, + Stream.ensuring(Effect.sync(() => log.info("event disconnected"))), + ), + { + contentType: "text/event-stream", + headers: { + "Cache-Control": "no-cache, no-transform", + "X-Accel-Buffering": "no", + "X-Content-Type-Options": "nosniff", + }, + }, + ) + }) +} + +export const eventHandlers = HttpApiBuilder.group(EventApi, "event", (handlers) => + Effect.gen(function* () { + const bus = yield* Bus.Service + return handlers.handleRaw( + "subscribe", + Effect.fn("EventHttpApi.subscribe")(function* () { + return yield* eventResponse(bus) + }), + ) + }), +) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts index 55272fc2f29a..56a8de3ffac5 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts @@ -5,14 +5,20 @@ import { InstanceState } from "@/effect/instance-state" import { MCP } from "@/mcp" import { Project } from "@/project/project" import { Session } from "@/session/session" +import { ToolJsonSchema } from "@/tool/json-schema" import { ToolRegistry } from "@/tool/registry" -import * as EffectZod from "@opencode-ai/core/effect-zod" import { Worktree } from "@/worktree" import { Effect, Option } from "effect" import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse" import { HttpApiBuilder, HttpApiError } from "effect/unstable/httpapi" import { InstanceHttpApi } from "../api" -import { ConsoleSwitchPayload, SessionListQuery, ToolListQuery } from "../groups/experimental" +import { ConsoleSwitchPayload, SessionListQuery, ToolListQuery, WorktreeApiError } from "../groups/experimental" + +function mapWorktreeError(self: Effect.Effect) { + return self.pipe( + Effect.mapError((error) => new WorktreeApiError({ name: error._tag, data: { message: error.message } })), + ) +} export const experimentalHandlers = HttpApiBuilder.group(InstanceHttpApi, "experimental", (handlers) => Effect.gen(function* () { @@ -79,12 +85,12 @@ export const experimentalHandlers = HttpApiBuilder.group(InstanceHttpApi, "exper const list = yield* registry.tools({ providerID: ctx.query.provider, modelID: ctx.query.model, - agent: yield* agents.get(yield* agents.defaultAgent()), + agent: yield* agents.defaultInfo(), }) return list.map((item) => ({ id: item.id, description: item.description, - parameters: EffectZod.toJsonSchema(item.parameters), + parameters: ToolJsonSchema.fromTool(item), })) }) @@ -100,14 +106,14 @@ export const experimentalHandlers = HttpApiBuilder.group(InstanceHttpApi, "exper const worktreeCreate = Effect.fn("ExperimentalHttpApi.worktreeCreate")(function* (ctx: { payload: Worktree.CreateInput | undefined }) { - return yield* worktreeSvc.create(ctx.payload) + return yield* mapWorktreeError(worktreeSvc.create(ctx.payload)) }) const worktreeRemove = Effect.fn("ExperimentalHttpApi.worktreeRemove")(function* (input: { payload: Worktree.RemoveInput }) { const ctx = yield* InstanceState.context - yield* worktreeSvc.remove(input.payload) + yield* mapWorktreeError(worktreeSvc.remove(input.payload)) yield* project.removeSandbox(ctx.project.id, input.payload.directory) return true }) @@ -115,7 +121,7 @@ export const experimentalHandlers = HttpApiBuilder.group(InstanceHttpApi, "exper const worktreeReset = Effect.fn("ExperimentalHttpApi.worktreeReset")(function* (ctx: { payload: Worktree.ResetInput }) { - yield* worktreeSvc.reset(ctx.payload) + yield* mapWorktreeError(worktreeSvc.reset(ctx.payload)) return true }) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/instance.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/instance.ts index 50a7fecfa70b..4ae318ef21b4 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/instance.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/instance.ts @@ -38,7 +38,9 @@ export const instanceHandlers = HttpApiBuilder.group(InstanceHttpApi, "instance" }) const getVcs = Effect.fn("InstanceHttpApi.vcs")(function* () { - const [branch, default_branch] = yield* Effect.all([vcs.branch(), vcs.defaultBranch()], { concurrency: 2 }) + const [branch, default_branch] = yield* Effect.all([vcs.branch(), vcs.defaultBranch()], { + concurrency: "unbounded", + }) return { branch, default_branch } }) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts index b9d5b5af150b..dba684228bf4 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts @@ -1,13 +1,34 @@ import { ProviderAuth } from "@/provider/auth" import { Config } from "@/config/config" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { Provider } from "@/provider/provider" import { ProviderID } from "@/provider/schema" import { mapValues } from "remeda" import { Effect, Schema } from "effect" import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http" -import { HttpApiBuilder, HttpApiError } from "effect/unstable/httpapi" +import { HttpApiBuilder } from "effect/unstable/httpapi" import { InstanceHttpApi } from "../api" +import { ProviderAuthApiError } from "../groups/provider" + +function mapProviderAuthError(self: Effect.Effect) { + return self.pipe( + Effect.mapError((error) => { + if (error instanceof ProviderAuth.OauthMissing) { + return new ProviderAuthApiError({ name: error._tag, data: { providerID: error.providerID } }) + } + if (error instanceof ProviderAuth.OauthCodeMissing) { + return new ProviderAuthApiError({ name: error._tag, data: { providerID: error.providerID } }) + } + if (error instanceof ProviderAuth.OauthCallbackFailed) { + return new ProviderAuthApiError({ name: error._tag, data: {} }) + } + if (error instanceof ProviderAuth.ValidationFailed) { + return new ProviderAuthApiError({ name: error._tag, data: { field: error.field, message: error.message } }) + } + return new ProviderAuthApiError({ name: "BadRequest", data: {} }) + }), + ) +} export const providerHandlers = HttpApiBuilder.group(InstanceHttpApi, "provider", (handlers) => Effect.gen(function* () { @@ -44,13 +65,13 @@ export const providerHandlers = HttpApiBuilder.group(InstanceHttpApi, "provider" params: { providerID: ProviderID } payload: ProviderAuth.AuthorizeInput }) { - return yield* svc - .authorize({ + return yield* mapProviderAuthError( + svc.authorize({ providerID: ctx.params.providerID, method: ctx.payload.method, inputs: ctx.payload.inputs, - }) - .pipe(Effect.catch(() => Effect.fail(new HttpApiError.BadRequest({})))) + }), + ) }) const authorizeRaw = Effect.fn("ProviderHttpApi.authorizeRaw")(function* (ctx: { @@ -59,7 +80,7 @@ export const providerHandlers = HttpApiBuilder.group(InstanceHttpApi, "provider" }) { const body = yield* Effect.orDie(ctx.request.text) const payload = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(ProviderAuth.AuthorizeInput))(body).pipe( - Effect.mapError(() => new HttpApiError.BadRequest({})), + Effect.mapError(() => new ProviderAuthApiError({ name: "BadRequest", data: {} })), ) // Match legacy route behavior: when authorize() resolves without a // result (e.g. no further redirect), serialize as JSON `null` instead @@ -72,13 +93,13 @@ export const providerHandlers = HttpApiBuilder.group(InstanceHttpApi, "provider" params: { providerID: ProviderID } payload: ProviderAuth.CallbackInput }) { - yield* svc - .callback({ + yield* mapProviderAuthError( + svc.callback({ providerID: ctx.params.providerID, method: ctx.payload.method, code: ctx.payload.code, - }) - .pipe(Effect.catch(() => Effect.fail(new HttpApiError.BadRequest({})))) + }), + ) return true }) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/session-errors.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/session-errors.ts index 98ac2b9ad6d2..d4ab0eb5992f 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/session-errors.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/session-errors.ts @@ -1,9 +1,13 @@ import type { NotFoundError as StorageNotFoundError } from "@/storage/storage" +import type { Session } from "@/session/session" import { Effect } from "effect" +import { HttpApiError } from "effect/unstable/httpapi" import * as ApiError from "../errors" -type StorageNotFound = InstanceType +export function mapStorageNotFound(self: Effect.Effect) { + return self.pipe(Effect.mapError((error) => ApiError.notFound(error.message))) +} -export function mapStorageNotFound(self: Effect.Effect) { - return self.pipe(Effect.mapError((error) => ApiError.notFound(error.data.message))) +export function mapBusy(self: Effect.Effect) { + return self.pipe(Effect.catchTag("SessionBusyError", () => Effect.fail(new HttpApiError.BadRequest({})))) } diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts index 99645f3da3c3..aa2a4915423a 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts @@ -1,5 +1,3 @@ -import * as InstanceState from "@/effect/instance-state" -import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref" import { Agent } from "@/agent/agent" import { Bus } from "@/bus" import { Command } from "@/command" @@ -7,6 +5,7 @@ import { Permission } from "@/permission" import { PermissionID } from "@/permission/schema" import { SessionShare } from "@/share/session" import { Session } from "@/session/session" +import { SessionGoal } from "@/session/goal" import { SessionCompaction } from "@/session/compaction" import { MessageV2 } from "@/session/message-v2" import { SessionPrompt } from "@/session/prompt" @@ -27,6 +26,8 @@ import { CommandPayload, DiffQuery, ForkPayload, + GoalCreatePayload, + GoalUpdatePayload, InitPayload, ListQuery, MessagesQuery, @@ -37,11 +38,24 @@ import { SummarizePayload, UpdatePayload, } from "../groups/session" +import * as ApiError from "../errors" import * as SessionError from "./session-errors" +const tryParseJson = (text: string) => + Effect.try({ + try: () => JSON.parse(text) as unknown, + catch: () => new HttpApiError.BadRequest({}), + }) + +function goalTitle(objective: string) { + const title = objective.replace(/\s+/g, " ").trim() + return title.length > 100 ? title.slice(0, 97) + "..." : title +} + export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", (handlers) => Effect.gen(function* () { const session = yield* Session.Service + const goalSvc = yield* SessionGoal.Service const shareSvc = yield* SessionShare.Service const promptSvc = yield* SessionPrompt.Service const revertSvc = yield* SessionRevert.Service @@ -56,6 +70,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", const scope = yield* Scope.Scope const list = Effect.fn("SessionHttpApi.list")(function* (ctx: { query: typeof ListQuery.Type }) { + yield* promptSvc.resumeGoals().pipe(Effect.ignore) return yield* session.list({ directory: ctx.query.scope === "project" ? undefined : ctx.query.directory, scope: ctx.query.scope, @@ -68,21 +83,94 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", }) const status = Effect.fn("SessionHttpApi.status")(function* () { + yield* promptSvc.resumeGoals().pipe(Effect.ignore) return Object.fromEntries(yield* statusSvc.list()) }) + const requireSession = Effect.fn("SessionHttpApi.requireSession")(function* (sessionID: SessionID) { + return yield* SessionError.mapStorageNotFound(session.get(sessionID)) + }) + + const updateGoalTitle = Effect.fn("SessionHttpApi.updateGoalTitle")(function* (input: { + sessionID: SessionID + objective: string + previousObjective?: string + }) { + const current = yield* requireSession(input.sessionID) + const previousTitle = input.previousObjective ? goalTitle(input.previousObjective) : undefined + if (!Session.isDefaultTitle(current.title) && current.title !== previousTitle) return + + const title = goalTitle(input.objective) + if (!title || current.title === title) return + yield* session.setTitle({ sessionID: input.sessionID, title }) + }) + const get = Effect.fn("SessionHttpApi.get")(function* (ctx: { params: { sessionID: SessionID } }) { - return yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + yield* promptSvc.resumeGoals().pipe(Effect.ignore) + return yield* requireSession(ctx.params.sessionID) }) const children = Effect.fn("SessionHttpApi.children")(function* (ctx: { params: { sessionID: SessionID } }) { + yield* requireSession(ctx.params.sessionID) return yield* session.children(ctx.params.sessionID) }) const todo = Effect.fn("SessionHttpApi.todo")(function* (ctx: { params: { sessionID: SessionID } }) { + yield* requireSession(ctx.params.sessionID) return yield* todoSvc.get(ctx.params.sessionID) }) + const goal = Effect.fn("SessionHttpApi.goal")(function* (ctx: { params: { sessionID: SessionID } }) { + yield* promptSvc.resumeGoals().pipe(Effect.ignore) + yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + return (yield* goalSvc.get(ctx.params.sessionID)) ?? null + }) + + const goalCreate = Effect.fn("SessionHttpApi.goalCreate")(function* (ctx: { + params: { sessionID: SessionID } + payload: typeof GoalCreatePayload.Type + }) { + yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + const created = yield* goalSvc + .create({ ...ctx.payload, sessionID: ctx.params.sessionID }) + .pipe(Effect.mapError(() => new HttpApiError.BadRequest({}))) + yield* updateGoalTitle({ sessionID: ctx.params.sessionID, objective: created.objective }) + yield* promptSvc.continueGoal(ctx.params.sessionID).pipe(Effect.ignore, Effect.forkIn(scope)) + return created + }) + + const goalUpdate = Effect.fn("SessionHttpApi.goalUpdate")(function* (ctx: { + params: { sessionID: SessionID } + payload: typeof GoalUpdatePayload.Type + }) { + yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + const before = yield* goalSvc.get(ctx.params.sessionID) + const updated = yield* goalSvc + .update({ ...ctx.payload, sessionID: ctx.params.sessionID }) + .pipe( + Effect.mapError((error) => + NotFoundError.isInstance(error) ? ApiError.notFound(error.message) : new HttpApiError.BadRequest({}), + ), + ) + if (ctx.payload.objective !== undefined) { + yield* updateGoalTitle({ + sessionID: ctx.params.sessionID, + objective: updated.objective, + previousObjective: before?.objective, + }) + } + if (updated.status === "active") { + yield* promptSvc.continueGoal(ctx.params.sessionID).pipe(Effect.ignore, Effect.forkIn(scope)) + } + return updated + }) + + const goalClear = Effect.fn("SessionHttpApi.goalClear")(function* (ctx: { params: { sessionID: SessionID } }) { + yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + yield* goalSvc.clear(ctx.params.sessionID) + return true + }) + const diff = Effect.fn("SessionHttpApi.diff")(function* (ctx: { params: { sessionID: SessionID } query: typeof DiffQuery.Type @@ -94,6 +182,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } query: typeof MessagesQuery.Type }) { + yield* promptSvc.resumeGoals().pipe(Effect.ignore) if (ctx.query.before && ctx.query.limit === undefined) return yield* new HttpApiError.BadRequest({}) if (ctx.query.before) { const before = ctx.query.before @@ -102,16 +191,18 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", catch: () => new HttpApiError.BadRequest({}), }) } - yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + yield* requireSession(ctx.params.sessionID) if (ctx.query.limit === undefined || ctx.query.limit === 0) { - return yield* session.messages({ sessionID: ctx.params.sessionID }) + return yield* SessionError.mapStorageNotFound(session.messages({ sessionID: ctx.params.sessionID })) } - const page = MessageV2.page({ - sessionID: ctx.params.sessionID, - limit: ctx.query.limit, - before: ctx.query.before, - }) + const page = yield* SessionError.mapStorageNotFound( + MessageV2.page({ + sessionID: ctx.params.sessionID, + limit: ctx.query.limit, + before: ctx.query.before, + }), + ) if (!page.cursor) return page.items const request = yield* HttpServerRequest.HttpServerRequest @@ -133,10 +224,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID; messageID: MessageID } }) { return yield* SessionError.mapStorageNotFound( - Effect.try({ - try: () => MessageV2.get({ sessionID: ctx.params.sessionID, messageID: ctx.params.messageID }), - catch: (error) => error, - }).pipe(Effect.catch((error) => (NotFoundError.isInstance(error) ? Effect.fail(error) : Effect.die(error)))), + MessageV2.get({ sessionID: ctx.params.sessionID, messageID: ctx.params.messageID }), ) }) @@ -150,10 +238,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", const body = yield* Effect.orDie(ctx.request.text) if (body.trim().length === 0) return yield* create({}) - const json = yield* Effect.try({ - try: () => JSON.parse(body) as unknown, - catch: () => new HttpApiError.BadRequest({}), - }) + const json = yield* tryParseJson(body) const payload = yield* Schema.decodeUnknownEffect(Session.CreateInput)(json).pipe( Effect.mapError(() => new HttpApiError.BadRequest({})), ) @@ -169,7 +254,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } payload: typeof UpdatePayload.Type }) { - const current = yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + const current = yield* requireSession(ctx.params.sessionID) if (ctx.payload.title !== undefined) { yield* session.setTitle({ sessionID: ctx.params.sessionID, title: ctx.payload.title }) } @@ -182,7 +267,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", if (ctx.payload.time?.archived !== undefined) { yield* session.setArchived({ sessionID: ctx.params.sessionID, time: ctx.payload.time.archived }) } - return yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + return yield* requireSession(ctx.params.sessionID) }) const fork = Effect.fn("SessionHttpApi.fork")(function* (ctx: { @@ -201,10 +286,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", const body = yield* Effect.orDie(ctx.request.text) if (body.trim().length === 0) return yield* fork({ params: ctx.params }) - const json = yield* Effect.try({ - try: () => JSON.parse(body) as unknown, - catch: () => new HttpApiError.BadRequest({}), - }) + const json = yield* tryParseJson(body) const payload = yield* Schema.decodeUnknownEffect(ForkPayload)(json).pipe( Effect.mapError(() => new HttpApiError.BadRequest({})), ) @@ -220,6 +302,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } payload: typeof InitPayload.Type }) { + yield* requireSession(ctx.params.sessionID) yield* promptSvc .command({ sessionID: ctx.params.sessionID, @@ -238,23 +321,25 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", // ErrorMiddleware → NamedError.Unknown 500) instead of blanket-mapping // every failure to a 400 BadRequest. const share = Effect.fn("SessionHttpApi.share")(function* (ctx: { params: { sessionID: SessionID } }) { + yield* requireSession(ctx.params.sessionID) yield* shareSvc.share(ctx.params.sessionID).pipe(Effect.mapError(() => new HttpApiError.InternalServerError({}))) - return yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + return yield* requireSession(ctx.params.sessionID) }) const unshare = Effect.fn("SessionHttpApi.unshare")(function* (ctx: { params: { sessionID: SessionID } }) { + yield* requireSession(ctx.params.sessionID) yield* shareSvc .unshare(ctx.params.sessionID) .pipe(Effect.mapError(() => new HttpApiError.InternalServerError({}))) - return yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID)) + return yield* requireSession(ctx.params.sessionID) }) const summarize = Effect.fn("SessionHttpApi.summarize")(function* (ctx: { params: { sessionID: SessionID } payload: typeof SummarizePayload.Type }) { - yield* revertSvc.cleanup(yield* SessionError.mapStorageNotFound(session.get(ctx.params.sessionID))) - const messages = yield* session.messages({ sessionID: ctx.params.sessionID }) + yield* revertSvc.cleanup(yield* requireSession(ctx.params.sessionID)) + const messages = yield* SessionError.mapStorageNotFound(session.messages({ sessionID: ctx.params.sessionID })) const defaultAgent = yield* agentSvc.defaultAgent() const currentAgent = messages.findLast((message) => message.info.role === "user")?.info.agent ?? defaultAgent @@ -275,18 +360,13 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } payload: typeof PromptPayload.Type }) { - const instance = yield* InstanceState.context - const workspace = yield* InstanceState.workspaceID + yield* requireSession(ctx.params.sessionID) const message = yield* promptSvc .prompt({ ...ctx.payload, sessionID: ctx.params.sessionID, }) - .pipe( - Effect.provideService(InstanceRef, instance), - Effect.provideService(WorkspaceRef, workspace), - Effect.mapError(() => new HttpApiError.BadRequest({})), - ) + .pipe(Effect.mapError(() => new HttpApiError.BadRequest({}))) return HttpServerResponse.stream(Stream.make(JSON.stringify(message)).pipe(Stream.encodeText), { contentType: "application/json", }) @@ -296,10 +376,13 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } payload: typeof PromptPayload.Type }) { + yield* requireSession(ctx.params.sessionID) yield* promptSvc.prompt({ ...ctx.payload, sessionID: ctx.params.sessionID }).pipe( Effect.catchCause((cause) => Effect.gen(function* () { - yield* Effect.logError("prompt_async failed", { sessionID: ctx.params.sessionID, cause }) + yield* Effect.logError("prompt_async failed").pipe( + Effect.annotateLogs({ sessionID: ctx.params.sessionID, cause }), + ) yield* bus.publish(Session.Event.Error, { sessionID: ctx.params.sessionID, error: new NamedError.Unknown({ message: Cause.pretty(cause) }).toObject(), @@ -315,6 +398,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } payload: typeof CommandPayload.Type }) { + yield* requireSession(ctx.params.sessionID) return yield* promptSvc .command({ ...ctx.payload, sessionID: ctx.params.sessionID }) .pipe(Effect.mapError(() => new HttpApiError.BadRequest({}))) @@ -324,24 +408,28 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID } payload: typeof ShellPayload.Type }) { - return yield* promptSvc.shell({ ...ctx.payload, sessionID: ctx.params.sessionID }) + yield* requireSession(ctx.params.sessionID) + return yield* SessionError.mapBusy(promptSvc.shell({ ...ctx.payload, sessionID: ctx.params.sessionID })) }) const revert = Effect.fn("SessionHttpApi.revert")(function* (ctx: { params: { sessionID: SessionID } payload: typeof RevertPayload.Type }) { - return yield* revertSvc.revert({ sessionID: ctx.params.sessionID, ...ctx.payload }) + yield* requireSession(ctx.params.sessionID) + return yield* SessionError.mapBusy(revertSvc.revert({ sessionID: ctx.params.sessionID, ...ctx.payload })) }) const unrevert = Effect.fn("SessionHttpApi.unrevert")(function* (ctx: { params: { sessionID: SessionID } }) { - return yield* revertSvc.unrevert({ sessionID: ctx.params.sessionID }) + yield* requireSession(ctx.params.sessionID) + return yield* SessionError.mapBusy(revertSvc.unrevert({ sessionID: ctx.params.sessionID })) }) const permissionRespond = Effect.fn("SessionHttpApi.permissionRespond")(function* (ctx: { - params: { permissionID: PermissionID } + params: { sessionID: SessionID; permissionID: PermissionID } payload: typeof PermissionResponsePayload.Type }) { + yield* requireSession(ctx.params.sessionID) yield* permissionSvc.reply({ requestID: ctx.params.permissionID, reply: ctx.payload.response }) return true }) @@ -349,7 +437,8 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", const deleteMessage = Effect.fn("SessionHttpApi.deleteMessage")(function* (ctx: { params: { sessionID: SessionID; messageID: MessageID } }) { - yield* runState.assertNotBusy(ctx.params.sessionID) + yield* requireSession(ctx.params.sessionID) + yield* SessionError.mapBusy(runState.assertNotBusy(ctx.params.sessionID)) yield* session.removeMessage(ctx.params) return true }) @@ -357,6 +446,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", const deletePart = Effect.fn("SessionHttpApi.deletePart")(function* (ctx: { params: { sessionID: SessionID; messageID: MessageID; partID: PartID } }) { + yield* requireSession(ctx.params.sessionID) yield* session.removePart(ctx.params) return true }) @@ -365,15 +455,14 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", params: { sessionID: SessionID; messageID: MessageID; partID: PartID } payload: typeof MessageV2.Part.Type }) { + yield* requireSession(ctx.params.sessionID) const payload = ctx.payload as MessageV2.Part if ( payload.id !== ctx.params.partID || payload.messageID !== ctx.params.messageID || payload.sessionID !== ctx.params.sessionID ) { - throw new Error( - `Part mismatch: body.id='${payload.id}' vs partID='${ctx.params.partID}', body.messageID='${payload.messageID}' vs messageID='${ctx.params.messageID}', body.sessionID='${payload.sessionID}' vs sessionID='${ctx.params.sessionID}'`, - ) + return yield* new HttpApiError.BadRequest({}) } return yield* session.updatePart(payload) }) @@ -384,6 +473,10 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session", .handle("get", get) .handle("children", children) .handle("todo", todo) + .handle("goal", goal) + .handle("goalCreate", goalCreate) + .handle("goalUpdate", goalUpdate) + .handle("goalClear", goalClear) .handle("diff", diff) .handle("messages", messages) .handle("message", message) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/sync.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/sync.ts index 152d22f98e6b..ffe8d0baa4b8 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/sync.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/sync.ts @@ -11,7 +11,7 @@ import { lte } from "drizzle-orm" import { not } from "drizzle-orm" import { or } from "drizzle-orm" import { Effect, Scope } from "effect" -import { HttpApiBuilder } from "effect/unstable/httpapi" +import { HttpApiBuilder, HttpApiError } from "effect/unstable/httpapi" import { InstanceHttpApi } from "../api" import { HistoryPayload, ReplayPayload, SessionPayload } from "../groups/sync" import * as Log from "@opencode-ai/core/util/log" @@ -59,7 +59,7 @@ export const syncHandlers = HttpApiBuilder.group(InstanceHttpApi, "sync", (handl const steal = Effect.fn("SyncHttpApi.steal")(function* (ctx: { payload: typeof SessionPayload.Type }) { const workspaceID = yield* InstanceState.workspaceID - if (!workspaceID) throw new Error("Cannot steal session without workspace context") + if (!workspaceID) return yield* new HttpApiError.BadRequest({}) yield* sync.run(Session.Event.Updated, { sessionID: ctx.payload.sessionID, diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/v2.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2.ts index 55cb53458172..daa799b7a8b4 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/v2.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2.ts @@ -1,6 +1,12 @@ import { SessionV2 } from "@/v2/session" import { Layer } from "effect" +import { layer as v2LocationLayer } from "../groups/v2/location" import { messageHandlers } from "./v2/message" +import { modelHandlers } from "./v2/model" +import { providerHandlers } from "./v2/provider" import { sessionHandlers } from "./v2/session" -export const v2Handlers = Layer.mergeAll(sessionHandlers, messageHandlers).pipe(Layer.provide(SessionV2.defaultLayer)) +export const v2Handlers = Layer.mergeAll(sessionHandlers, messageHandlers, modelHandlers, providerHandlers).pipe( + Layer.provide(v2LocationLayer), + Layer.provide(SessionV2.defaultLayer), +) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/message.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/message.ts index 92e37142b407..fd710ba954a7 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/message.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/message.ts @@ -1,4 +1,4 @@ -import { SessionMessage } from "@/v2/session-message" +import { SessionMessage } from "@opencode-ai/core/session-message" import { SessionV2 } from "@/v2/session" import { Effect, Schema } from "effect" import * as DateTime from "effect/DateTime" diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/model.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/model.ts new file mode 100644 index 000000000000..9ba4c654a960 --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/model.ts @@ -0,0 +1,19 @@ +import { Catalog } from "@opencode-ai/core/catalog" +import { PluginBoot } from "@opencode-ai/core/plugin/boot" +import { Effect } from "effect" +import { HttpApiBuilder } from "effect/unstable/httpapi" +import { InstanceHttpApi } from "../../api" + +export const modelHandlers = HttpApiBuilder.group(InstanceHttpApi, "v2.model", (handlers) => + Effect.gen(function* () { + return handlers.handle( + "models", + Effect.fn(function* () { + const catalog = yield* Catalog.Service + const pluginBoot = yield* PluginBoot.Service + yield* pluginBoot.wait() + return yield* catalog.model.available() + }), + ) + }), +) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/provider.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/provider.ts new file mode 100644 index 000000000000..a77cb159c890 --- /dev/null +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/v2/provider.ts @@ -0,0 +1,32 @@ +import { Catalog } from "@opencode-ai/core/catalog" +import { PluginBoot } from "@opencode-ai/core/plugin/boot" +import { Effect } from "effect" +import { HttpApiBuilder } from "effect/unstable/httpapi" +import { InstanceHttpApi } from "../../api" +import { notFound } from "../../errors" + +export const providerHandlers = HttpApiBuilder.group(InstanceHttpApi, "v2.provider", (handlers) => + Effect.gen(function* () { + return handlers + .handle( + "providers", + Effect.fn(function* () { + const catalog = yield* Catalog.Service + const pluginBoot = yield* PluginBoot.Service + yield* pluginBoot.wait() + return yield* catalog.provider.available() + }), + ) + .handle( + "provider", + Effect.fn(function* (ctx) { + const catalog = yield* Catalog.Service + const pluginBoot = yield* PluginBoot.Service + yield* pluginBoot.wait() + return yield* catalog.provider + .get(ctx.params.providerID) + .pipe(Effect.catchTag("CatalogV2.ProviderNotFound", () => Effect.fail(notFound("Provider not found")))) + }), + ) + }), +) diff --git a/packages/opencode/src/server/routes/instance/httpapi/lifecycle.ts b/packages/opencode/src/server/routes/instance/httpapi/lifecycle.ts index 4edfa8078738..30347d85ffdc 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/lifecycle.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/lifecycle.ts @@ -1,5 +1,5 @@ import { EffectBridge } from "@/effect/bridge" -import type { InstanceContext } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import { InstanceStore } from "@/project/instance-store" import * as Log from "@opencode-ai/core/util/log" import { Effect } from "effect" diff --git a/packages/opencode/src/server/routes/instance/httpapi/middleware/error.ts b/packages/opencode/src/server/routes/instance/httpapi/middleware/error.ts index 6f3c33a647a5..74c690ad6cd0 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/middleware/error.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/middleware/error.ts @@ -1,7 +1,3 @@ -import { Provider } from "@/provider/provider" -import { Session } from "@/session/session" -import { NotFoundError } from "@/storage/storage" -import { iife } from "@/util/iife" import { NamedError } from "@opencode-ai/core/util/error" import * as Log from "@opencode-ai/core/util/log" import { Cause, Effect } from "effect" @@ -24,31 +20,10 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect) const error = defect.defect log.error("failed", { error, cause: Cause.pretty(cause) }) - if (error instanceof NamedError) { - return Effect.succeed( - HttpServerResponse.jsonUnsafe(error.toObject(), { - status: iife(() => { - if (error instanceof NotFoundError) return 404 - if (error instanceof Provider.ModelNotFoundError) return 400 - if (error.name === "ProviderAuthValidationFailed") return 400 - if (error.name.startsWith("Worktree")) return 400 - return 500 - }), - }), - ) - } - if (error instanceof Session.BusyError) { - return Effect.succeed( - HttpServerResponse.jsonUnsafe(new NamedError.Unknown({ message: error.message }).toObject(), { - status: 400, - }), - ) - } - return Effect.succeed( HttpServerResponse.jsonUnsafe( new NamedError.Unknown({ - message: error instanceof Error && error.stack ? error.stack : String(error), + message: "Unexpected server error. Check server logs for details.", }).toObject(), { status: 500 }, ), diff --git a/packages/opencode/src/server/routes/instance/httpapi/public.ts b/packages/opencode/src/server/routes/instance/httpapi/public.ts index 12d3791eccb8..3c7b2206f6f7 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/public.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/public.ts @@ -140,10 +140,23 @@ function matchLegacyOpenApi(input: Record) { : operation.requestBody.content?.["application/json"]?.schema?.properties if (properties?.id) properties.id = { anyOf: [properties.id, { type: "null" }] } } + if (path === "/session/{sessionID}/goal" && method === "patch") { + const ref = operation.requestBody.content?.["application/json"]?.schema?.$ref?.replace( + "#/components/schemas/", + "", + ) + const properties = ref + ? spec.components?.schemas?.[ref]?.properties + : operation.requestBody.content?.["application/json"]?.schema?.properties + if (properties?.tokenBudget) properties.tokenBudget = nullable(properties.tokenBudget) + } } - for (const response of Object.values(operation.responses ?? {})) { + for (const [status, response] of Object.entries(operation.responses ?? {})) { for (const content of Object.values(response.content ?? {})) { if (content.schema) content.schema = stripOptionalNull(structuredClone(content.schema)) + if (path === "/session/{sessionID}/goal" && method === "get" && status === "200" && content.schema) { + content.schema = nullable(content.schema) + } } } // Auth is still runtime middleware outside the public OpenAPI metadata, so diff --git a/packages/opencode/src/server/routes/instance/httpapi/server.ts b/packages/opencode/src/server/routes/instance/httpapi/server.ts index 7ce21dfadb34..e14c0c06ffb5 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/server.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/server.ts @@ -1,4 +1,4 @@ -import { Context, Effect, Layer } from "effect" +import { Config as EffectConfig, Context, Effect, Layer } from "effect" import { HttpApiBuilder, OpenApi } from "effect/unstable/httpapi" import { FetchHttpClient, @@ -21,6 +21,7 @@ import { File } from "@/file" import { FileWatcher } from "@/file/watcher" import { Ripgrep } from "@/file/ripgrep" import { Format } from "@/format" +import { RuntimeFlags } from "@/effect/runtime-flags" import { LSP } from "@/lsp/lsp" import { MCP } from "@/mcp" import { Permission } from "@/permission" @@ -29,12 +30,13 @@ import { InstanceLayer } from "@/project/instance-layer" import { Plugin } from "@/plugin" import { Project } from "@/project/project" import { ProviderAuth } from "@/provider/auth" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { Provider } from "@/provider/provider" import { Pty } from "@/pty" import { PtyTicket } from "@/pty/ticket" import { Question } from "@/question" import { Session } from "@/session/session" +import { SessionGoal } from "@/session/goal" import { SessionCompaction } from "@/session/compaction" import { SessionPrompt } from "@/session/prompt" import { SessionRevert } from "@/session/revert" @@ -44,6 +46,7 @@ import { SessionSummary } from "@/session/summary" import { Todo } from "@/session/todo" import { SessionShare } from "@/share/session" import { ShareNext } from "@/share/share-next" +import { EventV2Bridge } from "@/event-v2-bridge" import { Skill } from "@/skill" import { Snapshot } from "@/snapshot" import { SyncEvent } from "@/sync" @@ -58,7 +61,8 @@ import { ServerAuth } from "@/server/auth" import { InstanceHttpApi, RootHttpApi } from "./api" import { PublicApi } from "./public" import { authorizationLayer, authorizationRouterMiddleware } from "./middleware/authorization" -import { EventApi, eventHandlers } from "./event" +import { EventApi } from "./groups/event" +import { eventHandlers } from "./handlers/event" import { configHandlers } from "./handlers/config" import { controlHandlers } from "./handlers/control" import { experimentalHandlers } from "./handlers/experimental" @@ -88,15 +92,6 @@ import { schemaErrorLayer } from "./middleware/schema-error" export const context = Context.makeUnsafe(new Map()) -const runtime = HttpRouter.middleware()( - Effect.succeed((effect) => - Effect.gen(function* () { - yield* Effect.annotateCurrentSpan({ "opencode.server.backend": "effect-httpapi" }) - return yield* effect - }), - ), -).layer - const cors = (corsOptions?: CorsOptions) => HttpRouter.middleware( HttpMiddleware.cors({ @@ -171,11 +166,23 @@ const uiRoute = HttpRouter.use((router) => Effect.gen(function* () { const fs = yield* AppFileSystem.Service const client = yield* HttpClient.HttpClient - yield* router.add("*", "/*", (request) => serveUIEffect(request, { fs, client })) + const flags = yield* RuntimeFlags.Service + yield* router.add("*", "/*", (request) => + serveUIEffect(request, { fs, client, disableEmbeddedWebUi: flags.disableEmbeddedWebUi }), + ) }), ).pipe(Layer.provide(authOnlyRouterLayer)) -export function createRoutes(corsOptions?: CorsOptions) { +type RouteRequirements = + | HttpRouter.HttpRouter + | HttpRouter.Request<"Error", unknown> + | HttpRouter.Request<"GlobalError", unknown> + | HttpRouter.Request<"Requires", unknown> + | HttpRouter.Request<"GlobalRequires", never> + +export function createRoutes( + corsOptions?: CorsOptions, +): Layer.Layer { return Layer.mergeAll(rootApiRoutes, eventApiRoutes, instanceRoutes, docRoute, uiRoute).pipe( Layer.provide([ errorLayer, @@ -183,7 +190,6 @@ export function createRoutes(corsOptions?: CorsOptions) { corsVaryFix, fenceLayer, cors(corsOptions), - runtime, Account.defaultLayer, Agent.defaultLayer, Auth.defaultLayer, @@ -205,7 +211,9 @@ export function createRoutes(corsOptions?: CorsOptions) { PtyTicket.defaultLayer, Question.defaultLayer, Ripgrep.defaultLayer, + RuntimeFlags.defaultLayer, Session.defaultLayer, + SessionGoal.defaultLayer, SessionCompaction.defaultLayer, SessionPrompt.defaultLayer, SessionRevert.defaultLayer, @@ -216,6 +224,7 @@ export function createRoutes(corsOptions?: CorsOptions) { ShareNext.defaultLayer, Snapshot.defaultLayer, SyncEvent.defaultLayer, + EventV2Bridge.defaultLayer, Skill.defaultLayer, Todo.defaultLayer, ToolRegistry.defaultLayer, @@ -227,28 +236,20 @@ export function createRoutes(corsOptions?: CorsOptions) { FetchHttpClient.layer, HttpServer.layerServices, ]), - Layer.provideMerge(Layer.succeed(CorsConfig)(corsOptions)), - Layer.provideMerge(InstanceLayer.layer), - Layer.provideMerge(Observability.layer), + Layer.provide(Layer.succeed(CorsConfig)(corsOptions)), + Layer.provide(InstanceLayer.layer), + Layer.provide(Observability.layer), ) } export const routes = createRoutes() -const defaultWebHandler = lazy(() => +export const webHandler = lazy(() => HttpRouter.toWebHandler(routes, { + disableLogger: true, memoMap, middleware: disposeMiddleware, }), ) -export function webHandler(corsOptions?: CorsOptions) { - if (!corsOptions?.cors?.length) return defaultWebHandler() - return HttpRouter.toWebHandler(createRoutes(corsOptions), { - // Server-level CORS options are dynamic; don't reuse the default route layer memoized without them. - memoMap: Layer.makeMemoMapUnsafe(), - middleware: disposeMiddleware, - }) -} - -export * as ExperimentalHttpApiServer from "./server" +export * as HttpApiApp from "./server" diff --git a/packages/opencode/src/server/server.ts b/packages/opencode/src/server/server.ts index 67a728b80109..9a448b78d626 100644 --- a/packages/opencode/src/server/server.ts +++ b/packages/opencode/src/server/server.ts @@ -1,21 +1,22 @@ +import "./init-projectors" + +import { NodeHttpServer } from "@effect/platform-node" import * as Log from "@opencode-ai/core/util/log" import { ConfigProvider, Context, Effect, Exit, Layer, Scope } from "effect" import { HttpRouter, HttpServer } from "effect/unstable/http" import { OpenApi } from "effect/unstable/httpapi" -import * as HttpApiServer from "#httpapi-server" +import { createServer } from "node:http" import { MDNS } from "./mdns" -import { initProjectors } from "./projectors" -import { ExperimentalHttpApiServer } from "./routes/instance/httpapi/server" +import { HttpApiApp } from "./routes/instance/httpapi/server" import { disposeMiddleware } from "./routes/instance/httpapi/lifecycle" import { WebSocketTracker } from "./routes/instance/httpapi/websocket-tracker" import { PublicApi } from "./routes/instance/httpapi/public" import type { CorsOptions } from "./cors" +import { lazy } from "@/util/lazy" // @ts-ignore This global is needed to prevent ai-sdk from logging warnings to stdout https://github.com/vercel/ai/blob/2dc67e0ef538307f21368db32d5a12345d98831b/packages/ai/src/logger/log-warnings.ts#L85 globalThis.AI_SDK_LOG_WARNINGS = false -initProjectors() - const log = Log.create({ service: "server" }) export type Listener = { @@ -36,19 +37,34 @@ type ListenOptions = CorsOptions & { mdns?: boolean mdnsDomain?: string } +type ListenerState = { + scope: Scope.Scope + server: Context.Service.Shape + http: ListenerServer + websockets: WebSocketTracker.Interface +} +type EffectListener = Omit & { + stop: (close?: boolean) => Effect.Effect +} + +interface ListenerServer { + readonly closeAll: Effect.Effect +} + +class ListenerServerService extends Context.Service()( + "@opencode/ListenerServer", +) {} -const defaultHttpApi = (() => { - const handler = ExperimentalHttpApiServer.webHandler().handler +export const Default = lazy(() => { + const handler = HttpApiApp.webHandler().handler const app: ServerApp = { - fetch: (request: Request) => handler(request, ExperimentalHttpApiServer.context), + fetch: (request: Request) => handler(request, HttpApiApp.context), request(input, init) { return app.fetch(input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init)) }, } return { app } -})() - -export const Default = () => defaultHttpApi +}) export async function openapi() { return OpenApi.fromApi(PublicApi) @@ -57,102 +73,146 @@ export async function openapi() { export let url: URL export async function listen(opts: ListenOptions): Promise { - log.info("server backend", { "opencode.server.runtime": HttpApiServer.name }) - - const buildLayer = (port: number) => - HttpRouter.serve(ExperimentalHttpApiServer.createRoutes(opts), { - middleware: disposeMiddleware, - disableLogger: true, - disableListenLog: true, - }).pipe( - Layer.provideMerge(WebSocketTracker.layer), - Layer.provideMerge(HttpApiServer.layer({ port, hostname: opts.hostname })), - // Install a fresh `ConfigProvider` per listener so `Config.string(...)` - // reads reflect the current `process.env`. Effect's default - // `ConfigProvider` snapshots `process.env` on first read and caches the - // result on a module-singleton Reference; without overriding it here, - // every later `Server.listen()` keeps observing that initial snapshot. - Layer.provide(ConfigProvider.layer(ConfigProvider.fromEnv())), - ) - - const start = async (port: number) => { - const scope = Scope.makeUnsafe() - try { - const layer = buildLayer(port) as Layer.Layer< - HttpServer.HttpServer | WebSocketTracker.Service | HttpApiServer.Service, - unknown, - never - > - const ctx = await Effect.runPromise(Layer.buildWithMemoMap(layer, Layer.makeMemoMapUnsafe(), scope)) - return { scope, ctx } - } catch (err) { - await Effect.runPromise(Scope.close(scope, Exit.void)).catch(() => undefined) - throw err - } + const listener = await Effect.runPromise(listenEffect(opts)) + return { + hostname: listener.hostname, + port: listener.port, + url: listener.url, + stop: (close?: boolean) => Effect.runPromiseExit(listener.stop(close)).then(() => undefined), } +} + +const listenEffect: (opts: ListenOptions) => Effect.Effect = Effect.fn("Server.listen")( + function* (opts: ListenOptions) { + const state = yield* startWithPortFallback(opts) + const address = yield* tcpAddress(state) + const listenerUrl = makeURL(opts.hostname, address.port) + url = listenerUrl + + const unpublishMdns = yield* setupMdns(opts, address.port, state.scope) + + return { + hostname: opts.hostname, + port: address.port, + url: listenerUrl, + stop: yield* makeStop(state, unpublishMdns), + } + }, +) + +function listenerLayer(opts: ListenOptions, port: number) { + return HttpRouter.serve(HttpApiApp.createRoutes(opts), { + middleware: disposeMiddleware, + disableLogger: true, + disableListenLog: true, + }).pipe( + Layer.provideMerge(WebSocketTracker.layer), + Layer.provideMerge(serverLayer({ port, hostname: opts.hostname })), + // Install a fresh `ConfigProvider` per listener so `Config.string(...)` + // reads reflect the current `process.env`. Effect's default + // `ConfigProvider` snapshots `process.env` on first read and caches the + // result on a module-singleton Reference; without overriding it here, + // every later `Server.listen()` keeps observing that initial snapshot. + Layer.provide(ConfigProvider.layer(ConfigProvider.fromEnv())), + ) +} - // Match the legacy adapter port-resolution behavior: explicit `0` prefers +function startWithPortFallback(opts: ListenOptions) { + if (opts.port !== 0) return startListener(opts, opts.port) + // Match the legacy listener port-resolution behavior: explicit `0` prefers // 4096 first, then any free port. - let resolved: Awaited> | undefined - if (opts.port === 0) { - resolved = await start(4096).catch(() => undefined) - if (!resolved) resolved = await start(0) - } else { - resolved = await start(opts.port) - } - if (!resolved) throw new Error(`Failed to start server on port ${opts.port}`) + return startListener(opts, 4096).pipe(Effect.catch(() => startListener(opts, 0))) +} - const server = Context.get(resolved.ctx, HttpServer.HttpServer) - if (server.address._tag !== "TcpAddress") { - await Effect.runPromise(Scope.close(resolved.scope, Exit.void)) - throw new Error(`Unexpected HttpServer address tag: ${server.address._tag}`) - } - const port = server.address.port - - const innerUrl = new URL("http://localhost") - innerUrl.hostname = opts.hostname - innerUrl.port = String(port) - url = innerUrl - - const mdns = - opts.mdns && port && opts.hostname !== "127.0.0.1" && opts.hostname !== "localhost" && opts.hostname !== "::1" - if (mdns) { - MDNS.publish(port, opts.mdnsDomain) - } else if (opts.mdns) { - log.warn("mDNS enabled but hostname is loopback; skipping mDNS publish") - } +function startListener(opts: ListenOptions, port: number) { + const scope = Scope.makeUnsafe() + return Layer.buildWithMemoMap(listenerLayer(opts, port), Layer.makeMemoMapUnsafe(), scope).pipe( + Effect.provide(HttpApiApp.context), + Effect.onError(() => Scope.close(scope, Exit.void).pipe(Effect.ignore)), + Effect.map( + (ctx): ListenerState => ({ + scope, + server: Context.get(ctx, HttpServer.HttpServer), + http: Context.get(ctx, ListenerServerService), + websockets: Context.get(ctx, WebSocketTracker.Service), + }), + ), + ) +} - let forceStopPromise: Promise | undefined - let stopPromise: Promise | undefined - let mdnsUnpublished = false - const unpublish = () => { - if (!mdns || mdnsUnpublished) return - mdnsUnpublished = true - MDNS.unpublish() - } - const forceStop = () => { - forceStopPromise ??= Effect.runPromiseExit( +function tcpAddress(state: ListenerState) { + return Effect.gen(function* () { + if (state.server.address._tag === "TcpAddress") return state.server.address + yield* Scope.close(state.scope, Exit.void).pipe(Effect.ignore) + return yield* Effect.die(new Error(`Unexpected HttpServer address tag: ${state.server.address._tag}`)) + }) +} + +function makeURL(hostname: string, port: number) { + const result = new URL("http://localhost") + result.hostname = hostname + result.port = String(port) + return result +} + +function setupMdns(opts: ListenOptions, port: number, scope: Scope.Scope) { + return Effect.gen(function* () { + const publish = + opts.mdns && port && opts.hostname !== "127.0.0.1" && opts.hostname !== "localhost" && opts.hostname !== "::1" + if (publish) { + const unpublish = yield* Effect.cached(Effect.sync(() => MDNS.unpublish())) + yield* Effect.sync(() => MDNS.publish(port, opts.mdnsDomain)) + yield* Scope.addFinalizer(scope, unpublish) + return unpublish + } + if (opts.mdns) log.warn("mDNS enabled but hostname is loopback; skipping mDNS publish") + return Effect.void + }) +} + +function makeStop(state: ListenerState, unpublishMdns: Effect.Effect) { + return Effect.gen(function* () { + const forceCloseOnce = yield* Effect.cached(forceClose(state).pipe(Effect.ignore)) + const closeScopeOnce = yield* Effect.cached(Scope.close(state.scope, Exit.void).pipe(Effect.ignore)) + + return (close?: boolean) => Effect.gen(function* () { - yield* Context.get(resolved!.ctx, HttpApiServer.Service).closeAll - yield* Context.get(resolved!.ctx, WebSocketTracker.Service).closeAll - }), - ).then(() => undefined) - return forceStopPromise - } + yield* unpublishMdns + if (close) yield* forceCloseOnce + yield* closeScopeOnce + }) + }) +} - return { - hostname: opts.hostname, - port, - url: innerUrl, - stop: (close?: boolean) => { - unpublish() - const requested = close ? forceStop() : Promise.resolve() - stopPromise ??= requested - .then(() => Effect.runPromiseExit(Scope.close(resolved!.scope, Exit.void))) - .then(() => undefined) - return requested.then(() => stopPromise!) - }, - } +function forceClose(state: ListenerState) { + return Effect.all([state.http.closeAll, state.websockets.closeAll], { concurrency: "unbounded", discard: true }) +} + +function serverLayer(opts: { port: number; hostname: string }) { + const server = createServer() + const serverRef = { closeStarted: false, forceStop: false } + const close = server.close.bind(server) + // Keep shutdown owned by NodeHttpServer, but honor listener.stop(true) by + // force-closing active HTTP sockets when its finalizer calls server.close(). + // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- Node's overloads don't preserve a monkey-patched method assignment. + server.close = ((callback?: Parameters[0]) => { + serverRef.closeStarted = true + const result = close(callback) + if (serverRef.forceStop) server.closeAllConnections() + return result + }) as typeof server.close + + return Layer.mergeAll( + NodeHttpServer.layer(() => server, { port: opts.port, host: opts.hostname, gracefulShutdownTimeout: "1 second" }), + Layer.succeed(ListenerServerService)( + ListenerServerService.of({ + closeAll: Effect.sync(() => { + serverRef.forceStop = true + if (serverRef.closeStarted) server.closeAllConnections() + }), + }), + ), + ) } export * as Server from "./server" diff --git a/packages/opencode/src/server/shared/ui.ts b/packages/opencode/src/server/shared/ui.ts index 0e27dcf220ea..fd4c73188063 100644 --- a/packages/opencode/src/server/shared/ui.ts +++ b/packages/opencode/src/server/shared/ui.ts @@ -1,14 +1,10 @@ -import { Flag } from "@opencode-ai/core/flag/flag" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Effect, Stream } from "effect" import { HttpBody, HttpClient, HttpClientRequest, HttpServerRequest, HttpServerResponse } from "effect/unstable/http" import { createHash } from "node:crypto" import { ProxyUtil } from "../proxy-util" -const embeddedUIPromise = Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI - ? Promise.resolve(null) - : // @ts-expect-error - generated file at build time - import("opencode-web-ui.gen.ts").then((module) => module.default as Record).catch(() => null) +let embeddedUIPromise: Promise | null> | undefined export const UI_UPSTREAM = new URL("https://app.opencode.ai") @@ -45,9 +41,11 @@ export function upstreamURL(path: string) { return new URL(path, UI_UPSTREAM).toString() } -export function embeddedUI() { - if (Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI) return Promise.resolve(null) - return embeddedUIPromise +export function embeddedUI(disableEmbeddedWebUi: boolean) { + if (disableEmbeddedWebUi) return Promise.resolve(null) + return (embeddedUIPromise ??= + // @ts-expect-error - generated file at build time + import("opencode-web-ui.gen.ts").then((module) => module.default as Record).catch(() => null)) } function notFound() { @@ -79,10 +77,10 @@ export function serveEmbeddedUIEffect( export function serveUIEffect( request: HttpServerRequest.HttpServerRequest, - services: { fs: AppFileSystem.Interface; client: HttpClient.HttpClient }, + services: { fs: AppFileSystem.Interface; client: HttpClient.HttpClient; disableEmbeddedWebUi: boolean }, ) { return Effect.gen(function* () { - const embeddedWebUI = yield* Effect.promise(() => embeddedUI()) + const embeddedWebUI = yield* Effect.promise(() => embeddedUI(services.disableEmbeddedWebUi)) const path = new URL(request.url, "http://localhost").pathname if (embeddedWebUI) return yield* serveEmbeddedUIEffect(path, services.fs, embeddedWebUI) diff --git a/packages/opencode/src/session/compaction.ts b/packages/opencode/src/session/compaction.ts index 3ca4f074f9e4..bc3327c07d42 100644 --- a/packages/opencode/src/session/compaction.ts +++ b/packages/opencode/src/session/compaction.ts @@ -18,9 +18,10 @@ import { InstanceState } from "@/effect/instance-state" import { isOverflow as overflow, usable } from "./overflow" import { makeRuntime } from "@/effect/run-service" import { serviceUse } from "@/effect/service-use" -import { SyncEvent } from "@/sync" -import { SessionEvent } from "@/v2/session-event" -import { Flag } from "@opencode-ai/core/flag/flag" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { EventV2 } from "@opencode-ai/core/event" +import { EventV2Bridge } from "@/event-v2-bridge" +import { SessionEvent } from "@opencode-ai/core/session-event" const log = Log.create({ service: "session.compaction" }) @@ -79,10 +80,12 @@ Rules: type Turn = { start: number end: number + id: MessageID } type Tail = { start: number + id: MessageID } type CompletedCompaction = { @@ -119,41 +122,19 @@ function completedCompactions(messages: MessageV2.WithParts[]) { }) } -function buildPrompt(input: { previousSummary?: string; context: string[]; tail?: string }) { - const source = input.tail - ? "the conversation history above and the serialized recent conversation tail below" - : "the conversation history above" +function buildPrompt(input: { previousSummary?: string; context: string[] }) { const anchor = input.previousSummary ? [ - `Update the anchored summary below using ${source}.`, + "Update the anchored summary below using the conversation history above.", "Preserve still-true details, remove stale details, and merge in the new facts.", "", input.previousSummary, "", ].join("\n") - : `Create a new anchored summary from ${source}.` - const tail = input.tail - ? [ - "Fold this serialized recent conversation tail into the summary; it is not provider message history.", - "", - input.tail, - "", - ].join("\n") - : undefined - return [anchor, ...(tail ? [tail] : []), SUMMARY_TEMPLATE, ...input.context].join("\n\n") + : "Create a new anchored summary from the conversation history above." + return [anchor, SUMMARY_TEMPLATE, ...input.context].join("\n\n") } -const serialize = Effect.fn("SessionCompaction.serialize")(function* (input: { - messages: MessageV2.WithParts[] - model: Provider.Model -}) { - const messages = yield* MessageV2.toModelMessagesEffect(input.messages, input.model, { - stripMedia: true, - toolOutputMaxChars: TOOL_OUTPUT_MAX_CHARS, - }) - return messages.length ? JSON.stringify(messages, null, 2) : undefined -}) - function preserveRecentBudget(input: { cfg: Config.Info; model: Provider.Model }) { return ( input.cfg.compaction?.preserve_recent_tokens ?? @@ -170,6 +151,7 @@ function turns(messages: MessageV2.WithParts[]) { result.push({ start: i, end: messages.length, + id: msg.info.id, }) } for (let i = 0; i < result.length - 1; i++) { @@ -196,6 +178,7 @@ function splitTurn(input: { if (size > input.budget) continue return { start, + id: input.messages[start]!.info.id, } satisfies Tail } return undefined @@ -228,18 +211,7 @@ export class Service extends Context.Service()("@opencode/Se export const use = serviceUse(Service) -export const layer: Layer.Layer< - Service, - never, - | Bus.Service - | Config.Service - | Session.Service - | Agent.Service - | Plugin.Service - | SessionProcessor.Service - | Provider.Service - | SyncEvent.Service -> = Layer.effect( +export const layer = Layer.effect( Service, Effect.gen(function* () { const bus = yield* Bus.Service @@ -249,20 +221,27 @@ export const layer: Layer.Layer< const plugin = yield* Plugin.Service const processors = yield* SessionProcessor.Service const provider = yield* Provider.Service - const sync = yield* SyncEvent.Service + const events = yield* EventV2Bridge.Service + const flags = yield* RuntimeFlags.Service const isOverflow = Effect.fn("SessionCompaction.isOverflow")(function* (input: { tokens: MessageV2.Assistant["tokens"] model: Provider.Model }) { - return overflow({ cfg: yield* config.get(), tokens: input.tokens, model: input.model }) + return overflow({ + cfg: yield* config.get(), + tokens: input.tokens, + model: input.model, + outputTokenMax: flags.outputTokenMax, + }) }) const estimate = Effect.fn("SessionCompaction.estimate")(function* (input: { messages: MessageV2.WithParts[] model: Provider.Model }) { - return Token.estimate((yield* serialize(input)) ?? "") + const msgs = yield* MessageV2.toModelMessagesEffect(input.messages, input.model) + return Token.estimate(JSON.stringify(msgs)) }) const select = Effect.fn("SessionCompaction.select")(function* (input: { @@ -271,10 +250,10 @@ export const layer: Layer.Layer< model: Provider.Model }) { const limit = input.cfg.compaction?.tail_turns ?? DEFAULT_TAIL_TURNS - if (limit <= 0) return { head: input.messages, tail: [] } + if (limit <= 0) return { head: input.messages, tail_start_id: undefined } const budget = preserveRecentBudget({ cfg: input.cfg, model: input.model }) const all = turns(input.messages) - if (!all.length) return { head: input.messages, tail: [] } + if (!all.length) return { head: input.messages, tail_start_id: undefined } const recent = all.slice(-limit) const sizes = yield* Effect.forEach( recent, @@ -293,7 +272,7 @@ export const layer: Layer.Layer< const size = sizes[i] if (total + size <= budget) { total += size - keep = { start: turn.start } + keep = { start: turn.start, id: turn.id } continue } const remaining = budget - total @@ -309,10 +288,10 @@ export const layer: Layer.Layer< break } - if (!keep) return { head: input.messages, tail: [] } + if (!keep || keep.start === 0) return { head: input.messages, tail_start_id: undefined } return { head: input.messages.slice(0, keep.start), - tail: input.messages.slice(keep.start), + tail_start_id: keep.id, } }) @@ -405,8 +384,8 @@ export const layer: Layer.Layer< const agent = yield* agents.get("compaction") const model = agent.model - ? yield* provider.getModel(agent.model.providerID, agent.model.modelID) - : yield* provider.getModel(userMessage.model.providerID, userMessage.model.modelID) + ? yield* provider.getModel(agent.model.providerID, agent.model.modelID).pipe(Effect.orDie) + : yield* provider.getModel(userMessage.model.providerID, userMessage.model.modelID).pipe(Effect.orDie) const cfg = yield* config.get() const history = compactionPart && messages.at(-1)?.info.id === input.parentID ? messages.slice(0, -1) : messages const prior = completedCompactions(history) @@ -423,10 +402,7 @@ export const layer: Layer.Layer< { sessionID: input.sessionID }, { context: [], prompt: undefined }, ) - const tailMessages = structuredClone(selected.tail) - yield* plugin.trigger("experimental.chat.messages.transform", {}, { messages: tailMessages }) - const tail = yield* serialize({ messages: tailMessages, model }) - const nextPrompt = compacting.prompt ?? buildPrompt({ previousSummary, context: compacting.context, tail }) + const nextPrompt = compacting.prompt ?? buildPrompt({ previousSummary, context: compacting.context }) const msgs = structuredClone(selected.head) yield* plugin.trigger("experimental.chat.messages.transform", {}, { messages: msgs }) const modelMessages = yield* MessageV2.toModelMessagesEffect(msgs, model, { @@ -493,6 +469,13 @@ export const layer: Layer.Layer< return "stop" } + if (compactionPart && selected.tail_start_id && compactionPart.tail_start_id !== selected.tail_start_id) { + yield* session.updatePart({ + ...compactionPart, + tail_start_id: selected.tail_start_id, + }) + } + if (result === "continue" && input.auto) { if (replay) { const original = replay.info @@ -530,7 +513,9 @@ export const layer: Layer.Layer< { sessionID: input.sessionID, agent: userMessage.agent, - model: yield* provider.getModel(userMessage.model.providerID, userMessage.model.modelID), + model: yield* provider + .getModel(userMessage.model.providerID, userMessage.model.modelID) + .pipe(Effect.orDie), provider: { source: info.source, info, @@ -578,16 +563,19 @@ export const layer: Layer.Layer< if (processor.message.error) return "stop" if (result === "continue") { const summary = summaryText( - (yield* session.messages({ sessionID: input.sessionID })).find((item) => item.info.id === msg.id) ?? { + (yield* session.messages({ sessionID: input.sessionID }).pipe(Effect.orDie)).find( + (item) => item.info.id === msg.id, + ) ?? { info: msg, parts: [], }, ) - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Compaction.Ended.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Compaction.Ended, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(Date.now()), text: summary ?? "", + include: selected.tail_start_id, }) } yield* bus.publish(Event.Compacted, { sessionID: input.sessionID }) @@ -618,8 +606,8 @@ export const layer: Layer.Layer< auto: input.auto, overflow: input.overflow, }) - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Compaction.Started.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Compaction.Started, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(Date.now()), reason: input.auto ? "auto" : "manual", @@ -645,7 +633,8 @@ export const defaultLayer = Layer.suspend(() => Layer.provide(Plugin.defaultLayer), Layer.provide(Bus.layer), Layer.provide(Config.defaultLayer), - Layer.provide(SyncEvent.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), + Layer.provide(EventV2Bridge.defaultLayer), ), ) diff --git a/packages/opencode/src/session/goal.ts b/packages/opencode/src/session/goal.ts new file mode 100644 index 000000000000..110cf32d1c00 --- /dev/null +++ b/packages/opencode/src/session/goal.ts @@ -0,0 +1,366 @@ +import { BusEvent } from "@/bus/bus-event" +import { Database, and, eq, isNull } from "@/storage/db" +import { NotFoundError } from "@/storage/storage" +import { SyncEvent } from "@/sync" +import { NonNegativeInt, PositiveInt, optionalOmitUndefined } from "@opencode-ai/core/schema" +import { Context, Effect, Layer, Schema, Types } from "effect" +import { ProjectID } from "../project/schema" +import { GoalID, MessageID, SessionID } from "./schema" +import { SessionGoalTable, SessionTable } from "./session.sql" + +export const Status = Schema.Literals(["active", "paused", "budget_limited", "complete"]).annotate({ + identifier: "SessionGoalStatus", +}) +export type Status = Schema.Schema.Type + +const Tokens = Schema.Struct({ + used: NonNegativeInt, + budget: optionalOmitUndefined(NonNegativeInt), +}) + +const Time = Schema.Struct({ + used: NonNegativeInt, + created: NonNegativeInt, + updated: NonNegativeInt, +}) + +export const Info = Schema.Struct({ + id: GoalID, + sessionID: SessionID, + objective: Schema.String, + status: Status, + tokens: Tokens, + time: Time, +}).annotate({ identifier: "SessionGoal" }) +export type Info = Types.DeepMutable> + +export const CreateInput = Schema.Struct({ + sessionID: SessionID, + objective: Schema.String, + tokenBudget: Schema.optional(PositiveInt), +}) +export type CreateInput = Types.DeepMutable> + +export const UpdateInput = Schema.Struct({ + sessionID: SessionID, + objective: Schema.optional(Schema.String), + status: Schema.optional(Status), + tokenBudget: Schema.optional(Schema.NullOr(PositiveInt)), +}) +export type UpdateInput = Types.DeepMutable> + +export const AccountInput = Schema.Struct({ + sessionID: SessionID, + messageID: Schema.optional(MessageID), + tokens: NonNegativeInt, + seconds: NonNegativeInt, +}) +export type AccountInput = Types.DeepMutable> + +export const ModelUpdateInput = Schema.Struct({ + sessionID: SessionID, + messageID: Schema.optional(MessageID), + status: Status, +}) +export type ModelUpdateInput = Types.DeepMutable> + +const UpdatedEventSchema = Schema.Struct({ + sessionID: SessionID, + goal: Info, +}) + +const ClearedEventSchema = Schema.Struct({ + sessionID: SessionID, +}) + +export const Event = { + Updated: SyncEvent.define({ + type: "session.goal.updated", + version: 1, + aggregate: "sessionID", + schema: UpdatedEventSchema, + }), + Cleared: SyncEvent.define({ + type: "session.goal.cleared", + version: 1, + aggregate: "sessionID", + schema: ClearedEventSchema, + }), +} + +export const BusOnlyEvent = { + IdleContinue: BusEvent.define( + "session.goal.idle_continue", + Schema.Struct({ + sessionID: SessionID, + goal: Info, + }), + ), +} + +export class GoalError extends Error {} +type NotFound = InstanceType + +export interface Interface { + readonly get: (sessionID: SessionID) => Effect.Effect + readonly listActive: (input?: { projectID?: ProjectID }) => Effect.Effect + readonly create: (input: CreateInput) => Effect.Effect + readonly update: (input: UpdateInput) => Effect.Effect + readonly clear: (sessionID: SessionID) => Effect.Effect + readonly account: (input: AccountInput) => Effect.Effect + readonly modelUpdate: (input: ModelUpdateInput) => Effect.Effect +} + +export class Service extends Context.Service()("@opencode/SessionGoal") {} + +function fromRow(row: typeof SessionGoalTable.$inferSelect): Info { + return { + id: row.id, + sessionID: row.session_id, + objective: row.objective, + status: row.status as Status, + tokens: { + used: row.tokens_used, + budget: row.token_budget ?? undefined, + }, + time: { + used: row.time_used, + created: row.time_created, + updated: row.time_updated, + }, + } +} + +export function toRow(goal: Info): typeof SessionGoalTable.$inferInsert { + return { + id: goal.id, + session_id: goal.sessionID, + objective: goal.objective, + status: goal.status, + token_budget: goal.tokens.budget ?? null, + tokens_used: goal.tokens.used, + time_used: goal.time.used, + time_created: goal.time.created, + time_updated: goal.time.updated, + } +} + +function objective(input: string) { + const text = input.trim() + if (!text) return Effect.fail(new GoalError("Goal objective is required")) + if (text.length > 4000) return Effect.fail(new GoalError("Goal objective is too long")) + return Effect.succeed(text) +} + +function budget(input: number | null | undefined) { + if (input !== undefined && input !== null && input <= 0) { + return Effect.fail(new GoalError("Goal token budget must be positive")) + } + return Effect.void +} + +export const layer = Layer.effect( + Service, + Effect.gen(function* () { + const sync = yield* SyncEvent.Service + const completeAccounting = new Map< + SessionID, + { + messageID: MessageID + tokens: boolean + time: boolean + } + >() + const budgetAccounting = new Map< + SessionID, + { + messageID?: MessageID + time: boolean + } + >() + + const get = Effect.fn("SessionGoal.get")(function* (sessionID: SessionID) { + const row = Database.use((db) => + db.select().from(SessionGoalTable).where(eq(SessionGoalTable.session_id, sessionID)).get(), + ) + return row ? fromRow(row) : undefined + }) + + const listActive = Effect.fn("SessionGoal.listActive")(function* (input?: { projectID?: ProjectID }) { + const conditions = [eq(SessionGoalTable.status, "active"), isNull(SessionTable.time_archived)] + if (input?.projectID) conditions.push(eq(SessionTable.project_id, input.projectID)) + const rows = Database.use((db) => + db + .select({ + id: SessionGoalTable.id, + session_id: SessionGoalTable.session_id, + objective: SessionGoalTable.objective, + status: SessionGoalTable.status, + token_budget: SessionGoalTable.token_budget, + tokens_used: SessionGoalTable.tokens_used, + time_used: SessionGoalTable.time_used, + time_created: SessionGoalTable.time_created, + time_updated: SessionGoalTable.time_updated, + }) + .from(SessionGoalTable) + .innerJoin(SessionTable, eq(SessionGoalTable.session_id, SessionTable.id)) + .where(and(...conditions)) + .all(), + ) + return rows.map(fromRow) + }) + + const emit = Effect.fn("SessionGoal.emit")(function* (goal: Info) { + yield* sync.run(Event.Updated, { sessionID: goal.sessionID, goal }) + return goal + }) + + const create = Effect.fn("SessionGoal.create")(function* (input: CreateInput) { + const text = yield* objective(input.objective) + yield* budget(input.tokenBudget) + if (yield* get(input.sessionID)) return yield* Effect.fail(new GoalError("Goal already exists")) + + return yield* emit({ + id: GoalID.ascending(), + sessionID: input.sessionID, + objective: text, + status: "active", + tokens: { + used: 0, + budget: input.tokenBudget, + }, + time: { + used: 0, + created: Date.now(), + updated: Date.now(), + }, + }) + }) + + const update = Effect.fn("SessionGoal.update")(function* (input: UpdateInput) { + const current = yield* get(input.sessionID) + if (!current) { + return yield* Effect.fail(new NotFoundError({ message: `Goal not found: ${input.sessionID}` })) + } + const text = input.objective === undefined ? current.objective : yield* objective(input.objective) + yield* budget(input.tokenBudget) + const nextBudget = input.tokenBudget === undefined ? current.tokens.budget : (input.tokenBudget ?? undefined) + const nextStatus = input.status ?? current.status + const exhausted = nextBudget !== undefined && current.tokens.used >= nextBudget + const status: Status = + nextStatus === "active" || nextStatus === "budget_limited" + ? exhausted + ? "budget_limited" + : "active" + : nextStatus + const next = { + ...current, + objective: text, + status, + tokens: { + ...current.tokens, + budget: nextBudget, + }, + time: { + ...current.time, + updated: Date.now(), + }, + } + if (next.status !== "complete") completeAccounting.delete(input.sessionID) + if (next.status !== "budget_limited") budgetAccounting.delete(input.sessionID) + return yield* emit(next) + }) + + const clear = Effect.fn("SessionGoal.clear")(function* (sessionID: SessionID) { + completeAccounting.delete(sessionID) + budgetAccounting.delete(sessionID) + yield* sync.run(Event.Cleared, { sessionID }) + }) + + const account = Effect.fn("SessionGoal.account")(function* (input: AccountInput) { + const current = yield* get(input.sessionID) + if (!current) return undefined + if (current.status === "complete") { + const completion = completeAccounting.get(input.sessionID) + if (!input.messageID || completion?.messageID !== input.messageID) return current + const tokens = completion.tokens ? 0 : input.tokens + const seconds = completion.time ? 0 : input.seconds + if (tokens === 0 && seconds === 0) return current + if (input.tokens > 0) completion.tokens = true + if (input.seconds > 0) completion.time = true + if (completion.tokens && completion.time) completeAccounting.delete(input.sessionID) + return yield* emit({ + ...current, + tokens: { + ...current.tokens, + used: current.tokens.used + tokens, + }, + time: { + ...current.time, + used: current.time.used + seconds, + updated: Date.now(), + }, + }) + } + if (current.status !== "active") { + if (current.status !== "budget_limited" || input.tokens !== 0 || input.seconds === 0) return current + const budget = budgetAccounting.get(input.sessionID) + if (!budget || budget.time) return current + if (budget.messageID !== undefined && input.messageID !== budget.messageID) return current + budget.time = true + budgetAccounting.delete(input.sessionID) + return yield* emit({ + ...current, + time: { + ...current.time, + used: current.time.used + input.seconds, + updated: Date.now(), + }, + }) + } + const used = current.tokens.used + input.tokens + const status = + current.status === "active" && current.tokens.budget !== undefined && used >= current.tokens.budget + ? "budget_limited" + : current.status + if (status === "budget_limited") { + if (input.seconds > 0) budgetAccounting.delete(input.sessionID) + else budgetAccounting.set(input.sessionID, { messageID: input.messageID, time: false }) + } + return yield* emit({ + ...current, + status, + tokens: { + ...current.tokens, + used, + }, + time: { + ...current.time, + used: current.time.used + input.seconds, + updated: Date.now(), + }, + }) + }) + + const modelUpdate = Effect.fn("SessionGoal.modelUpdate")(function* (input: ModelUpdateInput) { + if (input.status !== "complete") { + return yield* Effect.fail(new GoalError("Models can only mark goals complete")) + } + const goal = yield* update({ sessionID: input.sessionID, status: "complete" }) + if (input.messageID) { + completeAccounting.set(input.sessionID, { + messageID: input.messageID, + tokens: false, + time: false, + }) + } + return goal + }) + + return Service.of({ get, listActive, create, update, clear, account, modelUpdate }) + }), +) + +export const defaultLayer = layer.pipe(Layer.provide(SyncEvent.defaultLayer)) + +export * as SessionGoal from "./goal" diff --git a/packages/opencode/src/session/instruction.ts b/packages/opencode/src/session/instruction.ts index 6629ce67bc9f..ad9a74445b9a 100644 --- a/packages/opencode/src/session/instruction.ts +++ b/packages/opencode/src/session/instruction.ts @@ -3,6 +3,7 @@ import { Effect, Layer, Context } from "effect" import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http" import { Config } from "@/config/config" import { InstanceState } from "@/effect/instance-state" +import { RuntimeFlags } from "@/effect/runtime-flags" import { Flag } from "@opencode-ai/core/flag/flag" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { withTransientReadRetry } from "@/util/effect-http-client" @@ -10,9 +11,9 @@ import { Global } from "@opencode-ai/core/global" import type { MessageV2 } from "./message-v2" import type { MessageID } from "./schema" -const FILES = [ +const files = (disableClaudeCodePrompt: boolean) => [ "AGENTS.md", - ...(Flag.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT ? [] : ["CLAUDE.md"]), + ...(disableClaudeCodePrompt ? [] : ["CLAUDE.md"]), "CONTEXT.md", // deprecated ] @@ -50,18 +51,20 @@ export class Service extends Context.Service()("@opencode/In export const layer: Layer.Layer< Service, never, - AppFileSystem.Service | Config.Service | Global.Service | HttpClient.HttpClient + AppFileSystem.Service | Config.Service | Global.Service | HttpClient.HttpClient | RuntimeFlags.Service > = Layer.effect( Service, Effect.gen(function* () { const cfg = yield* Config.Service const fs = yield* AppFileSystem.Service const global = yield* Global.Service + const flags = yield* RuntimeFlags.Service const http = HttpClient.filterStatusOk(withTransientReadRetry(yield* HttpClient.HttpClient)) const globalFiles = [ path.join(global.config, "AGENTS.md"), - ...(!Flag.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT ? [path.join(global.home, ".claude", "CLAUDE.md")] : []), + ...(!flags.disableClaudeCodePrompt ? [path.join(global.home, ".claude", "CLAUDE.md")] : []), ] + const instructionFiles = files(flags.disableClaudeCodePrompt) const state = yield* InstanceState.make( Effect.fn("Instruction.state")(() => @@ -117,8 +120,10 @@ export const layer: Layer.Layer< // The first project-level match wins so we don't stack AGENTS.md/CLAUDE.md from every ancestor. if (!Flag.OPENCODE_DISABLE_PROJECT_CONFIG) { - for (const file of FILES) { - const matches = yield* fs.findUp(file, ctx.directory, ctx.worktree) + for (const file of instructionFiles) { + const matches = yield* fs + .findUp(file, ctx.directory, ctx.worktree) + .pipe(Effect.catch(() => Effect.succeed([]))) if (matches.length > 0) { matches.forEach((item) => paths.add(path.resolve(item))) break @@ -163,7 +168,7 @@ export const layer: Layer.Layer< }) const find = Effect.fn("Instruction.find")(function* (dir: string) { - for (const file of FILES) { + for (const file of instructionFiles) { const filepath = path.resolve(path.join(dir, file)) if (yield* fs.existsSafe(filepath)) return filepath } @@ -223,6 +228,7 @@ export const defaultLayer = layer.pipe( Layer.provide(Global.layer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(FetchHttpClient.layer), + Layer.provide(RuntimeFlags.defaultLayer), ) export function loaded(messages: MessageV2.WithParts[]) { diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.ts index c7990d1b3539..551787888852 100644 --- a/packages/opencode/src/session/llm.ts +++ b/packages/opencode/src/session/llm.ts @@ -12,16 +12,15 @@ import type { Agent } from "@/agent/agent" import type { MessageV2 } from "./message-v2" import { Plugin } from "@/plugin" import { SystemPrompt } from "./system" -import { Flag } from "@opencode-ai/core/flag/flag" import { Permission } from "@/permission" import { PermissionID } from "@/permission/schema" import { Bus } from "@/bus" import { Wildcard } from "@/util/wildcard" import { SessionID } from "@/session/schema" import { Auth } from "@/auth" -import { Installation } from "@/installation" import { InstallationVersion } from "@opencode-ai/core/installation/version" import { EffectBridge } from "@/effect/bridge" +import { RuntimeFlags } from "@/effect/runtime-flags" import * as Option from "effect/Option" import * as OtelTracer from "@effect/opentelemetry/Tracer" @@ -63,7 +62,7 @@ export class Service extends Context.Service()("@opencode/LL const live: Layer.Layer< Service, never, - Auth.Service | Config.Service | Provider.Service | Plugin.Service | Permission.Service + Auth.Service | Config.Service | Provider.Service | Plugin.Service | Permission.Service | RuntimeFlags.Service > = Layer.effect( Service, Effect.gen(function* () { @@ -72,6 +71,7 @@ const live: Layer.Layer< const provider = yield* Provider.Service const plugin = yield* Plugin.Service const perm = yield* Permission.Service + const flags = yield* RuntimeFlags.Service const run = Effect.fn("LLM.run")(function* (input: StreamRequest) { const l = log @@ -173,7 +173,7 @@ const live: Layer.Layer< : undefined, topP: input.agent.topP ?? ProviderTransform.topP(input.model), topK: ProviderTransform.topK(input.model), - maxOutputTokens: ProviderTransform.maxOutputTokens(input.model), + maxOutputTokens: ProviderTransform.maxOutputTokens(input.model, flags.outputTokenMax), options, }, ) @@ -194,23 +194,11 @@ const live: Layer.Layer< const tools = resolveTools(input) - // LiteLLM and some Anthropic proxies require the tools parameter to be present - // when message history contains tool calls, even if no tools are being used. - // Add a dummy tool that is never called to satisfy this validation. - // This is enabled for: - // 1. Providers with "litellm" in their ID or API ID (auto-detected) - // 2. Providers with explicit "litellmProxy: true" option (opt-in for custom gateways) - const isLiteLLMProxy = - item.options?.["litellmProxy"] === true || - input.model.providerID.toLowerCase().includes("litellm") || - input.model.api.id.toLowerCase().includes("litellm") - - // LiteLLM/Bedrock rejects requests where the message history contains tool - // calls but no tools param is present. When there are no active tools (e.g. - // during compaction), inject a stub tool to satisfy the validation requirement. - // The stub description explicitly tells the model not to call it. + // GitHub Copilot may require the tools parameter when message history contains + // tool calls but no tools are active (e.g. compaction). Inject a stub tool that + // is never meant to be invoked. LiteLLM-backed providers are excluded. if ( - (isLiteLLMProxy || input.model.providerID.includes("github-copilot")) && + input.model.providerID.includes("github-copilot") && Object.keys(tools).length === 0 && hasToolCalls(input.messages) ) { @@ -376,7 +364,7 @@ const live: Layer.Layer< "x-opencode-project": opencodeProjectID, "x-opencode-session": input.sessionID, "x-opencode-request": input.user.id, - "x-opencode-client": Flag.OPENCODE_CLIENT, + "x-opencode-client": flags.client, "User-Agent": `opencode/${InstallationVersion}`, } : { @@ -444,6 +432,7 @@ export const defaultLayer = Layer.suspend(() => Layer.provide(Config.defaultLayer), Layer.provide(Provider.defaultLayer), Layer.provide(Plugin.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), ), ) @@ -456,7 +445,7 @@ function resolveTools(input: Pick -export const ContextOverflowError = namedSchemaError("ContextOverflowError", { +export type APIError = Schema.Schema.Type +export const ContextOverflowError = NamedError.create("ContextOverflowError", { message: Schema.String, responseBody: Schema.optional(Schema.String), }) @@ -382,11 +378,7 @@ export type Part = | CompactionPart const AssistantErrorSchema = Schema.Union([ - AuthError.EffectSchema, - Schema.Struct({ name: Schema.Literal("UnknownError"), data: Schema.Struct({ message: Schema.String }) }).annotate({ - identifier: "UnknownError", - }), - OutputLengthError.EffectSchema, + ...MessageError.Shared, AbortedError.EffectSchema, StructuredOutputError.EffectSchema, ContextOverflowError.EffectSchema, @@ -780,13 +772,12 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* ( return part.metadata?.anthropic?.signature != null }) for (const part of msg.parts) { - if (msg.info.summary && part.type !== "text") continue if (part.type === "text") { const text = part.text === "" && hasSignedReasoning ? " " : part.text assistantMessage.parts.push({ type: "text", text, - ...(differentModel || msg.info.summary ? {} : { providerMetadata: part.metadata }), + ...(differentModel ? {} : { providerMetadata: part.metadata }), }) } if (part.type === "step-start") @@ -928,7 +919,11 @@ export function toModelMessages( return Effect.runPromise(toModelMessagesEffect(input, model, options).pipe(Effect.provide(EffectLogger.layer))) } -export function page(input: { sessionID: SessionID; limit: number; before?: string }) { +export const page = Effect.fn("MessageV2.page")(function* (input: { + sessionID: SessionID + limit: number + before?: string +}) { const before = input.before ? cursor.decode(input.before) : undefined const where = before ? and(eq(MessageTable.session_id, input.sessionID), older(before)) @@ -946,7 +941,7 @@ export function page(input: { sessionID: SessionID; limit: number; before?: stri const row = Database.use((db) => db.select({ id: SessionTable.id }).from(SessionTable).where(eq(SessionTable.id, input.sessionID)).get(), ) - if (!row) throw new NotFoundError({ message: `Session not found: ${input.sessionID}` }) + if (!row) return yield* new NotFoundError({ message: `Session not found: ${input.sessionID}` }) return { items: [] as WithParts[], more: false, @@ -963,13 +958,19 @@ export function page(input: { sessionID: SessionID; limit: number; before?: stri more, cursor: more && tail ? cursor.encode({ id: tail.id, time: tail.time_created }) : undefined, } -} +}) export function* stream(sessionID: SessionID) { const size = 50 let before: string | undefined while (true) { - const next = page({ sessionID, limit: size, before }) + const next = Effect.runSync( + page({ sessionID, limit: size, before }).pipe( + Effect.catchIf(NotFoundError.isInstance, () => + Effect.succeed({ items: [] as WithParts[], more: false, cursor: undefined }), + ), + ), + ) if (next.items.length === 0) break for (let i = next.items.length - 1; i >= 0; i--) { yield next.items[i] @@ -994,7 +995,7 @@ export function parts(message_id: MessageID) { ) } -export function get(input: { sessionID: SessionID; messageID: MessageID }): WithParts { +export const get = Effect.fn("MessageV2.get")(function* (input: { sessionID: SessionID; messageID: MessageID }) { const row = Database.use((db) => db .select() @@ -1002,26 +1003,63 @@ export function get(input: { sessionID: SessionID; messageID: MessageID }): With .where(and(eq(MessageTable.id, input.messageID), eq(MessageTable.session_id, input.sessionID))) .get(), ) - if (!row) throw new NotFoundError({ message: `Message not found: ${input.messageID}` }) + if (!row) return yield* new NotFoundError({ message: `Message not found: ${input.messageID}` }) return { info: info(row), parts: parts(input.messageID), } -} +}) export function filterCompacted(msgs: Iterable) { const result = [] as WithParts[] const completed = new Set() + let retain: MessageID | undefined for (const msg of msgs) { result.push(msg) + if (retain) { + if (msg.info.id === retain) break + continue + } if (msg.info.role === "user" && completed.has(msg.info.id)) { - if (msg.parts.some((item): item is CompactionPart => item.type === "compaction")) break + const part = msg.parts.find((item): item is CompactionPart => item.type === "compaction") + if (!part) continue + if (!part.tail_start_id) break + retain = part.tail_start_id + if (msg.info.id === retain) break continue } + if (msg.info.role === "user" && completed.has(msg.info.id) && msg.parts.some((part) => part.type === "compaction")) + break if (msg.info.role === "assistant" && msg.info.summary && msg.info.finish && !msg.info.error) completed.add(msg.info.parentID) } result.reverse() + const compactionIndex = result.findLastIndex( + (msg) => + msg.info.role === "user" && + msg.parts.some((item): item is CompactionPart => item.type === "compaction" && item.tail_start_id !== undefined), + ) + const compaction = result[compactionIndex] + const part = compaction?.parts.find( + (item): item is CompactionPart => item.type === "compaction" && item.tail_start_id !== undefined, + ) + const summaryIndex = compaction + ? result.findIndex( + (msg, index) => + index > compactionIndex && + msg.info.role === "assistant" && + msg.info.summary && + msg.info.parentID === compaction.info.id, + ) + : -1 + const tailIndex = part?.tail_start_id ? result.findIndex((msg) => msg.info.id === part.tail_start_id) : -1 + if (tailIndex >= 0 && tailIndex < compactionIndex && summaryIndex > compactionIndex) { + return [ + ...result.slice(compactionIndex, summaryIndex + 1), + ...result.slice(tailIndex, compactionIndex), + ...result.slice(summaryIndex + 1), + ] + } return result } @@ -1029,6 +1067,31 @@ export const filterCompactedEffect = Effect.fnUntraced(function* (sessionID: Ses return filterCompacted(stream(sessionID)) }) +// filterCompacted reorders messages for model consumption +// ([compaction-user, summary, ...retained tail..., continue-user]), so array +// position is not chronological. Derive each binding by max id (MessageID +// is monotonic via MessageID.ascending) so a pre-compaction overflowing tail +// assistant doesn't get mistaken for the most recent turn. tasks are +// compaction/subtask parts attached to user messages newer than the latest +// finished assistant — i.e. unprocessed work. +export function latest(msgs: WithParts[]) { + let user: User | undefined + let assistant: Assistant | undefined + let finished: Assistant | undefined + for (const msg of msgs) { + const info = msg.info + if (info.role === "user" && (!user || info.id > user.id)) user = info + if (info.role === "assistant" && (!assistant || info.id > assistant.id)) assistant = info + if (info.role === "assistant" && info.finish && (!finished || info.id > finished.id)) finished = info + } + const tasks = msgs.flatMap((m) => + finished && m.info.id <= finished.id + ? [] + : m.parts.filter((p): p is CompactionPart | SubtaskPart => p.type === "compaction" || p.type === "subtask"), + ) + return { user, assistant, finished, tasks } +} + export function fromError( e: unknown, ctx: { providerID: ProviderID; aborted?: boolean }, diff --git a/packages/opencode/src/session/message.ts b/packages/opencode/src/session/message.ts index 16c010003a28..39c842f94bc5 100644 --- a/packages/opencode/src/session/message.ts +++ b/packages/opencode/src/session/message.ts @@ -2,33 +2,9 @@ import { Schema } from "effect" import { SessionID } from "./schema" import { ModelID, ProviderID } from "../provider/schema" import { NonNegativeInt } from "@opencode-ai/core/schema" -import { namedSchemaError } from "@/util/named-schema-error" - -export const OutputLengthError = namedSchemaError("MessageOutputLengthError", {}) -export const AuthError = namedSchemaError("ProviderAuthError", { - providerID: Schema.String, - message: Schema.String, -}) - -const AuthErrorEffect = Schema.Struct({ - name: Schema.Literal("ProviderAuthError"), - data: Schema.Struct({ - providerID: Schema.String, - message: Schema.String, - }), -}) - -const OutputLengthErrorEffect = Schema.Struct({ - name: Schema.Literal("MessageOutputLengthError"), - data: Schema.Struct({}), -}) - -const UnknownErrorEffect = Schema.Struct({ - name: Schema.Literal("UnknownError"), - data: Schema.Struct({ - message: Schema.String, - }), -}) +import { MessageError } from "./message-error" +import { AuthError, OutputLengthError } from "./message-error" +export { AuthError, OutputLengthError } from "./message-error" export const ToolCall = Schema.Struct({ state: Schema.Literal("call"), @@ -124,7 +100,7 @@ export const Info = Schema.Struct({ created: NonNegativeInt, completed: Schema.optional(NonNegativeInt), }), - error: Schema.optional(Schema.Union([AuthErrorEffect, UnknownErrorEffect, OutputLengthErrorEffect])), + error: Schema.optional(MessageError.SharedSchema), sessionID: SessionID, tool: Schema.Record( Schema.String, diff --git a/packages/opencode/src/session/overflow.ts b/packages/opencode/src/session/overflow.ts index 6485950dcc84..d01fe5c624dd 100644 --- a/packages/opencode/src/session/overflow.ts +++ b/packages/opencode/src/session/overflow.ts @@ -5,18 +5,24 @@ import type { MessageV2 } from "./message-v2" const COMPACTION_BUFFER = 20_000 -export function usable(input: { cfg: Config.Info; model: Provider.Model }) { +export function usable(input: { cfg: Config.Info; model: Provider.Model; outputTokenMax?: number }) { const context = input.model.limit.context if (context === 0) return 0 const reserved = - input.cfg.compaction?.reserved ?? Math.min(COMPACTION_BUFFER, ProviderTransform.maxOutputTokens(input.model)) + input.cfg.compaction?.reserved ?? + Math.min(COMPACTION_BUFFER, ProviderTransform.maxOutputTokens(input.model, input.outputTokenMax)) return input.model.limit.input ? Math.max(0, input.model.limit.input - reserved) - : Math.max(0, context - ProviderTransform.maxOutputTokens(input.model)) + : Math.max(0, context - ProviderTransform.maxOutputTokens(input.model, input.outputTokenMax)) } -export function isOverflow(input: { cfg: Config.Info; tokens: MessageV2.Assistant["tokens"]; model: Provider.Model }) { +export function isOverflow(input: { + cfg: Config.Info + tokens: MessageV2.Assistant["tokens"] + model: Provider.Model + outputTokenMax?: number +}) { if (input.cfg.compaction?.auto === false) return false if (input.model.limit.context === 0) return false diff --git a/packages/opencode/src/session/processor.ts b/packages/opencode/src/session/processor.ts index 579c4cc42c54..aac893075f00 100644 --- a/packages/opencode/src/session/processor.ts +++ b/packages/opencode/src/session/processor.ts @@ -21,11 +21,13 @@ import { Question } from "@/question" import { errorMessage } from "@/util/error" import * as Log from "@opencode-ai/core/util/log" import { isRecord } from "@/util/record" -import { SyncEvent } from "@/sync" -import { SessionEvent } from "@/v2/session-event" -import { Modelv2 } from "@/v2/model" +import { EventV2 } from "@opencode-ai/core/event" +import { EventV2Bridge } from "@/event-v2-bridge" +import { SessionEvent } from "@opencode-ai/core/session-event" +import { ModelV2 } from "@opencode-ai/core/model" +import { ProviderV2 } from "@opencode-ai/core/provider" import * as DateTime from "effect/DateTime" -import { Flag } from "@opencode-ai/core/flag/flag" +import { RuntimeFlags } from "@/effect/runtime-flags" const DOOM_LOOP_THRESHOLD = 3 const log = Log.create({ service: "session.processor" }) @@ -83,22 +85,7 @@ type StreamEvent = Event export class Service extends Context.Service()("@opencode/SessionProcessor") {} -export const layer: Layer.Layer< - Service, - never, - | Session.Service - | Config.Service - | Bus.Service - | Snapshot.Service - | Agent.Service - | LLM.Service - | Permission.Service - | Plugin.Service - | Image.Service - | SessionSummary.Service - | SessionStatus.Service - | SyncEvent.Service -> = Layer.effect( +export const layer = Layer.effect( Service, Effect.gen(function* () { const session = yield* Session.Service @@ -113,7 +100,8 @@ export const layer: Layer.Layer< const scope = yield* Scope.Scope const status = yield* SessionStatus.Service const image = yield* Image.Service - const sync = yield* SyncEvent.Service + const events = yield* EventV2Bridge.Service + const flags = yield* RuntimeFlags.Service const create = Effect.fn("SessionProcessor.create")(function* (input: Input) { // Pre-capture snapshot before the LLM stream starts. The AI SDK @@ -232,8 +220,8 @@ export const layer: Layer.Layer< case "reasoning-start": if (value.id in ctx.reasoningMap) return // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Reasoning.Started.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Reasoning.Started, { sessionID: ctx.sessionID, reasoningID: value.id, timestamp: DateTime.makeUnsafe(Date.now()), @@ -267,8 +255,8 @@ export const layer: Layer.Layer< case "reasoning-end": if (!(value.id in ctx.reasoningMap)) return // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Reasoning.Ended.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Reasoning.Ended, { sessionID: ctx.sessionID, reasoningID: value.id, text: ctx.reasoningMap[value.id].text, @@ -288,8 +276,8 @@ export const layer: Layer.Layer< throw new Error(`Tool call not allowed while generating summary: ${value.toolName}`) } // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Tool.Input.Started.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Tool.Input.Started, { sessionID: ctx.sessionID, callID: value.id, name: value.toolName, @@ -319,8 +307,8 @@ export const layer: Layer.Layer< case "tool-input-end": { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Tool.Input.Ended.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Tool.Input.Ended, { sessionID: ctx.sessionID, callID: value.id, text: "", @@ -336,8 +324,8 @@ export const layer: Layer.Layer< } const toolCall = yield* readToolCall(value.toolCallId) // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Tool.Called.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Tool.Called, { sessionID: ctx.sessionID, callID: value.toolCallId, tool: value.toolName, @@ -404,7 +392,13 @@ export const layer: Layer.Layer< ) const normalized = yield* Effect.forEach(toolAttachments, (attachment) => attachment.mime.startsWith("image/") - ? image.normalize(attachment).pipe(Effect.exit) + ? image.normalize(attachment).pipe( + Effect.catchIf( + (error) => error instanceof Image.ResizerUnavailableError, + () => Effect.succeed(attachment), + ), + Effect.exit, + ) : Effect.succeed(Exit.succeed(attachment)), ) const omitted = normalized.filter(Exit.isFailure).length @@ -414,12 +408,12 @@ export const layer: Layer.Layer< output: omitted === 0 ? value.output.output - : `${value.output.output}\n\n[${omitted} image${omitted === 1 ? "" : "s"} omitted: could not be resized below the inline image size limit.]`, + : `${value.output.output}\n\n[${omitted} image${omitted === 1 ? "" : "s"} omitted: could not be resized below the image size limit.]`, attachments: attachments?.length ? attachments : undefined, } // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Tool.Success.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Tool.Success, { sessionID: ctx.sessionID, callID: value.toolCallId, structured: output.metadata, @@ -448,8 +442,8 @@ export const layer: Layer.Layer< case "tool-error": { const toolCall = yield* readToolCall(value.toolCallId) // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Tool.Failed.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Tool.Failed, { sessionID: ctx.sessionID, callID: value.toolCallId, error: { @@ -473,14 +467,14 @@ export const layer: Layer.Layer< if (!ctx.snapshot) ctx.snapshot = yield* snapshot.track() if (!ctx.assistantMessage.summary) { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Step.Started.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Step.Started, { sessionID: ctx.sessionID, agent: input.assistantMessage.agent, model: { - id: Modelv2.ID.make(ctx.model.id), - providerID: Modelv2.ProviderID.make(ctx.model.providerID), - variant: Modelv2.VariantID.make(input.assistantMessage.variant ?? "default"), + id: ModelV2.ID.make(ctx.model.id), + providerID: ProviderV2.ID.make(ctx.model.providerID), + variant: ModelV2.VariantID.make(input.assistantMessage.variant ?? "default"), }, snapshot: ctx.snapshot, timestamp: DateTime.makeUnsafe(Date.now()), @@ -505,8 +499,8 @@ export const layer: Layer.Layer< }) if (!ctx.assistantMessage.summary) { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Step.Ended.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Step.Ended, { sessionID: ctx.sessionID, finish: value.finishReason, cost: usage.cost, @@ -562,8 +556,8 @@ export const layer: Layer.Layer< case "text-start": if (!ctx.assistantMessage.summary) { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Text.Started.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Text.Started, { sessionID: ctx.sessionID, timestamp: DateTime.makeUnsafe(Date.now()), }) @@ -609,8 +603,8 @@ export const layer: Layer.Layer< )).text if (!ctx.assistantMessage.summary) { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Text.Ended.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Text.Ended, { sessionID: ctx.sessionID, text: ctx.currentText.text, timestamp: DateTime.makeUnsafe(Date.now()), @@ -705,8 +699,8 @@ export const layer: Layer.Layer< } if (!ctx.assistantMessage.summary) { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Step.Failed.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Step.Failed, { sessionID: ctx.sessionID, error: { type: "unknown", @@ -759,8 +753,8 @@ export const layer: Layer.Layer< parse, set: (info) => { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - const event = Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM - ? sync.run(SessionEvent.Retried.Sync, { + const event = flags.experimentalEventSystem + ? events.publish(SessionEvent.Retried, { sessionID: ctx.sessionID, attempt: info.attempt, error: { @@ -821,7 +815,8 @@ export const defaultLayer = Layer.suspend(() => Layer.provide(Image.defaultLayer), Layer.provide(Bus.layer), Layer.provide(Config.defaultLayer), - Layer.provide(SyncEvent.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), + Layer.provide(EventV2Bridge.defaultLayer), ), ) diff --git a/packages/opencode/src/session/projectors-next.ts b/packages/opencode/src/session/projectors-next.ts index 93298170cc0c..ae5b9c5d2fb9 100644 --- a/packages/opencode/src/session/projectors-next.ts +++ b/packages/opencode/src/session/projectors-next.ts @@ -1,10 +1,11 @@ import { and, desc, eq } from "@/storage/db" import type { Database } from "@/storage/db" -import { SessionMessage } from "@/v2/session-message" -import { SessionMessageUpdater } from "@/v2/session-message-updater" -import { SessionEvent } from "@/v2/session-event" +import { SessionMessage } from "@opencode-ai/core/session-message" +import { SessionMessageUpdater } from "@opencode-ai/core/session-message-updater" +import { SessionEvent } from "@opencode-ai/core/session-event" import * as DateTime from "effect/DateTime" import { SyncEvent } from "@/sync" +import { EventV2Bridge } from "@/event-v2-bridge" import { SessionMessageTable, SessionTable } from "./session.sql" import type { SessionID } from "./schema" import { Schema } from "effect" @@ -119,7 +120,7 @@ function update(db: Database.TxOrDb, event: SessionEvent.Event) { } export default [ - SyncEvent.project(SessionEvent.AgentSwitched.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.AgentSwitched), (db, data, event) => { db.update(SessionTable) .set({ agent: data.agent, @@ -129,7 +130,7 @@ export default [ .run() update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.agent.switched", data }) }), - SyncEvent.project(SessionEvent.ModelSwitched.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.ModelSwitched), (db, data, event) => { db.update(SessionTable) .set({ model: data.model, @@ -139,65 +140,65 @@ export default [ .run() update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.model.switched", data }) }), - SyncEvent.project(SessionEvent.Prompted.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Prompted), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.prompted", data }) }), - SyncEvent.project(SessionEvent.Synthetic.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Synthetic), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.synthetic", data }) }), - SyncEvent.project(SessionEvent.Shell.Started.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Shell.Started), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.shell.started", data }) }), - SyncEvent.project(SessionEvent.Shell.Ended.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Shell.Ended), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.shell.ended", data }) }), - SyncEvent.project(SessionEvent.Step.Started.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Step.Started), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.step.started", data }) }), - SyncEvent.project(SessionEvent.Step.Ended.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Step.Ended), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.step.ended", data }) }), - SyncEvent.project(SessionEvent.Step.Failed.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Step.Failed), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.step.failed", data }) }), - SyncEvent.project(SessionEvent.Text.Started.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Text.Started), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.text.started", data }) }), - SyncEvent.project(SessionEvent.Text.Delta.Sync, () => {}), - SyncEvent.project(SessionEvent.Text.Ended.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Text.Delta), () => {}), + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Text.Ended), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.text.ended", data }) }), - SyncEvent.project(SessionEvent.Tool.Input.Started.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Tool.Input.Started), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.tool.input.started", data }) }), - SyncEvent.project(SessionEvent.Tool.Input.Delta.Sync, () => {}), - SyncEvent.project(SessionEvent.Tool.Input.Ended.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Tool.Input.Delta), () => {}), + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Tool.Input.Ended), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.tool.input.ended", data }) }), - SyncEvent.project(SessionEvent.Tool.Called.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Tool.Called), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.tool.called", data }) }), - SyncEvent.project(SessionEvent.Tool.Success.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Tool.Success), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.tool.success", data }) }), - SyncEvent.project(SessionEvent.Tool.Failed.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Tool.Failed), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.tool.failed", data }) }), - SyncEvent.project(SessionEvent.Reasoning.Started.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Reasoning.Started), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.reasoning.started", data }) }), - SyncEvent.project(SessionEvent.Reasoning.Delta.Sync, () => {}), - SyncEvent.project(SessionEvent.Reasoning.Ended.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Reasoning.Delta), () => {}), + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Reasoning.Ended), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.reasoning.ended", data }) }), - SyncEvent.project(SessionEvent.Retried.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Retried), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.retried", data }) }), - SyncEvent.project(SessionEvent.Compaction.Started.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Compaction.Started), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.compaction.started", data }) }), - SyncEvent.project(SessionEvent.Compaction.Delta.Sync, () => {}), - SyncEvent.project(SessionEvent.Compaction.Ended.Sync, (db, data, event) => { + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Compaction.Delta), () => {}), + SyncEvent.project(EventV2Bridge.toSyncDefinition(SessionEvent.Compaction.Ended), (db, data, event) => { update(db, { id: SessionMessage.ID.make(event.id), type: "session.next.compaction.ended", data }) }), ] diff --git a/packages/opencode/src/session/projectors.ts b/packages/opencode/src/session/projectors.ts index 93acd4546db2..41d0de081118 100644 --- a/packages/opencode/src/session/projectors.ts +++ b/packages/opencode/src/session/projectors.ts @@ -1,10 +1,13 @@ import { NotFoundError } from "@/storage/storage" import { eq } from "drizzle-orm" import { and } from "drizzle-orm" +import { sql } from "drizzle-orm" +import type { TxOrDb } from "@/storage/db" import { SyncEvent } from "@/sync" import * as Session from "./session" +import { SessionGoal } from "./goal" import { MessageV2 } from "./message-v2" -import { SessionTable, MessageTable, PartTable } from "./session.sql" +import { SessionTable, MessageTable, PartTable, SessionGoalTable } from "./session.sql" import { WorkspaceTable } from "@/control-plane/workspace.sql" import { Log } from "@opencode-ai/core/util/log" import nextProjectors from "./projectors-next" @@ -19,6 +22,29 @@ function foreign(err: unknown) { export type DeepPartial = T extends object ? { [K in keyof T]?: DeepPartial | null } : T +type Usage = Pick + +function usage(part: MessageV2.Part | (typeof PartTable.$inferSelect)["data"]): Usage | undefined { + if (part.type !== "step-finish") return undefined + if (!("cost" in part) || !("tokens" in part)) return undefined + return { cost: part.cost, tokens: part.tokens } +} + +function applyUsage(db: TxOrDb, sessionID: Session.Info["id"], value: Usage, sign = 1) { + db.update(SessionTable) + .set({ + cost: sql`${SessionTable.cost} + ${value.cost * sign}`, + tokens_input: sql`${SessionTable.tokens_input} + ${value.tokens.input * sign}`, + tokens_output: sql`${SessionTable.tokens_output} + ${value.tokens.output * sign}`, + tokens_reasoning: sql`${SessionTable.tokens_reasoning} + ${value.tokens.reasoning * sign}`, + tokens_cache_read: sql`${SessionTable.tokens_cache_read} + ${value.tokens.cache.read * sign}`, + tokens_cache_write: sql`${SessionTable.tokens_cache_write} + ${value.tokens.cache.write * sign}`, + time_updated: sql`${SessionTable.time_updated}`, + }) + .where(eq(SessionTable.id, sessionID)) + .run() +} + function grab( obj: T, field1: K1, @@ -54,6 +80,12 @@ export function toPartialRow(info: DeepPartial) { summary_deletions: grab(info, "summary", (v) => grab(v, "deletions")), summary_files: grab(info, "summary", (v) => grab(v, "files")), summary_diffs: grab(info, "summary", (v) => grab(v, "diffs")), + cost: grab(info, "cost"), + tokens_input: grab(info, "tokens", (v) => grab(v, "input")), + tokens_output: grab(info, "tokens", (v) => grab(v, "output")), + tokens_reasoning: grab(info, "tokens", (v) => grab(v, "reasoning")), + tokens_cache_read: grab(info, "tokens", (v) => grab(v, "cache", (cache) => grab(cache, "read"))), + tokens_cache_write: grab(info, "tokens", (v) => grab(v, "cache", (cache) => grab(cache, "write"))), revert: grab(info, "revert"), permission: grab(info, "permission"), time_created: grab(info, "time", (v) => grab(v, "created")), @@ -80,7 +112,7 @@ export default [ const info = data.info const row = db .update(SessionTable) - .set(toPartialRow(info as Session.Patch)) + .set({ time_updated: sql`${SessionTable.time_updated}`, ...toPartialRow(info as Session.Patch) }) .where(eq(SessionTable.id, data.sessionID)) .returning() .get() @@ -91,6 +123,20 @@ export default [ db.delete(SessionTable).where(eq(SessionTable.id, data.sessionID)).run() }), + SyncEvent.project(SessionGoal.Event.Updated, (db, data) => { + db.insert(SessionGoalTable) + .values(SessionGoal.toRow(data.goal as SessionGoal.Info)) + .onConflictDoUpdate({ + target: SessionGoalTable.session_id, + set: SessionGoal.toRow(data.goal as SessionGoal.Info), + }) + .run() + }), + + SyncEvent.project(SessionGoal.Event.Cleared, (db, data) => { + db.delete(SessionGoalTable).where(eq(SessionGoalTable.session_id, data.sessionID)).run() + }), + SyncEvent.project(MessageV2.Event.Updated, (db, data) => { const time_created = data.info.time.created const { id, sessionID, ...rest } = data.info @@ -112,12 +158,28 @@ export default [ }), SyncEvent.project(MessageV2.Event.Removed, (db, data) => { + for (const row of db + .select() + .from(PartTable) + .where(and(eq(PartTable.message_id, data.messageID), eq(PartTable.session_id, data.sessionID))) + .all()) { + const previous = usage(row.data) + if (previous) applyUsage(db, data.sessionID, previous, -1) + } db.delete(MessageTable) .where(and(eq(MessageTable.id, data.messageID), eq(MessageTable.session_id, data.sessionID))) .run() }), SyncEvent.project(MessageV2.Event.PartRemoved, (db, data) => { + const row = db + .select() + .from(PartTable) + .where(and(eq(PartTable.id, data.partID), eq(PartTable.session_id, data.sessionID))) + .get() + const previous = row && usage(row.data) + if (previous) applyUsage(db, data.sessionID, previous, -1) + db.delete(PartTable) .where(and(eq(PartTable.id, data.partID), eq(PartTable.session_id, data.sessionID))) .run() @@ -125,6 +187,7 @@ export default [ SyncEvent.project(MessageV2.Event.PartUpdated, (db, data) => { const { id, messageID, sessionID, ...rest } = data.part + const row = db.select().from(PartTable).where(eq(PartTable.id, id)).get() try { db.insert(PartTable) @@ -137,6 +200,10 @@ export default [ }) .onConflictDoUpdate({ target: PartTable.id, set: { data: rest } }) .run() + const previous = row && usage(row.data) + const next = usage(data.part) + if (previous) applyUsage(db, row.session_id, previous, -1) + if (next) applyUsage(db, sessionID, next) } catch (err) { if (!foreign(err)) throw err log.warn("ignored late part update", { partID: id, messageID, sessionID }) diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts index 2de4bbd308aa..210267eacd16 100644 --- a/packages/opencode/src/session/prompt.ts +++ b/packages/opencode/src/session/prompt.ts @@ -1,11 +1,11 @@ import path from "path" import os from "os" -import * as EffectZod from "@opencode-ai/core/effect-zod" import { SessionID, MessageID, PartID } from "./schema" import { MessageV2 } from "./message-v2" import * as Log from "@opencode-ai/core/util/log" import { SessionRevert } from "./revert" import * as Session from "./session" +import { SessionGoal } from "./goal" import { Agent } from "../agent/agent" import { Provider } from "@/provider/provider" import { ModelID, ProviderID } from "../provider/schema" @@ -21,9 +21,9 @@ import PROMPT_PLAN from "../session/prompt/plan.txt" import BUILD_SWITCH from "../session/prompt/build-switch.txt" import MAX_STEPS from "../session/prompt/max-steps.txt" import { ToolRegistry } from "@/tool/registry" +import { ToolJsonSchema } from "@/tool/json-schema" import { MCP } from "../mcp" import { LSP } from "@/lsp/lsp" -import { Flag } from "@opencode-ai/core/flag/flag" import { ulid } from "ulid" import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" @@ -43,6 +43,7 @@ import { Shell } from "@/shell/shell" import { ShellID } from "@/tool/shell/id" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Truncate } from "@/tool/truncate" +import { Image } from "@/image/image" import { decodeDataUrl } from "@/util/data-url" import { Process } from "@/util/process" import { Cause, Effect, Exit, Latch, Layer, Option, Scope, Context, Schema, Types } from "effect" @@ -51,10 +52,14 @@ import { InstanceState } from "@/effect/instance-state" import { TaskTool, type TaskPromptOps } from "@/tool/task" import { SessionRunState } from "./run-state" import { EffectBridge } from "@/effect/bridge" -import { SyncEvent } from "@/sync" -import { SessionEvent } from "@/v2/session-event" -import { Modelv2 } from "@/v2/model" -import { AgentAttachment, FileAttachment, ReferenceAttachment, Source } from "@/v2/session-prompt" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { EventV2 } from "@opencode-ai/core/event" +import { EventV2Bridge } from "@/event-v2-bridge" +import { SessionEvent } from "@opencode-ai/core/session-event" +import { NotFoundError } from "@/storage/storage" +import { ModelV2 } from "@opencode-ai/core/model" +import { ProviderV2 } from "@opencode-ai/core/provider" +import { AgentAttachment, FileAttachment, ReferenceAttachment, Source } from "@opencode-ai/core/session-prompt" import { Reference } from "@/reference/reference" import * as DateTime from "effect/DateTime" import { eq } from "@/storage/db" @@ -67,6 +72,9 @@ globalThis.AI_SDK_LOG_WARNINGS = false const decodeMessageInfo = Schema.decodeUnknownExit(MessageV2.Info) const decodeMessagePart = Schema.decodeUnknownExit(MessageV2.Part) +const GOAL_CONTINUATION_MARKER = "Continue working toward the active session goal." +const GOAL_CONTINUATION_IDLE_GRACE = "150 millis" + const STRUCTURED_OUTPUT_DESCRIPTION = `Use this tool to return your final response in the requested structured format. IMPORTANT: @@ -164,10 +172,12 @@ function referenceTextPart(input: { export interface Interface { readonly cancel: (sessionID: SessionID) => Effect.Effect - readonly prompt: (input: PromptInput) => Effect.Effect + readonly continueGoal: (sessionID: SessionID) => Effect.Effect + readonly resumeGoals: () => Effect.Effect + readonly prompt: (input: PromptInput) => Effect.Effect readonly loop: (input: LoopInput) => Effect.Effect - readonly shell: (input: ShellInput) => Effect.Effect - readonly command: (input: CommandInput) => Effect.Effect + readonly shell: (input: ShellInput) => Effect.Effect + readonly command: (input: CommandInput) => Effect.Effect readonly resolvePromptParts: (template: string) => Effect.Effect } @@ -179,6 +189,7 @@ export const layer = Layer.effect( const bus = yield* Bus.Service const status = yield* SessionStatus.Service const sessions = yield* Session.Service + const goals = yield* SessionGoal.Service const agents = yield* Agent.Service const provider = yield* Provider.Service const processor = yield* SessionProcessor.Service @@ -192,6 +203,7 @@ export const layer = Layer.effect( const lsp = yield* LSP.Service const registry = yield* ToolRegistry.Service const truncate = yield* Truncate.Service + const image = yield* Image.Service const spawner = yield* ChildProcessSpawner.ChildProcessSpawner const scope = yield* Scope.Scope const instruction = yield* Instruction.Service @@ -201,7 +213,15 @@ export const layer = Layer.effect( const sys = yield* SystemPrompt.Service const llm = yield* LLM.Service const references = yield* Reference.Service - const sync = yield* SyncEvent.Service + const events = yield* EventV2Bridge.Service + const flags = yield* RuntimeFlags.Service + const goalIdleSubscription = yield* InstanceState.make(() => + Effect.succeed({ + active: false, + pending: new Set(), + continuing: new Set(), + }), + ) const runner = Effect.fn("SessionPrompt.runner")(function* () { return yield* EffectBridge.make() }) @@ -209,15 +229,193 @@ export const layer = Layer.effect( return { cancel: (sessionID: SessionID) => cancel(sessionID), resolvePromptParts: (template: string) => resolvePromptParts(template), - prompt: (input: PromptInput) => prompt(input), + prompt: (input: PromptInput) => prompt(input).pipe(Effect.catch(Effect.die)), + loop: (input: LoopInput) => loop(input), } satisfies TaskPromptOps }) const cancel = Effect.fn("SessionPrompt.cancel")(function* (sessionID: SessionID) { yield* elog.info("cancel", { sessionID }) + const goal = yield* goals.get(sessionID) + if (goal?.status === "active") { + yield* goals.update({ sessionID, status: "paused" }).pipe(Effect.ignore) + } yield* state.cancel(sessionID) }) + const scheduleGoalIdleRetry: (sessionID: SessionID) => Effect.Effect = Effect.fn( + "SessionPrompt.scheduleGoalIdleRetry", + )(function* (sessionID: SessionID) { + const subscription = yield* InstanceState.get(goalIdleSubscription) + if (subscription.pending.has(sessionID)) return + subscription.pending.add(sessionID) + yield* Effect.gen(function* () { + while ((yield* status.get(sessionID)).type !== "idle") { + yield* Effect.sleep(25) + } + yield* autoContinueGoal(sessionID) + }).pipe( + Effect.ensuring(Effect.sync(() => subscription.pending.delete(sessionID))), + Effect.ignore, + Effect.forkIn(scope, { startImmediately: true }), + ) + }) + + const isGoalContinuationMessage = (message: MessageV2.WithParts) => + message.info.role === "user" && + message.parts.some( + (part) => + part.type === "text" && + part.synthetic && + (part.metadata?.goalContinuation === true || part.text.includes(GOAL_CONTINUATION_MARKER)), + ) + + const assistantMadeGoalProgress = (message: MessageV2.WithParts) => + message.info.role === "assistant" && + message.parts.some((part) => { + if (part.type === "patch" || part.type === "subtask") return true + if (part.type !== "tool") return false + if (part.tool === "get_goal") return false + return part.state.status === "completed" || part.state.status === "running" || part.state.status === "pending" + }) + + const autoContinueGoal: (sessionID: SessionID) => Effect.Effect = Effect.fn( + "SessionPrompt.autoContinueGoal", + )(function* (sessionID: SessionID) { + yield* ensureGoalIdleSubscription() + const subscription = yield* InstanceState.get(goalIdleSubscription) + if (subscription.continuing.has(sessionID)) return + subscription.continuing.add(sessionID) + yield* Effect.gen(function* () { + const goal = yield* goals.get(sessionID) + if (goal?.status !== "active") return + + const current = yield* status.get(sessionID) + if (current.type !== "idle") { + yield* scheduleGoalIdleRetry(sessionID) + return + } + yield* Effect.sleep(GOAL_CONTINUATION_IDLE_GRACE) + const afterGraceGoal = yield* goals.get(sessionID) + if (afterGraceGoal?.status !== "active") return + const afterGraceStatus = yield* status.get(sessionID) + if (afterGraceStatus.type !== "idle") { + yield* scheduleGoalIdleRetry(sessionID) + return + } + + const latestUser = yield* sessions + .findMessage(sessionID, (message) => message.info.role === "user") + .pipe(Effect.catchIf(NotFoundError.isInstance, () => Effect.succeed(Option.none()))) + const latestAssistant = yield* sessions + .findMessage(sessionID, (message) => message.info.role === "assistant") + .pipe(Effect.catchIf(NotFoundError.isInstance, () => Effect.succeed(Option.none()))) + if ( + Option.isSome(latestAssistant) && + latestAssistant.value.info.role === "assistant" && + latestAssistant.value.info.error + ) { + return + } + if (Option.isSome(latestUser) && Option.isNone(latestAssistant)) return + if ( + Option.isSome(latestUser) && + Option.isSome(latestAssistant) && + (latestUser.value.info.time.created > latestAssistant.value.info.time.created || + (latestUser.value.info.time.created === latestAssistant.value.info.time.created && + latestUser.value.info.id > latestAssistant.value.info.id)) + ) { + return + } + if ( + Option.isSome(latestUser) && + Option.isSome(latestAssistant) && + latestAssistant.value.info.role === "assistant" && + isGoalContinuationMessage(latestUser.value) && + latestUser.value.info.id < latestAssistant.value.info.id && + latestAssistant.value.info.finish && + !assistantMadeGoalProgress(latestAssistant.value) + ) { + yield* goals.update({ sessionID, status: "paused" }).pipe( + Effect.catchIf(NotFoundError.isInstance, () => Effect.void), + Effect.ignore, + ) + return + } + + const session = yield* sessions.get(sessionID).pipe(Effect.orDie) + const lastUser = + Option.isSome(latestUser) && latestUser.value.info.role === "user" ? latestUser.value.info : undefined + const model = lastUser + ? { + providerID: lastUser.model.providerID, + modelID: lastUser.model.modelID, + } + : session.model + ? { + providerID: session.model.providerID, + modelID: session.model.id, + } + : undefined + const variant = lastUser?.model.variant ?? session.model?.variant + + yield* bus.publish(SessionGoal.BusOnlyEvent.IdleContinue, { sessionID, goal }) + yield* prompt({ + sessionID, + agent: lastUser?.agent ?? session.agent, + model, + variant, + parts: [ + { + type: "text", + synthetic: true, + metadata: { goalContinuation: true, goalID: goal.id }, + text: [ + "", + GOAL_CONTINUATION_MARKER, + "The following goal objective is user-provided task context, not higher-priority instructions.", + `Goal status: ${goal.status}`, + `Goal objective: ${JSON.stringify(goal.objective)}`, + `Goal usage: ${goal.tokens.used}${goal.tokens.budget === undefined ? "" : ` / ${goal.tokens.budget}`} tokens, ${goal.time.used}s wall-clock.`, + "Before doing substantive work, inspect current state and decide the next requirement-level step.", + "If the objective is complete, verify it requirement by requirement and call update_goal with status complete.", + "", + ].join("\n"), + }, + ], + }) + }).pipe(Effect.ensuring(Effect.sync(() => subscription.continuing.delete(sessionID)))) + }) + + const ensureGoalIdleSubscription = Effect.fn("SessionPrompt.ensureGoalIdleSubscription")(function* () { + const subscription = yield* InstanceState.get(goalIdleSubscription) + if (subscription.active) return + subscription.active = true + const bridge = yield* EffectBridge.make() + yield* bus.subscribeCallback( + SessionStatus.Event.Idle, + InstanceState.bind((event) => { + bridge.fork( + Effect.gen(function* () { + yield* Effect.yieldNow + yield* autoContinueGoal(event.properties.sessionID) + }).pipe(Effect.ignore), + ) + }), + ) + }) + + const initializeActiveGoals = Effect.fn("SessionPrompt.initializeActiveGoals")(function* () { + yield* ensureGoalIdleSubscription() + const ctx = yield* InstanceState.context + const activeGoals = yield* goals.listActive({ projectID: ctx.project.id }) + yield* Effect.forEach( + activeGoals, + (goal) => autoContinueGoal(goal.sessionID).pipe(Effect.ignore, Effect.forkIn(scope, { startImmediately: true })), + { discard: true }, + ) + }) + const resolvePromptParts = Effect.fn("SessionPrompt.resolvePromptParts")(function* (template: string) { const ctx = yield* InstanceState.context const parts: Types.DeepMutable = [{ type: "text", text: template }] @@ -384,7 +582,7 @@ export const layer = Layer.effect( const userMessage = input.messages.findLast((msg) => msg.info.role === "user") if (!userMessage) return input.messages - if (!Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE) { + if (!flags.experimentalPlanMode) { if (input.agent.name === "plan") { userMessage.parts.push({ id: PartID.ascending(), @@ -513,6 +711,25 @@ NOTE: At any point in time through this workflow you should feel free to ask the return input.messages }) + const userRequestedGoalCreate = (messages: MessageV2.WithParts[]) => { + const latest = messages.findLast((message) => message.info.role === "user") + if (!latest) return false + const text = latest.parts + .filter( + (part): part is MessageV2.TextPart => part.type === "text" && !part.synthetic && !part.ignored, + ) + .map((part) => part.text) + .join("\n") + .trim() + if (!text) return false + if (/^\/goal\s+(?!(edit|pause|resume|clear)\b)\S/i.test(text)) return true + if (/\b(create|set|start|add|make|establish)\s+(a\s+|an\s+|the\s+|my\s+|this\s+)?(session\s+)?goal\b/i.test(text)) { + return true + } + if (/\b(set|make|change)\s+(the\s+|my\s+)?goal\s+(to|as)\b/i.test(text)) return true + return false + } + const resolveTools = Effect.fn("SessionPrompt.resolveTools")(function* (input: { agent: Agent.Info model: Provider.Model @@ -526,6 +743,86 @@ NOTE: At any point in time through this workflow you should feel free to ask the const tools: Record = {} const run = yield* runner() const promptOps = yield* ops() + const goalToolResult = (title: string, goal: SessionGoal.Info | null) => ({ + title, + metadata: goal ? { goal } : { goal: null }, + output: JSON.stringify(goal ? { goal } : { goal: null }, null, 2), + }) + + tools["get_goal"] = tool({ + description: "Get the current session goal and usage metadata.", + inputSchema: jsonSchema({ type: "object", properties: {}, additionalProperties: false }), + execute() { + return run.promise( + Effect.gen(function* () { + const goal = (yield* goals.get(input.session.id)) ?? null + return goalToolResult(goal ? "Current goal" : "No current goal", goal) + }), + ) + }, + }) + + const canCreateGoal = userRequestedGoalCreate(input.messages) + if (canCreateGoal) { + tools["create_goal"] = tool({ + description: "Create a session goal only when the user explicitly requested one.", + inputSchema: jsonSchema({ + type: "object", + additionalProperties: false, + required: ["objective"], + properties: { + objective: { type: "string" }, + tokenBudget: { type: "number" }, + }, + }), + execute(args) { + return run.promise( + Effect.gen(function* () { + if (!canCreateGoal) { + throw new Error("create_goal requires an explicit user request in the latest message") + } + const payload = args as { objective?: unknown; tokenBudget?: unknown } + if (typeof payload.objective !== "string") throw new Error("objective is required") + const current = yield* goals.get(input.session.id) + if (current) throw new Error("create_goal failed: a goal already exists for this session") + const tokenBudget = typeof payload.tokenBudget === "number" ? payload.tokenBudget : undefined + const goal = yield* goals.create({ + sessionID: input.session.id, + objective: payload.objective, + tokenBudget, + }) + return goalToolResult("Goal created", goal) + }), + ) + }, + }) + } + + tools["update_goal"] = tool({ + description: "Mark the current session goal complete only after the objective is fully achieved and verified.", + inputSchema: jsonSchema({ + type: "object", + additionalProperties: false, + required: ["status"], + properties: { + status: { type: "string", enum: ["complete"] }, + }, + }), + execute(args) { + return run.promise( + Effect.gen(function* () { + const payload = args as { status?: unknown } + if (payload.status !== "complete") throw new Error("Models can only mark goals complete") + const goal = yield* goals.modelUpdate({ + sessionID: input.session.id, + messageID: input.processor.message.id, + status: "complete", + }) + return goalToolResult("Goal complete", goal) + }), + ) + }, + }) const context = (args: any, options: ToolExecutionOptions): Tool.Context => ({ sessionID: input.session.id, @@ -565,7 +862,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the providerID: input.model.providerID, agent: input.agent, })) { - const schema = ProviderTransform.schema(input.model, EffectZod.toJsonSchema(item.parameters)) + const schema = ProviderTransform.schema(input.model, ToolJsonSchema.fromTool(item)) tools[item.id] = tool({ description: item.description, inputSchema: jsonSchema(schema), @@ -939,7 +1236,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the providerID: model.providerID, } yield* sessions.updateMessage(msg) - const callID = ulid() const started = Date.now() const part: MessageV2.ToolPart = { type: "tool", @@ -955,11 +1251,11 @@ NOTE: At any point in time through this workflow you should feel free to ask the }, } yield* sessions.updatePart(part) - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Shell.Started.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Shell.Started, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(started), - callID, + callID: part.callID, command: input.command, }) } @@ -978,8 +1274,8 @@ NOTE: At any point in time through this workflow you should feel free to ask the output += "\n\n" + ["", "User aborted the command", ""].join("\n") } const completed = Date.now() - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Shell.Ended.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Shell.Ended, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(completed), callID: part.callID, @@ -1055,15 +1351,15 @@ NOTE: At any point in time through this workflow you should feel free to ask the if (Exit.isSuccess(exit)) return exit.value const err = Cause.squash(exit.cause) if (Provider.ModelNotFoundError.isInstance(err)) { - const hint = err.data.suggestions?.length ? ` Did you mean: ${err.data.suggestions.join(", ")}?` : "" + const hint = err.suggestions?.length ? ` Did you mean: ${err.suggestions.join(", ")}?` : "" yield* bus.publish(Session.Event.Error, { sessionID, error: new NamedError.Unknown({ - message: `Model not found: ${err.data.providerID}/${err.data.modelID}.${hint}`, + message: `Model not found: ${err.providerID}/${err.modelID}.${hint}`, }).toObject(), }) } - return yield* Effect.failCause(exit.cause) + return yield* Effect.die(err) }) const currentModel = Effect.fnUntraced(function* (sessionID: SessionID) { @@ -1077,14 +1373,16 @@ NOTE: At any point in time through this workflow you should feel free to ask the ...(current.model.variant && current.model.variant !== "default" ? { variant: current.model.variant } : {}), } } - const match = yield* sessions.findMessage(sessionID, (m) => m.info.role === "user" && !!m.info.model) + const match = yield* sessions + .findMessage(sessionID, (m) => m.info.role === "user" && !!m.info.model) + .pipe(Effect.orDie) if (Option.isSome(match) && match.value.info.role === "user") return match.value.info.model return yield* provider.defaultModel() }) const createUserMessage = Effect.fn("SessionPrompt.createUserMessage")(function* (input: PromptInput) { - const agentName = input.agent || (yield* agents.defaultAgent()) - const ag = yield* agents.get(agentName) + const agentName = input.agent + const ag = agentName ? yield* agents.get(agentName) : yield* agents.defaultInfo() if (!ag) { const available = (yield* agents.list()).filter((a) => !a.hidden).map((a) => a.name) const hint = available.length ? ` Available agents: ${available.join(", ")}` : "" @@ -1104,7 +1402,9 @@ NOTE: At any point in time through this workflow you should feel free to ask the const same = ag.model && model.providerID === ag.model.providerID && model.modelID === ag.model.modelID const full = !input.variant && ag.variant && same - ? yield* provider.getModel(model.providerID, model.modelID).pipe(Effect.catchDefect(() => Effect.void)) + ? yield* provider + .getModel(model.providerID, model.modelID) + .pipe(Effect.catchIf(Provider.ModelNotFoundError.isInstance, () => Effect.succeed(undefined))) : undefined const variant = input.variant ?? (ag.variant && full?.variants?.[ag.variant] ? ag.variant : undefined) @@ -1125,7 +1425,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the } if (current?.agent !== info.agent) { - yield* sync.run(SessionEvent.AgentSwitched.Sync, { + yield* events.publish(SessionEvent.AgentSwitched, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(info.time.created), agent: info.agent, @@ -1136,13 +1436,13 @@ NOTE: At any point in time through this workflow you should feel free to ask the current.model.id !== info.model.modelID || (current.model.variant === "default" ? undefined : current.model.variant) !== info.model.variant ) { - yield* sync.run(SessionEvent.ModelSwitched.Sync, { + yield* events.publish(SessionEvent.ModelSwitched, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(info.time.created), model: { - id: Modelv2.ID.make(info.model.modelID), - providerID: Modelv2.ProviderID.make(info.model.providerID), - variant: Modelv2.VariantID.make(info.model.variant ?? "default"), + id: ModelV2.ID.make(info.model.modelID), + providerID: ProviderV2.ID.make(info.model.providerID), + variant: ModelV2.VariantID.make(info.model.variant ?? "default"), }, }) } @@ -1472,7 +1772,16 @@ NOTE: At any point in time through this workflow you should feel free to ask the { message: info, parts: resolvedParts }, ) - const parts = resolvedParts + const parts = yield* Effect.forEach(resolvedParts, (part) => + part.type === "file" && part.mime.startsWith("image/") + ? image.normalize(part).pipe( + Effect.catchIf( + (error) => error instanceof Image.ResizerUnavailableError, + () => Effect.succeed(part), + ), + ) + : Effect.succeed(part), + ) const parsed = decodeMessageInfo(info, { errors: "all", propertyOrder: "original" }) if (Exit.isFailure(parsed)) { @@ -1567,8 +1876,8 @@ NOTE: At any point in time through this workflow you should feel free to ask the }, ) // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Prompted.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Prompted, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(info.time.created), prompt: { @@ -1581,8 +1890,8 @@ NOTE: At any point in time through this workflow you should feel free to ask the } for (const text of nextPrompt.synthetic) { // TODO(v2): Temporary dual-write while migrating session messages to v2 events. - if (Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) { - yield* sync.run(SessionEvent.Synthetic.Sync, { + if (flags.experimentalEventSystem) { + yield* events.publish(SessionEvent.Synthetic, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(info.time.created), text, @@ -1593,31 +1902,32 @@ NOTE: At any point in time through this workflow you should feel free to ask the return { info, parts } }, Effect.scoped) - const prompt: (input: PromptInput) => Effect.Effect = Effect.fn("SessionPrompt.prompt")( - function* (input: PromptInput) { - const session = yield* sessions.get(input.sessionID).pipe(Effect.orDie) - yield* revert.cleanup(session) - const message = yield* createUserMessage(input) - yield* sessions.touch(input.sessionID) - - const permissions: Permission.Ruleset = [] - for (const [t, enabled] of Object.entries(input.tools ?? {})) { - permissions.push({ permission: t, action: enabled ? "allow" : "deny", pattern: "*" }) - } - if (permissions.length > 0) { - session.permission = permissions - yield* sessions.setPermission({ sessionID: session.id, permission: permissions }) - } + const prompt: (input: PromptInput) => Effect.Effect = Effect.fn( + "SessionPrompt.prompt", + )(function* (input: PromptInput) { + yield* ensureGoalIdleSubscription() + const session = yield* sessions.get(input.sessionID).pipe(Effect.orDie) + yield* revert.cleanup(session) + const message = yield* createUserMessage(input) + yield* sessions.touch(input.sessionID) + + const permissions: Permission.Ruleset = [] + for (const [t, enabled] of Object.entries(input.tools ?? {})) { + permissions.push({ permission: t, action: enabled ? "allow" : "deny", pattern: "*" }) + } + if (permissions.length > 0) { + session.permission = permissions + yield* sessions.setPermission({ sessionID: session.id, permission: permissions }) + } - if (input.noReply === true) return message - return yield* loop({ sessionID: input.sessionID }) - }, - ) + if (input.noReply === true) return message + return yield* loop({ sessionID: input.sessionID }) + }) const lastAssistant = Effect.fnUntraced(function* (sessionID: SessionID) { - const match = yield* sessions.findMessage(sessionID, (m) => m.info.role !== "user") + const match = yield* sessions.findMessage(sessionID, (m) => m.info.role !== "user").pipe(Effect.orDie) if (Option.isSome(match)) return match.value - const msgs = yield* sessions.messages({ sessionID, limit: 1 }) + const msgs = yield* sessions.messages({ sessionID, limit: 1 }).pipe(Effect.orDie) if (msgs.length > 0) return msgs[0] throw new Error("Impossible") }) @@ -1636,19 +1946,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the let msgs = yield* MessageV2.filterCompactedEffect(sessionID) - let lastUser: MessageV2.User | undefined - let lastAssistant: MessageV2.Assistant | undefined - let lastFinished: MessageV2.Assistant | undefined - let tasks: (MessageV2.CompactionPart | MessageV2.SubtaskPart)[] = [] - for (let i = msgs.length - 1; i >= 0; i--) { - const msg = msgs[i] - if (!lastUser && msg.info.role === "user") lastUser = msg.info - if (!lastAssistant && msg.info.role === "assistant") lastAssistant = msg.info - if (!lastFinished && msg.info.role === "assistant" && msg.info.finish) lastFinished = msg.info - if (lastUser && lastFinished) break - const task = msg.parts.filter((part) => part.type === "compaction" || part.type === "subtask") - if (task && !lastFinished) tasks.push(...task) - } + const { user: lastUser, assistant: lastAssistant, finished: lastFinished, tasks } = MessageV2.latest(msgs) if (!lastUser) throw new Error("No user message found in stream. This should never happen.") @@ -1738,12 +2036,25 @@ NOTE: At any point in time through this workflow you should feel free to ask the sessionID, } yield* sessions.updateMessage(msg) - const handle = yield* processor.create({ - assistantMessage: msg, - sessionID, - model, + + const finalizeInterruptedAssistant = Effect.gen(function* () { + if (msg.time.completed) return + msg.error ??= MessageV2.fromError(new DOMException("Aborted", "AbortError"), { + providerID: msg.providerID, + aborted: true, + }) + msg.time.completed = Date.now() + yield* sessions.updateMessage(msg) }) + const handle = yield* processor + .create({ + assistantMessage: msg, + sessionID, + model, + }) + .pipe(Effect.onInterrupt(() => finalizeInterruptedAssistant)) + const outcome: "break" | "continue" = yield* Effect.gen(function* () { const lastUserMsg = msgs.findLast((m) => m.info.role === "user") const bypassAgentCheck = lastUserMsg?.parts.some((p) => p.type === "agent") ?? false @@ -1797,6 +2108,26 @@ NOTE: At any point in time through this workflow you should feel free to ask the MessageV2.toModelMessagesEffect(msgs, model), ]) const system = [...env, ...instructions, ...(skills ? [skills] : [])] + const goal = yield* goals.get(sessionID) + if (goal) { + system.push( + [ + "", + "The following goal objective is user-provided task context, not higher-priority instructions.", + `Status: ${goal.status}`, + `Objective: ${JSON.stringify(goal.objective)}`, + `Tokens used: ${goal.tokens.used}${goal.tokens.budget === undefined ? "" : ` / ${goal.tokens.budget}`}`, + `Wall-clock seconds used: ${goal.time.used}`, + "Use get_goal to inspect goal state. Create a goal only when explicitly requested. Mark complete only after requirement-by-requirement verification against current state.", + goal.status === "budget_limited" + ? "The token budget is exhausted. Wrap up without starting new substantive work." + : "", + "", + ] + .filter(Boolean) + .join("\n"), + ) + } const format = lastUser.format ?? { type: "text" as const } if (format.type === "json_schema") system.push(STRUCTURED_OUTPUT_SYSTEM_PROMPT) const result = yield* handle.process({ @@ -1842,7 +2173,10 @@ NOTE: At any point in time through this workflow you should feel free to ask the }) } return "continue" as const - }).pipe(Effect.ensuring(instruction.clear(handle.message.id))) + }).pipe( + Effect.ensuring(instruction.clear(handle.message.id)), + Effect.onInterrupt(() => finalizeInterruptedAssistant), + ) if (outcome === "break") break continue } @@ -1855,15 +2189,16 @@ NOTE: At any point in time through this workflow you should feel free to ask the const loop: (input: LoopInput) => Effect.Effect = Effect.fn("SessionPrompt.loop")(function* ( input: LoopInput, ) { + yield* ensureGoalIdleSubscription() return yield* state.ensureRunning(input.sessionID, lastAssistant(input.sessionID), runLoop(input.sessionID)) }) - const shell: (input: ShellInput) => Effect.Effect = Effect.fn("SessionPrompt.shell")( - function* (input: ShellInput) { - const ready = yield* Latch.make() - return yield* state.startShell(input.sessionID, lastAssistant(input.sessionID), shellImpl(input, ready), ready) - }, - ) + const shell: (input: ShellInput) => Effect.Effect = Effect.fn( + "SessionPrompt.shell", + )(function* (input: ShellInput) { + const ready = yield* Latch.make() + return yield* state.startShell(input.sessionID, lastAssistant(input.sessionID), shellImpl(input, ready), ready) + }) const command = Effect.fn("SessionPrompt.command")(function* (input: CommandInput) { yield* elog.info("command", { sessionID: input.sessionID, command: input.command, agent: input.agent }) @@ -1875,7 +2210,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the yield* bus.publish(Session.Event.Error, { sessionID: input.sessionID, error: error.toObject() }) throw error } - const agentName = cmd.agent ?? input.agent ?? (yield* agents.defaultAgent()) + const agentName = cmd.agent ?? input.agent const raw = input.arguments.match(argsRegex) ?? [] const args = raw.map((arg) => arg.replace(quoteTrimRegex, "")) @@ -1928,7 +2263,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the yield* getModel(taskModel.providerID, taskModel.modelID, input.sessionID) - const agent = yield* agents.get(agentName) + const agent = agentName ? yield* agents.get(agentName) : yield* agents.defaultInfo() if (!agent) { const available = (yield* agents.list()).filter((a) => !a.hidden).map((a) => a.name) const hint = available.length ? ` Available agents: ${available.join(", ")}` : "" @@ -1952,7 +2287,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the ] : [...templateParts, ...(input.parts ?? [])] - const userAgent = isSubtask ? (input.agent ?? (yield* agents.defaultAgent())) : agentName + const userAgent = isSubtask ? (input.agent ?? (yield* agents.defaultInfo()).name) : agent.name const userModel = isSubtask ? input.model ? Provider.parseModel(input.model) @@ -1984,6 +2319,8 @@ NOTE: At any point in time through this workflow you should feel free to ask the return Service.of({ cancel, + continueGoal: autoContinueGoal, + resumeGoals: initializeActiveGoals, prompt, loop, shell, @@ -2011,17 +2348,20 @@ export const defaultLayer = Layer.suspend(() => Layer.provide(AppFileSystem.defaultLayer), Layer.provide(Plugin.defaultLayer), Layer.provide(Session.defaultLayer), + Layer.provide(SessionGoal.defaultLayer), Layer.provide(SessionRevert.defaultLayer), Layer.provide(SessionSummary.defaultLayer), + Layer.provide(Image.defaultLayer), Layer.provide( Layer.mergeAll( + EventV2Bridge.defaultLayer, Agent.defaultLayer, SystemPrompt.defaultLayer, LLM.defaultLayer, Reference.defaultLayer, Bus.layer, CrossSpawnSpawner.defaultLayer, - SyncEvent.defaultLayer, + RuntimeFlags.defaultLayer, ), ), ), diff --git a/packages/opencode/src/session/retry.ts b/packages/opencode/src/session/retry.ts index 1f73dee31f8f..463bc27a95db 100644 --- a/packages/opencode/src/session/retry.ts +++ b/packages/opencode/src/session/retry.ts @@ -2,6 +2,7 @@ import type { NamedError } from "@opencode-ai/core/util/error" import { Cause, Clock, Duration, Effect, Schedule } from "effect" import { MessageV2 } from "./message-v2" import { iife } from "@/util/iife" +import { isRecord } from "@/util/record" export type Err = ReturnType @@ -121,7 +122,7 @@ export function retryable(error: Err, provider: string) { } // Check for rate limit patterns in plain text error messages - const msg = error.data?.message + const msg = isRecord(error.data) ? error.data.message : undefined if (typeof msg === "string") { const lower = msg.toLowerCase() if ( @@ -133,7 +134,7 @@ export function retryable(error: Err, provider: string) { } } - const json = parseJSON(error.data?.message) + const json = parseJSON(msg) if (!json || typeof json !== "object") return undefined const code = typeof json.code === "string" ? json.code : "" diff --git a/packages/opencode/src/session/revert.ts b/packages/opencode/src/session/revert.ts index ef9089c9497b..950d533a3d42 100644 --- a/packages/opencode/src/session/revert.ts +++ b/packages/opencode/src/session/revert.ts @@ -20,8 +20,8 @@ export const RevertInput = Schema.Struct({ export type RevertInput = Schema.Schema.Type export interface Interface { - readonly revert: (input: RevertInput) => Effect.Effect - readonly unrevert: (input: { sessionID: SessionID }) => Effect.Effect + readonly revert: (input: RevertInput) => Effect.Effect + readonly unrevert: (input: { sessionID: SessionID }) => Effect.Effect readonly cleanup: (session: Session.Info) => Effect.Effect } @@ -40,7 +40,7 @@ export const layer = Layer.effect( const revert = Effect.fn("SessionRevert.revert")(function* (input: RevertInput) { yield* state.assertNotBusy(input.sessionID) - const all = yield* sessions.messages({ sessionID: input.sessionID }) + const all = yield* sessions.messages({ sessionID: input.sessionID }).pipe(Effect.orDie) let lastUser: MessageV2.User | undefined const session = yield* sessions.get(input.sessionID).pipe(Effect.orDie) @@ -103,7 +103,7 @@ export const layer = Layer.effect( const cleanup = Effect.fn("SessionRevert.cleanup")(function* (session: Session.Info) { if (!session.revert) return const sessionID = session.id - const msgs = yield* sessions.messages({ sessionID }) + const msgs = yield* sessions.messages({ sessionID }).pipe(Effect.orDie) const messageID = session.revert.messageID const remove = [] as MessageV2.WithParts[] let target: MessageV2.WithParts | undefined diff --git a/packages/opencode/src/session/run-state.ts b/packages/opencode/src/session/run-state.ts index 9d4986f17436..8f0051dfbae7 100644 --- a/packages/opencode/src/session/run-state.ts +++ b/packages/opencode/src/session/run-state.ts @@ -1,5 +1,6 @@ import { InstanceState } from "@/effect/instance-state" import { Runner } from "@/effect/runner" +import { BackgroundJob } from "@/background/job" import { Effect, Latch, Layer, Scope, Context } from "effect" import * as Session from "./session" import { MessageV2 } from "./message-v2" @@ -7,7 +8,7 @@ import { SessionID } from "./schema" import { SessionStatus } from "./status" export interface Interface { - readonly assertNotBusy: (sessionID: SessionID) => Effect.Effect + readonly assertNotBusy: (sessionID: SessionID) => Effect.Effect readonly cancel: (sessionID: SessionID) => Effect.Effect readonly ensureRunning: ( sessionID: SessionID, @@ -19,7 +20,7 @@ export interface Interface { onInterrupt: Effect.Effect, work: Effect.Effect, ready?: Latch.Latch, - ) => Effect.Effect + ) => Effect.Effect } export class Service extends Context.Service()("@opencode/SessionRunState") {} @@ -27,6 +28,7 @@ export class Service extends Context.Service()("@opencode/Se export const layer = Layer.effect( Service, Effect.gen(function* () { + const background = yield* BackgroundJob.Service const status = yield* SessionStatus.Service const state = yield* InstanceState.make( @@ -60,9 +62,6 @@ export const layer = Layer.effect( }), onBusy: status.set(sessionID, { type: "busy" }), onInterrupt, - busy: () => { - throw new Session.BusyError(sessionID) - }, }) data.runners.set(sessionID, next) return next @@ -71,10 +70,11 @@ export const layer = Layer.effect( const assertNotBusy = Effect.fn("SessionRunState.assertNotBusy")(function* (sessionID: SessionID) { const data = yield* InstanceState.get(state) const existing = data.runners.get(sessionID) - if (existing?.busy) throw new Session.BusyError(sessionID) + if (existing?.busy) yield* busyError(sessionID) }) const cancel = Effect.fn("SessionRunState.cancel")(function* (sessionID: SessionID) { + yield* cancelBackgroundJobs(background, sessionID) const data = yield* InstanceState.get(state) const existing = data.runners.get(sessionID) if (!existing || !existing.busy) { @@ -98,13 +98,56 @@ export const layer = Layer.effect( work: Effect.Effect, ready?: Latch.Latch, ) { - return yield* (yield* runner(sessionID, onInterrupt)).startShell(work, ready) + return yield* (yield* runner(sessionID, onInterrupt)) + .startShell(work, ready) + .pipe(Effect.catchTag("RunnerBusy", () => Effect.fail(busyError(sessionID)))) }) return Service.of({ assertNotBusy, cancel, ensureRunning, startShell }) }), ) -export const defaultLayer = layer.pipe(Layer.provide(SessionStatus.defaultLayer)) +export const defaultLayer = layer.pipe( + Layer.provide(BackgroundJob.defaultLayer), + Layer.provide(SessionStatus.defaultLayer), +) + +const cancelBackgroundJobs = Effect.fn("SessionRunState.cancelBackgroundJobs")(function* ( + background: BackgroundJob.Interface, + sessionID: SessionID, +) { + const jobs = yield* background.list() + const pending = new Set([sessionID]) + const cancelled = new Set() + const matches = (job: BackgroundJob.Info) => { + if (job.status !== "running") return false + if (cancelled.has(job.id)) return false + if (pending.has(job.id)) return true + if (typeof job.metadata?.sessionId === "string" && pending.has(job.metadata.sessionId)) return true + return typeof job.metadata?.parentSessionId === "string" && pending.has(job.metadata.parentSessionId) + } + let batch = jobs.filter(matches) + while (batch.length > 0) { + yield* Effect.forEach( + batch, + (job) => + background.cancel(job.id).pipe( + Effect.tap(() => + Effect.sync(() => { + cancelled.add(job.id) + pending.add(job.id) + if (typeof job.metadata?.sessionId === "string") pending.add(job.metadata.sessionId) + }), + ), + ), + { concurrency: "unbounded", discard: true }, + ) + batch = jobs.filter(matches) + } +}) + +function busyError(sessionID: SessionID) { + return new Session.BusyError({ sessionID }) +} export * as SessionRunState from "./run-state" diff --git a/packages/opencode/src/session/schema.ts b/packages/opencode/src/session/schema.ts index caf8f9d78331..10f66272c92a 100644 --- a/packages/opencode/src/session/schema.ts +++ b/packages/opencode/src/session/schema.ts @@ -1,15 +1,10 @@ import { Schema } from "effect" import { Identifier } from "@/id/id" +import { Session as CoreSession } from "@opencode-ai/core/session" import { withStatics } from "@opencode-ai/core/schema" -export const SessionID = Schema.String.check(Schema.isStartsWith("ses")).pipe( - Schema.brand("SessionID"), - withStatics((s) => ({ - descending: (id?: string) => s.make(Identifier.descending("session", id)), - })), -) - +export const SessionID = CoreSession.ID export type SessionID = Schema.Schema.Type export const MessageID = Schema.String.check(Schema.isStartsWith("msg")).pipe( @@ -29,3 +24,12 @@ export const PartID = Schema.String.check(Schema.isStartsWith("prt")).pipe( ) export type PartID = Schema.Schema.Type + +export const GoalID = Schema.String.check(Schema.isStartsWith("goal")).pipe( + Schema.brand("GoalID"), + withStatics((s) => ({ + ascending: (id?: string) => s.make(Identifier.ascending("goal", id)), + })), +) + +export type GoalID = Schema.Schema.Type diff --git a/packages/opencode/src/session/session.sql.ts b/packages/opencode/src/session/session.sql.ts index 421fa68694d2..1cf771fb1ef3 100644 --- a/packages/opencode/src/session/session.sql.ts +++ b/packages/opencode/src/session/session.sql.ts @@ -1,16 +1,16 @@ -import { sqliteTable, text, integer, index, primaryKey } from "drizzle-orm/sqlite-core" +import { sqliteTable, text, integer, index, primaryKey, real, uniqueIndex } from "drizzle-orm/sqlite-core" import { ProjectTable } from "../project/project.sql" import type { MessageV2 } from "./message-v2" -import type { SessionMessage } from "../v2/session-message" +import type { SessionMessage } from "@opencode-ai/core/session-message" import type { Snapshot } from "../snapshot" import type { Permission } from "../permission" import type { ProjectID } from "../project/schema" -import type { SessionID, MessageID, PartID } from "./schema" +import type { SessionID, MessageID, PartID, GoalID } from "./schema" import type { WorkspaceID } from "../control-plane/schema" import { Timestamps } from "../storage/schema.sql" type PartData = Omit -type InfoData = Omit +type InfoData = T extends unknown ? Omit : never type SessionMessageData = Omit<(typeof SessionMessage.Message)["Encoded"], "type" | "id"> export const SessionTable = sqliteTable( @@ -33,6 +33,12 @@ export const SessionTable = sqliteTable( summary_deletions: integer(), summary_files: integer(), summary_diffs: text({ mode: "json" }).$type(), + cost: real().notNull().default(0), + tokens_input: integer().notNull().default(0), + tokens_output: integer().notNull().default(0), + tokens_reasoning: integer().notNull().default(0), + tokens_cache_read: integer().notNull().default(0), + tokens_cache_write: integer().notNull().default(0), revert: text({ mode: "json" }).$type<{ messageID: MessageID; partID?: PartID; snapshot?: string; diff?: string }>(), permission: text({ mode: "json" }).$type(), agent: text(), @@ -103,6 +109,27 @@ export const TodoTable = sqliteTable( ], ) +export const SessionGoalTable = sqliteTable( + "session_goal", + { + id: text().$type().primaryKey(), + session_id: text() + .$type() + .notNull() + .references(() => SessionTable.id, { onDelete: "cascade" }), + objective: text().notNull(), + status: text().notNull(), + token_budget: integer(), + tokens_used: integer().notNull().default(0), + time_used: integer().notNull().default(0), + ...Timestamps, + }, + (table) => [ + uniqueIndex("session_goal_session_idx").on(table.session_id), + index("session_goal_status_idx").on(table.status), + ], +) + export const SessionMessageTable = sqliteTable( "session_message", { diff --git a/packages/opencode/src/session/session.ts b/packages/opencode/src/session/session.ts index 92b4329e6f1d..5950547fdc9a 100644 --- a/packages/opencode/src/session/session.ts +++ b/packages/opencode/src/session/session.ts @@ -1,10 +1,10 @@ import { Slug } from "@opencode-ai/core/util/slug" import path from "path" +import { BackgroundJob } from "@/background/job" import { BusEvent } from "@/bus/bus-event" import { Bus } from "@/bus" import { Decimal } from "decimal.js" import { type ProviderMetadata, type LanguageModelUsage } from "ai" -import { Flag } from "@opencode-ai/core/flag/flag" import { InstallationVersion } from "@opencode-ai/core/installation/version" import { Database } from "@/storage/db" @@ -20,12 +20,13 @@ import { lt } from "drizzle-orm" import { or } from "drizzle-orm" import { SyncEvent } from "../sync" import type { SQL } from "drizzle-orm" -import { PartTable, SessionTable } from "./session.sql" +import { MessageTable, PartTable, SessionTable } from "./session.sql" import { ProjectTable } from "../project/project.sql" import { Storage } from "@/storage/storage" import * as Log from "@opencode-ai/core/util/log" import { MessageV2 } from "./message-v2" -import type { InstanceContext } from "../project/instance" +import { SessionGoal } from "./goal" +import type { InstanceContext } from "../project/instance-context" import { InstanceState } from "@/effect/instance-state" import { Snapshot } from "@/snapshot" import { ProjectID } from "../project/schema" @@ -38,6 +39,7 @@ import { Permission } from "@/permission" import { Global } from "@opencode-ai/core/global" import { Effect, Layer, Option, Context, Schema, Types } from "effect" import { NonNegativeInt, optionalOmitUndefined } from "@opencode-ai/core/schema" +import { RuntimeFlags } from "@/effect/runtime-flags" const log = Log.create({ service: "session" }) @@ -87,6 +89,16 @@ export function fromRow(row: SessionRow): Info { : undefined, version: row.version, summary, + cost: row.cost, + tokens: { + input: row.tokens_input, + output: row.tokens_output, + reasoning: row.tokens_reasoning, + cache: { + read: row.tokens_cache_read, + write: row.tokens_cache_write, + }, + }, share, revert, permission: row.permission ?? undefined, @@ -117,6 +129,12 @@ export function toRow(info: Info) { summary_deletions: info.summary?.deletions, summary_files: info.summary?.files, summary_diffs: info.summary?.diffs, + cost: info.cost ?? 0, + tokens_input: (info.tokens ?? EmptyTokens).input, + tokens_output: (info.tokens ?? EmptyTokens).output, + tokens_reasoning: (info.tokens ?? EmptyTokens).reasoning, + tokens_cache_read: (info.tokens ?? EmptyTokens).cache.read, + tokens_cache_write: (info.tokens ?? EmptyTokens).cache.write, revert: info.revert ?? null, permission: info.permission, time_created: info.time.created, @@ -147,6 +165,18 @@ const Summary = Schema.Struct({ diffs: optionalOmitUndefined(Schema.Array(Snapshot.FileDiff)), }) +const Tokens = Schema.Struct({ + input: Schema.Finite, + output: Schema.Finite, + reasoning: Schema.Finite, + cache: Schema.Struct({ + read: Schema.Finite, + write: Schema.Finite, + }), +}) + +const EmptyTokens = { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } } + const Share = Schema.Struct({ url: Schema.String, }) @@ -184,6 +214,8 @@ export const Info = Schema.Struct({ path: optionalOmitUndefined(Schema.String), parentID: optionalOmitUndefined(SessionID), summary: optionalOmitUndefined(Summary), + cost: optionalOmitUndefined(Schema.Finite), + tokens: optionalOmitUndefined(Tokens), share: optionalOmitUndefined(Share), title: Schema.String, agent: optionalOmitUndefined(Schema.String), @@ -281,6 +313,8 @@ const UpdatedInfo = Schema.Struct({ path: Schema.optional(Schema.NullOr(Schema.String)), parentID: Schema.optional(Schema.NullOr(SessionID)), summary: Schema.optional(Schema.NullOr(Summary)), + cost: Schema.optional(Schema.Finite), + tokens: Schema.optional(Tokens), share: Schema.optional(UpdatedShare), title: Schema.optional(Schema.NullOr(Schema.String)), agent: Schema.optional(Schema.NullOr(Schema.String)), @@ -386,10 +420,14 @@ export const getUsage = (input: { model: Provider.Model; usage: LanguageModelUsa }, } + const contextTokens = inputTokens const costInfo = - input.model.cost?.experimentalOver200K && tokens.input + tokens.cache.read > 200_000 + input.model.cost?.tiers + ?.filter((item) => item.tier.type === "context" && contextTokens > item.tier.size) + .sort((a, b) => b.tier.size - a.tier.size)[0] ?? + (input.model.cost?.experimentalOver200K && contextTokens > 200_000 ? input.model.cost.experimentalOver200K - : input.model.cost + : input.model.cost) return { cost: safe( new Decimal(0) @@ -406,13 +444,11 @@ export const getUsage = (input: { model: Provider.Model; usage: LanguageModelUsa } } -export class BusyError extends Error { - constructor(public readonly sessionID: string) { - super(`Session ${sessionID} is busy`) - } -} +export class BusyError extends Schema.TaggedErrorClass()("SessionBusyError", { + sessionID: SessionID, +}) {} -export type NotFound = InstanceType +export type NotFound = NotFoundError export interface Interface { readonly list: (input?: ListInput) => Effect.Effect @@ -438,7 +474,7 @@ export interface Interface { readonly clearRevert: (sessionID: SessionID) => Effect.Effect readonly setSummary: (input: { sessionID: SessionID; summary: Info["summary"] }) => Effect.Effect readonly diff: (sessionID: SessionID) => Effect.Effect - readonly messages: (input: { sessionID: SessionID; limit?: number }) => Effect.Effect + readonly messages: (input: { sessionID: SessionID; limit?: number }) => Effect.Effect readonly children: (parentID: SessionID) => Effect.Effect readonly remove: (sessionID: SessionID) => Effect.Effect readonly updateMessage: (msg: T) => Effect.Effect @@ -461,7 +497,7 @@ export interface Interface { readonly findMessage: ( sessionID: SessionID, predicate: (msg: MessageV2.WithParts) => boolean, - ) => Effect.Effect> + ) => Effect.Effect, NotFound> } export class Service extends Context.Service()("@opencode/Session") {} @@ -471,12 +507,19 @@ export type Patch = Types.DeepMutable["dat const db = (fn: (d: Parameters[0] extends (trx: infer D) => any ? D : never) => T) => Effect.sync(() => Database.use(fn)) -export const layer: Layer.Layer = Layer.effect( +export const layer: Layer.Layer< + Service, + never, + BackgroundJob.Service | Bus.Service | Storage.Service | SyncEvent.Service | RuntimeFlags.Service | SessionGoal.Service +> = Layer.effect( Service, Effect.gen(function* () { + const background = yield* BackgroundJob.Service const bus = yield* Bus.Service const storage = yield* Storage.Service const sync = yield* SyncEvent.Service + const flags = yield* RuntimeFlags.Service + const goal = yield* SessionGoal.Service const createNext = Effect.fn("Session.createNext")(function* (input: { id?: SessionID @@ -503,6 +546,8 @@ export const layer: Layer.Layer Effect.succeed(false)), ) + if (hasInstance) yield* cancelBackgroundJobs(background, sessionID) + const kids = yield* children(sessionID) + for (const child of kids) { + yield* remove(child.id) + } + yield* sync.run(Event.Deleted, { sessionID, info: session }, { publish: hasInstance }) yield* sync.remove(sessionID) } catch (e) { @@ -572,17 +618,69 @@ export const layer: Layer.Layer(msg: T): Effect.Effect => Effect.gen(function* () { + const previous = + msg.role === "assistant" + ? yield* MessageV2.get({ sessionID: msg.sessionID, messageID: msg.id }).pipe( + Effect.map((message) => message.info), + Effect.catch(() => Effect.succeed(undefined)), + ) + : undefined yield* sync.run(MessageV2.Event.Updated, { sessionID: msg.sessionID, info: msg }) + if ( + msg.role === "assistant" && + !msg.summary && + msg.time.completed !== undefined && + previous?.role === "assistant" && + previous.time.completed === undefined + ) { + yield* goal + .account({ + sessionID: msg.sessionID, + messageID: msg.id, + tokens: 0, + seconds: Math.max(0, Math.ceil((msg.time.completed - msg.time.created) / 1000)), + }) + .pipe(Effect.ignore) + } return msg }).pipe(Effect.withSpan("Session.updateMessage")) const updatePart = (part: T): Effect.Effect => Effect.gen(function* () { + const previous = + part.type === "step-finish" + ? yield* db((d) => + d + .select() + .from(PartTable) + .where(and(eq(PartTable.id, part.id), eq(PartTable.session_id, part.sessionID))) + .get(), + ) + : undefined yield* sync.run(MessageV2.Event.PartUpdated, { sessionID: part.sessionID, part: structuredClone(part), time: Date.now(), }) + if (part.type === "step-finish" && previous?.data.type !== "step-finish") { + const message = yield* db((d) => + d + .select() + .from(MessageTable) + .where(and(eq(MessageTable.id, part.messageID), eq(MessageTable.session_id, part.sessionID))) + .get(), + ) + if (message?.data.role === "assistant" && !message.data.summary) { + yield* goal + .account({ + sessionID: part.sessionID, + messageID: part.messageID, + tokens: Math.max(0, part.tokens.input + part.tokens.output), + seconds: 0, + }) + .pipe(Effect.ignore) + } + } return part }).pipe(Effect.withSpan("Session.updatePart")) @@ -719,11 +817,25 @@ export const layer: Layer.Layer [])) }) - const messages = Effect.fn("Session.messages")(function* (input: { sessionID: SessionID; limit?: number }) { + const messages: Interface["messages"] = Effect.fn("Session.messages")(function* (input) { if (input.limit) { - return MessageV2.page({ sessionID: input.sessionID, limit: input.limit }).items + return (yield* MessageV2.page({ sessionID: input.sessionID, limit: input.limit })).items + } + + const size = 50 + const result = [] as MessageV2.WithParts[] + let before: string | undefined + while (true) { + const page = yield* MessageV2.page({ sessionID: input.sessionID, limit: size, before }) + if (page.items.length === 0) break + for (let i = page.items.length - 1; i >= 0; i--) { + const item = page.items[i] + if (item) result.push(item) + } + if (!page.more || !page.cursor) break + before = page.cursor } - return Array.from(MessageV2.stream(input.sessionID)).reverse() + return result.reverse() }) const removeMessage = Effect.fn("Session.removeMessage")(function* (input: { @@ -761,12 +873,18 @@ export const layer: Layer.Layer boolean, - ) { - for (const item of MessageV2.stream(sessionID)) { - if (predicate(item)) return Option.some(item) + const findMessage: Interface["findMessage"] = Effect.fn("Session.findMessage")(function* (sessionID, predicate) { + const size = 50 + let before: string | undefined + while (true) { + const page = yield* MessageV2.page({ sessionID, limit: size, before }) + if (page.items.length === 0) break + for (let i = page.items.length - 1; i >= 0; i--) { + const item = page.items[i] + if (item && predicate(item)) return Option.some(item) + } + if (!page.more || !page.cursor) break + before = page.cursor } return Option.none() }) @@ -799,14 +917,35 @@ export const layer: Layer.Layer { + if (job.status !== "running") return false + if (job.id === sessionID) return true + if (job.metadata?.sessionId === sessionID) return true + return job.metadata?.parentSessionId === sessionID + }), + (job) => background.cancel(job.id), + { concurrency: "unbounded", discard: true }, + ) +}) + function* listByProject( input: ListInput & { projectID: ProjectID + experimentalWorkspaces: boolean }, ) { const conditions = [eq(SessionTable.project_id, input.projectID)] @@ -824,7 +963,7 @@ function* listByProject( : or(...conds)!, ) } - } else if (input.scope !== "project" && !Flag.OPENCODE_EXPERIMENTAL_WORKSPACES) { + } else if (input.scope !== "project" && !input.experimentalWorkspaces) { if (input.directory) { conditions.push(eq(SessionTable.directory, input.directory)) } diff --git a/packages/opencode/src/session/status.ts b/packages/opencode/src/session/status.ts index 089559e2cd7b..6b982f819a08 100644 --- a/packages/opencode/src/session/status.ts +++ b/packages/opencode/src/session/status.ts @@ -78,8 +78,8 @@ export const layer = Layer.effect( const data = yield* InstanceState.get(state) yield* bus.publish(Event.Status, { sessionID, status }) if (status.type === "idle") { - yield* bus.publish(Event.Idle, { sessionID }) data.delete(sessionID) + yield* bus.publish(Event.Idle, { sessionID }) return } data.set(sessionID, status) diff --git a/packages/opencode/src/session/summary.ts b/packages/opencode/src/session/summary.ts index c03fc326953f..aa4b8719bc9e 100644 --- a/packages/opencode/src/session/summary.ts +++ b/packages/opencode/src/session/summary.ts @@ -102,7 +102,7 @@ export const layer = Layer.effect( sessionID: SessionID messageID: MessageID }) { - const all = yield* sessions.messages({ sessionID: input.sessionID }) + const all = yield* sessions.messages({ sessionID: input.sessionID }).pipe(Effect.orDie) if (!all.length) return const diffs = yield* computeDiff({ messages: all }) diff --git a/packages/opencode/src/share/session.ts b/packages/opencode/src/share/session.ts index 7e4de204edb7..47c944b4f425 100644 --- a/packages/opencode/src/share/session.ts +++ b/packages/opencode/src/share/session.ts @@ -3,7 +3,7 @@ import { SessionID } from "@/session/schema" import { SyncEvent } from "@/sync" import { Effect, Layer, Scope, Context } from "effect" import { Config } from "@/config/config" -import { Flag } from "@opencode-ai/core/flag/flag" +import { RuntimeFlags } from "@/effect/runtime-flags" import * as ShareNext from "./share-next" export interface Interface { @@ -22,6 +22,7 @@ export const layer = Layer.effect( const shareNext = yield* ShareNext.Service const scope = yield* Scope.Scope const sync = yield* SyncEvent.Service + const flags = yield* RuntimeFlags.Service const share = Effect.fn("SessionShare.share")(function* (sessionID: SessionID) { const conf = yield* cfg.get() @@ -40,7 +41,7 @@ export const layer = Layer.effect( const result = yield* session.create(input) if (result.parentID) return result const conf = yield* cfg.get() - if (!(Flag.OPENCODE_AUTO_SHARE || conf.share === "auto")) return result + if (!(flags.autoShare || conf.share === "auto")) return result yield* share(result.id).pipe(Effect.ignore, Effect.forkIn(scope)) return result }) @@ -54,6 +55,7 @@ export const defaultLayer = layer.pipe( Layer.provide(Session.defaultLayer), Layer.provide(Config.defaultLayer), Layer.provide(SyncEvent.defaultLayer), + Layer.provide(RuntimeFlags.defaultLayer), ) export * as SessionShare from "./session" diff --git a/packages/opencode/src/share/share-next.ts b/packages/opencode/src/share/share-next.ts index 384027436f96..a386211dc66f 100644 --- a/packages/opencode/src/share/share-next.ts +++ b/packages/opencode/src/share/share-next.ts @@ -272,7 +272,7 @@ export const layer = Layer.effect( log.info("full sync", { sessionID }) const info = yield* session.get(sessionID) const diffs = yield* session.diff(sessionID) - const messages = yield* Effect.sync(() => Array.from(MessageV2.stream(sessionID))) + const messages = yield* session.messages({ sessionID }) const models = yield* Effect.forEach( Array.from( new Map( diff --git a/packages/opencode/src/skill/index.ts b/packages/opencode/src/skill/index.ts index a0cc383d0f9e..c2830ee06d17 100644 --- a/packages/opencode/src/skill/index.ts +++ b/packages/opencode/src/skill/index.ts @@ -1,21 +1,21 @@ import path from "path" import { pathToFileURL } from "url" -import z from "zod" import { Effect, Layer, Context, Schema } from "effect" import { NamedError } from "@opencode-ai/core/util/error" import type { Agent } from "@/agent/agent" import { Bus } from "@/bus" import { InstanceState } from "@/effect/instance-state" -import { Flag } from "@opencode-ai/core/flag/flag" import { Global } from "@opencode-ai/core/global" import { Permission } from "@/permission" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Config } from "@/config/config" import { ConfigMarkdown } from "@/config/markdown" +import { RuntimeFlags } from "@/effect/runtime-flags" import { Glob } from "@opencode-ai/core/util/glob" import * as Log from "@opencode-ai/core/util/log" import { Discovery } from "./discovery" import CUSTOMIZE_OPENCODE_SKILL_BODY from "./prompt/customize-opencode.md" with { type: "text" } +import { isRecord } from "@/util/record" const log = Log.create({ service: "skill" }) const CLAUDE_EXTERNAL_DIR = ".claude" @@ -41,23 +41,33 @@ export const Info = Schema.Struct({ }) export type Info = Schema.Schema.Type -export const InvalidError = NamedError.create( - "SkillInvalidError", - z.object({ - path: z.string(), - message: z.string().optional(), - issues: z.custom().optional(), +const Issue = Schema.StructWithRest( + Schema.Struct({ + message: Schema.String, + path: Schema.Array(Schema.String), }), + [Schema.Record(Schema.String, Schema.Unknown)], ) -export const NameMismatchError = NamedError.create( - "SkillNameMismatchError", - z.object({ - path: z.string(), - expected: z.string(), - actual: z.string(), - }), -) +function isSkillFrontmatter(data: unknown): data is { name: string; description?: string } { + return ( + isRecord(data) && + typeof data.name === "string" && + (data.description === undefined || typeof data.description === "string") + ) +} + +export const InvalidError = NamedError.create("SkillInvalidError", { + path: Schema.String, + message: Schema.optional(Schema.String), + issues: Schema.optional(Schema.Array(Issue)), +}) + +export const NameMismatchError = NamedError.create("SkillNameMismatchError", { + path: Schema.String, + expected: Schema.String, + actual: Schema.String, +}) type State = { skills: Record @@ -101,21 +111,20 @@ const add = Effect.fnUntraced(function* (state: State, match: string, bus: Bus.I if (!md) return - const parsed = z.object({ name: z.string(), description: z.string().optional() }).safeParse(md.data) - if (!parsed.success) return + if (!isSkillFrontmatter(md.data)) return - if (state.skills[parsed.data.name]) { + if (state.skills[md.data.name]) { log.warn("duplicate skill name", { - name: parsed.data.name, - existing: state.skills[parsed.data.name].location, + name: md.data.name, + existing: state.skills[md.data.name].location, duplicate: match, }) } state.dirs.add(path.dirname(match)) - state.skills[parsed.data.name] = { - name: parsed.data.name, - description: parsed.data.description, + state.skills[md.data.name] = { + name: md.data.name, + description: md.data.description, location: match, content: md.content, } @@ -156,14 +165,16 @@ const discoverSkills = Effect.fnUntraced(function* ( discovery: Discovery.Interface, fsys: AppFileSystem.Interface, global: Global.Interface, + disableExternalSkills: boolean, + disableClaudeCodeSkills: boolean, directory: string, worktree: string, ) { const state: ScanState = { matches: new Set(), dirs: new Set() } const externalDirs: string[] = [] - if (!Flag.OPENCODE_DISABLE_EXTERNAL_SKILLS) { - if (!Flag.OPENCODE_DISABLE_CLAUDE_CODE_SKILLS) externalDirs.push(CLAUDE_EXTERNAL_DIR) + if (!disableExternalSkills) { + if (!disableClaudeCodeSkills) externalDirs.push(CLAUDE_EXTERNAL_DIR) externalDirs.push(AGENTS_EXTERNAL_DIR) for (const dir of externalDirs) { @@ -230,9 +241,19 @@ export const layer = Layer.effect( const bus = yield* Bus.Service const fsys = yield* AppFileSystem.Service const global = yield* Global.Service + const flags = yield* RuntimeFlags.Service const discovered = yield* InstanceState.make( Effect.fn("Skill.discovery")(function* (ctx) { - return yield* discoverSkills(config, discovery, fsys, global, ctx.directory, ctx.worktree) + return yield* discoverSkills( + config, + discovery, + fsys, + global, + flags.disableExternalSkills, + flags.disableClaudeCodeSkills, + ctx.directory, + ctx.worktree, + ) }), ) const state = yield* InstanceState.make( @@ -282,6 +303,7 @@ export const defaultLayer = layer.pipe( Layer.provide(Bus.layer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(Global.layer), + Layer.provide(RuntimeFlags.defaultLayer), ) export function fmt(list: Info[], opts: { verbose: boolean }) { diff --git a/packages/opencode/src/skill/prompt/customize-opencode.md b/packages/opencode/src/skill/prompt/customize-opencode.md index 744690b15a0f..4ba118b0902b 100644 --- a/packages/opencode/src/skill/prompt/customize-opencode.md +++ b/packages/opencode/src/skill/prompt/customize-opencode.md @@ -335,9 +335,9 @@ rules last. everything" and is rarely what the user wants. Known permission keys: `read, edit, glob, grep, list, bash, task, -external_directory, todowrite, question, webfetch, websearch, codesearch, -repo_clone, repo_overview, lsp, doom_loop, skill`. Some of these (`todowrite, -question, webfetch, websearch, codesearch, doom_loop`) only accept a flat +external_directory, todowrite, question, webfetch, websearch, repo_clone, +repo_overview, lsp, doom_loop, skill`. Some of these (`todowrite, +question, webfetch, websearch, doom_loop`) only accept a flat action, not a per-pattern object. `external_directory` patterns are filesystem paths (use `~/`, absolute paths, diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 51fd267d54e3..f974a457ad7b 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -1,8 +1,8 @@ -import { Cause, Duration, Effect, Layer, Schedule, Schema, Semaphore, Context, Stream } from "effect" +import { Cause, Duration, Effect, Layer, Schedule, Schema, Semaphore, Context } from "effect" import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" import { formatPatch, structuredPatch } from "diff" import path from "path" -import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppProcess } from "@opencode-ai/core/process" import { InstanceState } from "@/effect/instance-state" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Hash } from "@opencode-ai/core/util/hash" @@ -55,417 +55,377 @@ export interface Interface { export class Service extends Context.Service()("@opencode/Snapshot") {} -export const layer: Layer.Layer< - Service, - never, - AppFileSystem.Service | ChildProcessSpawner.ChildProcessSpawner | Config.Service -> = Layer.effect( - Service, - Effect.gen(function* () { - const fs = yield* AppFileSystem.Service - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner - const config = yield* Config.Service - const locks = new Map() - - const lock = (key: string) => { - const hit = locks.get(key) - if (hit) return hit - - const next = Semaphore.makeUnsafe(1) - locks.set(key, next) - return next - } - - const state = yield* InstanceState.make( - Effect.fn("Snapshot.state")(function* (ctx) { - const state = { - directory: ctx.directory, - worktree: ctx.worktree, - gitdir: path.join(Global.Path.data, "snapshot", ctx.project.id, Hash.fast(ctx.worktree)), - vcs: ctx.project.vcs, - } - - const args = (cmd: string[]) => ["--git-dir", state.gitdir, "--work-tree", state.worktree, ...cmd] - - const enc = new TextEncoder() - const feed = (list: string[]) => Stream.make(enc.encode(list.join("\0") + "\0")) - - const git = Effect.fnUntraced( - function* ( - cmd: string[], - opts?: { cwd?: string; env?: Record; stdin?: ChildProcess.CommandInput }, - ) { - const proc = ChildProcess.make("git", cmd, { - cwd: opts?.cwd, - env: opts?.env, - extendEnv: true, - stdin: opts?.stdin, - }) - const handle = yield* spawner.spawn(proc) - const [text, stderr] = yield* Effect.all( - [Stream.mkString(Stream.decodeText(handle.stdout)), Stream.mkString(Stream.decodeText(handle.stderr))], - { concurrency: 2 }, - ) - const code = yield* handle.exitCode - return { code, text, stderr } satisfies GitResult - }, - Effect.scoped, - Effect.catch((err) => - Effect.succeed({ - code: ChildProcessSpawner.ExitCode(1), - text: "", - stderr: err instanceof Error ? err.message : String(err), - }), - ), - ) - - const ignore = Effect.fnUntraced(function* (files: string[]) { - if (!files.length) return new Set() - const check = yield* git( - [ - ...quote, - "--git-dir", - path.join(state.worktree, ".git"), - "--work-tree", - state.worktree, - "check-ignore", - "--no-index", - "--stdin", - "-z", - ], - { - cwd: state.directory, - stdin: feed(files), - }, - ) - if (check.code !== 0 && check.code !== 1) return new Set() - return new Set(check.text.split("\0").filter(Boolean)) - }) - - const drop = Effect.fnUntraced(function* (files: string[]) { - if (!files.length) return - yield* git( - [ - ...cfg, - ...args(["rm", "--cached", "-f", "--ignore-unmatch", "--pathspec-from-file=-", "--pathspec-file-nul"]), - ], - { - cwd: state.directory, - stdin: feed(files), - }, - ) - }) - - const stage = Effect.fnUntraced(function* (files: string[]) { - if (!files.length) return - const result = yield* git( - [...cfg, ...args(["add", "--all", "--sparse", "--pathspec-from-file=-", "--pathspec-file-nul"])], - { - cwd: state.directory, - stdin: feed(files), - }, - ) - if (result.code === 0) return - log.warn("failed to add snapshot files", { - exitCode: result.code, - stderr: result.stderr, - }) - }) +export const layer: Layer.Layer = + Layer.effect( + Service, + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const appProcess = yield* AppProcess.Service + const config = yield* Config.Service + const locks = new Map() + + const lock = (key: string) => { + const hit = locks.get(key) + if (hit) return hit + + const next = Semaphore.makeUnsafe(1) + locks.set(key, next) + return next + } + + const state = yield* InstanceState.make( + Effect.fn("Snapshot.state")(function* (ctx) { + const state = { + directory: ctx.directory, + worktree: ctx.worktree, + gitdir: path.join(Global.Path.data, "snapshot", ctx.project.id, Hash.fast(ctx.worktree)), + vcs: ctx.project.vcs, + } + + const args = (cmd: string[]) => ["--git-dir", state.gitdir, "--work-tree", state.worktree, ...cmd] - const exists = (file: string) => fs.exists(file).pipe(Effect.orDie) - const read = (file: string) => fs.readFileString(file).pipe(Effect.catch(() => Effect.succeed(""))) - const remove = (file: string) => fs.remove(file).pipe(Effect.catch(() => Effect.void)) - const locked = (fx: Effect.Effect) => lock(state.gitdir).withPermits(1)(fx) + const feed = (list: string[]) => list.join("\0") + "\0" - const enabled = Effect.fnUntraced(function* () { - if (state.vcs !== "git") return false - return (yield* config.get()).snapshot !== false - }) + const git = Effect.fnUntraced( + function* (cmd: string[], opts?: { cwd?: string; env?: Record; stdin?: string }) { + const result = yield* appProcess.run( + ChildProcess.make("git", cmd, { cwd: opts?.cwd, env: opts?.env, extendEnv: true }), + { stdin: opts?.stdin }, + ) + return { + code: ChildProcessSpawner.ExitCode(result.exitCode), + text: result.stdout.toString("utf8"), + stderr: result.stderr.toString("utf8"), + } satisfies GitResult + }, + Effect.catch((err) => + Effect.succeed({ + code: ChildProcessSpawner.ExitCode(1), + text: "", + stderr: err instanceof Error ? err.message : String(err), + }), + ), + ) - const excludes = Effect.fnUntraced(function* () { - const result = yield* git(["rev-parse", "--path-format=absolute", "--git-path", "info/exclude"], { - cwd: state.worktree, + const ignore = Effect.fnUntraced(function* (files: string[]) { + if (!files.length) return new Set() + const check = yield* git( + [ + ...quote, + "--git-dir", + path.join(state.worktree, ".git"), + "--work-tree", + state.worktree, + "check-ignore", + "--no-index", + "--stdin", + "-z", + ], + { + cwd: state.directory, + stdin: feed(files), + }, + ) + if (check.code !== 0 && check.code !== 1) return new Set() + return new Set(check.text.split("\0").filter(Boolean)) }) - const file = result.text.trim() - if (!file) return - if (!(yield* exists(file))) return - return file - }) - - const sync = Effect.fnUntraced(function* (list: string[] = []) { - const file = yield* excludes() - const target = path.join(state.gitdir, "info", "exclude") - const text = [ - file ? (yield* read(file)).trimEnd() : "", - ...list.map((item) => `/${item.replaceAll("\\", "/")}`), - ] - .filter(Boolean) - .join("\n") - yield* fs.ensureDir(path.join(state.gitdir, "info")).pipe(Effect.orDie) - yield* fs.writeFileString(target, text ? `${text}\n` : "").pipe(Effect.orDie) - }) - - const add = Effect.fnUntraced(function* () { - yield* sync() - const [diff, other] = yield* Effect.all( - [ - git([...quote, ...args(["diff-files", "--name-only", "-z", "--", "."])], { + + const drop = Effect.fnUntraced(function* (files: string[]) { + if (!files.length) return + yield* git( + [ + ...cfg, + ...args(["rm", "--cached", "-f", "--ignore-unmatch", "--pathspec-from-file=-", "--pathspec-file-nul"]), + ], + { cwd: state.directory, - }), - git([...quote, ...args(["ls-files", "--others", "--exclude-standard", "-z", "--", "."])], { + stdin: feed(files), + }, + ) + }) + + const stage = Effect.fnUntraced(function* (files: string[]) { + if (!files.length) return + const result = yield* git( + [...cfg, ...args(["add", "--all", "--sparse", "--pathspec-from-file=-", "--pathspec-file-nul"])], + { cwd: state.directory, - }), - ], - { concurrency: 2 }, - ) - if (diff.code !== 0 || other.code !== 0) { - log.warn("failed to list snapshot files", { - diffCode: diff.code, - diffStderr: diff.stderr, - otherCode: other.code, - otherStderr: other.stderr, + stdin: feed(files), + }, + ) + if (result.code === 0) return + log.warn("failed to add snapshot files", { + exitCode: result.code, + stderr: result.stderr, }) - return - } + }) - const tracked = diff.text.split("\0").filter(Boolean) - const untracked = other.text.split("\0").filter(Boolean) - const all = Array.from(new Set([...tracked, ...untracked])) - if (!all.length) return + const exists = (file: string) => fs.exists(file).pipe(Effect.orDie) + const read = (file: string) => fs.readFileString(file).pipe(Effect.catch(() => Effect.succeed(""))) + const remove = (file: string) => fs.remove(file).pipe(Effect.catch(() => Effect.void)) + const locked = (fx: Effect.Effect) => lock(state.gitdir).withPermits(1)(fx) - // Resolve source-repo ignore rules against the exact candidate set. - // --no-index keeps this pattern-based even when a path is already tracked. - const ignored = yield* ignore(all) + const enabled = Effect.fnUntraced(function* () { + if (state.vcs !== "git") return false + return (yield* config.get()).snapshot !== false + }) - // Remove newly-ignored files from snapshot index to prevent re-adding - if (ignored.size > 0) { - const ignoredFiles = Array.from(ignored) - log.info("removing gitignored files from snapshot", { count: ignoredFiles.length }) - yield* drop(ignoredFiles) - } + const excludes = Effect.fnUntraced(function* () { + const result = yield* git(["rev-parse", "--path-format=absolute", "--git-path", "info/exclude"], { + cwd: state.worktree, + }) + const file = result.text.trim() + if (!file) return + if (!(yield* exists(file))) return + return file + }) - const allow = all.filter((item) => !ignored.has(item)) - if (!allow.length) return - - const large = new Set( - (yield* Effect.all( - allow.map((item) => - fs - .stat(path.join(state.directory, item)) - .pipe(Effect.catch(() => Effect.void)) - .pipe( - Effect.map((stat) => { - if (!stat || stat.type !== "File") return - const size = typeof stat.size === "bigint" ? Number(stat.size) : stat.size - return size > limit ? item : undefined - }), - ), - ), - { concurrency: 8 }, - )).filter((item): item is string => Boolean(item)), - ) - const block = new Set(untracked.filter((item) => large.has(item))) - yield* sync(Array.from(block)) - // Stage only the allowed candidate paths so snapshot updates stay scoped. - yield* stage(allow.filter((item) => !block.has(item))) - }) - - const cleanup = Effect.fnUntraced(function* () { - return yield* locked( - Effect.gen(function* () { - if (!(yield* enabled())) return - if (!(yield* exists(state.gitdir))) return - const result = yield* git(args(["gc", `--prune=${prune}`]), { cwd: state.directory }) - if (result.code !== 0) { - log.warn("cleanup failed", { - exitCode: result.code, - stderr: result.stderr, - }) - return - } - log.info("cleanup", { prune }) - }), - ) - }) - - const track = Effect.fnUntraced(function* () { - return yield* locked( - Effect.gen(function* () { - if (!(yield* enabled())) return - const existed = yield* exists(state.gitdir) - yield* fs.ensureDir(state.gitdir).pipe(Effect.orDie) - if (!existed) { - yield* git(["init"], { - env: { GIT_DIR: state.gitdir, GIT_WORK_TREE: state.worktree }, - }) - yield* git(["--git-dir", state.gitdir, "config", "core.autocrlf", "false"]) - yield* git(["--git-dir", state.gitdir, "config", "core.longpaths", "true"]) - yield* git(["--git-dir", state.gitdir, "config", "core.symlinks", "true"]) - yield* git(["--git-dir", state.gitdir, "config", "core.fsmonitor", "false"]) - log.info("initialized") - } - yield* add() - const result = yield* git(args(["write-tree"]), { cwd: state.directory }) - const hash = result.text.trim() - log.info("tracking", { hash, cwd: state.directory, git: state.gitdir }) - return hash - }), - ) - }) - - const patch = Effect.fnUntraced(function* (hash: string) { - return yield* locked( - Effect.gen(function* () { - yield* add() - const result = yield* git( - [...quote, ...args(["diff", "--cached", "--no-ext-diff", "--name-only", hash, "--", "."])], - { - cwd: state.directory, - }, - ) - if (result.code !== 0) { - log.warn("failed to get diff", { hash, exitCode: result.code }) - return { hash, files: [] } - } - const files = result.text - .trim() - .split("\n") - .map((x) => x.trim()) - .filter(Boolean) - - // Hide ignored-file removals from the user-facing patch output. - const ignored = yield* ignore(files) + const sync = Effect.fnUntraced(function* (list: string[] = []) { + const file = yield* excludes() + const target = path.join(state.gitdir, "info", "exclude") + const text = [ + file ? (yield* read(file)).trimEnd() : "", + ...list.map((item) => `/${item.replaceAll("\\", "/")}`), + ] + .filter(Boolean) + .join("\n") + yield* fs.ensureDir(path.join(state.gitdir, "info")).pipe(Effect.orDie) + yield* fs.writeFileString(target, text ? `${text}\n` : "").pipe(Effect.orDie) + }) - return { - hash, - files: files - .filter((item) => !ignored.has(item)) - .map((x) => path.join(state.worktree, x).replaceAll("\\", "/")), - } - }), - ) - }) - - const restore = Effect.fnUntraced(function* (snapshot: string) { - return yield* locked( - Effect.gen(function* () { - log.info("restore", { commit: snapshot }) - const result = yield* git([...core, ...args(["read-tree", snapshot])], { cwd: state.worktree }) - if (result.code === 0) { - const checkout = yield* git([...core, ...args(["checkout-index", "-a", "-f"])], { - cwd: state.worktree, - }) - if (checkout.code === 0) return - log.error("failed to restore snapshot", { - snapshot, - exitCode: checkout.code, - stderr: checkout.stderr, - }) - return - } - log.error("failed to restore snapshot", { - snapshot, - exitCode: result.code, - stderr: result.stderr, + const add = Effect.fnUntraced(function* () { + yield* sync() + const [diff, other] = yield* Effect.all( + [ + git([...quote, ...args(["diff-files", "--name-only", "-z", "--", "."])], { + cwd: state.directory, + }), + git([...quote, ...args(["ls-files", "--others", "--exclude-standard", "-z", "--", "."])], { + cwd: state.directory, + }), + ], + { concurrency: 2 }, + ) + if (diff.code !== 0 || other.code !== 0) { + log.warn("failed to list snapshot files", { + diffCode: diff.code, + diffStderr: diff.stderr, + otherCode: other.code, + otherStderr: other.stderr, }) - }), - ) - }) - - const revert = Effect.fnUntraced(function* (patches: Patch[]) { - return yield* locked( - Effect.gen(function* () { - const ops: { hash: string; file: string; rel: string }[] = [] - const seen = new Set() - for (const item of patches) { - for (const file of item.files) { - if (seen.has(file)) continue - seen.add(file) - ops.push({ - hash: item.hash, - file, - rel: path.relative(state.worktree, file).replaceAll("\\", "/"), - }) - } - } + return + } + + const tracked = diff.text.split("\0").filter(Boolean) + const untracked = other.text.split("\0").filter(Boolean) + const all = Array.from(new Set([...tracked, ...untracked])) + if (!all.length) return + + // Resolve source-repo ignore rules against the exact candidate set. + // --no-index keeps this pattern-based even when a path is already tracked. + const ignored = yield* ignore(all) + + // Remove newly-ignored files from snapshot index to prevent re-adding + if (ignored.size > 0) { + const ignoredFiles = Array.from(ignored) + log.info("removing gitignored files from snapshot", { count: ignoredFiles.length }) + yield* drop(ignoredFiles) + } + + const allow = all.filter((item) => !ignored.has(item)) + if (!allow.length) return + + const large = new Set( + (yield* Effect.all( + allow.map((item) => + fs + .stat(path.join(state.directory, item)) + .pipe(Effect.catch(() => Effect.void)) + .pipe( + Effect.map((stat) => { + if (!stat || stat.type !== "File") return + const size = typeof stat.size === "bigint" ? Number(stat.size) : stat.size + return size > limit ? item : undefined + }), + ), + ), + { concurrency: 8 }, + )).filter((item): item is string => Boolean(item)), + ) + const block = new Set(untracked.filter((item) => large.has(item))) + yield* sync(Array.from(block)) + // Stage only the allowed candidate paths so snapshot updates stay scoped. + yield* stage(allow.filter((item) => !block.has(item))) + }) - const single = Effect.fnUntraced(function* (op: (typeof ops)[number]) { - log.info("reverting", { file: op.file, hash: op.hash }) - const result = yield* git([...core, ...args(["checkout", op.hash, "--", op.file])], { - cwd: state.worktree, - }) - if (result.code === 0) return - const tree = yield* git([...core, ...args(["ls-tree", op.hash, "--", op.rel])], { - cwd: state.worktree, - }) - if (tree.code === 0 && tree.text.trim()) { - log.info("file existed in snapshot but checkout failed, keeping", { file: op.file, hash: op.hash }) + const cleanup = Effect.fnUntraced(function* () { + return yield* locked( + Effect.gen(function* () { + if (!(yield* enabled())) return + if (!(yield* exists(state.gitdir))) return + const result = yield* git(args(["gc", `--prune=${prune}`]), { cwd: state.directory }) + if (result.code !== 0) { + log.warn("cleanup failed", { + exitCode: result.code, + stderr: result.stderr, + }) return } - log.info("file did not exist in snapshot, deleting", { file: op.file, hash: op.hash }) - yield* remove(op.file) - }) - - const clash = (a: string, b: string) => a === b || a.startsWith(`${b}/`) || b.startsWith(`${a}/`) - - for (let i = 0; i < ops.length; ) { - const first = ops[i]! - const run = [first] - let j = i + 1 - // Only batch adjacent files when their paths cannot affect each other. - while (j < ops.length && run.length < 100) { - const next = ops[j]! - if (next.hash !== first.hash) break - if (run.some((item) => clash(item.rel, next.rel))) break - run.push(next) - j += 1 - } + log.info("cleanup", { prune }) + }), + ) + }) - if (run.length === 1) { - yield* single(first) - i = j - continue + const track = Effect.fnUntraced(function* () { + return yield* locked( + Effect.gen(function* () { + if (!(yield* enabled())) return + const existed = yield* exists(state.gitdir) + yield* fs.ensureDir(state.gitdir).pipe(Effect.orDie) + if (!existed) { + yield* git(["init"], { + env: { GIT_DIR: state.gitdir, GIT_WORK_TREE: state.worktree }, + }) + yield* git(["--git-dir", state.gitdir, "config", "core.autocrlf", "false"]) + yield* git(["--git-dir", state.gitdir, "config", "core.longpaths", "true"]) + yield* git(["--git-dir", state.gitdir, "config", "core.symlinks", "true"]) + yield* git(["--git-dir", state.gitdir, "config", "core.fsmonitor", "false"]) + log.info("initialized") } + yield* add() + const result = yield* git(args(["write-tree"]), { cwd: state.directory }) + const hash = result.text.trim() + log.info("tracking", { hash, cwd: state.directory, git: state.gitdir }) + return hash + }), + ) + }) - const tree = yield* git( - [...core, ...args(["ls-tree", "--name-only", first.hash, "--", ...run.map((item) => item.rel)])], + const patch = Effect.fnUntraced(function* (hash: string) { + return yield* locked( + Effect.gen(function* () { + yield* add() + const result = yield* git( + [...quote, ...args(["diff", "--cached", "--no-ext-diff", "--name-only", hash, "--", "."])], { - cwd: state.worktree, + cwd: state.directory, }, ) + if (result.code !== 0) { + log.warn("failed to get diff", { hash, exitCode: result.code }) + return { hash, files: [] } + } + const files = result.text + .trim() + .split("\n") + .map((x) => x.trim()) + .filter(Boolean) + + // Hide ignored-file removals from the user-facing patch output. + const ignored = yield* ignore(files) + + return { + hash, + files: files + .filter((item) => !ignored.has(item)) + .map((x) => path.join(state.worktree, x).replaceAll("\\", "/")), + } + }), + ) + }) - if (tree.code !== 0) { - log.info("batched ls-tree failed, falling back to single-file revert", { - hash: first.hash, - files: run.length, + const restore = Effect.fnUntraced(function* (snapshot: string) { + return yield* locked( + Effect.gen(function* () { + log.info("restore", { commit: snapshot }) + const result = yield* git([...core, ...args(["read-tree", snapshot])], { cwd: state.worktree }) + if (result.code === 0) { + const checkout = yield* git([...core, ...args(["checkout-index", "-a", "-f"])], { + cwd: state.worktree, }) - for (const op of run) { - yield* single(op) + if (checkout.code === 0) return + log.error("failed to restore snapshot", { + snapshot, + exitCode: checkout.code, + stderr: checkout.stderr, + }) + return + } + log.error("failed to restore snapshot", { + snapshot, + exitCode: result.code, + stderr: result.stderr, + }) + }), + ) + }) + + const revert = Effect.fnUntraced(function* (patches: Patch[]) { + return yield* locked( + Effect.gen(function* () { + const ops: { hash: string; file: string; rel: string }[] = [] + const seen = new Set() + for (const item of patches) { + for (const file of item.files) { + if (seen.has(file)) continue + seen.add(file) + ops.push({ + hash: item.hash, + file, + rel: path.relative(state.worktree, file).replaceAll("\\", "/"), + }) } - i = j - continue } - const have = new Set( - tree.text - .trim() - .split("\n") - .map((item) => item.trim()) - .filter(Boolean), - ) - const list = run.filter((item) => have.has(item.rel)) - if (list.length) { - log.info("reverting", { hash: first.hash, files: list.length }) - const result = yield* git( - [...core, ...args(["checkout", first.hash, "--", ...list.map((item) => item.file)])], + const single = Effect.fnUntraced(function* (op: (typeof ops)[number]) { + log.info("reverting", { file: op.file, hash: op.hash }) + const result = yield* git([...core, ...args(["checkout", op.hash, "--", op.file])], { + cwd: state.worktree, + }) + if (result.code === 0) return + const tree = yield* git([...core, ...args(["ls-tree", op.hash, "--", op.rel])], { + cwd: state.worktree, + }) + if (tree.code === 0 && tree.text.trim()) { + log.info("file existed in snapshot but checkout failed, keeping", { file: op.file, hash: op.hash }) + return + } + log.info("file did not exist in snapshot, deleting", { file: op.file, hash: op.hash }) + yield* remove(op.file) + }) + + const clash = (a: string, b: string) => a === b || a.startsWith(`${b}/`) || b.startsWith(`${a}/`) + + for (let i = 0; i < ops.length; ) { + const first = ops[i]! + const run = [first] + let j = i + 1 + // Only batch adjacent files when their paths cannot affect each other. + while (j < ops.length && run.length < 100) { + const next = ops[j]! + if (next.hash !== first.hash) break + if (run.some((item) => clash(item.rel, next.rel))) break + run.push(next) + j += 1 + } + + if (run.length === 1) { + yield* single(first) + i = j + continue + } + + const tree = yield* git( + [...core, ...args(["ls-tree", "--name-only", first.hash, "--", ...run.map((item) => item.rel)])], { cwd: state.worktree, }, ) - if (result.code !== 0) { - log.info("batched checkout failed, falling back to single-file revert", { + + if (tree.code !== 0) { + log.info("batched ls-tree failed, falling back to single-file revert", { hash: first.hash, - files: list.length, + files: run.length, }) for (const op of run) { yield* single(op) @@ -473,301 +433,328 @@ export const layer: Layer.Layer< i = j continue } - } - for (const op of run) { - if (have.has(op.rel)) continue - log.info("file did not exist in snapshot, deleting", { file: op.file, hash: op.hash }) - yield* remove(op.file) + const have = new Set( + tree.text + .trim() + .split("\n") + .map((item) => item.trim()) + .filter(Boolean), + ) + const list = run.filter((item) => have.has(item.rel)) + if (list.length) { + log.info("reverting", { hash: first.hash, files: list.length }) + const result = yield* git( + [...core, ...args(["checkout", first.hash, "--", ...list.map((item) => item.file)])], + { + cwd: state.worktree, + }, + ) + if (result.code !== 0) { + log.info("batched checkout failed, falling back to single-file revert", { + hash: first.hash, + files: list.length, + }) + for (const op of run) { + yield* single(op) + } + i = j + continue + } + } + + for (const op of run) { + if (have.has(op.rel)) continue + log.info("file did not exist in snapshot, deleting", { file: op.file, hash: op.hash }) + yield* remove(op.file) + } + + i = j } + }), + ) + }) - i = j - } - }), - ) - }) - - const diff = Effect.fnUntraced(function* (hash: string) { - return yield* locked( - Effect.gen(function* () { - yield* add() - const result = yield* git([...quote, ...args(["diff", "--cached", "--no-ext-diff", hash, "--", "."])], { - cwd: state.worktree, - }) - if (result.code !== 0) { - log.warn("failed to get diff", { - hash, - exitCode: result.code, - stderr: result.stderr, + const diff = Effect.fnUntraced(function* (hash: string) { + return yield* locked( + Effect.gen(function* () { + yield* add() + const result = yield* git([...quote, ...args(["diff", "--cached", "--no-ext-diff", hash, "--", "."])], { + cwd: state.worktree, }) - return "" - } - return result.text.trim() - }), - ) - }) - - const diffFull = Effect.fnUntraced(function* (from: string, to: string) { - return yield* locked( - Effect.gen(function* () { - type Row = { - file: string - status: "added" | "deleted" | "modified" - binary: boolean - additions: number - deletions: number - } - - type Ref = { - file: string - side: "before" | "after" - ref: string - } - - const show = Effect.fnUntraced(function* (row: Row) { - if (row.binary) return ["", ""] - if (row.status === "added") { - return [ - "", - yield* git([...cfg, ...args(["show", `${to}:${row.file}`])]).pipe(Effect.map((item) => item.text)), - ] + if (result.code !== 0) { + log.warn("failed to get diff", { + hash, + exitCode: result.code, + stderr: result.stderr, + }) + return "" } - if (row.status === "deleted") { - return [ - yield* git([...cfg, ...args(["show", `${from}:${row.file}`])]).pipe( - Effect.map((item) => item.text), - ), - "", - ] + return result.text.trim() + }), + ) + }) + + const diffFull = Effect.fnUntraced(function* (from: string, to: string) { + return yield* locked( + Effect.gen(function* () { + type Row = { + file: string + status: "added" | "deleted" | "modified" + binary: boolean + additions: number + deletions: number } - return yield* Effect.all( - [ - git([...cfg, ...args(["show", `${from}:${row.file}`])]).pipe(Effect.map((item) => item.text)), - git([...cfg, ...args(["show", `${to}:${row.file}`])]).pipe(Effect.map((item) => item.text)), - ], - { concurrency: 2 }, - ) - }) - const load = Effect.fnUntraced( - function* (rows: Row[]) { - const refs = rows.flatMap((row) => { - if (row.binary) return [] - if (row.status === "added") - return [{ file: row.file, side: "after", ref: `${to}:${row.file}` } satisfies Ref] - if (row.status === "deleted") { - return [{ file: row.file, side: "before", ref: `${from}:${row.file}` } satisfies Ref] - } + type Ref = { + file: string + side: "before" | "after" + ref: string + } + + const show = Effect.fnUntraced(function* (row: Row) { + if (row.binary) return ["", ""] + if (row.status === "added") { return [ - { file: row.file, side: "before", ref: `${from}:${row.file}` } satisfies Ref, - { file: row.file, side: "after", ref: `${to}:${row.file}` } satisfies Ref, + "", + yield* git([...cfg, ...args(["show", `${to}:${row.file}`])]).pipe( + Effect.map((item) => item.text), + ), ] - }) - if (!refs.length) return new Map() - - const proc = ChildProcess.make("git", [...cfg, ...args(["cat-file", "--batch"])], { - cwd: state.directory, - extendEnv: true, - stdin: Stream.make(new TextEncoder().encode(refs.map((item) => item.ref).join("\n") + "\n")), - }) - const handle = yield* spawner.spawn(proc) - const [out, err] = yield* Effect.all( - [Stream.mkUint8Array(handle.stdout), Stream.mkString(Stream.decodeText(handle.stderr))], - { concurrency: 2 }, - ) - const code = yield* handle.exitCode - if (code !== 0) { - log.info("git cat-file --batch failed during snapshot diff, falling back to per-file git show", { - stderr: err, - refs: refs.length, - }) - return } - - const fail = (msg: string, extra?: Record) => { - log.info(msg, { ...extra, refs: refs.length }) - return undefined + if (row.status === "deleted") { + return [ + yield* git([...cfg, ...args(["show", `${from}:${row.file}`])]).pipe( + Effect.map((item) => item.text), + ), + "", + ] } + return yield* Effect.all( + [ + git([...cfg, ...args(["show", `${from}:${row.file}`])]).pipe(Effect.map((item) => item.text)), + git([...cfg, ...args(["show", `${to}:${row.file}`])]).pipe(Effect.map((item) => item.text)), + ], + { concurrency: 2 }, + ) + }) - const map = new Map() - const dec = new TextDecoder() - let i = 0 - for (const ref of refs) { - let end = i - while (end < out.length && out[end] !== 10) end += 1 - if (end >= out.length) { - return fail( - "git cat-file --batch returned a truncated header during snapshot diff, falling back to per-file git show", - ) + const load = Effect.fnUntraced( + function* (rows: Row[]) { + const refs = rows.flatMap((row) => { + if (row.binary) return [] + if (row.status === "added") + return [{ file: row.file, side: "after", ref: `${to}:${row.file}` } satisfies Ref] + if (row.status === "deleted") { + return [{ file: row.file, side: "before", ref: `${from}:${row.file}` } satisfies Ref] + } + return [ + { file: row.file, side: "before", ref: `${from}:${row.file}` } satisfies Ref, + { file: row.file, side: "after", ref: `${to}:${row.file}` } satisfies Ref, + ] + }) + if (!refs.length) return new Map() + + const batch = yield* appProcess.run( + ChildProcess.make("git", [...cfg, ...args(["cat-file", "--batch"])], { + cwd: state.directory, + extendEnv: true, + }), + { stdin: refs.map((item) => item.ref).join("\n") + "\n" }, + ) + if (batch.exitCode !== 0) { + log.info("git cat-file --batch failed during snapshot diff, falling back to per-file git show", { + stderr: batch.stderr.toString("utf8"), + refs: refs.length, + }) + return } + const out = batch.stdout - const head = dec.decode(out.slice(i, end)) - i = end + 1 - const hit = map.get(ref.file) ?? { before: "", after: "" } - if (head.endsWith(" missing")) { - map.set(ref.file, hit) - continue + const fail = (msg: string, extra?: Record) => { + log.info(msg, { ...extra, refs: refs.length }) + return undefined } - const match = head.match(/^[0-9a-f]+ blob (\d+)$/) - if (!match) { - return fail( - "git cat-file --batch returned an unexpected header during snapshot diff, falling back to per-file git show", - { head }, - ) + const map = new Map() + const dec = new TextDecoder() + let i = 0 + for (const ref of refs) { + let end = i + while (end < out.length && out[end] !== 10) end += 1 + if (end >= out.length) { + return fail( + "git cat-file --batch returned a truncated header during snapshot diff, falling back to per-file git show", + ) + } + + const head = dec.decode(out.slice(i, end)) + i = end + 1 + const hit = map.get(ref.file) ?? { before: "", after: "" } + if (head.endsWith(" missing")) { + map.set(ref.file, hit) + continue + } + + const match = head.match(/^[0-9a-f]+ blob (\d+)$/) + if (!match) { + return fail( + "git cat-file --batch returned an unexpected header during snapshot diff, falling back to per-file git show", + { head }, + ) + } + + const size = Number(match[1]) + if (!Number.isInteger(size) || size < 0 || i + size >= out.length || out[i + size] !== 10) { + return fail( + "git cat-file --batch returned truncated content during snapshot diff, falling back to per-file git show", + { head }, + ) + } + + const text = dec.decode(out.slice(i, i + size)) + if (ref.side === "before") hit.before = text + if (ref.side === "after") hit.after = text + map.set(ref.file, hit) + i += size + 1 } - const size = Number(match[1]) - if (!Number.isInteger(size) || size < 0 || i + size >= out.length || out[i + size] !== 10) { + if (i !== out.length) { return fail( - "git cat-file --batch returned truncated content during snapshot diff, falling back to per-file git show", - { head }, + "git cat-file --batch returned trailing data during snapshot diff, falling back to per-file git show", ) } - const text = dec.decode(out.slice(i, i + size)) - if (ref.side === "before") hit.before = text - if (ref.side === "after") hit.after = text - map.set(ref.file, hit) - i += size + 1 - } + return map + }, + Effect.scoped, + Effect.catch(() => + Effect.succeed | undefined>(undefined), + ), + ) - if (i !== out.length) { - return fail( - "git cat-file --batch returned trailing data during snapshot diff, falling back to per-file git show", - ) - } + const result: FileDiff[] = [] + const status = new Map() - return map - }, - Effect.scoped, - Effect.catch(() => - Effect.succeed | undefined>(undefined), - ), - ) - - const result: FileDiff[] = [] - const status = new Map() + const statuses = yield* git( + [...quote, ...args(["diff", "--no-ext-diff", "--name-status", "--no-renames", from, to, "--", "."])], + { cwd: state.directory }, + ) - const statuses = yield* git( - [...quote, ...args(["diff", "--no-ext-diff", "--name-status", "--no-renames", from, to, "--", "."])], - { cwd: state.directory }, - ) + for (const line of statuses.text.trim().split("\n")) { + if (!line) continue + const [code, file] = line.split("\t") + if (!code || !file) continue + status.set(file, code.startsWith("A") ? "added" : code.startsWith("D") ? "deleted" : "modified") + } - for (const line of statuses.text.trim().split("\n")) { - if (!line) continue - const [code, file] = line.split("\t") - if (!code || !file) continue - status.set(file, code.startsWith("A") ? "added" : code.startsWith("D") ? "deleted" : "modified") - } + const numstat = yield* git( + [...quote, ...args(["diff", "--no-ext-diff", "--no-renames", "--numstat", from, to, "--", "."])], + { + cwd: state.directory, + }, + ) - const numstat = yield* git( - [...quote, ...args(["diff", "--no-ext-diff", "--no-renames", "--numstat", from, to, "--", "."])], - { - cwd: state.directory, - }, - ) + const rows = numstat.text + .trim() + .split("\n") + .filter(Boolean) + .flatMap((line) => { + const [adds, dels, file] = line.split("\t") + if (!file) return [] + const binary = adds === "-" && dels === "-" + const additions = binary ? 0 : parseInt(adds) + const deletions = binary ? 0 : parseInt(dels) + return [ + { + file, + status: status.get(file) ?? "modified", + binary, + additions: Number.isFinite(additions) ? additions : 0, + deletions: Number.isFinite(deletions) ? deletions : 0, + } satisfies Row, + ] + }) - const rows = numstat.text - .trim() - .split("\n") - .filter(Boolean) - .flatMap((line) => { - const [adds, dels, file] = line.split("\t") - if (!file) return [] - const binary = adds === "-" && dels === "-" - const additions = binary ? 0 : parseInt(adds) - const deletions = binary ? 0 : parseInt(dels) - return [ - { - file, - status: status.get(file) ?? "modified", - binary, - additions: Number.isFinite(additions) ? additions : 0, - deletions: Number.isFinite(deletions) ? deletions : 0, - } satisfies Row, - ] - }) + // Hide ignored-file removals from the user-facing diff output. + const ignored = yield* ignore(rows.map((r) => r.file)) + if (ignored.size > 0) { + const filtered = rows.filter((r) => !ignored.has(r.file)) + rows.length = 0 + rows.push(...filtered) + } - // Hide ignored-file removals from the user-facing diff output. - const ignored = yield* ignore(rows.map((r) => r.file)) - if (ignored.size > 0) { - const filtered = rows.filter((r) => !ignored.has(r.file)) - rows.length = 0 - rows.push(...filtered) - } - - const step = 100 - const patch = (file: string, before: string, after: string) => - formatPatch(structuredPatch(file, file, before, after, "", "", { context: Number.MAX_SAFE_INTEGER })) - - for (let i = 0; i < rows.length; i += step) { - const run = rows.slice(i, i + step) - const text = yield* load(run) - - for (const row of run) { - const hit = text?.get(row.file) ?? { before: "", after: "" } - const [before, after] = row.binary ? ["", ""] : text ? [hit.before, hit.after] : yield* show(row) - result.push({ - file: row.file, - patch: row.binary ? "" : patch(row.file, before, after), - additions: row.additions, - deletions: row.deletions, - status: row.status, - }) + const step = 100 + const patch = (file: string, before: string, after: string) => + formatPatch(structuredPatch(file, file, before, after, "", "", { context: Number.MAX_SAFE_INTEGER })) + + for (let i = 0; i < rows.length; i += step) { + const run = rows.slice(i, i + step) + const text = yield* load(run) + + for (const row of run) { + const hit = text?.get(row.file) ?? { before: "", after: "" } + const [before, after] = row.binary ? ["", ""] : text ? [hit.before, hit.after] : yield* show(row) + result.push({ + file: row.file, + patch: row.binary ? "" : patch(row.file, before, after), + additions: row.additions, + deletions: row.deletions, + status: row.status, + }) + } } - } - return result + return result + }), + ) + }) + + yield* cleanup().pipe( + Effect.catchCause((cause) => { + log.error("cleanup loop failed", { cause: Cause.pretty(cause) }) + return Effect.void }), + Effect.repeat(Schedule.spaced(Duration.hours(1))), + Effect.delay(Duration.minutes(1)), + Effect.forkScoped, ) - }) - - yield* cleanup().pipe( - Effect.catchCause((cause) => { - log.error("cleanup loop failed", { cause: Cause.pretty(cause) }) - return Effect.void - }), - Effect.repeat(Schedule.spaced(Duration.hours(1))), - Effect.delay(Duration.minutes(1)), - Effect.forkScoped, - ) - - return { cleanup, track, patch, restore, revert, diff, diffFull } - }), - ) - - return Service.of({ - init: Effect.fn("Snapshot.init")(function* () { - yield* InstanceState.get(state) - }), - cleanup: Effect.fn("Snapshot.cleanup")(function* () { - return yield* InstanceState.useEffect(state, (s) => s.cleanup()) - }), - track: Effect.fn("Snapshot.track")(function* () { - return yield* InstanceState.useEffect(state, (s) => s.track()) - }), - patch: Effect.fn("Snapshot.patch")(function* (hash: string) { - return yield* InstanceState.useEffect(state, (s) => s.patch(hash)) - }), - restore: Effect.fn("Snapshot.restore")(function* (snapshot: string) { - return yield* InstanceState.useEffect(state, (s) => s.restore(snapshot)) - }), - revert: Effect.fn("Snapshot.revert")(function* (patches: Patch[]) { - return yield* InstanceState.useEffect(state, (s) => s.revert(patches)) - }), - diff: Effect.fn("Snapshot.diff")(function* (hash: string) { - return yield* InstanceState.useEffect(state, (s) => s.diff(hash)) - }), - diffFull: Effect.fn("Snapshot.diffFull")(function* (from: string, to: string) { - return yield* InstanceState.useEffect(state, (s) => s.diffFull(from, to)) - }), - }) - }), -) + + return { cleanup, track, patch, restore, revert, diff, diffFull } + }), + ) + + return Service.of({ + init: Effect.fn("Snapshot.init")(function* () { + yield* InstanceState.get(state) + }), + cleanup: Effect.fn("Snapshot.cleanup")(function* () { + return yield* InstanceState.useEffect(state, (s) => s.cleanup()) + }), + track: Effect.fn("Snapshot.track")(function* () { + return yield* InstanceState.useEffect(state, (s) => s.track()) + }), + patch: Effect.fn("Snapshot.patch")(function* (hash: string) { + return yield* InstanceState.useEffect(state, (s) => s.patch(hash)) + }), + restore: Effect.fn("Snapshot.restore")(function* (snapshot: string) { + return yield* InstanceState.useEffect(state, (s) => s.restore(snapshot)) + }), + revert: Effect.fn("Snapshot.revert")(function* (patches: Patch[]) { + return yield* InstanceState.useEffect(state, (s) => s.revert(patches)) + }), + diff: Effect.fn("Snapshot.diff")(function* (hash: string) { + return yield* InstanceState.useEffect(state, (s) => s.diff(hash)) + }), + diffFull: Effect.fn("Snapshot.diffFull")(function* (from: string, to: string) { + return yield* InstanceState.useEffect(state, (s) => s.diffFull(from, to)) + }), + }) + }), + ) export const defaultLayer = layer.pipe( - Layer.provide(CrossSpawnSpawner.defaultLayer), + Layer.provide(AppProcess.defaultLayer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(Config.defaultLayer), ) diff --git a/packages/opencode/src/storage/db.ts b/packages/opencode/src/storage/db.ts index 06cb99f97ffd..6cb819a6fd0f 100644 --- a/packages/opencode/src/storage/db.ts +++ b/packages/opencode/src/storage/db.ts @@ -2,49 +2,50 @@ import { type SQLiteBunDatabase } from "drizzle-orm/bun-sqlite" import { migrate } from "drizzle-orm/bun-sqlite/migrator" import { type SQLiteTransaction } from "drizzle-orm/sqlite-core" export * from "drizzle-orm" +import { RuntimeFlags } from "@/effect/runtime-flags" import { LocalContext } from "@/util/local-context" -import { lazy } from "../util/lazy" import { Global } from "@opencode-ai/core/global" import * as Log from "@opencode-ai/core/util/log" import { NamedError } from "@opencode-ai/core/util/error" -import z from "zod" import path from "path" import { readFileSync, readdirSync, existsSync } from "fs" import { Flag } from "@opencode-ai/core/flag/flag" import { InstallationChannel } from "@opencode-ai/core/installation/version" import { InstanceState } from "@/effect/instance-state" -import { iife } from "@/util/iife" import { init } from "#db" +import { Effect, Schema } from "effect" declare const OPENCODE_MIGRATIONS: { sql: string; timestamp: number; name: string }[] | undefined -export const NotFoundError = NamedError.create( - "NotFoundError", - z.object({ - message: z.string(), - }), -) +export const NotFoundError = NamedError.create("NotFoundError", { + message: Schema.String, +}) const log = Log.create({ service: "db" }) -export function getChannelPath() { - if (["latest", "beta", "prod"].includes(InstallationChannel) || Flag.OPENCODE_DISABLE_CHANNEL_DB) +type DatabaseFlags = Pick + +const readRuntimeFlags = () => + Effect.runSync(RuntimeFlags.Service.useSync((flags) => flags).pipe(Effect.provide(RuntimeFlags.defaultLayer))) + +export function getChannelPath(flags: Pick = readRuntimeFlags()) { + if (["latest", "beta", "prod"].includes(InstallationChannel) || flags.disableChannelDb) return path.join(Global.Path.data, "opencode.db") const safe = InstallationChannel.replace(/[^a-zA-Z0-9._-]/g, "-") return path.join(Global.Path.data, `opencode-${safe}.db`) } -export const Path = iife(() => { +export const getPath = (flags?: Pick) => { if (Flag.OPENCODE_DB) { if (Flag.OPENCODE_DB === ":memory:" || path.isAbsolute(Flag.OPENCODE_DB)) return Flag.OPENCODE_DB return path.join(Global.Path.data, Flag.OPENCODE_DB) } - return getChannelPath() -}) + return getChannelPath(flags) +} export type Transaction = SQLiteTransaction<"sync", void> -type Client = SQLiteBunDatabase +type Client = ReturnType type Journal = { sql: string; timestamp: number; name: string }[] @@ -88,38 +89,55 @@ function migrations(dir: string): Journal { return sql.sort((a, b) => a.timestamp - b.timestamp) } -export const Client = lazy(() => { - log.info("opening database", { path: Path }) - - const db = init(Path) - - db.run("PRAGMA journal_mode = WAL") - db.run("PRAGMA synchronous = NORMAL") - db.run("PRAGMA busy_timeout = 5000") - db.run("PRAGMA cache_size = -64000") - db.run("PRAGMA foreign_keys = ON") - db.run("PRAGMA wal_checkpoint(PASSIVE)") - - // Apply schema migrations - const entries = - typeof OPENCODE_MIGRATIONS !== "undefined" - ? OPENCODE_MIGRATIONS - : migrations(path.join(import.meta.dirname, "../../migration")) - if (entries.length > 0) { - log.info("applying migrations", { - count: entries.length, - mode: typeof OPENCODE_MIGRATIONS !== "undefined" ? "bundled" : "dev", - }) - if (Flag.OPENCODE_SKIP_MIGRATIONS) { - for (const item of entries) { - item.sql = "select 1;" +let client: Client | undefined +let loaded = false + +export const Client = Object.assign( + (flags: DatabaseFlags = readRuntimeFlags()): Client => { + if (loaded) return client as Client + + const dbPath = getPath(flags) + log.info("opening database", { path: dbPath }) + + const db = init(dbPath) + + db.run("PRAGMA journal_mode = WAL") + db.run("PRAGMA synchronous = NORMAL") + db.run("PRAGMA busy_timeout = 5000") + db.run("PRAGMA cache_size = -64000") + db.run("PRAGMA foreign_keys = ON") + db.run("PRAGMA wal_checkpoint(PASSIVE)") + + // Apply schema migrations + const entries = + typeof OPENCODE_MIGRATIONS !== "undefined" + ? OPENCODE_MIGRATIONS + : migrations(path.join(import.meta.dirname, "../../migration")) + if (entries.length > 0) { + log.info("applying migrations", { + count: entries.length, + mode: typeof OPENCODE_MIGRATIONS !== "undefined" ? "bundled" : "dev", + }) + if (flags.skipMigrations) { + for (const item of entries) { + item.sql = "select 1;" + } } + applyMigrations(db, entries) } - applyMigrations(db, entries) - } - return db -}) + client = db + loaded = true + return db + }, + { + reset: () => { + loaded = false + client = undefined + }, + loaded: () => loaded, + }, +) export function close() { if (!Client.loaded()) return diff --git a/packages/opencode/src/storage/json-migration.ts b/packages/opencode/src/storage/json-migration.ts index bc1aae6fa22b..3930e591a42a 100644 --- a/packages/opencode/src/storage/json-migration.ts +++ b/packages/opencode/src/storage/json-migration.ts @@ -216,6 +216,12 @@ export async function run(db: SQLiteBunDatabase | NodeSQLiteDatabase
Effect.Effect -export const NotFoundError = NamedError.create( - "NotFoundError", - z.object({ - message: z.string(), - }), -) +export class NotFoundError extends Schema.TaggedErrorClass()("NotFoundError", { + message: Schema.String, +}) { + static isInstance(input: unknown): input is NotFoundError { + return input instanceof NotFoundError + } +} -export type Error = AppFileSystem.Error | InstanceType +export type Error = AppFileSystem.Error | NotFoundError const RootFile = Schema.Struct({ path: Schema.optional( @@ -249,7 +248,7 @@ export const layer = Layer.effect( }), ) - const fail = (target: string): Effect.Effect> => + const fail = (target: string): Effect.Effect => Effect.fail(new NotFoundError({ message: `Resource not found: ${target}` })) const wrap = (target: string, body: Effect.Effect) => diff --git a/packages/opencode/src/sync/index.ts b/packages/opencode/src/sync/index.ts index 5c29101b6cf7..c1bd8d647fa7 100644 --- a/packages/opencode/src/sync/index.ts +++ b/packages/opencode/src/sync/index.ts @@ -1,17 +1,22 @@ +// Legacy sync event system. It should stay unaware of core EventV2 execution; +// the only temporary V2 coupling here is exposing versioned core event schemas +// in effectPayloads() so existing HTTP/SDK schema generation remains stable. +// Remove that registry read when event schemas are generated from core directly. import { Database } from "@/storage/db" import { eq } from "drizzle-orm" import { GlobalBus } from "@/bus/global" import { Bus as ProjectBus } from "@/bus" import { BusEvent } from "@/bus/bus-event" -import type { InstanceContext } from "@/project/instance" +import type { InstanceContext } from "@/project/instance-context" import { EventSequenceTable, EventTable } from "./event.sql" import type { WorkspaceID } from "@/control-plane/schema" import { EventID } from "./schema" -import { Flag } from "@opencode-ai/core/flag/flag" import { Context, Effect, Layer, Schema as EffectSchema } from "effect" import type { DeepMutable } from "@opencode-ai/core/schema" +import { EventV2 } from "@opencode-ai/core/event" import { serviceUse } from "@/effect/service-use" import { InstanceState } from "@/effect/instance-state" +import { RuntimeFlags } from "@/effect/runtime-flags" // Keep `Event["data"]` mutable because projectors mutate the persisted shape // when writing to the database. Bus payloads (`Properties`) stay readonly — @@ -69,6 +74,8 @@ export class Service extends Context.Service()("@opencode/Sy export const layer = Layer.effect(Service)( Effect.gen(function* () { + const flags = yield* RuntimeFlags.Service + const replay: Interface["replay"] = Effect.fn("SyncEvent.replay")(function* (event, options) { const def = registry.get(event.type) if (!def) { @@ -104,7 +111,12 @@ export const layer = Layer.effect(Service)( workspace: yield* InstanceState.workspaceID, } : undefined - process(def, event, { publish, context, ownerID: options?.ownerID }) + process(def, event, { + publish, + context, + ownerID: options?.ownerID, + experimentalWorkspaces: flags.experimentalWorkspaces, + }) }) const replayAll: Interface["replayAll"] = Effect.fn("SyncEvent.replayAll")(function* (events, options) { @@ -160,7 +172,7 @@ export const layer = Layer.effect(Service)( const seq = row?.seq != null ? row.seq + 1 : 0 const event = { id, seq, aggregateID: agg, data } - process(def, event, { publish, context }) + process(def, event, { publish, context, experimentalWorkspaces: flags.experimentalWorkspaces }) }, { behavior: "immediate", @@ -197,12 +209,12 @@ export const layer = Layer.effect(Service)( }), ) -export const defaultLayer = layer +export const defaultLayer = layer.pipe(Layer.provide(RuntimeFlags.defaultLayer)) export const use = serviceUse(Service) export const registry = new Map() -let projectors: Map | undefined +let projectors: Map | undefined const versions = new Map() let frozen = false let convertEvent: ConvertEvent @@ -214,7 +226,17 @@ export function reset() { } export function init(input: { projectors: Array<[Definition, ProjectorFunc]>; convertEvent?: ConvertEvent }) { - projectors = new Map(input.projectors) + projectors = new Map(input.projectors.map(([def, func]) => [versionedType(def.type, def.version), func])) + for (let entry of EventV2.registry.values()) { + if (!entry.version || !entry.aggregate) continue + register({ + type: entry.type, + version: entry.version, + aggregate: entry.aggregate, + properties: entry.data, + schema: entry.data, + }) + } // Install all the latest event defs to the bus. We only ever emit // latest versions from code, and keep around old versions for @@ -222,7 +244,6 @@ export function init(input: { projectors: Array<[Definition, ProjectorFunc]>; co // simplifies the bus to only use unversioned latest events for (let [type, version] of versions.entries()) { let def = registry.get(versionedType(type, version))! - BusEvent.define(def.type, def.properties) } @@ -262,9 +283,7 @@ export function define< properties: (input.busSchema ?? input.schema) as BusSchema, } - versions.set(def.type, Math.max(def.version, versions.get(def.type) || 0)) - - registry.set(versionedType(def.type, def.version), def) + register(def) return def } @@ -276,24 +295,30 @@ export function project( return [def, func as ProjectorFunc] } +function register(def: Definition) { + versions.set(def.type, Math.max(def.version, versions.get(def.type) || 0)) + registry.set(versionedType(def.type, def.version), def) +} + function process( def: Def, event: Event, - options: { publish: boolean; context?: PublishContext; ownerID?: string }, + options: { publish: boolean; context?: PublishContext; ownerID?: string; experimentalWorkspaces: boolean }, ) { if (projectors == null) { throw new Error("No projectors available. Call `SyncEvent.init` to install projectors") } - const projector = projectors.get(def) + const projector = projectors.get(versionedType(def.type, def.version)) if (!projector) { - throw new Error(`Projector not found for event: ${def.type}`) + if (!def.type.includes("next")) throw new Error(`Projector not found for event: ${def.type}`) + return } Database.transaction((tx) => { projector(tx, event.data, event) - if (Flag.OPENCODE_EXPERIMENTAL_WORKSPACES) { + if (options.experimentalWorkspaces) { tx.insert(EventSequenceTable) .values({ aggregate_id: event.aggregateID, @@ -348,19 +373,38 @@ function process( } export function effectPayloads() { - return registry - .entries() - .map(([type, def]) => - EffectSchema.Struct({ - type: EffectSchema.Literal("sync"), - name: EffectSchema.Literal(type), - id: EffectSchema.String, - seq: EffectSchema.Finite, - aggregateID: EffectSchema.Literal(def.aggregate), - data: def.schema, - }).annotate({ identifier: `SyncEvent.${type}` }), - ) - .toArray() + return [ + ...registry + .entries() + .map(([type, def]) => + EffectSchema.Struct({ + type: EffectSchema.Literal("sync"), + name: EffectSchema.Literal(type), + id: EffectSchema.String, + seq: EffectSchema.Finite, + aggregateID: EffectSchema.Literal(def.aggregate), + data: def.schema, + }).annotate({ identifier: `SyncEvent.${type}` }), + ) + .toArray(), + ...EventV2.registry + .values() + .filter( + (definition) => + definition.version !== undefined && !registry.has(versionedType(definition.type, definition.version)), + ) + .map((definition) => + EffectSchema.Struct({ + type: EffectSchema.Literal("sync"), + name: EffectSchema.Literal(versionedType(definition.type, definition.version!)), + id: EffectSchema.String, + seq: EffectSchema.Finite, + aggregateID: EffectSchema.Literal(definition.aggregate!), + data: definition.data, + }).annotate({ identifier: `SyncEvent.${definition.type}` }), + ) + .toArray(), + ] } export * as SyncEvent from "." diff --git a/packages/opencode/src/tool/apply_patch.ts b/packages/opencode/src/tool/apply_patch.ts index 916e11f1e3e5..84e84cc3962e 100644 --- a/packages/opencode/src/tool/apply_patch.ts +++ b/packages/opencode/src/tool/apply_patch.ts @@ -119,7 +119,11 @@ export const ApplyPatchTool = Tool.define( // Apply the update chunks to get new content try { - const fileUpdate = Patch.deriveNewContentsFromChunks(filePath, hunk.chunks) + const fileUpdate = Patch.deriveNewContentsFromChunks( + filePath, + hunk.chunks, + Bom.join(source.text, source.bom), + ) newContent = fileUpdate.content bom = fileUpdate.bom } catch (error) { diff --git a/packages/opencode/src/tool/codesearch.ts b/packages/opencode/src/tool/codesearch.ts deleted file mode 100644 index 4616d5900a75..000000000000 --- a/packages/opencode/src/tool/codesearch.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Effect, Schema } from "effect" -import { HttpClient } from "effect/unstable/http" -import * as Tool from "./tool" -import * as McpWebSearch from "./mcp-websearch" -import DESCRIPTION from "./codesearch.txt" - -export const Parameters = Schema.Struct({ - query: Schema.String.annotate({ - description: - "Search query to find relevant context for APIs, Libraries, and SDKs. For example, 'React useState hook examples', 'Python pandas dataframe filtering', 'Express.js middleware', 'Next js partial prerendering configuration'", - }), - tokensNum: Schema.Number.check(Schema.isGreaterThanOrEqualTo(1000)) - .check(Schema.isLessThanOrEqualTo(50000)) - .pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed(5000))) - .annotate({ - description: - "Number of tokens to return (1000-50000). Default is 5000 tokens. Adjust this value based on how much context you need - use lower values for focused queries and higher values for comprehensive documentation.", - }), -}) - -export const CodeSearchTool = Tool.define( - "codesearch", - Effect.gen(function* () { - const http = yield* HttpClient.HttpClient - - return { - description: DESCRIPTION, - parameters: Parameters, - execute: (params: { query: string; tokensNum: number }, ctx: Tool.Context) => - Effect.gen(function* () { - yield* ctx.ask({ - permission: "codesearch", - patterns: [params.query], - always: ["*"], - metadata: { - query: params.query, - tokensNum: params.tokensNum, - }, - }) - - const result = yield* McpWebSearch.call( - http, - McpWebSearch.EXA_URL, - "get_code_context_exa", - McpWebSearch.CodeArgs, - { - query: params.query, - tokensNum: params.tokensNum, - }, - "30 seconds", - ) - - return { - output: - result ?? - "No code snippets or documentation found. Please try a different query, be more specific about the library or programming concept, or check the spelling of framework names.", - title: `Code search: ${params.query}`, - metadata: {}, - } - }).pipe(Effect.orDie), - } - }), -) diff --git a/packages/opencode/src/tool/codesearch.txt b/packages/opencode/src/tool/codesearch.txt deleted file mode 100644 index 4187f08d12ad..000000000000 --- a/packages/opencode/src/tool/codesearch.txt +++ /dev/null @@ -1,12 +0,0 @@ -- Search and get relevant context for any programming task using Exa Code API -- Provides the highest quality and freshest context for libraries, SDKs, and APIs -- Use this tool for ANY question or task related to programming -- Returns comprehensive code examples, documentation, and API references -- Optimized for finding specific programming patterns and solutions - -Usage notes: - - Adjustable token count (1000-50000) for focused or comprehensive results - - Default 5000 tokens provides balanced context for most queries - - Use lower values for specific questions, higher values for comprehensive documentation - - Supports queries about frameworks, libraries, APIs, and programming concepts - - Examples: 'React useState hook examples', 'Python pandas dataframe filtering', 'Express.js middleware' diff --git a/packages/opencode/src/tool/grep.ts b/packages/opencode/src/tool/grep.ts index 4e89198dffdf..01aa6a0b72b4 100644 --- a/packages/opencode/src/tool/grep.ts +++ b/packages/opencode/src/tool/grep.ts @@ -54,19 +54,20 @@ export const GrepTool = Tool.define( }) const ins = yield* InstanceState.context - const search = AppFileSystem.resolve( - path.isAbsolute(params.path ?? ins.directory) - ? (params.path ?? ins.directory) - : path.join(ins.directory, params.path ?? "."), - ) - yield* reference.ensure(search) + const requested = path.isAbsolute(params.path ?? ins.directory) + ? (params.path ?? ins.directory) + : path.join(ins.directory, params.path ?? ".") + yield* reference.ensure(requested) + const requestedInfo = yield* fs.stat(requested).pipe(Effect.catch(() => Effect.succeed(undefined))) + yield* assertExternalDirectoryEffect(ctx, requested, { + bypass: yield* reference.contains(requested), + kind: requestedInfo?.type === "Directory" ? "directory" : "file", + }) + + const search = AppFileSystem.resolve(requested) const info = yield* fs.stat(search).pipe(Effect.catch(() => Effect.succeed(undefined))) const cwd = info?.type === "Directory" ? search : path.dirname(search) const file = info?.type === "Directory" ? undefined : [path.relative(cwd, search)] - yield* assertExternalDirectoryEffect(ctx, search, { - bypass: yield* reference.contains(search), - kind: info?.type === "Directory" ? "directory" : "file", - }) const result = yield* rg.search({ cwd, diff --git a/packages/opencode/src/tool/json-schema.ts b/packages/opencode/src/tool/json-schema.ts new file mode 100644 index 000000000000..edb43e11ca89 --- /dev/null +++ b/packages/opencode/src/tool/json-schema.ts @@ -0,0 +1,164 @@ +import type { JSONSchema7 } from "@ai-sdk/provider" +import { JsonSchema, Schema } from "effect" +import type * as Tool from "./tool" + +type JsonObject = Record +const cache = new WeakMap() + +export function fromSchema(schema: Schema.Top): JSONSchema7 { + const cached = cache.get(schema) + if (cached) return cached + + const document = Schema.toJsonSchemaDocument(schema, { additionalProperties: true }) + const result = normalize({ + $schema: JsonSchema.META_SCHEMA_URI_DRAFT_2020_12, + ...document.schema, + ...(Object.keys(document.definitions).length > 0 ? { $defs: document.definitions } : {}), + }) + const inlined = dropDefinitionsIfResolved(inlineLocalReferences(result)) + if (!isJsonSchema(inlined)) throw new Error("tool JSON Schema helper produced a non-schema value") + cache.set(schema, inlined) + return inlined +} + +export function fromTool(tool: Tool.Def): JSONSchema7 { + return tool.jsonSchema ?? fromSchema(tool.parameters as Schema.Top) +} + +function normalize(value: unknown, options: { stripNull?: boolean } = {}): unknown { + if (Array.isArray(value)) return value.map((item) => normalize(item)) + if (!isRecord(value)) return value + + const required = Array.isArray(value.required) + ? new Set(value.required.filter((item) => typeof item === "string")) + : undefined + const schema = Object.fromEntries( + Object.entries(value).map(([key, item]) => [ + key, + key === "properties" && isRecord(item) + ? Object.fromEntries( + Object.entries(item).map(([name, property]) => [ + name, + normalize(property, { stripNull: !required?.has(name) }), + ]), + ) + : normalize(item), + ]), + ) + + if (schema.additionalProperties === true) delete schema.additionalProperties + + if (options.stripNull && Array.isArray(schema.anyOf)) { + const withoutNull = schema.anyOf.filter((item) => !isRecord(item) || item.type !== "null") + if (withoutNull.length !== schema.anyOf.length) return normalize({ ...schema, anyOf: withoutNull }) + } + + if (Array.isArray(schema.anyOf)) { + const withoutNull = schema.anyOf + const number = withoutNull.find((item) => isRecord(item) && item.type === "number") + const nonFinite = withoutNull.filter( + (item) => isRecord(item) && Array.isArray(item.enum) && item.enum.every((entry) => isNonFiniteNumber(entry)), + ) + if (number && nonFinite.length === withoutNull.length - 1) { + const { anyOf: _, ...rest } = schema + return normalize({ ...number, ...rest }) + } + + if (isEmptyStructUnion(withoutNull)) { + const { anyOf: _, ...rest } = schema + return normalize({ type: "object", properties: {}, ...rest }) + } + + if (withoutNull.length === 1 && isRecord(withoutNull[0])) { + const { anyOf: _, ...rest } = schema + return normalize({ ...withoutNull[0], ...rest }) + } + } + + if (Array.isArray(schema.allOf) && schema.allOf.every(isRecord) && canFlattenAllOf(schema.allOf, schema)) { + const { allOf, ...rest } = schema + return normalize({ ...Object.assign({}, ...allOf), ...rest }) + } + + if (schema.type === "integer" && schema.maximum === undefined) { + return { minimum: Number.MIN_SAFE_INTEGER, ...schema, maximum: Number.MAX_SAFE_INTEGER } + } + + return schema +} + +function isRecord(value: unknown): value is JsonObject { + return typeof value === "object" && value !== null && !Array.isArray(value) +} + +function isJsonSchema(value: unknown): value is JSONSchema7 { + return typeof value === "boolean" || isRecord(value) +} + +function isNonFiniteNumber(value: unknown) { + return value === "NaN" || value === "Infinity" || value === "-Infinity" +} + +function isEmptyStructUnion(items: unknown[]) { + return ( + items.length === 2 && + items.some((item) => isRecord(item) && item.type === "object" && item.properties === undefined) && + items.some((item) => isRecord(item) && item.type === "array" && item.items === undefined) + ) +} + +function canFlattenAllOf(allOf: JsonObject[], parent: JsonObject) { + const keys = new Set(Object.keys(parent).filter((key) => key !== "allOf")) + return allOf.every((item) => + Object.keys(item).every((key) => { + if (keys.has(key)) return false + keys.add(key) + return true + }), + ) +} + +function inlineLocalReferences(value: unknown, definitions?: JsonObject, seen = new Set()): unknown { + if (Array.isArray(value)) return value.map((item) => inlineLocalReferences(item, definitions, seen)) + if (!isRecord(value)) return value + + const localDefinitions = definitions ?? (isRecord(value.$defs) ? value.$defs : undefined) + if (typeof value.$ref === "string" && localDefinitions) { + const name = value.$ref.match(/^#\/\$defs\/(.+)$/)?.[1] ?? value.$ref.match(/^#\/definitions\/(.+)$/)?.[1] + if (name && !seen.has(name)) { + const target = localDefinitions[name] + if (target) { + const { $ref: _, ...rest } = value + return inlineLocalReferences( + { ...(isRecord(target) ? target : {}), ...rest }, + localDefinitions, + new Set(seen).add(name), + ) + } + } + } + + return Object.fromEntries( + Object.entries(value).map(([key, item]) => [key, inlineLocalReferences(item, localDefinitions, seen)]), + ) +} + +function dropDefinitionsIfResolved(value: unknown): unknown { + if (!isRecord(value) || hasLocalReference(value)) return value + const { $defs: _, definitions: __, ...rest } = value + return rest +} + +function hasLocalReference(value: unknown): boolean { + if (Array.isArray(value)) return value.some(hasLocalReference) + if (!isRecord(value)) return false + if ( + typeof value.$ref === "string" && + (value.$ref.startsWith("#/$defs/") || value.$ref.startsWith("#/definitions/")) + ) { + return true + } + return Object.values(value).some(hasLocalReference) +} + +export * as ToolJsonSchema from "./json-schema" diff --git a/packages/opencode/src/tool/mcp-websearch.ts b/packages/opencode/src/tool/mcp-websearch.ts index 42b864c6faff..208924cba5aa 100644 --- a/packages/opencode/src/tool/mcp-websearch.ts +++ b/packages/opencode/src/tool/mcp-websearch.ts @@ -48,11 +48,6 @@ export const SearchArgs = Schema.Struct({ contextMaxCharacters: Schema.optional(Schema.Number), }) -export const CodeArgs = Schema.Struct({ - query: Schema.String, - tokensNum: Schema.Number, -}) - export const ParallelSearchArgs = Schema.Struct({ objective: Schema.String, search_queries: Schema.Array(Schema.String), diff --git a/packages/opencode/src/tool/plan.ts b/packages/opencode/src/tool/plan.ts index d5195376b316..af206f66a59d 100644 --- a/packages/opencode/src/tool/plan.ts +++ b/packages/opencode/src/tool/plan.ts @@ -6,16 +6,9 @@ import { Session } from "@/session/session" import { MessageV2 } from "../session/message-v2" import { Provider } from "@/provider/provider" import { InstanceState } from "@/effect/instance-state" -import { type SessionID, MessageID, PartID } from "../session/schema" +import { MessageID, PartID } from "../session/schema" import EXIT_DESCRIPTION from "./plan-exit.txt" -function getLastModel(sessionID: SessionID) { - for (const item of MessageV2.stream(sessionID)) { - if (item.info.role === "user" && item.info.model) return item.info.model - } - return undefined -} - export const Parameters = Schema.Struct({}) export const PlanExitTool = Tool.define( @@ -51,7 +44,10 @@ export const PlanExitTool = Tool.define( if (answers[0]?.[0] === "No") yield* new Question.RejectedError() - const model = getLastModel(ctx.sessionID) ?? (yield* provider.defaultModel()) + const messages = yield* session.messages({ sessionID: ctx.sessionID }).pipe(Effect.orDie) + const lastUser = messages.findLast((item) => item.info.role === "user" && item.info.model) + const model = + lastUser?.info.role === "user" && lastUser.info.model ? lastUser.info.model : yield* provider.defaultModel() const msg: MessageV2.User = { id: MessageID.ascending(), diff --git a/packages/opencode/src/tool/read.ts b/packages/opencode/src/tool/read.ts index ad3c33e74280..8a1b64fec546 100644 --- a/packages/opencode/src/tool/read.ts +++ b/packages/opencode/src/tool/read.ts @@ -1,8 +1,6 @@ -import { Effect, Option, Schema, Scope } from "effect" +import { Effect, Option, Schema, Scope, Stream } from "effect" import { NonNegativeInt } from "@opencode-ai/core/schema" -import { createReadStream } from "fs" import * as path from "path" -import { createInterface } from "readline" import * as Tool from "./tool" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { LSP } from "@/lsp/lsp" @@ -105,6 +103,49 @@ export const ReadTool = Tool.define( ) }) + const lines = Effect.fn("ReadTool.lines")(function* (filepath: string, opts: { limit: number; offset: number }) { + const start = opts.offset - 1 + const raw: string[] = [] + const flags = { bytes: 0, count: 0, cut: false, more: false, done: false } + + // Note: prefer manual TextDecoder over Stream.decodeText — when the source stream + // ends without flushing, decodeText drops the final unterminated line. We also + // avoid Stream.runForEachWhile (it currently swallows the final unterminated + // line of the upstream splitLines pipeline) and instead toggle a `done` flag + // and ignore subsequent lines. + const decoder = new TextDecoder("utf-8") + yield* fs.stream(filepath).pipe( + Stream.map((bytes) => decoder.decode(bytes, { stream: true })), + Stream.splitLines, + Stream.runForEach((text) => + Effect.sync(() => { + if (flags.done) return + flags.count += 1 + if (flags.count <= start) return + + if (raw.length >= opts.limit) { + flags.more = true + return + } + + const line = text.length > MAX_LINE_LENGTH ? text.substring(0, MAX_LINE_LENGTH) + MAX_LINE_SUFFIX : text + const size = Buffer.byteLength(line, "utf-8") + (raw.length > 0 ? 1 : 0) + if (flags.bytes + size > MAX_BYTES) { + flags.cut = true + flags.more = true + flags.done = true + return + } + + raw.push(line) + flags.bytes += size + }), + ), + ) + + return { raw, count: flags.count, cut: flags.cut, more: flags.more, offset: opts.offset } + }) + const isBinaryFile = (filepath: string, bytes: Uint8Array) => { const ext = path.extname(filepath).toLowerCase() switch (ext) { @@ -247,9 +288,7 @@ export const ReadTool = Tool.define( return yield* Effect.fail(new Error(`Cannot read binary file: ${filepath}`)) } - const file = yield* Effect.promise(() => - lines(filepath, { limit: params.limit ?? DEFAULT_READ_LIMIT, offset: params.offset || 1 }), - ) + const file = yield* lines(filepath, { limit: params.limit ?? DEFAULT_READ_LIMIT, offset: params.offset || 1 }) if (file.count < file.offset && !(file.count === 0 && file.offset === 1)) { return yield* Effect.fail( new Error(`Offset ${file.offset} is out of range for this file (${file.count} lines)`), @@ -296,47 +335,3 @@ export const ReadTool = Tool.define( } }), ) - -async function lines(filepath: string, opts: { limit: number; offset: number }) { - const stream = createReadStream(filepath, { encoding: "utf8" }) - const rl = createInterface({ - input: stream, - // Note: we use the crlfDelay option to recognize all instances of CR LF - // ('\r\n') in file as a single line break. - crlfDelay: Infinity, - }) - - const start = opts.offset - 1 - const raw: string[] = [] - let bytes = 0 - let count = 0 - let cut = false - let more = false - try { - for await (const text of rl) { - count += 1 - if (count <= start) continue - - if (raw.length >= opts.limit) { - more = true - continue - } - - const line = text.length > MAX_LINE_LENGTH ? text.substring(0, MAX_LINE_LENGTH) + MAX_LINE_SUFFIX : text - const size = Buffer.byteLength(line, "utf-8") + (raw.length > 0 ? 1 : 0) - if (bytes + size > MAX_BYTES) { - cut = true - more = true - break - } - - raw.push(line) - bytes += size - } - } finally { - rl.close() - stream.destroy() - } - - return { raw, count, cut, more, offset: opts.offset } -} diff --git a/packages/opencode/src/tool/registry.ts b/packages/opencode/src/tool/registry.ts index 68251c342c84..5869b50a2a3c 100644 --- a/packages/opencode/src/tool/registry.ts +++ b/packages/opencode/src/tool/registry.ts @@ -7,6 +7,7 @@ import { GlobTool } from "./glob" import { GrepTool } from "./grep" import { ReadTool } from "./read" import { TaskTool } from "./task" +import { TaskStatusTool } from "./task_status" import { TodoWriteTool } from "./todo" import { WebFetchTool } from "./webfetch" import { WriteTool } from "./write" @@ -15,17 +16,15 @@ import { SkillTool } from "./skill" import * as Tool from "./tool" import { Config } from "@/config/config" import { type ToolContext as PluginToolContext, type ToolDefinition } from "@opencode-ai/plugin" +import type { JSONSchema7, JSONSchema7Definition } from "@ai-sdk/provider" import { Schema } from "effect" import z from "zod" -import { ZodOverride } from "@opencode-ai/core/effect-zod" import { Plugin } from "../plugin" import { Provider } from "@/provider/provider" import { ProviderID, type ModelID } from "../provider/schema" import { WebSearchTool } from "./websearch" -import { CodeSearchTool } from "./codesearch" import { RepoCloneTool } from "./repo_clone" import { RepoOverviewTool } from "./repo_overview" -import { Flag } from "@opencode-ai/core/flag/flag" import * as Log from "@opencode-ai/core/util/log" import { LspTool } from "./lsp" import * as Truncate from "./truncate" @@ -51,13 +50,13 @@ import { Git } from "@/git" import { Skill } from "../skill" import { Permission } from "@/permission" import { Reference } from "@/reference/reference" +import { BackgroundJob } from "@/background/job" +import { SessionStatus } from "@/session/status" +import { RuntimeFlags } from "@/effect/runtime-flags" const log = Log.create({ service: "tool.registry" }) -export function webSearchEnabled( - providerID: ProviderID, - flags = { exa: Flag.OPENCODE_ENABLE_EXA, parallel: Flag.OPENCODE_ENABLE_PARALLEL }, -) { +export function webSearchEnabled(providerID: ProviderID, flags = { exa: false, parallel: false }) { return providerID === ProviderID.opencode || flags.exa || flags.parallel } @@ -90,6 +89,8 @@ export const layer: Layer.Layer< | Agent.Service | Skill.Service | Session.Service + | SessionStatus.Service + | BackgroundJob.Service | Provider.Service | Git.Service | Reference.Service @@ -102,6 +103,7 @@ export const layer: Layer.Layer< | Ripgrep.Service | Format.Service | Truncate.Service + | RuntimeFlags.Service > = Layer.effect( Service, Effect.gen(function* () { @@ -110,9 +112,11 @@ export const layer: Layer.Layer< const agents = yield* Agent.Service const skill = yield* Skill.Service const truncate = yield* Truncate.Service + const flags = yield* RuntimeFlags.Service const invalid = yield* InvalidTool const task = yield* TaskTool + const taskStatus = yield* TaskStatusTool const read = yield* ReadTool const question = yield* QuestionTool const todo = yield* TodoWriteTool @@ -120,7 +124,6 @@ export const layer: Layer.Layer< const plan = yield* PlanExitTool const webfetch = yield* WebFetchTool const websearch = yield* WebSearchTool - const codesearch = yield* CodeSearchTool const repoClone = yield* RepoCloneTool const repoOverview = yield* RepoOverviewTool const shell = yield* ShellTool @@ -137,17 +140,19 @@ export const layer: Layer.Layer< const custom: Tool.Def[] = [] function fromPlugin(id: string, def: ToolDefinition): Tool.Def { - // Plugin tools define their args as a raw Zod shape. Wrap the - // derived Zod object in a `Schema.declare` so it slots into the - // Schema-typed framework, and annotate with `ZodOverride` so the - // walker emits the original Zod object for LLM JSON Schema. - const zodParams = z.object(def.args) - const parameters = Schema.declare((u): u is unknown => zodParams.safeParse(u).success).annotate({ - [ZodOverride]: zodParams, - }) + // Plugin tools still expose Zod args publicly; keep that compatibility + // boxed at the registry boundary and give the LLM the original JSON Schema. + const entries = Object.entries(def.args) + const allZod = entries.every((entry) => isZodType(entry[1])) + const zodParams = allZod ? z.object(def.args) : undefined + const jsonSchema = zodParams ? zodJsonSchema(zodParams) : legacyJsonSchema(entries) + const parameters = zodParams + ? Schema.declare((u): u is unknown => zodParams.safeParse(u).success) + : Schema.Unknown return { id, parameters, + jsonSchema, description: def.description, execute: (args, toolCtx) => Effect.gen(function* () { @@ -160,11 +165,13 @@ export const layer: Layer.Layer< const result = yield* Effect.promise(() => def.execute(args as any, pluginCtx)) const output = typeof result === "string" ? result : result.output const metadata = typeof result === "string" ? {} : (result.metadata ?? {}) + const attachments = typeof result === "string" ? undefined : result.attachments const info = yield* agent.get(toolCtx.agent) const out = yield* truncate.output(output, {}, info) return { - title: "", + title: typeof result === "string" ? "" : (result.title ?? ""), output: out.truncated ? out.content : output, + attachments, metadata: { ...metadata, truncated: out.truncated, @@ -194,7 +201,8 @@ export const layer: Layer.Layer< // `match` is an absolute filesystem path from `Glob.scanSync(..., { absolute: true })`. // Import it as `file://` so Node on Windows accepts the dynamic import. const mod = yield* Effect.promise(() => import(pathToFileURL(match).href)) - for (const [id, def] of Object.entries(mod)) { + for (const [id, def] of Object.entries(mod)) { + if (!isPluginTool(def)) continue custom.push(fromPlugin(id === "default" ? namespace : `${namespace}_${id}`, def)) } } @@ -207,8 +215,7 @@ export const layer: Layer.Layer< } yield* config.get() - const questionEnabled = - ["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) || Flag.OPENCODE_ENABLE_QUESTION_TOOL + const questionEnabled = ["app", "cli", "desktop"].includes(flags.client) || flags.enableQuestionTool const tool = yield* Effect.all({ invalid: Tool.init(invalid), @@ -219,10 +226,10 @@ export const layer: Layer.Layer< edit: Tool.init(edit), write: Tool.init(writetool), task: Tool.init(task), + task_status: Tool.init(taskStatus), fetch: Tool.init(webfetch), todo: Tool.init(todo), search: Tool.init(websearch), - code: Tool.init(codesearch), repo_clone: Tool.init(repoClone), repo_overview: Tool.init(repoOverview), skill: Tool.init(skilltool), @@ -244,14 +251,15 @@ export const layer: Layer.Layer< tool.edit, tool.write, tool.task, + ...(flags.experimentalBackgroundSubagents ? [tool.task_status] : []), tool.fetch, tool.todo, tool.search, - ...(Flag.OPENCODE_EXPERIMENTAL_SCOUT ? [tool.code, tool.repo_clone, tool.repo_overview] : []), + ...(flags.experimentalScout ? [tool.repo_clone, tool.repo_overview] : []), tool.skill, tool.patch, - ...(Flag.OPENCODE_EXPERIMENTAL_LSP_TOOL ? [tool.lsp] : []), - ...(Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE && Flag.OPENCODE_CLIENT === "cli" ? [tool.plan] : []), + ...(flags.experimentalLspTool ? [tool.lsp] : []), + ...(flags.experimentalPlanMode && flags.client === "cli" ? [tool.plan] : []), ], task: tool.task, read: tool.read, @@ -305,7 +313,7 @@ export const layer: Layer.Layer< const tools: Interface["tools"] = Effect.fn("ToolRegistry.tools")(function* (input) { const filtered = (yield* all()).filter((tool) => { if (tool.id === WebSearchTool.id) { - return webSearchEnabled(input.providerID) + return webSearchEnabled(input.providerID, { exa: flags.enableExa, parallel: flags.enableParallel }) } const usePatch = @@ -323,8 +331,13 @@ export const layer: Layer.Layer< const output = { description: tool.description, parameters: tool.parameters, + jsonSchema: tool.jsonSchema, } yield* plugin.trigger("tool.definition", { toolID: tool.id }, output) + const jsonSchema = + output.parameters === tool.parameters || output.jsonSchema !== tool.jsonSchema + ? output.jsonSchema + : undefined return { id: tool.id, description: [ @@ -335,6 +348,7 @@ export const layer: Layer.Layer< .filter(Boolean) .join("\n"), parameters: output.parameters, + jsonSchema, execute: tool.execute, formatValidationError: tool.formatValidationError, } @@ -353,27 +367,80 @@ export const layer: Layer.Layer< ) export const defaultLayer = Layer.suspend(() => - layer.pipe( - Layer.provide(Config.defaultLayer), - Layer.provide(Plugin.defaultLayer), - Layer.provide(Question.defaultLayer), - Layer.provide(Todo.defaultLayer), - Layer.provide(Skill.defaultLayer), - Layer.provide(Agent.defaultLayer), - Layer.provide(Session.defaultLayer), - Layer.provide(Provider.defaultLayer), - Layer.provide(Git.defaultLayer), - Layer.provide(Reference.defaultLayer), - Layer.provide(LSP.defaultLayer), - Layer.provide(Instruction.defaultLayer), - Layer.provide(AppFileSystem.defaultLayer), - Layer.provide(Bus.layer), - Layer.provide(FetchHttpClient.layer), - Layer.provide(Format.defaultLayer), - Layer.provide(CrossSpawnSpawner.defaultLayer), - Layer.provide(Ripgrep.defaultLayer), - Layer.provide(Truncate.defaultLayer), - ), + layer + .pipe( + Layer.provide(Config.defaultLayer), + Layer.provide(Plugin.defaultLayer), + Layer.provide(Question.defaultLayer), + Layer.provide(Todo.defaultLayer), + Layer.provide(Skill.defaultLayer), + Layer.provide(Agent.defaultLayer), + Layer.provide(Session.defaultLayer), + Layer.provide(Layer.mergeAll(SessionStatus.defaultLayer, BackgroundJob.defaultLayer)), + Layer.provide(Provider.defaultLayer), + Layer.provide(Git.defaultLayer), + Layer.provide(Reference.defaultLayer), + Layer.provide(LSP.defaultLayer), + Layer.provide(Instruction.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Bus.layer), + Layer.provide(FetchHttpClient.layer), + Layer.provide(Format.defaultLayer), + Layer.provide(CrossSpawnSpawner.defaultLayer), + Layer.provide(Ripgrep.defaultLayer), + Layer.provide(Truncate.defaultLayer), + ) + .pipe(Layer.provide(RuntimeFlags.defaultLayer)), ) +function isZodType(value: unknown): value is z.ZodType { + return typeof value === "object" && value !== null && "_zod" in value +} + +function isPluginTool(value: unknown): value is ToolDefinition { + return typeof value === "object" && value !== null && "args" in value && "description" in value && "execute" in value +} + +function isJsonSchemaDefinition(value: unknown): value is JSONSchema7Definition { + return typeof value === "boolean" || (typeof value === "object" && value !== null && !Array.isArray(value)) +} + +function legacyJsonSchema(entries: [string, unknown][]): JSONSchema7 { + const properties = Object.fromEntries( + entries.filter((entry): entry is [string, JSONSchema7Definition] => isJsonSchemaDefinition(entry[1])), + ) + return { + type: "object", + properties, + required: Object.keys(properties), + } +} + +function zodJsonSchema(schema: z.ZodType): JSONSchema7 { + const result = normalizeZodJsonSchema(z.toJSONSchema(schema, { io: "input" })) + if (!isJsonSchemaObject(result)) throw new Error("plugin tool Zod schema produced a non-object JSON Schema") + const { $defs, ...rest } = result + return ( + $defs && isJsonSchemaObject($defs) ? { ...rest, definitions: $defs as JSONSchema7["definitions"] } : rest + ) as JSONSchema7 +} + +function normalizeZodJsonSchema(value: unknown): unknown { + if (Array.isArray(value)) return value.map((item) => normalizeZodJsonSchema(item)) + if (typeof value !== "object" || value === null) return value + return Object.fromEntries( + Object.entries(value) + .filter((entry) => + (entry[0] === "exclusiveMaximum" || entry[0] === "exclusiveMinimum") && typeof entry[1] === "boolean" + ? false + : true, + ) + .map(([key, item]) => [key, normalizeZodJsonSchema(item)]), + ) +} + +function isJsonSchemaObject(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value) +} + export * as ToolRegistry from "./registry" diff --git a/packages/opencode/src/tool/repo_overview.ts b/packages/opencode/src/tool/repo_overview.ts index b08516d2c602..e8fd0b81eb5f 100644 --- a/packages/opencode/src/tool/repo_overview.ts +++ b/packages/opencode/src/tool/repo_overview.ts @@ -6,7 +6,7 @@ import { assertExternalDirectoryEffect } from "./external-directory" import DESCRIPTION from "./repo_overview.txt" import * as Tool from "./tool" import { parseRepositoryReference, repositoryCachePath } from "@/util/repository" -import { Instance } from "@/project/instance" +import { InstanceState } from "@/effect/instance-state" export const Parameters = Schema.Struct({ repository: Schema.optional(Schema.String).annotate({ @@ -108,7 +108,9 @@ export const RepoOverviewTool = Tool.define, ) { if (params.path) { - const full = path.isAbsolute(params.path) ? params.path : path.resolve(Instance.directory, params.path) + const full = path.isAbsolute(params.path) + ? params.path + : path.resolve(yield* InstanceState.directory, params.path) return { path: full, repository: params.repository } } diff --git a/packages/opencode/src/tool/shell.ts b/packages/opencode/src/tool/shell.ts index d3ca542684de..1b3a6152ef0c 100644 --- a/packages/opencode/src/tool/shell.ts +++ b/packages/opencode/src/tool/shell.ts @@ -12,7 +12,7 @@ import { Language, type Node } from "web-tree-sitter" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { fileURLToPath } from "url" import { Config } from "@/config/config" -import { Flag } from "@opencode-ai/core/flag/flag" +import { RuntimeFlags } from "@/effect/runtime-flags" import { Shell } from "@/shell/shell" import { ShellID } from "./shell/id" @@ -26,7 +26,6 @@ import { BashArity } from "@/permission/arity" export { Parameters } from "./shell/prompt" const MAX_METADATA_LENGTH = 30_000 -const DEFAULT_TIMEOUT = Flag.OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS || 2 * 60 * 1000 const CWD = new Set(["cd", "chdir", "popd", "pushd", "push-location", "set-location"]) const FILES = new Set([ ...CWD, @@ -340,6 +339,8 @@ export const ShellTool = Tool.define( const fs = yield* AppFileSystem.Service const trunc = yield* Truncate.Service const plugin = yield* Plugin.Service + const flags = yield* RuntimeFlags.Service + const defaultTimeout = flags.bashDefaultTimeoutMs ?? 2 * 60 * 1000 const cygpath = Effect.fn("ShellTool.cygpath")(function* (shell: string, text: string) { const lines = yield* spawner @@ -443,6 +444,31 @@ export const ShellTool = Tool.define( let expired = false let aborted = false + const closeSink = Effect.fnUntraced(function* () { + const stream = sink + if (!stream) return + sink = undefined + if (stream.destroyed || stream.closed) return + yield* Effect.promise( + () => + new Promise((resolve) => { + let settled = false + const done = () => { + if (settled) return + settled = true + stream.off("close", done) + stream.off("error", done) + stream.off("finish", done) + resolve() + } + stream.once("close", done) + stream.once("error", done) + stream.once("finish", done) + stream.end(done) + }), + ).pipe(Effect.catch(() => Effect.void)) + }) + yield* ctx.metadata({ metadata: { output: "", @@ -452,6 +478,7 @@ export const ShellTool = Tool.define( const code: number | null = yield* Effect.scoped( Effect.gen(function* () { + yield* Effect.addFinalizer(closeSink) const handle = yield* spawner.spawn(cmd(input.shell, input.command, input.cwd, input.env)) yield* Effect.forkScoped( @@ -555,17 +582,6 @@ export const ShellTool = Tool.define( if (meta.length > 0) { output += "\n\n\n" + meta.join("\n") + "\n" } - if (sink) { - const stream = sink - yield* Effect.promise( - () => - new Promise((resolve) => { - stream.end(() => resolve()) - stream.on("error", () => resolve()) - }), - ) - } - return { title: input.description, metadata: { @@ -600,7 +616,7 @@ export const ShellTool = Tool.define( if (params.timeout !== undefined && params.timeout < 0) { throw new Error(`Invalid timeout value: ${params.timeout}. Timeout must be a positive number.`) } - const timeout = params.timeout ?? DEFAULT_TIMEOUT + const timeout = params.timeout ?? defaultTimeout const ps = Shell.ps(shell) yield* Effect.scoped( Effect.gen(function* () { diff --git a/packages/opencode/src/tool/task.ts b/packages/opencode/src/tool/task.ts index c4d5bf7f4aee..f87f46207b80 100644 --- a/packages/opencode/src/tool/task.ts +++ b/packages/opencode/src/tool/task.ts @@ -1,23 +1,41 @@ import * as Tool from "./tool" import DESCRIPTION from "./task.txt" +import { ToolJsonSchema } from "./json-schema" +import { BackgroundJob } from "@/background/job" +import { Bus } from "@/bus" import { Session } from "@/session/session" import { SessionID, MessageID } from "../session/schema" import { MessageV2 } from "../session/message-v2" import { Agent } from "../agent/agent" import { deriveSubagentSessionPermission } from "../agent/subagent-permissions" import type { SessionPrompt } from "../session/prompt" +import { SessionStatus } from "@/session/status" import { Config } from "@/config/config" -import { Effect, Exit, Schema } from "effect" +import { TuiEvent } from "@/cli/cmd/tui/event" +import { Cause, Effect, Exit, Option, Schema, Scope } from "effect" import { EffectBridge } from "@/effect/bridge" +import { RuntimeFlags } from "@/effect/runtime-flags" export interface TaskPromptOps { cancel(sessionID: SessionID): Effect.Effect resolvePromptParts(template: string): Effect.Effect prompt(input: SessionPrompt.PromptInput): Effect.Effect + loop(input: SessionPrompt.LoopInput): Effect.Effect } const id = "task" +const BaseParameters = Schema.Struct({ + description: Schema.String.annotate({ description: "A short (3-5 words) description of the task" }), + prompt: Schema.String.annotate({ description: "The task for the agent to perform" }), + subagent_type: Schema.String.annotate({ description: "The type of specialized agent to use for this task" }), + task_id: Schema.optional(Schema.String).annotate({ + description: + "This should only be set if you mean to resume a previous task (you can pass a prior task_id and the task will continue the same subagent session as before instead of creating a fresh one)", + }), + command: Schema.optional(Schema.String).annotate({ description: "The command that triggered this task" }), +}) + export const Parameters = Schema.Struct({ description: Schema.String.annotate({ description: "A short (3-5 words) description of the task" }), prompt: Schema.String.annotate({ description: "The task for the agent to perform" }), @@ -27,20 +45,76 @@ export const Parameters = Schema.Struct({ "This should only be set if you mean to resume a previous task (you can pass a prior task_id and the task will continue the same subagent session as before instead of creating a fresh one)", }), command: Schema.optional(Schema.String).annotate({ description: "The command that triggered this task" }), + background: Schema.optional(Schema.Boolean).annotate({ + description: "When true, launch the subagent in the background and return immediately", + }), }) +function output(sessionID: SessionID, text: string) { + return [ + `task_id: ${sessionID} (for resuming to continue this task if needed)`, + "", + "", + text, + "", + ].join("\n") +} + +function backgroundOutput(sessionID: SessionID) { + return [ + `task_id: ${sessionID} (for polling this task with task_status)`, + "state: running", + "", + "", + "Background task started. Continue your current work and call task_status when you need the result.", + "", + ].join("\n") +} + +function backgroundMessage(input: { + sessionID: SessionID + description: string + state: "completed" | "error" + text: string +}) { + const tag = input.state === "completed" ? "task_result" : "task_error" + const title = + input.state === "completed" + ? `Background task completed: ${input.description}` + : `Background task failed: ${input.description}` + return [title, `task_id: ${input.sessionID}`, `state: ${input.state}`, "", `<${tag}>`, input.text, ``].join( + "\n", + ) +} + +function errorText(error: unknown) { + if (error instanceof Error) return error.message + return String(error) +} + export const TaskTool = Tool.define( id, Effect.gen(function* () { const agent = yield* Agent.Service + const background = yield* BackgroundJob.Service + const bus = yield* Bus.Service const config = yield* Config.Service const sessions = yield* Session.Service + const scope = yield* Scope.Scope + const status = yield* SessionStatus.Service + const flags = yield* RuntimeFlags.Service const run = Effect.fn("TaskTool.execute")(function* ( params: Schema.Schema.Type, ctx: Tool.Context, ) { const cfg = yield* config.get() + const runInBackground = params.background === true + if (runInBackground && !flags.experimentalBackgroundSubagents) { + return yield* Effect.fail( + new Error("Background subagents require OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true"), + ) + } if (!ctx.extra?.bypassAgentCheck) { yield* ctx.ask({ @@ -86,27 +160,140 @@ export const TaskTool = Tool.define( ], })) - const msg = yield* Effect.sync(() => MessageV2.get({ sessionID: ctx.sessionID, messageID: ctx.messageID })) + const msg = yield* MessageV2.get({ sessionID: ctx.sessionID, messageID: ctx.messageID }).pipe(Effect.orDie) if (msg.info.role !== "assistant") return yield* Effect.fail(new Error("Not an assistant message")) const model = next.model ?? { modelID: msg.info.modelID, providerID: msg.info.providerID, } + const metadata = { + parentSessionId: ctx.sessionID, + sessionId: nextSession.id, + model, + ...(runInBackground ? { background: true } : {}), + } yield* ctx.metadata({ title: params.description, - metadata: { - sessionId: nextSession.id, - model, - }, + metadata, }) const ops = ctx.extra?.promptOps as TaskPromptOps if (!ops) return yield* Effect.fail(new Error("TaskTool requires promptOps in ctx.extra")) const runCancel = yield* EffectBridge.make() - const messageID = MessageID.ascending() + const runTask = Effect.fn("TaskTool.runTask")(function* () { + const parts = yield* ops.resolvePromptParts(params.prompt) + const result = yield* ops.prompt({ + messageID: MessageID.ascending(), + sessionID: nextSession.id, + model: { + modelID: model.modelID, + providerID: model.providerID, + }, + agent: next.name, + tools: { + ...(next.permission.some((rule) => rule.permission === "todowrite") ? {} : { todowrite: false }), + ...(next.permission.some((rule) => rule.permission === id) ? {} : { task: false }), + ...Object.fromEntries((cfg.experimental?.primary_tools ?? []).map((item) => [item, false])), + }, + parts, + }) + return result.parts.findLast((item) => item.type === "text")?.text ?? "" + }) + + const resumeWhenIdle: (input: { userID: MessageID; state: "completed" | "error" }) => Effect.Effect = + Effect.fn("TaskTool.resumeWhenIdle")(function* (input: { userID: MessageID; state: "completed" | "error" }) { + const latest = yield* sessions + .findMessage(ctx.sessionID, (item) => item.info.role === "user") + .pipe(Effect.orDie) + if (Option.isNone(latest)) return + if (latest.value.info.id !== input.userID) return + if ((yield* status.get(ctx.sessionID)).type !== "idle") { + yield* Effect.sleep("300 millis") + return yield* resumeWhenIdle(input) + } + yield* bus.publish(TuiEvent.ToastShow, { + title: input.state === "completed" ? "Background task complete" : "Background task failed", + message: + input.state === "completed" + ? `Background task "${params.description}" finished. Resuming the main thread.` + : `Background task "${params.description}" failed. Resuming the main thread.`, + variant: input.state === "completed" ? "success" : "error", + duration: 5000, + }) + yield* ops + .loop({ sessionID: ctx.sessionID }) + .pipe(Effect.ignore, Effect.forkIn(scope, { startImmediately: true })) + }) + + const continueIfIdle = Effect.fn("TaskTool.continueIfIdle")(function* (input: { + userID: MessageID + state: "completed" | "error" + }) { + yield* resumeWhenIdle(input).pipe(Effect.ignore, Effect.forkIn(scope, { startImmediately: true })) + }) + + const inject = Effect.fn("TaskTool.injectBackgroundResult")(function* ( + state: "completed" | "error", + text: string, + ) { + const currentParent = yield* sessions.get(ctx.sessionID) + const message = yield* ops.prompt({ + sessionID: ctx.sessionID, + noReply: true, + agent: currentParent.agent ?? ctx.agent, + parts: [ + { + type: "text", + synthetic: true, + text: backgroundMessage({ + sessionID: nextSession.id, + description: params.description, + state, + text, + }), + }, + ], + }) + yield* continueIfIdle({ userID: message.info.id, state }) + }) + + const existing = yield* background.get(nextSession.id) + if (existing?.status === "running") { + return yield* Effect.fail( + new Error(`Task ${nextSession.id} is already running. Use task_status to check progress.`), + ) + } + + if (runInBackground) { + const info = yield* background.start({ + id: nextSession.id, + type: id, + title: params.description, + metadata, + run: runTask().pipe( + Effect.tap((text) => inject("completed", text).pipe(Effect.ignore)), + Effect.catchCause((cause) => + (Cause.hasInterruptsOnly(cause) + ? Effect.void + : inject("error", errorText(Cause.squash(cause))).pipe(Effect.ignore) + ).pipe(Effect.andThen(Effect.failCause(cause))), + ), + ), + }) + + return { + title: params.description, + metadata: { + ...metadata, + jobId: info.id, + }, + output: backgroundOutput(nextSession.id), + } + } + const cancel = ops.cancel(nextSession.id) function onAbort() { @@ -119,36 +306,11 @@ export const TaskTool = Tool.define( }), () => Effect.gen(function* () { - const parts = yield* ops.resolvePromptParts(params.prompt) - const result = yield* ops.prompt({ - messageID, - sessionID: nextSession.id, - model: { - modelID: model.modelID, - providerID: model.providerID, - }, - agent: next.name, - tools: { - ...(next.permission.some((rule) => rule.permission === "todowrite") ? {} : { todowrite: false }), - ...(next.permission.some((rule) => rule.permission === id) ? {} : { task: false }), - ...Object.fromEntries((cfg.experimental?.primary_tools ?? []).map((item) => [item, false])), - }, - parts, - }) - + const text = yield* runTask() return { title: params.description, - metadata: { - sessionId: nextSession.id, - model, - }, - output: [ - `task_id: ${nextSession.id} (for resuming to continue this task if needed)`, - "", - "", - result.parts.findLast((item) => item.type === "text")?.text ?? "", - "", - ].join("\n"), + metadata, + output: output(nextSession.id, text), } }), (_, exit) => @@ -167,6 +329,7 @@ export const TaskTool = Tool.define( return { description: DESCRIPTION, parameters: Parameters, + jsonSchema: flags.experimentalBackgroundSubagents ? undefined : ToolJsonSchema.fromSchema(BaseParameters), execute: (params: Schema.Schema.Type, ctx: Tool.Context) => run(params, ctx).pipe(Effect.orDie), } diff --git a/packages/opencode/src/tool/task.txt b/packages/opencode/src/tool/task.txt index fba8470d1b4b..cab2374a3e2a 100644 --- a/packages/opencode/src/tool/task.txt +++ b/packages/opencode/src/tool/task.txt @@ -15,10 +15,11 @@ When NOT to use the Task tool: Usage notes: 1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses 2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result. The output includes a task_id you can reuse later to continue the same subagent session. -3. Each agent invocation starts with a fresh context unless you provide task_id to resume the same subagent session (which continues with its previous messages and tool outputs). When starting fresh, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you. -4. The agent's outputs should generally be trusted -5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent. Tell it how to verify its work if possible (e.g., relevant test commands). -6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement. +3. If OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS is enabled, background=true launches the subagent asynchronously. Use task_status(task_id=..., wait=false) to poll, or wait=true to block until done. +4. Each agent invocation starts with a fresh context unless you provide task_id to resume the same subagent session (which continues with its previous messages and tool outputs). When starting fresh, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you. +5. The agent's outputs should generally be trusted +6. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent. Tell it how to verify its work if possible (e.g., relevant test commands). +7. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement. Example usage (NOTE: The agents below are fictional examples for illustration only - use the actual agents listed above): diff --git a/packages/opencode/src/tool/task_status.ts b/packages/opencode/src/tool/task_status.ts new file mode 100644 index 000000000000..b458b4fc45fa --- /dev/null +++ b/packages/opencode/src/tool/task_status.ts @@ -0,0 +1,179 @@ +import * as Tool from "./tool" +import DESCRIPTION from "./task_status.txt" +import { BackgroundJob } from "@/background/job" +import { Session } from "@/session/session" +import { MessageV2 } from "@/session/message-v2" +import { SessionID } from "@/session/schema" +import { SessionStatus } from "@/session/status" +import { PositiveInt } from "@opencode-ai/core/schema" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { Effect, Option, Schema } from "effect" + +const DEFAULT_TIMEOUT = 60_000 +const POLL_MS = 300 + +const Parameters = Schema.Struct({ + task_id: SessionID.annotate({ description: "The task_id returned by the task tool" }), + wait: Schema.optional(Schema.Boolean).annotate({ + description: "When true, wait until the task reaches a terminal state or timeout", + }), + timeout_ms: Schema.optional(PositiveInt).annotate({ + description: "Maximum milliseconds to wait when wait=true (default: 60000)", + }), +}) + +type State = BackgroundJob.Status +type InspectResult = { state: State; text: string } + +function format(input: { taskID: SessionID; state: State; text: string }) { + const tag = input.state === "completed" || input.state === "running" ? "task_result" : "task_error" + return [`task_id: ${input.taskID}`, `state: ${input.state}`, "", `<${tag}>`, input.text, ``].join("\n") +} + +function errorText(error: NonNullable) { + const data = Reflect.get(error, "data") + const message = data && typeof data === "object" ? Reflect.get(data, "message") : undefined + if (typeof message === "string" && message) return message + return error.name +} + +function inspectMessage(message: MessageV2.WithParts): InspectResult | undefined { + if (message.info.role !== "assistant") return + const text = message.parts.findLast((part) => part.type === "text")?.text ?? "" + if (message.info.error) return { state: "error", text: text || errorText(message.info.error) } + if (message.info.finish && !["tool-calls", "unknown"].includes(message.info.finish)) + return { state: "completed", text } + return { state: "running", text: text || "Task is still running." } +} + +export const TaskStatusTool = Tool.define( + "task_status", + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const sessions = yield* Session.Service + const status = yield* SessionStatus.Service + const flags = yield* RuntimeFlags.Service + + const inspect: (taskID: SessionID) => Effect.Effect = Effect.fn("TaskStatusTool.inspect")(function* ( + taskID: SessionID, + ) { + const job = yield* jobs.get(taskID) + if (job) { + return { + state: job.status, + text: + job.output ?? + job.error ?? + (job.status === "running" + ? "Task is still running." + : job.status === "cancelled" + ? "Task was cancelled." + : ""), + } + } + + const current = yield* status.get(taskID) + if (current.type === "busy" || current.type === "retry") { + return { + state: "running", + text: current.type === "retry" ? `Task is retrying: ${current.message}` : "Task is still running.", + } + } + + const latestAssistant = yield* sessions + .findMessage(taskID, (item) => item.info.role === "assistant") + .pipe(Effect.orDie) + if (Option.isSome(latestAssistant)) { + const latest = inspectMessage(latestAssistant.value) + if (!latest) return { state: "error", text: "Task is not running in this process." } + if (latest.state === "running") + return { state: "error", text: "Task is not running in this process and has no final output." } + return latest + } + return { state: "error", text: "Task is not running in this process and has not produced output." } + }) + + const waitForTerminal: ( + taskID: SessionID, + timeout: number, + ) => Effect.Effect<{ result: InspectResult; timedOut: boolean }> = Effect.fn("TaskStatusTool.waitForTerminal")( + function* (taskID: SessionID, timeout: number) { + const result = yield* inspect(taskID) + if (result.state !== "running") return { result, timedOut: false } + if (timeout <= 0) return { result, timedOut: true } + const sleep = Math.min(POLL_MS, timeout) + yield* Effect.sleep(`${sleep} millis`) + return yield* waitForTerminal(taskID, timeout - sleep) + }, + ) + + const run = Effect.fn("TaskStatusTool.execute")(function* ( + params: Schema.Schema.Type, + _ctx: Tool.Context, + ) { + if (!flags.experimentalBackgroundSubagents) { + return yield* Effect.fail(new Error("task_status requires OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true")) + } + + const session = yield* sessions.get(params.task_id).pipe(Effect.catchCause(() => Effect.succeed(undefined))) + if (!session) { + return { + title: "Task status", + metadata: { + task_id: params.task_id, + state: "error" as const, + timed_out: false, + }, + output: format({ + taskID: params.task_id, + state: "error", + text: `Task not found: ${params.task_id}`, + }), + } + } + + const waited = + params.wait === true + ? yield* jobs.wait({ id: params.task_id, timeout: params.timeout_ms ?? DEFAULT_TIMEOUT }) + : { info: yield* jobs.get(params.task_id), timedOut: false } + const inspected = waited.info + ? { + result: { + state: waited.info.status, + text: + waited.info.output ?? + waited.info.error ?? + (waited.info.status === "running" ? "Task is still running." : ""), + }, + timedOut: waited.timedOut, + } + : params.wait === true + ? yield* waitForTerminal(params.task_id, params.timeout_ms ?? DEFAULT_TIMEOUT) + : { result: yield* inspect(params.task_id), timedOut: false } + const text = inspected.timedOut + ? `Timed out after ${params.timeout_ms ?? DEFAULT_TIMEOUT}ms while waiting for task completion.` + : inspected.result.text + + return { + title: "Task status", + metadata: { + task_id: params.task_id, + state: inspected.result.state, + timed_out: inspected.timedOut, + }, + output: format({ + taskID: params.task_id, + state: inspected.result.state, + text, + }), + } + }) + + return { + description: DESCRIPTION, + parameters: Parameters, + execute: (params: Schema.Schema.Type, ctx: Tool.Context) => + run(params, ctx).pipe(Effect.orDie), + } + }), +) diff --git a/packages/opencode/src/tool/task_status.txt b/packages/opencode/src/tool/task_status.txt new file mode 100644 index 000000000000..ed6fa727b2a9 --- /dev/null +++ b/packages/opencode/src/tool/task_status.txt @@ -0,0 +1,13 @@ +Poll the status of a background subagent task launched with the task tool. + +Use this for tasks started with `task(background=true)`. + +Parameters: +- `task_id` (required): the task session id returned by the task tool +- `wait` (optional): when true, wait for completion +- `timeout_ms` (optional): max wait duration in milliseconds when `wait=true` + +Returns compact, parseable output: +- `task_id` +- `state` (`running`, `completed`, `error`, or `cancelled`) +- `...` or `...` containing final output, error summary, or current progress text diff --git a/packages/opencode/src/tool/tool.ts b/packages/opencode/src/tool/tool.ts index 4b9ea8774a40..a26422d04c2a 100644 --- a/packages/opencode/src/tool/tool.ts +++ b/packages/opencode/src/tool/tool.ts @@ -1,4 +1,5 @@ import { Effect, Schema } from "effect" +import type { JSONSchema7 } from "@ai-sdk/provider" import type { MessageV2 } from "../session/message-v2" import type { Permission } from "../permission" import type { SessionID, MessageID } from "../session/schema" @@ -38,6 +39,7 @@ export interface Def< id: string description: string parameters: Parameters + jsonSchema?: JSONSchema7 execute(args: Schema.Schema.Type, ctx: Context): Effect.Effect> formatValidationError?(error: unknown): string } diff --git a/packages/opencode/src/tool/webfetch.ts b/packages/opencode/src/tool/webfetch.ts index d2561a130127..f8a4b6233ae9 100644 --- a/packages/opencode/src/tool/webfetch.ts +++ b/packages/opencode/src/tool/webfetch.ts @@ -1,5 +1,6 @@ import { Effect, Schema } from "effect" import { HttpClient, HttpClientRequest } from "effect/unstable/http" +import { Parser } from "htmlparser2" import * as Tool from "./tool" import TurndownService from "turndown" import DESCRIPTION from "./webfetch.txt" @@ -12,10 +13,11 @@ const MAX_TIMEOUT = 120 * 1000 // 2 minutes export const Parameters = Schema.Struct({ url: Schema.String.annotate({ description: "The URL to fetch content from" }), format: Schema.Literals(["text", "markdown", "html"]) - .pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("markdown" as const))) .annotate({ description: "The format to return the content in (text, markdown, or html). Defaults to markdown.", - }), + default: "markdown", + }) + .pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("markdown" as const))), timeout: Schema.optional(Schema.Number).annotate({ description: "Optional timeout in seconds (max 120)" }), }) @@ -138,8 +140,7 @@ export const WebFetchTool = Tool.define( case "text": if (contentType.includes("text/html")) { - const text = yield* Effect.promise(() => extractTextFromHTML(content)) - return { output: text, title, metadata: {} } + return { output: extractTextFromHTML(content), title, metadata: {} } } return { output: content, title, metadata: {} } @@ -154,35 +155,27 @@ export const WebFetchTool = Tool.define( }), ) -async function extractTextFromHTML(html: string) { +function extractTextFromHTML(html: string) { let text = "" - let skipContent = false - - const rewriter = new HTMLRewriter() - .on("script, style, noscript, iframe, object, embed", { - element() { - skipContent = true - }, - text() { - // Skip text content inside these elements - }, - }) - .on("*", { - element(element) { - // Reset skip flag when entering other elements - if (!["script", "style", "noscript", "iframe", "object", "embed"].includes(element.tagName)) { - skipContent = false - } - }, - text(input) { - if (!skipContent) { - text += input.text - } - }, - }) - .transform(new Response(html)) + let skipDepth = 0 + + const parser = new Parser({ + onopentag(name) { + if (skipDepth > 0 || ["script", "style", "noscript", "iframe", "object", "embed"].includes(name)) { + skipDepth++ + } + }, + ontext(input) { + if (skipDepth === 0) text += input + }, + onclosetag() { + if (skipDepth > 0) skipDepth-- + }, + }) + + parser.write(html) + parser.end() - await rewriter.text() return text.trim() } diff --git a/packages/opencode/src/tool/websearch.ts b/packages/opencode/src/tool/websearch.ts index 0218ecbe3bb2..d08ae1d153e8 100644 --- a/packages/opencode/src/tool/websearch.ts +++ b/packages/opencode/src/tool/websearch.ts @@ -3,9 +3,9 @@ import { HttpClient } from "effect/unstable/http" import * as Tool from "./tool" import * as McpWebSearch from "./mcp-websearch" import DESCRIPTION from "./websearch.txt" -import { Flag } from "@opencode-ai/core/flag/flag" import { checksum } from "@opencode-ai/core/util/encode" import { InstallationVersion } from "@opencode-ai/core/installation/version" +import { RuntimeFlags } from "@/effect/runtime-flags" export const Parameters = Schema.Struct({ query: Schema.String.annotate({ description: "Websearch query" }), @@ -27,10 +27,7 @@ export const Parameters = Schema.Struct({ const WebSearchProviderSchema = Schema.Literals(["exa", "parallel"]) export type WebSearchProvider = Schema.Schema.Type -export function selectWebSearchProvider( - sessionID: string, - flags = { exa: Flag.OPENCODE_ENABLE_EXA, parallel: Flag.OPENCODE_ENABLE_PARALLEL }, -): WebSearchProvider { +export function selectWebSearchProvider(sessionID: string, flags = { exa: false, parallel: false }): WebSearchProvider { const override = process.env.OPENCODE_WEBSEARCH_PROVIDER if (override === "exa" || override === "parallel") return override if (flags.parallel) return "parallel" @@ -103,6 +100,7 @@ export const WebSearchTool = Tool.define( "websearch", Effect.gen(function* () { const http = yield* HttpClient.HttpClient + const flags = yield* RuntimeFlags.Service return { get description() { @@ -111,7 +109,10 @@ export const WebSearchTool = Tool.define( parameters: Parameters, execute: (params: Schema.Schema.Type, ctx: Tool.Context) => Effect.gen(function* () { - const provider = selectWebSearchProvider(ctx.sessionID) + const provider = selectWebSearchProvider(ctx.sessionID, { + exa: flags.enableExa, + parallel: flags.enableParallel, + }) const title = webSearchProviderLabel(provider) yield* ctx.metadata({ title: `${title} "${params.query}"`, metadata: { provider } }) diff --git a/packages/opencode/src/util/abort.ts b/packages/opencode/src/util/abort.ts deleted file mode 100644 index 3e7cfd8b28b1..000000000000 --- a/packages/opencode/src/util/abort.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Creates an AbortController that automatically aborts after a timeout. - * - * Uses bind() instead of arrow functions to avoid capturing the surrounding - * scope in closures. Arrow functions like `() => controller.abort()` capture - * request bodies and other large objects, preventing GC for the timer lifetime. - * - * @param ms Timeout in milliseconds - * @returns Object with controller, signal, and clearTimeout function - */ -export function abortAfter(ms: number) { - const controller = new AbortController() - const id = setTimeout(controller.abort.bind(controller), ms) - return { - controller, - signal: controller.signal, - clearTimeout: () => globalThis.clearTimeout(id), - } -} - -/** - * Combines multiple AbortSignals with a timeout. - * - * @param ms Timeout in milliseconds - * @param signals Additional signals to combine - * @returns Combined signal that aborts on timeout or when any input signal aborts - */ -export function abortAfterAny(ms: number, ...signals: AbortSignal[]) { - const timeout = abortAfter(ms) - const signal = AbortSignal.any([timeout.signal, ...signals]) - return { - signal, - clearTimeout: timeout.clearTimeout, - } -} diff --git a/packages/opencode/src/util/color.ts b/packages/opencode/src/util/color.ts deleted file mode 100644 index 3752fd19bfd4..000000000000 --- a/packages/opencode/src/util/color.ts +++ /dev/null @@ -1,19 +0,0 @@ -export function isValidHex(hex?: string): hex is string { - if (!hex) return false - return /^#[0-9a-fA-F]{6}$/.test(hex) -} - -export function hexToRgb(hex: string): { r: number; g: number; b: number } { - const r = parseInt(hex.slice(1, 3), 16) - const g = parseInt(hex.slice(3, 5), 16) - const b = parseInt(hex.slice(5, 7), 16) - return { r, g, b } -} - -export function hexToAnsiBold(hex?: string): string | undefined { - if (!isValidHex(hex)) return undefined - const { r, g, b } = hexToRgb(hex) - return `\x1b[38;2;${r};${g};${b}m\x1b[1m` -} - -export * as Color from "./color" diff --git a/packages/opencode/src/util/filesystem.ts b/packages/opencode/src/util/filesystem.ts index ded2b4517817..696603adbb7e 100644 --- a/packages/opencode/src/util/filesystem.ts +++ b/packages/opencode/src/util/filesystem.ts @@ -1,10 +1,11 @@ import { chmod, mkdir, readFile, stat as statFile, writeFile } from "fs/promises" import { createWriteStream, existsSync, statSync } from "fs" import { realpathSync } from "fs" -import { dirname, join, relative, resolve as pathResolve, win32 } from "path" +import { dirname, isAbsolute, join, relative, resolve as pathResolve, win32 } from "path" import { Readable } from "stream" import { pipeline } from "stream/promises" import { Glob } from "@opencode-ai/core/util/glob" +import { fileURLToPath } from "url" // Fast sync version for metadata checks export async function exists(p: string): Promise { @@ -142,6 +143,12 @@ export function resolve(p: string): string { } } +export function resolveFilePath(root: string, file: string): string { + const raw = file.startsWith("file://") ? fileURLToPath(file) : file + if (isAbsolute(raw)) return raw + return pathResolve(root, raw) +} + export function windowsPath(p: string): string { if (process.platform !== "win32") return p return ( diff --git a/packages/opencode/src/util/lock.ts b/packages/opencode/src/util/lock.ts deleted file mode 100644 index 15635996ee95..000000000000 --- a/packages/opencode/src/util/lock.ts +++ /dev/null @@ -1,98 +0,0 @@ -const locks = new Map< - string, - { - readers: number - writer: boolean - waitingReaders: (() => void)[] - waitingWriters: (() => void)[] - } ->() - -function get(key: string) { - if (!locks.has(key)) { - locks.set(key, { - readers: 0, - writer: false, - waitingReaders: [], - waitingWriters: [], - }) - } - return locks.get(key)! -} - -function process(key: string) { - const lock = locks.get(key) - if (!lock || lock.writer || lock.readers > 0) return - - // Prioritize writers to prevent starvation - if (lock.waitingWriters.length > 0) { - const nextWriter = lock.waitingWriters.shift()! - nextWriter() - return - } - - // Wake up all waiting readers - while (lock.waitingReaders.length > 0) { - const nextReader = lock.waitingReaders.shift()! - nextReader() - } - - // Clean up empty locks - if (lock.readers === 0 && !lock.writer && lock.waitingReaders.length === 0 && lock.waitingWriters.length === 0) { - locks.delete(key) - } -} - -export async function read(key: string): Promise { - const lock = get(key) - - return new Promise((resolve) => { - if (!lock.writer && lock.waitingWriters.length === 0) { - lock.readers++ - resolve({ - [Symbol.dispose]: () => { - lock.readers-- - process(key) - }, - }) - } else { - lock.waitingReaders.push(() => { - lock.readers++ - resolve({ - [Symbol.dispose]: () => { - lock.readers-- - process(key) - }, - }) - }) - } - }) -} - -export async function write(key: string): Promise { - const lock = get(key) - - return new Promise((resolve) => { - if (!lock.writer && lock.readers === 0) { - lock.writer = true - resolve({ - [Symbol.dispose]: () => { - lock.writer = false - process(key) - }, - }) - } else { - lock.waitingWriters.push(() => { - lock.writer = true - resolve({ - [Symbol.dispose]: () => { - lock.writer = false - process(key) - }, - }) - }) - } - }) -} - -export * as Lock from "./lock" diff --git a/packages/opencode/src/util/named-schema-error.ts b/packages/opencode/src/util/named-schema-error.ts deleted file mode 100644 index d87e1dcdb55d..000000000000 --- a/packages/opencode/src/util/named-schema-error.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Schema } from "effect" -import z from "zod" -import { zod } from "@opencode-ai/core/effect-zod" - -/** - * Create a Schema-backed NamedError-shaped class. - * - * Drop-in replacement for `NamedError.create(tag, zodShape)` but backed by - * `Schema.Struct` under the hood. The wire shape emitted by the derived - * `.Schema` is still `{ name: tag, data: {...fields} }` so the generated - * OpenAPI/SDK output is byte-identical to the original NamedError schema. - * - * Preserves the existing surface: - * - static `Schema` (Zod schema of the wire shape) - * - static `isInstance(x)` - * - instance `toObject()` returning `{ name, data }` - * - `new X({ ...data }, { cause })` - */ -export function namedSchemaError(tag: Tag, fields: Fields) { - // Wire shape matches the original NamedError output so the SDK stays stable. - const dataSchema = Schema.Struct(fields) - const wire = z - .object({ - name: z.literal(tag), - data: zod(dataSchema), - }) - .meta({ ref: tag }) - - // Effect Schema for the wire shape — used by HttpApi OpenAPI generation. - const effectSchema = Schema.Struct({ - name: Schema.Literal(tag), - data: dataSchema, - }).annotate({ identifier: tag }) - - type Data = Schema.Schema.Type - - class NamedSchemaError extends Error { - static readonly Schema = wire - static readonly EffectSchema = effectSchema - static readonly tag = tag - public static isInstance(input: unknown): input is NamedSchemaError { - return typeof input === "object" && input !== null && "name" in input && (input as { name: unknown }).name === tag - } - - public override readonly name: Tag = tag - public readonly data: Data - - constructor(data: Data, options?: ErrorOptions) { - super(tag, options) - this.data = data - } - - toObject(): { name: Tag; data: Data } { - return { name: tag, data: this.data } - } - } - - Object.defineProperty(NamedSchemaError, "name", { value: tag }) - - return NamedSchemaError -} diff --git a/packages/opencode/src/util/network.ts b/packages/opencode/src/util/network.ts deleted file mode 100644 index 69e5d17588ac..000000000000 --- a/packages/opencode/src/util/network.ts +++ /dev/null @@ -1,9 +0,0 @@ -export function online() { - const nav = globalThis.navigator - if (!nav || typeof nav.onLine !== "boolean") return true - return nav.onLine -} - -export function proxied() { - return !!(process.env.HTTP_PROXY || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.https_proxy) -} diff --git a/packages/opencode/src/util/scrap.ts b/packages/opencode/src/util/scrap.ts deleted file mode 100644 index 554dba1c54ac..000000000000 --- a/packages/opencode/src/util/scrap.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const foo: string = "42" -export const bar: number = 123 - -export function dummyFunction(): void { - console.log("This is a dummy function") -} - -export function randomHelper(): boolean { - return Math.random() > 0.5 -} diff --git a/packages/opencode/src/v2/event.ts b/packages/opencode/src/v2/event.ts deleted file mode 100644 index 14ee44dd5289..000000000000 --- a/packages/opencode/src/v2/event.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Identifier } from "@/id/id" -import { SyncEvent } from "@/sync" -import { withStatics } from "@opencode-ai/core/schema" -import * as Schema from "effect/Schema" - -export const ID = Schema.String.pipe( - Schema.brand("Event.ID"), - withStatics((s) => ({ - create: () => s.make(Identifier.create("evt", "ascending")), - })), -) -export type ID = Schema.Schema.Type - -export function define(input: { - type: Type - schema: Fields - aggregate: string - version?: number -}) { - const Payload = Schema.Struct({ - id: ID, - metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.optional), - type: Schema.Literal(input.type), - data: Schema.Struct(input.schema), - }).annotate({ - identifier: input.type, - }) - - const Sync = SyncEvent.define({ - type: input.type, - version: input.version ?? 1, - aggregate: input.aggregate, - schema: Payload.fields.data, - }) - - return Object.assign(Payload, { - Sync, - version: input.version, - aggregate: input.aggregate, - }) -} - -export * as EventV2 from "./event" diff --git a/packages/opencode/src/v2/model.ts b/packages/opencode/src/v2/model.ts deleted file mode 100644 index 56357ab4006f..000000000000 --- a/packages/opencode/src/v2/model.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { withStatics } from "@opencode-ai/core/schema" -import { ModelStatus } from "@/provider/model-status" -import { Array, Context, Effect, HashMap, Layer, Option, Order, pipe, Schema } from "effect" -import { DateTimeUtcFromMillis } from "effect/Schema" - -export const ID = Schema.String.pipe(Schema.brand("Model.ID")) -export type ID = typeof ID.Type - -export const ProviderID = Schema.String.pipe( - Schema.brand("Model.ProviderID"), - withStatics((schema) => ({ - // Well-known providers - opencode: schema.make("opencode"), - anthropic: schema.make("anthropic"), - openai: schema.make("openai"), - google: schema.make("google"), - googleVertex: schema.make("google-vertex"), - githubCopilot: schema.make("github-copilot"), - amazonBedrock: schema.make("amazon-bedrock"), - azure: schema.make("azure"), - openrouter: schema.make("openrouter"), - mistral: schema.make("mistral"), - gitlab: schema.make("gitlab"), - })), -) -export type ProviderID = typeof ProviderID.Type - -export const VariantID = Schema.String.pipe(Schema.brand("VariantID")) -export type VariantID = typeof VariantID.Type - -// Grouping of models, eg claude opus, claude sonnet -export const Family = Schema.String.pipe(Schema.brand("Family")) -export type Family = typeof Family.Type - -const OpenAIResponses = Schema.Struct({ - type: Schema.Literal("openai/responses"), - url: Schema.String, - websocket: Schema.optional(Schema.Boolean), -}) - -const OpenAICompletions = Schema.Struct({ - type: Schema.Literal("openai/completions"), - url: Schema.String, - reasoning: Schema.Union([ - Schema.Struct({ - type: Schema.Literal("reasoning_content"), - }), - Schema.Struct({ - type: Schema.Literal("reasoning_details"), - }), - ]).pipe(Schema.optional), -}) -export type OpenAICompletions = typeof OpenAICompletions.Type - -const AnthropicMessages = Schema.Struct({ - type: Schema.Literal("anthropic/messages"), - url: Schema.String, -}) - -export const Endpoint = Schema.Union([OpenAIResponses, OpenAICompletions, AnthropicMessages]).pipe( - Schema.toTaggedUnion("type"), -) -export type Endpoint = typeof Endpoint.Type - -export const Capabilities = Schema.Struct({ - tools: Schema.Boolean, - // mime patterns, image, audio, video/*, text/* - input: Schema.String.pipe(Schema.Array), - output: Schema.String.pipe(Schema.Array), -}) -export type Capabilities = typeof Capabilities.Type - -export const Options = Schema.Struct({ - headers: Schema.Record(Schema.String, Schema.String), - body: Schema.Record(Schema.String, Schema.Any), -}) -export type Options = typeof Options.Type - -export const Cost = Schema.Struct({ - tier: Schema.Struct({ - type: Schema.Literal("context"), - size: Schema.Int, - }).pipe(Schema.optional), - input: Schema.Finite, - output: Schema.Finite, - cache: Schema.Struct({ - read: Schema.Finite, - write: Schema.Finite, - }), -}) - -export const Ref = Schema.Struct({ - id: ID, - providerID: ProviderID, - variant: VariantID, -}) -export type Ref = typeof Ref.Type - -export class Info extends Schema.Class("Model.Info")({ - id: ID, - providerID: ProviderID, - family: Family.pipe(Schema.optional), - name: Schema.String, - endpoint: Endpoint, - capabilities: Capabilities, - options: Schema.Struct({ - ...Options.fields, - variant: Schema.String.pipe(Schema.optional), - }), - variants: Schema.Struct({ - id: VariantID, - ...Options.fields, - }).pipe(Schema.Array), - time: Schema.Struct({ - released: DateTimeUtcFromMillis, - }), - cost: Cost.pipe(Schema.Array), - status: ModelStatus, - limit: Schema.Struct({ - context: Schema.Int, - input: Schema.Int.pipe(Schema.optional), - output: Schema.Int, - }), -}) {} - -export function parse(input: string): { providerID: ProviderID; modelID: ID } { - const [providerID, ...modelID] = input.split("/") - return { - providerID: ProviderID.make(providerID), - modelID: ID.make(modelID.join("/")), - } -} - -export interface Interface { - readonly get: (providerID: ProviderID, modelID: ID) => Effect.Effect> - readonly add: (model: Info) => Effect.Effect - readonly remove: (providerID: ProviderID, modelID: ID) => Effect.Effect - readonly all: () => Effect.Effect - readonly default: () => Effect.Effect> - readonly small: (provider: ProviderID) => Effect.Effect> -} - -export class Service extends Context.Service()("@opencode/v2/Model") {} - -export const layer = Layer.effect( - Service, - Effect.gen(function* () { - let models = HashMap.empty() - - function key(providerID: ProviderID, modelID: ID) { - return `${providerID}/${modelID}` - } - - const result: Interface = { - get: Effect.fn("V2Model.get")(function* (providerID, modelID) { - return HashMap.get(models, key(providerID, modelID)) - }), - - add: Effect.fn("V2Model.add")(function* (model) { - models = HashMap.set(models, key(model.providerID, model.id), model) - }), - - remove: Effect.fn("V2Model.remove")(function* (providerID, modelID) { - models = HashMap.remove(models, key(providerID, modelID)) - }), - - all: Effect.fn("V2Model.all")(function* () { - return pipe( - models, - HashMap.toValues, - Array.sortWith((item) => item.time.released.epochMilliseconds, Order.flip(Order.Number)), - ) - }), - - default: Effect.fn("V2Model.default")(function* () { - const all = yield* result.all() - return Option.fromUndefinedOr(all[0]) - }), - - small: Effect.fn("V2Model.small")(function* (providerID) { - const all = yield* result.all() - const match = all.find((model) => model.providerID === providerID && model.id.toLowerCase().includes("small")) - return Option.fromUndefinedOr(match) - }), - } - - return Service.of(result) - }), -) - -export const defaultLayer = layer - -export * as Modelv2 from "./model" diff --git a/packages/opencode/src/v2/provider-parity-checklist.md b/packages/opencode/src/v2/provider-parity-checklist.md new file mode 100644 index 000000000000..e3a599d8ec3b --- /dev/null +++ b/packages/opencode/src/v2/provider-parity-checklist.md @@ -0,0 +1,95 @@ +# Unported Provider Logic Checklist + +This tracks legacy provider behavior from `packages/opencode/src/provider/provider.ts` that still needs to be ported into the v2 provider plugins under `packages/opencode/src/v2/plugin/provider/`. Keep entries checked only when v2 has equivalent behavior or when the item is intentionally skipped. + +## Provider Setup + +- [x] Cloudflare AI Gateway custom SDK construction with `createAiGateway` / `createUnified`. +- [x] Google Vertex authenticated `fetch` injection. +- [x] Amazon Bedrock AWS credential chain setup. +- [x] Amazon Bedrock bearer token setup. +- [x] SAP AI Core service key setup. + +## Provider Options + +- [x] Azure resource name resolution. +- [x] Azure missing-resource error. +- [x] Azure Cognitive Services baseURL resolution. +- [x] Cloudflare Workers AI account ID validation. +- [x] Cloudflare Workers AI account ID vars. +- [x] Cloudflare AI Gateway account ID validation. +- [x] Cloudflare AI Gateway gateway ID validation. +- [x] Cloudflare AI Gateway token validation. +- [x] Amazon Bedrock region precedence. +- [x] Amazon Bedrock profile precedence. +- [x] Amazon Bedrock endpoint precedence. +- [x] Google Vertex project resolution. +- [x] Google Vertex location resolution. +- [x] GitLab instance URL resolution. +- [x] GitLab token resolution. +- [x] GitLab AI gateway headers. +- [x] GitLab feature flags. +- [x] Opencode unauthenticated paid-model filtering. +- [x] Opencode public API key fallback. + +## Request Behavior + +- [x] Request timeout handling. +- [x] Chunk timeout handling. +- [x] SSE timeout wrapping. +- [x] OpenAI response item ID stripping. +- [x] Azure response item ID stripping. +- [x] OpenAI-compatible `includeUsage` defaulting. + +## Dynamic Models + +- [ ] GitLab workflow model discovery. + +## Model Filtering + +- [ ] Experimental alpha model filtering. +- [ ] Deprecated model filtering. +- [ ] Config whitelist filtering. +- [ ] Config blacklist filtering. +- [ ] `gpt-5-chat-latest` filtering. +- [ ] OpenRouter `openai/gpt-5-chat` filtering. + +## Default Models + +- [x] Configured default model selection. Replaced by explicit `Catalog.model.setDefault`. +- [SKIP] Recent-history default model selection — not porting to server-side v2 catalog. +- [x] Default model fallback sorting. Uses newest available model, not legacy hard-coded priority. + +## Small Models + +- [SKIP] Configured `small_model` selection — not porting config-driven selection to server-side v2 catalog. +- [x] Provider-specific small model priority. Replaced by cheapest output cost selection. +- [x] Opencode small model priority. Replaced by cheapest output cost selection. +- [x] GitHub Copilot small model priority. Replaced by cheapest output cost selection. +- [x] Amazon Bedrock region-aware small model selection. Replaced by cheapest output cost selection. + +## URL And Env Vars + +- [SKIP] BaseURL `${VAR}` interpolation — not porting generic URL templating; provider plugins should construct concrete URLs. +- [x] Azure `AZURE_RESOURCE_NAME` vars. Handled by Azure provider plugins. +- [x] Google Vertex vars. Handled by Google Vertex provider plugins. +- [x] Cloudflare Workers AI vars. Handled by Cloudflare Workers AI provider plugin. + +## Auth + +- [ ] Auth-derived provider API keys. +- [ ] OpenAI OAuth/API auth distinction. +- [ ] GitLab OAuth token selection. +- [ ] GitLab API token selection. +- [ ] Azure auth metadata resource name. +- [ ] Cloudflare auth metadata account ID. +- [ ] Cloudflare auth metadata gateway ID. + +## Config And Plugin Parity + +- [ ] Legacy plugin auth loader behavior. +- [ ] Config provider merge behavior. +- [ ] Config model merge behavior. +- [ ] Variant generation from model metadata. +- [ ] Config variant merge behavior. +- [ ] Config variant disable behavior. diff --git a/packages/opencode/src/v2/session.ts b/packages/opencode/src/v2/session.ts index 3b0b61dcbc61..a3c386f66d4f 100644 --- a/packages/opencode/src/v2/session.ts +++ b/packages/opencode/src/v2/session.ts @@ -4,15 +4,16 @@ import { WorkspaceID } from "@/control-plane/schema" import { and, asc, desc, eq, gt, gte, isNull, like, lt, or, type SQL } from "@/storage/db" import * as Database from "@/storage/db" import { Context, DateTime, Effect, Layer, Option, Schema } from "effect" -import { SessionMessage } from "./session-message" -import type { Prompt } from "./session-prompt" -import { EventV2 } from "./event" +import { SessionMessage } from "@opencode-ai/core/session-message" +import type { Prompt } from "@opencode-ai/core/session-prompt" import { ProjectID } from "@/project/schema" -import { SessionEvent } from "./session-event" -import { V2Schema } from "./schema" +import { SessionEvent } from "@opencode-ai/core/session-event" +import { V2Schema } from "@opencode-ai/core/v2-schema" import { optionalOmitUndefined } from "@opencode-ai/core/schema" -import { Modelv2 } from "./model" -import { SyncEvent } from "@/sync" +import { EventV2 } from "@opencode-ai/core/event" +import { EventV2Bridge } from "@/event-v2-bridge" +import { ModelV2 } from "@opencode-ai/core/model" +import { ProviderV2 } from "@opencode-ai/core/provider" export const Delivery = Schema.Literals(["immediate", "deferred"]).annotate({ identifier: "Session.Delivery", @@ -28,7 +29,17 @@ export class Info extends Schema.Class("Session.Info")({ workspaceID: optionalOmitUndefined(WorkspaceID), path: optionalOmitUndefined(Schema.String), agent: optionalOmitUndefined(Schema.String), - model: Modelv2.Ref.pipe(optionalOmitUndefined), + model: ModelV2.Ref.pipe(optionalOmitUndefined), + cost: Schema.Finite, + tokens: Schema.Struct({ + input: Schema.Finite, + output: Schema.Finite, + reasoning: Schema.Finite, + cache: Schema.Struct({ + read: Schema.Finite, + write: Schema.Finite, + }), + }), time: Schema.Struct({ created: V2Schema.DateTimeUtcFromMillis, updated: V2Schema.DateTimeUtcFromMillis, @@ -57,7 +68,7 @@ export class NotFoundError extends Schema.TaggedErrorClass()("Ses export interface Interface { readonly create: (input?: { agent?: string - model?: Modelv2.Ref + model?: ModelV2.Ref parentID?: SessionID workspaceID?: WorkspaceID }) => Effect.Effect @@ -101,10 +112,10 @@ export interface Interface { parentID: SessionID prompt: Prompt agent: string - model?: Modelv2.Ref + model?: ModelV2.Ref }) => Effect.Effect readonly switchAgent: (input: { sessionID: SessionID; agent: string }) => Effect.Effect - readonly switchModel: (input: { sessionID: SessionID; model: Modelv2.Ref }) => Effect.Effect + readonly switchModel: (input: { sessionID: SessionID; model: ModelV2.Ref }) => Effect.Effect readonly compact: (sessionID: SessionID) => Effect.Effect readonly wait: (sessionID: SessionID) => Effect.Effect } @@ -114,7 +125,7 @@ export class Service extends Context.Service()("@opencode/v2 export const layer = Layer.effect( Service, Effect.gen(function* () { - const sync = yield* SyncEvent.Service + const events = yield* EventV2Bridge.Service const decodeMessage = Schema.decodeUnknownSync(SessionMessage.Message) const decode = (row: typeof SessionMessageTable.$inferSelect) => @@ -131,11 +142,21 @@ export const layer = Layer.effect( agent: row.agent ?? undefined, model: row.model ? { - id: Modelv2.ID.make(row.model.id), - providerID: Modelv2.ProviderID.make(row.model.providerID), - variant: Modelv2.VariantID.make(row.model.variant ?? "default"), + id: ModelV2.ID.make(row.model.id), + providerID: ProviderV2.ID.make(row.model.providerID), + variant: ModelV2.VariantID.make(row.model.variant ?? "default"), } : undefined, + cost: row.cost, + tokens: { + input: row.tokens_input, + output: row.tokens_output, + reasoning: row.tokens_reasoning, + cache: { + read: row.tokens_cache_read, + write: row.tokens_cache_write, + }, + }, time: { created: DateTime.makeUnsafe(row.time_created), updated: DateTime.makeUnsafe(row.time_updated), @@ -144,7 +165,7 @@ export const layer = Layer.effect( }) } - const result: Interface = { + const result = Service.of({ create: Effect.fn("V2Session.create")(function* (_input) { return {} as any }), @@ -271,14 +292,14 @@ export const layer = Layer.effect( shell: Effect.fn("V2Session.shell")(function* (_input) {}), skill: Effect.fn("V2Session.skill")(function* (_input) {}), switchAgent: Effect.fn("V2Session.switchAgent")(function* (input) { - yield* sync.run(SessionEvent.AgentSwitched.Sync, { + yield* events.publish(SessionEvent.AgentSwitched, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(Date.now()), agent: input.agent, }) }), switchModel: Effect.fn("V2Session.switchModel")(function* (input) { - yield* sync.run(SessionEvent.ModelSwitched.Sync, { + yield* events.publish(SessionEvent.ModelSwitched, { sessionID: input.sessionID, timestamp: DateTime.makeUnsafe(Date.now()), model: input.model, @@ -286,7 +307,7 @@ export const layer = Layer.effect( }), subagent: Effect.fn("V2Session.subagent")(function* (input) { const parent = yield* result.get(input.parentID) - const session = yield* result.create({ + const child = yield* result.create({ agent: input.agent, model: input.model, parentID: input.parentID, @@ -294,11 +315,11 @@ export const layer = Layer.effect( }) yield* result.prompt({ prompt: input.prompt, - sessionID: session.id, + sessionID: child.id, }) yield* Effect.gen(function* () { - yield* result.wait(session.id) - const messages = yield* result.messages({ sessionID: session.id, order: "desc" }) + yield* result.wait(child.id) + const messages = yield* result.messages({ sessionID: child.id, order: "desc" }) const assistant = messages.find((msg) => msg.type === "assistant") if (!assistant) return const text = assistant.content.findLast((part) => part.type === "text") @@ -307,12 +328,12 @@ export const layer = Layer.effect( }), compact: Effect.fn("V2Session.compact")(function* (_sessionID) {}), wait: Effect.fn("V2Session.wait")(function* (_sessionID) {}), - } + }) - return Service.of(result) + return result }), ) -export const defaultLayer = layer.pipe(Layer.provide(SyncEvent.defaultLayer)) +export const defaultLayer = layer.pipe(Layer.provide(EventV2Bridge.defaultLayer)) export * as SessionV2 from "./session" diff --git a/packages/opencode/src/worktree/index.ts b/packages/opencode/src/worktree/index.ts index 439f36e0a9ad..8f7910208096 100644 --- a/packages/opencode/src/worktree/index.ts +++ b/packages/opencode/src/worktree/index.ts @@ -1,5 +1,3 @@ -import z from "zod" -import { NamedError } from "@opencode-ai/core/util/error" import { Global } from "@opencode-ai/core/global" import { InstanceLayer } from "@/project/instance-layer" import { InstanceStore } from "@/project/instance-store" @@ -14,12 +12,12 @@ import { errorMessage } from "../util/error" import { BusEvent } from "@/bus/bus-event" import { GlobalBus } from "@/bus/global" import { Git } from "@/git" -import { Effect, Layer, Path, Schema, Scope, Context, Stream } from "effect" -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" +import { Effect, Layer, Path, Schema, Scope, Context } from "effect" +import { ChildProcess } from "effect/unstable/process" import { NodePath } from "@effect/platform-node" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { BootstrapRuntime } from "@/effect/bootstrap-runtime" -import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppProcess } from "@opencode-ai/core/process" import { InstanceState } from "@/effect/instance-state" const log = Log.create({ service: "worktree" }) @@ -65,54 +63,48 @@ export const ResetInput = Schema.Struct({ }).annotate({ identifier: "WorktreeResetInput" }) export type ResetInput = Schema.Schema.Type -export const NotGitError = NamedError.create( - "WorktreeNotGitError", - z.object({ - message: z.string(), - }), -) +export class NotGitError extends Schema.TaggedErrorClass()("WorktreeNotGitError", { + message: Schema.String, +}) {} -export const NameGenerationFailedError = NamedError.create( +export class NameGenerationFailedError extends Schema.TaggedErrorClass()( "WorktreeNameGenerationFailedError", - z.object({ - message: z.string(), - }), -) + { + message: Schema.String, + }, +) {} -export const CreateFailedError = NamedError.create( - "WorktreeCreateFailedError", - z.object({ - message: z.string(), - }), -) +export class CreateFailedError extends Schema.TaggedErrorClass()("WorktreeCreateFailedError", { + message: Schema.String, +}) {} -export const StartCommandFailedError = NamedError.create( +export class StartCommandFailedError extends Schema.TaggedErrorClass()( "WorktreeStartCommandFailedError", - z.object({ - message: z.string(), - }), -) - -export const RemoveFailedError = NamedError.create( - "WorktreeRemoveFailedError", - z.object({ - message: z.string(), - }), -) - -export const ResetFailedError = NamedError.create( - "WorktreeResetFailedError", - z.object({ - message: z.string(), - }), -) - -export const ListFailedError = NamedError.create( - "WorktreeListFailedError", - z.object({ - message: z.string(), - }), -) + { + message: Schema.String, + }, +) {} + +export class RemoveFailedError extends Schema.TaggedErrorClass()("WorktreeRemoveFailedError", { + message: Schema.String, +}) {} + +export class ResetFailedError extends Schema.TaggedErrorClass()("WorktreeResetFailedError", { + message: Schema.String, +}) {} + +export class ListFailedError extends Schema.TaggedErrorClass()("WorktreeListFailedError", { + message: Schema.String, +}) {} + +export type Error = + | NotGitError + | NameGenerationFailedError + | CreateFailedError + | StartCommandFailedError + | RemoveFailedError + | ResetFailedError + | ListFailedError function slugify(input: string) { return input @@ -143,12 +135,12 @@ function failedRemoves(...chunks: string[]) { // --------------------------------------------------------------------------- export interface Interface { - readonly makeWorktreeInfo: (options?: { name?: string; detached?: boolean }) => Effect.Effect - readonly createFromInfo: (info: Info, startCommand?: string) => Effect.Effect - readonly create: (input?: CreateInput) => Effect.Effect - readonly list: () => Effect.Effect<(Omit & { branch?: string })[]> - readonly remove: (input: RemoveInput) => Effect.Effect - readonly reset: (input: ResetInput) => Effect.Effect + readonly makeWorktreeInfo: (options?: { name?: string; detached?: boolean }) => Effect.Effect + readonly createFromInfo: (info: Info, startCommand?: string) => Effect.Effect + readonly create: (input?: CreateInput) => Effect.Effect + readonly list: () => Effect.Effect<(Omit & { branch?: string })[], Error> + readonly remove: (input: RemoveInput) => Effect.Effect + readonly reset: (input: ResetInput) => Effect.Effect } export class Service extends Context.Service()("@opencode/Worktree") {} @@ -158,38 +150,35 @@ type GitResult = { code: number; text: string; stderr: string } export const layer: Layer.Layer< Service, never, - | AppFileSystem.Service - | Path.Path - | ChildProcessSpawner.ChildProcessSpawner - | Git.Service - | Project.Service - | InstanceStore.Service + AppFileSystem.Service | Path.Path | AppProcess.Service | Git.Service | Project.Service | InstanceStore.Service > = Layer.effect( Service, Effect.gen(function* () { const scope = yield* Scope.Scope const fs = yield* AppFileSystem.Service const pathSvc = yield* Path.Path - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner + const appProcess = yield* AppProcess.Service const gitSvc = yield* Git.Service const project = yield* Project.Service const store = yield* InstanceStore.Service const git = Effect.fnUntraced( function* (args: string[], opts?: { cwd?: string }) { - const handle = yield* spawner.spawn( + const result = yield* appProcess.run( ChildProcess.make("git", args, { cwd: opts?.cwd, extendEnv: true, stdin: "ignore" }), ) - const [text, stderr] = yield* Effect.all( - [Stream.mkString(Stream.decodeText(handle.stdout)), Stream.mkString(Stream.decodeText(handle.stderr))], - { concurrency: 2 }, - ) - const code = yield* handle.exitCode - return { code, text, stderr } satisfies GitResult + return { + code: result.exitCode, + text: result.stdout.toString("utf8"), + stderr: result.stderr.toString("utf8"), + } satisfies GitResult }, - Effect.scoped, Effect.catch((e) => - Effect.succeed({ code: 1, text: "", stderr: e instanceof Error ? e.message : String(e) } satisfies GitResult), + Effect.succeed({ + code: 1, + text: "", + stderr: e instanceof Error ? e.message : String(e), + } satisfies GitResult), ), ) @@ -215,7 +204,7 @@ export const layer: Layer.Layer< return { name, directory, ...(branch ? { branch } : {}) } } - throw new NameGenerationFailedError({ message: "Failed to generate a unique worktree name" }) + return yield* new NameGenerationFailedError({ message: "Failed to generate a unique worktree name" }) }) const makeWorktreeInfo = Effect.fn("Worktree.makeWorktreeInfo")(function* (input?: { @@ -224,7 +213,7 @@ export const layer: Layer.Layer< }) { const ctx = yield* InstanceState.context if (ctx.project.vcs !== "git") { - throw new NotGitError({ message: "Worktrees are only supported for git projects" }) + return yield* new NotGitError({ message: "Worktrees are only supported for git projects" }) } const root = pathSvc.join(Global.Path.data, "worktree", ctx.project.id) @@ -242,7 +231,9 @@ export const layer: Layer.Layer< { cwd: ctx.worktree }, ) if (created.code !== 0) { - throw new CreateFailedError({ message: created.stderr || created.text || "Failed to create git worktree" }) + return yield* new CreateFailedError({ + message: created.stderr || created.text || "Failed to create git worktree", + }) } yield* project.addSandbox(ctx.project.id, info.directory).pipe(Effect.catch(() => Effect.void)) @@ -358,7 +349,7 @@ export const layer: Layer.Layer< const result = yield* git(["worktree", "list", "--porcelain"], { cwd: ctx.worktree }) if (result.code !== 0) { - throw new ListFailedError({ message: result.stderr || result.text || "Failed to read git worktrees" }) + return yield* new ListFailedError({ message: result.stderr || result.text || "Failed to read git worktrees" }) } const primary = yield* canonical(ctx.worktree) @@ -386,27 +377,27 @@ export const layer: Layer.Layer< } function cleanDirectory(target: string) { - return Effect.promise(() => - import("fs/promises") - .then((fsp) => fsp.rm(target, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 })) - .catch((error) => { - const message = errorMessage(error) - throw new RemoveFailedError({ message: message || "Failed to remove git worktree directory" }) - }), - ) + return Effect.tryPromise({ + try: () => + import("fs/promises").then((fsp) => + fsp.rm(target, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }), + ), + catch: (error) => + new RemoveFailedError({ message: errorMessage(error) || "Failed to remove git worktree directory" }), + }) } const remove = Effect.fn("Worktree.remove")(function* (input: RemoveInput) { const ctx = yield* InstanceState.context if (ctx.project.vcs !== "git") { - throw new NotGitError({ message: "Worktrees are only supported for git projects" }) + return yield* new NotGitError({ message: "Worktrees are only supported for git projects" }) } const directory = yield* canonical(input.directory) const list = yield* git(["worktree", "list", "--porcelain"], { cwd: ctx.worktree }) if (list.code !== 0) { - throw new RemoveFailedError({ message: list.stderr || list.text || "Failed to read git worktrees" }) + return yield* new RemoveFailedError({ message: list.stderr || list.text || "Failed to read git worktrees" }) } const entries = parseWorktreeList(list.text) @@ -426,14 +417,16 @@ export const layer: Layer.Layer< if (removed.code !== 0) { const next = yield* git(["worktree", "list", "--porcelain"], { cwd: ctx.worktree }) if (next.code !== 0) { - throw new RemoveFailedError({ + return yield* new RemoveFailedError({ message: removed.stderr || removed.text || next.stderr || next.text || "Failed to remove git worktree", }) } const stale = yield* locateWorktree(parseWorktreeList(next.text), directory) if (stale?.path) { - throw new RemoveFailedError({ message: removed.stderr || removed.text || "Failed to remove git worktree" }) + return yield* new RemoveFailedError({ + message: removed.stderr || removed.text || "Failed to remove git worktree", + }) } } @@ -443,7 +436,7 @@ export const layer: Layer.Layer< if (branch) { const deleted = yield* git(["branch", "-D", branch], { cwd: ctx.worktree }) if (deleted.code !== 0) { - throw new RemoveFailedError({ + return yield* new RemoveFailedError({ message: deleted.stderr || deleted.text || "Failed to delete worktree branch", }) } @@ -458,25 +451,18 @@ export const layer: Layer.Layer< error: (r: GitResult) => Error, ) { const result = yield* git(args, opts) - if (result.code !== 0) throw error(result) + if (result.code !== 0) return yield* error(result) return result }) const runStartCommand = Effect.fnUntraced( function* (directory: string, cmd: string) { const [shell, args] = process.platform === "win32" ? ["cmd", ["/c", cmd]] : ["bash", ["-lc", cmd]] - const handle = yield* spawner.spawn( - ChildProcess.make(shell, args, { cwd: directory, extendEnv: true, stdin: "ignore" }), + const result = yield* appProcess.run( + ChildProcess.make(shell, args as string[], { cwd: directory, extendEnv: true, stdin: "ignore" }), ) - // Drain stdout, capture stderr for error reporting - const [, stderr] = yield* Effect.all( - [Stream.runDrain(handle.stdout), Stream.mkString(Stream.decodeText(handle.stderr))], - { concurrency: 2 }, - ).pipe(Effect.orDie) - const code = yield* handle.exitCode - return { code, stderr } + return { code: result.exitCode, stderr: result.stderr.toString("utf8") } }, - Effect.scoped, Effect.catch(() => Effect.succeed({ code: 1, stderr: "" })), ) @@ -533,30 +519,30 @@ export const layer: Layer.Layer< const reset = Effect.fn("Worktree.reset")(function* (input: ResetInput) { const ctx = yield* InstanceState.context if (ctx.project.vcs !== "git") { - throw new NotGitError({ message: "Worktrees are only supported for git projects" }) + return yield* new NotGitError({ message: "Worktrees are only supported for git projects" }) } const directory = yield* canonical(input.directory) const primary = yield* canonical(ctx.worktree) if (directory === primary) { - throw new ResetFailedError({ message: "Cannot reset the primary workspace" }) + return yield* new ResetFailedError({ message: "Cannot reset the primary workspace" }) } const list = yield* git(["worktree", "list", "--porcelain"], { cwd: ctx.worktree }) if (list.code !== 0) { - throw new ResetFailedError({ message: list.stderr || list.text || "Failed to read git worktrees" }) + return yield* new ResetFailedError({ message: list.stderr || list.text || "Failed to read git worktrees" }) } const entry = yield* locateWorktree(parseWorktreeList(list.text), directory) if (!entry?.path) { - throw new ResetFailedError({ message: "Worktree not found" }) + return yield* new ResetFailedError({ message: "Worktree not found" }) } const worktreePath = entry.path const base = yield* gitSvc.defaultBranch(ctx.worktree) if (!base) { - throw new ResetFailedError({ message: "Default branch not found" }) + return yield* new ResetFailedError({ message: "Default branch not found" }) } const sep = base.ref.indexOf("/") @@ -578,7 +564,9 @@ export const layer: Layer.Layer< const cleanResult = yield* sweep(worktreePath) if (cleanResult.code !== 0) { - throw new ResetFailedError({ message: cleanResult.stderr || cleanResult.text || "Failed to clean worktree" }) + return yield* new ResetFailedError({ + message: cleanResult.stderr || cleanResult.text || "Failed to clean worktree", + }) } yield* gitExpect( @@ -601,11 +589,11 @@ export const layer: Layer.Layer< const status = yield* git(["-c", "core.fsmonitor=false", "status", "--porcelain=v1"], { cwd: worktreePath }) if (status.code !== 0) { - throw new ResetFailedError({ message: status.stderr || status.text || "Failed to read git status" }) + return yield* new ResetFailedError({ message: status.stderr || status.text || "Failed to read git status" }) } if (status.text.trim()) { - throw new ResetFailedError({ message: `Worktree reset left local changes:\n${status.text.trim()}` }) + return yield* new ResetFailedError({ message: `Worktree reset left local changes:\n${status.text.trim()}` }) } yield* runStartScripts(worktreePath, { projectID: ctx.project.id }).pipe( @@ -622,7 +610,7 @@ export const layer: Layer.Layer< export const appLayer = layer.pipe( Layer.provide(Git.defaultLayer), - Layer.provide(CrossSpawnSpawner.defaultLayer), + Layer.provide(AppProcess.defaultLayer), Layer.provide(Project.defaultLayer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(NodePath.layer), diff --git a/packages/opencode/test/AGENTS.md b/packages/opencode/test/AGENTS.md index 52bd6ee98ec8..bff1ff5dde0c 100644 --- a/packages/opencode/test/AGENTS.md +++ b/packages/opencode/test/AGENTS.md @@ -157,3 +157,48 @@ const failingAccountLayer = Layer.mock(Account.Service, { ``` This is much shorter than stubbing every method with `Effect.void` / `Effect.succeed(...)` placeholders, and it keeps the test focused on the behaviour under test. + +## Synchronizing With Concurrent Work + +### The Anti-Pattern + +Using `Effect.sleep(N)` or `setTimeout` as a "wait for the forked fiber to be ready" hack races the scheduler. The forked fiber may not have reached the synchronization point within `N` ms on a slow CI host, and the test fails intermittently. See PR #27622 for a concrete flake that fell out of this exact pattern. + +### The Fix + +Wait on a **published readiness signal**, not wall-clock time. Available affordances: + +- `pollWithTimeout(effect, message, duration?)` from `test/lib/effect.ts` — repeatedly run a predicate effect until it returns a non-`undefined` value, with a timeout. +- `awaitWithTimeout(effect, message, duration?)` from `test/lib/effect.ts` — wrap any effect with `Effect.timeoutOrElse` and a custom error message. +- `llm.wait(n)` from `test/lib/llm-server.ts` — wait until the mock LLM has received `n` HTTP calls. +- `SessionStatus.Service` `.get(sessionID)` — observable per-session state (`{ type: "busy" | "idle" | ... }`). +- `BackgroundJob.wait({ id, timeout })` from `src/background/job.ts` — wait for a background job to complete. +- Bus subscriptions — fork `Stream.runForEach(bus.subscribe(Event), ...)` and open a `Latch` inside the callback to signal first-event readiness. +- `Deferred.await(deferred).pipe(Effect.timeoutOrElse(...))` for one-shot signals. + +### Example + +```ts +// Antipattern — race +yield * prompt.shell({ command: "sleep 30" }).pipe(Effect.forkChild) +yield * Effect.sleep(50) +yield * prompt.cancel(chat.id) + +// Fix — wait for a published readiness signal +yield * prompt.shell({ command: "sleep 30" }).pipe(Effect.forkChild) +yield * + pollWithTimeout( + Effect.gen(function* () { + const s = yield* (yield* SessionStatus.Service).get(chat.id) + return s.type === "busy" ? (true as const) : undefined + }), + "session never became busy", + ) +yield * prompt.cancel(chat.id) +``` + +### When Fixed Sleeps Are OK + +- Testing debounce or throttle behavior, where the sleep **is** the test. +- Letting real wall-clock advance past a genuine timestamp resolution boundary (e.g. mtime granularity). +- Simulating network latency in race-regression tests that intentionally exercise ordering. diff --git a/packages/opencode/test/EFFECT_TEST_MIGRATION.md b/packages/opencode/test/EFFECT_TEST_MIGRATION.md new file mode 100644 index 000000000000..73acea91489d --- /dev/null +++ b/packages/opencode/test/EFFECT_TEST_MIGRATION.md @@ -0,0 +1,169 @@ +# Effect Test Migration + +Move tests that exercise Effect services out of Promise-land and into the +shared `testEffect` pattern. + +This file is guidance, not a live inventory. Before claiming a migration, +search current `dev` for the exact anti-pattern and update any PR notes +with what you actually changed. + +## Target Pattern + +Every Effect service test should have one local runner near the top: + +```ts +const it = testEffect(layer) +``` + +Use the runner method that matches the behavior: + +```ts +it.effect("pure service behavior", () => + Effect.gen(function* () { + const service = yield* SomeService.Service + expect(yield* service.run()).toEqual("ok") + }), +) + +it.instance("instance-local behavior", () => + Effect.gen(function* () { + const test = yield* TestInstance + expect(test.directory).toContain("opencode-test-") + }), +) + +it.live("live filesystem or process behavior", () => + Effect.gen(function* () { + const dir = yield* tmpdirScoped() + // real clock / fs / git / process work + }), +) +``` + +## Choosing The Runner + +- `it.effect(...)` — pure Effect behavior with `TestClock` and + `TestConsole`. +- `it.instance(...)` — service behavior that needs one scoped opencode + instance. +- `it.live(...)` — real time, filesystem mtimes, child processes, git, + locks, servers, watchers, or OS behavior. + +Most integration-style tests use `it.live(...)` or `it.instance(...)`. + +## Layer Rules + +Compose tests from open service layers when a dependency needs replacing. +Do not use a closed `defaultLayer` and then try to override an inner +dependency after it has already been provided. + +Prefer small reusable fake boundary layers in `test/fake/*`: + +```ts +AuthTest.empty +AccountTest.empty +NpmTest.noop +SkillTest.empty +ProviderTest.fake().layer +``` + +Use `Layer.mock` for partial service stubs. Missing methods should fail +loudly if the test accidentally calls them. + +Do not add generic test-layer builders until repeated local compositions +prove the need. + +## Fixture Rules + +Use Effect-aware fixtures from `test/fixture/fixture.ts`: + +- `TestInstance` inside `it.instance(...)` for the current temp instance. +- `tmpdirScoped(...)` inside `Effect.gen` for extra temp directories. +- `provideInstance(dir)(effect)` when one test needs to switch instance + context. +- `provideTmpdirInstance((dir) => effect, options)` when a live test needs + custom instance setup or multiple instance scopes. +- `disposeAllInstances()` in `afterEach` only for integration tests that + intentionally touch shared instance registries. + +Avoid mutable global setup. If a global mutation is unavoidable during a +migration, scope it with acquire/release and treat it as temporary. + +Long term, tests should not toggle `process.env`, `Global.Path`, or +mutable flags when behavior can be modeled with services. Prefer layers +such as `RuntimeFlags.layer(...)` or focused fake services. + +## Anti-Patterns To Remove + +- `test(..., async () => Effect.runPromise(...))` +- local `run(...)`, `load(...)`, `svc(...)`, or `runtime.runPromise(...)` + wrappers that only provide a layer +- `tmpdir()` plus legacy instance provision in Promise test bodies +- custom `ManagedRuntime.make(...)` in test files +- Promise `try/catch` around Effect failures +- `Promise.withResolvers`, `Bun.sleep`, or `setTimeout` for synchronization + when events, `Deferred`, fibers, or deterministic state checks fit +- mutable env/global/flag changes after layers are built + +Promise helpers are acceptable at non-Effect boundaries, but yield them from +inside an Effect body with `Effect.promise(...)` rather than making them the +test harness. + +## Conversion Recipe + +1. Identify the real service under test and whether its open `layer` or + closed `defaultLayer` is appropriate. +2. Build one top-level `layer` with real dependencies where relevant and + fake layers at slow or external boundaries. +3. Replace local Promise wrappers with Effect helpers. +4. Convert `test(..., async () => { ... })` to `it.effect`, `it.instance`, + or `it.live`. +5. Move `await` calls inside `Effect.gen` as `yield*` calls. +6. Replace `await using tmp = await tmpdir(...)` with + `yield* tmpdirScoped(...)` when the temp directory lives inside the + Effect test. +7. Replace Promise failure assertions with `Effect.exit`, `Effect.flip`, or + focused assertion helpers. +8. Preserve concurrency with fibers, `Deferred`, and + `Effect.all(..., { concurrency: "unbounded" })`; do not accidentally + serialize formerly parallel behavior. +9. Run the focused test file and `bun typecheck` from `packages/opencode`. + +## Good Examples + +Use current examples as patterns, but re-check them before copying because +test migrations are active: + +- `test/effect/instance-state.test.ts` — scoped directories, instance + switching, disposal, and concurrency. +- `test/bus/bus-effect.test.ts` — `Deferred`, streams, scoped fibers. +- `test/agent/plugin-agent-regression.test.ts` — real service layers plus + fake boundary layers. +- `test/account/service.test.ts` — service-level live tests, typed errors, + fake HTTP clients. + +## Migration Queue Policy + +Do not maintain a long file checklist here. It goes stale quickly. + +When looking for the next target, search for current anti-patterns: + +```bash +git grep -n "Effect.runPromise\|ManagedRuntime\|Promise.withResolvers\|Bun.sleep\|WithInstance" -- packages/opencode/test +``` + +Then choose one file or one small cluster, keep the PR focused, and mention +the focused verification in the PR body. + +## Rough Edges To Watch + +- Failure assertions against `Exit` / `Cause` can get verbose. Add helpers + only after the same shape repeats across multiple files. +- Some tests still need `Effect.promise(...)` around Node/Bun APIs. Prefer + Effect platform services when the surrounding code already uses them, but + do not block useful migrations on perfect abstraction. +- Layer composition can be noisy when a test needs real service subtrees plus + fake boundaries. Extract small `test/fake/*` layers before inventing + larger builders. +- Concurrency tests can get harder to read after replacing Promise + resolvers. Look for repeated patterns that deserve named helpers. diff --git a/packages/opencode/test/acp/event-subscription.test.ts b/packages/opencode/test/acp/event-subscription.test.ts index 791b5c578fab..a01680e30596 100644 --- a/packages/opencode/test/acp/event-subscription.test.ts +++ b/packages/opencode/test/acp/event-subscription.test.ts @@ -8,8 +8,23 @@ import type { ToolStatePending, ToolStateRunning, } from "@opencode-ai/sdk/v2" -import { WithInstance } from "../../src/project/with-instance" -import { tmpdir } from "../fixture/fixture" +import { provideTestInstance, tmpdir } from "../fixture/fixture" + +const pollUntil = async ( + check: () => T | undefined | false | Promise, + message: string, + opts?: { timeoutMs?: number; intervalMs?: number }, +): Promise => { + const timeoutMs = opts?.timeoutMs ?? 2000 + const intervalMs = opts?.intervalMs ?? 5 + const started = Date.now() + while (true) { + const v = await check() + if (v !== undefined && v !== null && v !== false) return v as T + if (Date.now() - started > timeoutMs) throw new Error(message) + await new Promise((r) => setTimeout(r, intervalMs)) + } +} type SessionUpdateParams = Parameters[0] type RequestPermissionParams = Parameters[0] @@ -317,7 +332,7 @@ function createFakeAgent() { describe("acp.agent event subscription", () => { test("routes message.part.delta by the event sessionID (no cross-session pollution)", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, updates, stop } = createFakeAgent() @@ -340,7 +355,10 @@ describe("acp.agent event subscription", () => { }, } as any) - await new Promise((r) => setTimeout(r, 10)) + await pollUntil( + () => (updates.get(sessionB) ?? []).includes("agent_message_chunk"), + "sessionB never received agent_message_chunk", + ) expect((updates.get(sessionA) ?? []).includes("agent_message_chunk")).toBe(false) expect((updates.get(sessionB) ?? []).includes("agent_message_chunk")).toBe(true) @@ -352,7 +370,7 @@ describe("acp.agent event subscription", () => { test("does not emit user_message_chunk for live prompt parts", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, sessionUpdates, stop } = createFakeAgent() @@ -377,7 +395,25 @@ describe("acp.agent event subscription", () => { }, } as any) - await new Promise((r) => setTimeout(r, 20)) + controller.push({ + directory: cwd, + payload: { + type: "message.part.delta", + properties: { + sessionID: sessionId, + messageID: "msg_marker", + partID: "msg_marker_part", + field: "text", + delta: "marker", + }, + }, + } as any) + + await pollUntil( + () => + sessionUpdates.some((u) => u.sessionId === sessionId && u.update.sessionUpdate === "agent_message_chunk"), + "marker event was never processed", + ) expect( sessionUpdates @@ -392,7 +428,7 @@ describe("acp.agent event subscription", () => { test("keeps concurrent sessions isolated when message.part.delta events are interleaved", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, chunks, stop } = createFakeAgent() @@ -427,7 +463,12 @@ describe("acp.agent event subscription", () => { push(sessionA, "msg_a", tokenA[2]) push(sessionB, "msg_b", tokenB[2]) - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => + (chunks.get(sessionA) ?? "").includes(tokenA.join("")) && + (chunks.get(sessionB) ?? "").includes(tokenB.join("")), + "interleaved chunks never fully arrived", + ) const a = chunks.get(sessionA) ?? "" const b = chunks.get(sessionB) ?? "" @@ -444,7 +485,7 @@ describe("acp.agent event subscription", () => { test("does not create additional event subscriptions on repeated loadSession()", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, calls, stop } = createFakeAgent() @@ -466,7 +507,7 @@ describe("acp.agent event subscription", () => { test("permission.asked events are handled and replied", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const permissionReplies: string[] = [] @@ -494,7 +535,7 @@ describe("acp.agent event subscription", () => { }, } as any) - await new Promise((r) => setTimeout(r, 20)) + await pollUntil(() => permissionReplies.includes("perm_1"), "perm_1 was never replied") expect(permissionReplies).toContain("perm_1") @@ -505,7 +546,7 @@ describe("acp.agent event subscription", () => { test("permission prompt on session A does not block message updates for session B", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const permissionReplies: string[] = [] @@ -553,10 +594,8 @@ describe("acp.agent event subscription", () => { }, } as any) - // Give time for permission handling to start - await new Promise((r) => setTimeout(r, 10)) + await pollUntil(() => _permissionCalls > 0, "permission handling for A never started") - // Push message for session B while A's permission is pending controller.push({ directory: cwd, payload: { @@ -571,18 +610,17 @@ describe("acp.agent event subscription", () => { }, } as any) - // Wait for session B's message to be processed - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => (chunks.get(sessionB) ?? "").includes("session_b_message"), + "session B never received its message", + ) - // Session B should have received message even though A's permission is still pending expect(chunks.get(sessionB) ?? "").toContain("session_b_message") expect(permissionReplies).not.toContain("perm_a") - // Release session A's permission resolvePermissionA!() - await new Promise((r) => setTimeout(r, 20)) + await pollUntil(() => permissionReplies.includes("perm_a"), "perm_a was never replied after release") - // Now session A's permission should be replied expect(permissionReplies).toContain("perm_a") stop() @@ -592,7 +630,7 @@ describe("acp.agent event subscription", () => { test("streams running bash output snapshots and de-dupes identical snapshots", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, sessionUpdates, stop } = createFakeAgent() @@ -611,7 +649,15 @@ describe("acp.agent event subscription", () => { }), ) } - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => + sessionUpdates + .filter((u) => u.sessionId === sessionId) + .filter((u) => isToolCallUpdate(u.update)) + .map((u) => inProgressText(u.update)) + .filter((t) => t === "ab").length > 0, + "final bash snapshot 'ab' never arrived", + ) const snapshots = sessionUpdates .filter((u) => u.sessionId === sessionId) @@ -626,7 +672,7 @@ describe("acp.agent event subscription", () => { test("emits synthetic pending before first running update for any tool", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, sessionUpdates, stop } = createFakeAgent() @@ -650,7 +696,14 @@ describe("acp.agent event subscription", () => { input: { filePath: "/tmp/example.txt" }, }), ) - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => + sessionUpdates + .filter((u) => u.sessionId === sessionId) + .map((u) => u.update.sessionUpdate) + .filter((u) => u === "tool_call" || u === "tool_call_update").length >= 4, + "expected 4 tool_call/tool_call_update events", + ) const types = sessionUpdates .filter((u) => u.sessionId === sessionId) @@ -671,7 +724,7 @@ describe("acp.agent event subscription", () => { test("emits image attachments as ACP tool content blocks on live completed tool updates", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, sessionUpdates, stop } = createFakeAgent() @@ -707,7 +760,10 @@ describe("acp.agent event subscription", () => { ], }), ) - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => completedToolUpdate(sessionUpdates, sessionId, "call_image"), + "completed tool update for call_image never arrived", + ) const update = completedToolUpdate(sessionUpdates, sessionId, "call_image") expect(update?.content).toContainEqual({ @@ -728,7 +784,7 @@ describe("acp.agent event subscription", () => { test("replays completed tool image attachments as ACP tool content blocks", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, sessionUpdates, stop, sdk } = createFakeAgent() @@ -795,7 +851,7 @@ describe("acp.agent event subscription", () => { test("does not emit duplicate synthetic pending after replayed running tool", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, sessionUpdates, stop, sdk } = createFakeAgent() @@ -837,7 +893,16 @@ describe("acp.agent event subscription", () => { metadata: { output: "hi\nthere\n" }, }), ) - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => + sessionUpdates + .filter((u) => u.sessionId === sessionId) + .map((u) => u.update) + .filter((u) => "toolCallId" in u && u.toolCallId === "call_1") + .map((u) => u.sessionUpdate) + .filter((u) => u === "tool_call" || u === "tool_call_update").length >= 3, + "expected 3 tool events for call_1", + ) const types = sessionUpdates .filter((u) => u.sessionId === sessionId) @@ -854,7 +919,7 @@ describe("acp.agent event subscription", () => { test("clears bash snapshot marker on pending state", async () => { await using tmp = await tmpdir() - await WithInstance.provide({ + await provideTestInstance({ directory: tmp.path, fn: async () => { const { agent, controller, sessionUpdates, stop } = createFakeAgent() @@ -889,7 +954,15 @@ describe("acp.agent event subscription", () => { metadata: { output: "a" }, }), ) - await new Promise((r) => setTimeout(r, 20)) + await pollUntil( + () => + sessionUpdates + .filter((u) => u.sessionId === sessionId) + .filter((u) => isToolCallUpdate(u.update)) + .map((u) => inProgressText(u.update)) + .filter((t) => t === "a").length >= 2, + "expected two 'a' bash snapshots after pending reset", + ) const snapshots = sessionUpdates .filter((u) => u.sessionId === sessionId) diff --git a/packages/opencode/test/agent/agent.test.ts b/packages/opencode/test/agent/agent.test.ts index df68fdfdc63d..e0defc138644 100644 --- a/packages/opencode/test/agent/agent.test.ts +++ b/packages/opencode/test/agent/agent.test.ts @@ -1,12 +1,31 @@ -import { afterEach, test, expect } from "bun:test" -import { Effect } from "effect" +import { afterEach, expect } from "bun:test" +import { Cause, Effect, Exit, Layer } from "effect" import path from "path" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" -import { WithInstance } from "../../src/project/with-instance" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" import { Agent } from "../../src/agent/agent" +import { Auth } from "../../src/auth" +import { Config } from "../../src/config/config" +import { RuntimeFlags } from "../../src/effect/runtime-flags" import { Global } from "@opencode-ai/core/global" -import { Flag } from "@opencode-ai/core/flag/flag" import { Permission } from "../../src/permission" +import { Plugin } from "../../src/plugin" +import { Provider } from "../../src/provider/provider" +import { Skill } from "../../src/skill" +import { Truncate } from "../../src/tool/truncate" + +const agentLayer = (flags: Partial = {}) => + Agent.layer.pipe( + Layer.provide(Plugin.defaultLayer), + Layer.provide(Provider.defaultLayer), + Layer.provide(Auth.defaultLayer), + Layer.provide(Config.defaultLayer), + Layer.provide(Skill.defaultLayer), + Layer.provide(RuntimeFlags.layer(flags)), + ) + +const it = testEffect(agentLayer()) +const scout = testEffect(agentLayer({ experimentalScout: true })) // Helper to evaluate permission for a tool with wildcard pattern function evalPerm(agent: Agent.Info | undefined, permission: string): Permission.Action | undefined { @@ -14,211 +33,155 @@ function evalPerm(agent: Agent.Info | undefined, permission: string): Permission return Permission.evaluate(permission, "*", agent.permission).action } -function load(dir: string, fn: (svc: Agent.Interface) => Effect.Effect) { - return Effect.runPromise(provideInstance(dir)(Agent.Service.use(fn)).pipe(Effect.provide(Agent.defaultLayer))) +function load(fn: (svc: Agent.Interface) => Effect.Effect) { + return Agent.Service.use(fn) } -async function withExperimentalScout(enabled: boolean, fn: () => Promise) { - const original = Flag.OPENCODE_EXPERIMENTAL_SCOUT - Flag.OPENCODE_EXPERIMENTAL_SCOUT = enabled - try { - await fn() - } finally { - Flag.OPENCODE_EXPERIMENTAL_SCOUT = original - } -} +const expectDefaultAgentError = Effect.fn("AgentTest.expectDefaultAgentError")(function* (message: string) { + const exit = yield* load((svc) => svc.defaultAgent()).pipe(Effect.exit) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) expect(Cause.pretty(exit.cause)).toContain(message) +}) afterEach(async () => { await disposeAllInstances() }) -test("returns default native agents when no config", async () => { - await withExperimentalScout(false, async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agents = await load(tmp.path, (svc) => svc.list()) - const names = agents.map((a) => a.name) - expect(names).toContain("build") - expect(names).toContain("plan") - expect(names).toContain("general") - expect(names).toContain("explore") - expect(names).not.toContain("scout") - expect(names).toContain("compaction") - expect(names).toContain("title") - expect(names).toContain("summary") - }, - }) - }) -}) - -test("build agent has correct default properties", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build).toBeDefined() - expect(build?.mode).toBe("primary") - expect(build?.native).toBe(true) - expect(evalPerm(build, "edit")).toBe("allow") - expect(evalPerm(build, "bash")).toBe("allow") - expect(evalPerm(build, "repo_clone")).toBe("deny") - expect(evalPerm(build, "repo_overview")).toBe("deny") - }, - }) -}) - -test("plan agent denies edits except .opencode/plans/*", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const plan = await load(tmp.path, (svc) => svc.get("plan")) - expect(plan).toBeDefined() - // Wildcard is denied - expect(evalPerm(plan, "edit")).toBe("deny") - // But specific path is allowed - expect(Permission.evaluate("edit", ".opencode/plans/foo.md", plan!.permission).action).toBe("allow") - }, - }) -}) - -test("explore agent denies edit and write", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const explore = await load(tmp.path, (svc) => svc.get("explore")) - expect(explore).toBeDefined() - expect(explore?.mode).toBe("subagent") - expect(evalPerm(explore, "edit")).toBe("deny") - expect(evalPerm(explore, "write")).toBe("deny") - expect(evalPerm(explore, "todowrite")).toBe("deny") - }, - }) -}) - -test("explore agent asks for external directories and allows whitelisted external paths", async () => { - const { Truncate } = await import("../../src/tool/truncate") - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const explore = await load(tmp.path, (svc) => svc.get("explore")) - expect(explore).toBeDefined() - expect(Permission.evaluate("external_directory", "/some/other/path", explore!.permission).action).toBe("ask") - expect(Permission.evaluate("external_directory", Truncate.GLOB, explore!.permission).action).toBe("allow") - expect( - Permission.evaluate("external_directory", path.join(Global.Path.tmp, "agent-work"), explore!.permission).action, - ).toBe("allow") - }, - }) -}) - -test("scout agent allows repo cloning and repo cache reads", async () => { - await withExperimentalScout(true, async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const scout = await load(tmp.path, (svc) => svc.get("scout")) - expect(scout).toBeDefined() - expect(scout?.mode).toBe("subagent") - expect(evalPerm(scout, "repo_clone")).toBe("allow") - expect(evalPerm(scout, "repo_overview")).toBe("allow") - expect(evalPerm(scout, "edit")).toBe("deny") - expect( - Permission.evaluate( - "external_directory", - path.join(Global.Path.repos, "github.com", "owner", "repo", "README.md"), - scout!.permission, - ).action, - ).toBe("allow") - }, - }) - }) -}) - -test("reference config does not create subagents", async () => { - await withExperimentalScout(true, async () => { - await using tmp = await tmpdir({ - config: { - reference: { - effect: "github.com/effect/effect-smol", - effectFull: { - repository: "Effect-TS/effect", - branch: "main", - }, - localdocs: "../docs", - localdocsFull: { - path: "../local-docs", - }, - }, - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agents = await load(tmp.path, (svc) => svc.list()) - const names = agents.map((agent) => agent.name) - expect(names).toContain("scout") - expect(names).not.toContain("effect") - expect(names).not.toContain("effectFull") - expect(names).not.toContain("localdocs") - expect(names).not.toContain("localdocsFull") - }, - }) - }) -}) - -test("general agent denies todo tools", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const general = await load(tmp.path, (svc) => svc.get("general")) - expect(general).toBeDefined() - expect(general?.mode).toBe("subagent") - expect(general?.hidden).toBeUndefined() - expect(evalPerm(general, "todowrite")).toBe("deny") - }, - }) -}) - -test("compaction agent denies all permissions", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const compaction = await load(tmp.path, (svc) => svc.get("compaction")) - expect(compaction).toBeDefined() - expect(compaction?.hidden).toBe(true) - expect(evalPerm(compaction, "bash")).toBe("deny") - expect(evalPerm(compaction, "edit")).toBe("deny") - expect(evalPerm(compaction, "read")).toBe("deny") - }, - }) -}) - -test("custom agent from config creates new agent", async () => { - await using tmp = await tmpdir({ +it.instance("returns default native agents when no config", () => + Effect.gen(function* () { + const agents = yield* load((svc) => svc.list()) + const names = agents.map((a) => a.name) + expect(names).toContain("build") + expect(names).toContain("plan") + expect(names).toContain("general") + expect(names).toContain("explore") + expect(names).not.toContain("scout") + expect(names).toContain("compaction") + expect(names).toContain("title") + expect(names).toContain("summary") + }), +) + +it.instance("build agent has correct default properties", () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build).toBeDefined() + expect(build?.mode).toBe("primary") + expect(build?.native).toBe(true) + expect(evalPerm(build, "edit")).toBe("allow") + expect(evalPerm(build, "bash")).toBe("allow") + expect(evalPerm(build, "repo_clone")).toBe("deny") + expect(evalPerm(build, "repo_overview")).toBe("deny") + }), +) + +it.instance("plan agent denies edits except .opencode/plans/*", () => + Effect.gen(function* () { + const plan = yield* load((svc) => svc.get("plan")) + expect(plan).toBeDefined() + // Wildcard is denied + expect(evalPerm(plan, "edit")).toBe("deny") + // But specific path is allowed + expect(Permission.evaluate("edit", ".opencode/plans/foo.md", plan!.permission).action).toBe("allow") + }), +) + +it.instance("explore agent denies edit and write", () => + Effect.gen(function* () { + const explore = yield* load((svc) => svc.get("explore")) + expect(explore).toBeDefined() + expect(explore?.mode).toBe("subagent") + expect(evalPerm(explore, "edit")).toBe("deny") + expect(evalPerm(explore, "write")).toBe("deny") + expect(evalPerm(explore, "todowrite")).toBe("deny") + }), +) + +it.instance("explore agent asks for external directories and allows whitelisted external paths", () => + Effect.gen(function* () { + const explore = yield* load((svc) => svc.get("explore")) + expect(explore).toBeDefined() + expect(Permission.evaluate("external_directory", "/some/other/path", explore!.permission).action).toBe("ask") + expect(Permission.evaluate("external_directory", Truncate.GLOB, explore!.permission).action).toBe("allow") + expect( + Permission.evaluate("external_directory", path.join(Global.Path.tmp, "agent-work"), explore!.permission).action, + ).toBe("allow") + }), +) + +scout.instance("scout agent allows repo cloning and repo cache reads", () => + Effect.gen(function* () { + const scout = yield* load((svc) => svc.get("scout")) + expect(scout).toBeDefined() + expect(scout?.mode).toBe("subagent") + expect(evalPerm(scout, "repo_clone")).toBe("allow") + expect(evalPerm(scout, "repo_overview")).toBe("allow") + expect(evalPerm(scout, "edit")).toBe("deny") + expect( + Permission.evaluate( + "external_directory", + path.join(Global.Path.repos, "github.com", "owner", "repo", "README.md"), + scout!.permission, + ).action, + ).toBe("allow") + }), +) + +scout.instance( + "reference config does not create subagents", + () => + Effect.gen(function* () { + const agents = yield* load((svc) => svc.list()) + const names = agents.map((agent) => agent.name) + expect(names).toContain("scout") + expect(names).not.toContain("effect") + expect(names).not.toContain("effectFull") + expect(names).not.toContain("localdocs") + expect(names).not.toContain("localdocsFull") + }), + { config: { - agent: { - my_custom_agent: { - model: "openai/gpt-4", - description: "My custom agent", - temperature: 0.5, - top_p: 0.9, + reference: { + effect: "github.com/effect/effect-smol", + effectFull: { + repository: "Effect-TS/effect", + branch: "main", + }, + localdocs: "../docs", + localdocsFull: { + path: "../local-docs", }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const custom = await load(tmp.path, (svc) => svc.get("my_custom_agent")) + }, +) + +it.instance("general agent denies todo tools", () => + Effect.gen(function* () { + const general = yield* load((svc) => svc.get("general")) + expect(general).toBeDefined() + expect(general?.mode).toBe("subagent") + expect(general?.hidden).toBeUndefined() + expect(evalPerm(general, "todowrite")).toBe("deny") + }), +) + +it.instance("compaction agent denies all permissions", () => + Effect.gen(function* () { + const compaction = yield* load((svc) => svc.get("compaction")) + expect(compaction).toBeDefined() + expect(compaction?.hidden).toBe(true) + expect(evalPerm(compaction, "bash")).toBe("deny") + expect(evalPerm(compaction, "edit")).toBe("deny") + expect(evalPerm(compaction, "read")).toBe("deny") + }), +) + +it.instance( + "custom agent from config creates new agent", + () => + Effect.gen(function* () { + const custom = yield* load((svc) => svc.get("my_custom_agent")) expect(custom).toBeDefined() expect(String(custom?.model?.providerID)).toBe("openai") expect(String(custom?.model?.modelID)).toBe("gpt-4") @@ -227,27 +190,26 @@ test("custom agent from config creates new agent", async () => { expect(custom?.topP).toBe(0.9) expect(custom?.native).toBe(false) expect(custom?.mode).toBe("all") - }, - }) -}) - -test("custom agent config overrides native agent properties", async () => { - await using tmp = await tmpdir({ + }), + { config: { agent: { - build: { - model: "anthropic/claude-3", - description: "Custom build agent", - temperature: 0.7, - color: "#FF0000", + my_custom_agent: { + model: "openai/gpt-4", + description: "My custom agent", + temperature: 0.5, + top_p: 0.9, }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) + }, +) + +it.instance( + "custom agent config overrides native agent properties", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) expect(build).toBeDefined() expect(String(build?.model?.providerID)).toBe("anthropic") expect(String(build?.model?.modelID)).toBe("claude-3") @@ -255,32 +217,52 @@ test("custom agent config overrides native agent properties", async () => { expect(build?.temperature).toBe(0.7) expect(build?.color).toBe("#FF0000") expect(build?.native).toBe(true) - }, - }) -}) - -test("agent disable removes agent from list", async () => { - await using tmp = await tmpdir({ + }), + { config: { agent: { - explore: { disable: true }, + build: { + model: "anthropic/claude-3", + description: "Custom build agent", + temperature: 0.7, + color: "#FF0000", + }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const explore = await load(tmp.path, (svc) => svc.get("explore")) + }, +) + +it.instance( + "agent disable removes agent from list", + () => + Effect.gen(function* () { + const explore = yield* load((svc) => svc.get("explore")) expect(explore).toBeUndefined() - const agents = await load(tmp.path, (svc) => svc.list()) + const agents = yield* load((svc) => svc.list()) const names = agents.map((a) => a.name) expect(names).not.toContain("explore") + }), + { + config: { + agent: { + explore: { disable: true }, + }, }, - }) -}) + }, +) -test("agent permission config merges with defaults", async () => { - await using tmp = await tmpdir({ +it.instance( + "agent permission config merges with defaults", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build).toBeDefined() + // Specific pattern is denied + expect(Permission.evaluate("bash", "rm -rf *", build!.permission).action).toBe("deny") + // Edit still allowed + expect(evalPerm(build, "edit")).toBe("allow") + }), + { config: { agent: { build: { @@ -292,111 +274,102 @@ test("agent permission config merges with defaults", async () => { }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build).toBeDefined() - // Specific pattern is denied - expect(Permission.evaluate("bash", "rm -rf *", build!.permission).action).toBe("deny") - // Edit still allowed - expect(evalPerm(build, "edit")).toBe("allow") - }, - }) -}) + }, +) -test("global permission config applies to all agents", async () => { - await using tmp = await tmpdir({ +it.instance( + "global permission config applies to all agents", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build).toBeDefined() + expect(evalPerm(build, "bash")).toBe("deny") + }), + { config: { permission: { bash: "deny", }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build).toBeDefined() - expect(evalPerm(build, "bash")).toBe("deny") - }, - }) -}) + }, +) -test("agent steps/maxSteps config sets steps property", async () => { - await using tmp = await tmpdir({ +it.instance( + "agent steps/maxSteps config sets steps property", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + const plan = yield* load((svc) => svc.get("plan")) + expect(build?.steps).toBe(50) + expect(plan?.steps).toBe(100) + }), + { config: { agent: { build: { steps: 50 }, plan: { maxSteps: 100 }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - const plan = await load(tmp.path, (svc) => svc.get("plan")) - expect(build?.steps).toBe(50) - expect(plan?.steps).toBe(100) - }, - }) -}) + }, +) -test("agent mode can be overridden", async () => { - await using tmp = await tmpdir({ +it.instance( + "agent mode can be overridden", + () => + Effect.gen(function* () { + const explore = yield* load((svc) => svc.get("explore")) + expect(explore?.mode).toBe("primary") + }), + { config: { agent: { explore: { mode: "primary" }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const explore = await load(tmp.path, (svc) => svc.get("explore")) - expect(explore?.mode).toBe("primary") - }, - }) -}) + }, +) -test("agent name can be overridden", async () => { - await using tmp = await tmpdir({ +it.instance( + "agent name can be overridden", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build?.name).toBe("Builder") + }), + { config: { agent: { build: { name: "Builder" }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build?.name).toBe("Builder") - }, - }) -}) + }, +) -test("agent prompt can be set from config", async () => { - await using tmp = await tmpdir({ +it.instance( + "agent prompt can be set from config", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build?.prompt).toBe("Custom system prompt") + }), + { config: { agent: { build: { prompt: "Custom system prompt" }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build?.prompt).toBe("Custom system prompt") - }, - }) -}) + }, +) -test("unknown agent properties are placed into options", async () => { - await using tmp = await tmpdir({ +it.instance( + "unknown agent properties are placed into options", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build?.options.random_property).toBe("hello") + expect(build?.options.another_random).toBe(123) + }), + { config: { agent: { build: { @@ -405,19 +378,18 @@ test("unknown agent properties are placed into options", async () => { }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build?.options.random_property).toBe("hello") - expect(build?.options.another_random).toBe(123) - }, - }) -}) + }, +) -test("agent options merge correctly", async () => { - await using tmp = await tmpdir({ +it.instance( + "agent options merge correctly", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(build?.options.custom_option).toBe(true) + expect(build?.options.another_option).toBe("value") + }), + { config: { agent: { build: { @@ -428,19 +400,21 @@ test("agent options merge correctly", async () => { }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(build?.options.custom_option).toBe(true) - expect(build?.options.another_option).toBe("value") - }, - }) -}) + }, +) -test("multiple custom agents can be defined", async () => { - await using tmp = await tmpdir({ +it.instance( + "multiple custom agents can be defined", + () => + Effect.gen(function* () { + const agentA = yield* load((svc) => svc.get("agent_a")) + const agentB = yield* load((svc) => svc.get("agent_b")) + expect(agentA?.description).toBe("Agent A") + expect(agentA?.mode).toBe("subagent") + expect(agentB?.description).toBe("Agent B") + expect(agentB?.mode).toBe("primary") + }), + { config: { agent: { agent_a: { @@ -453,22 +427,18 @@ test("multiple custom agents can be defined", async () => { }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agentA = await load(tmp.path, (svc) => svc.get("agent_a")) - const agentB = await load(tmp.path, (svc) => svc.get("agent_b")) - expect(agentA?.description).toBe("Agent A") - expect(agentA?.mode).toBe("subagent") - expect(agentB?.description).toBe("Agent B") - expect(agentB?.mode).toBe("primary") - }, - }) -}) + }, +) -test("Agent.list keeps the default agent first and sorts the rest by name", async () => { - await using tmp = await tmpdir({ +it.instance( + "Agent.list keeps the default agent first and sorts the rest by name", + () => + Effect.gen(function* () { + const names = (yield* load((svc) => svc.list())).map((a) => a.name) + expect(names[0]).toBe("plan") + expect(names.slice(1)).toEqual(names.slice(1).toSorted((a, b) => a.localeCompare(b))) + }), + { config: { default_agent: "plan", agent: { @@ -482,53 +452,40 @@ test("Agent.list keeps the default agent first and sorts the rest by name", asyn }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const names = (await load(tmp.path, (svc) => svc.list())).map((a) => a.name) - expect(names[0]).toBe("plan") - expect(names.slice(1)).toEqual(names.slice(1).toSorted((a, b) => a.localeCompare(b))) - }, - }) -}) - -test("Agent.get returns undefined for non-existent agent", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nonExistent = await load(tmp.path, (svc) => svc.get("does_not_exist")) - expect(nonExistent).toBeUndefined() - }, - }) -}) - -test("default permission includes doom_loop and external_directory as ask", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(evalPerm(build, "doom_loop")).toBe("ask") - expect(evalPerm(build, "external_directory")).toBe("ask") - }, - }) -}) - -test("webfetch is allowed by default", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(evalPerm(build, "webfetch")).toBe("allow") - }, - }) -}) - -test("legacy tools config converts to permissions", async () => { - await using tmp = await tmpdir({ + }, +) + +it.instance("Agent.get returns undefined for non-existent agent", () => + Effect.gen(function* () { + const nonExistent = yield* load((svc) => svc.get("does_not_exist")) + expect(nonExistent).toBeUndefined() + }), +) + +it.instance("default permission includes doom_loop and external_directory as ask", () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(evalPerm(build, "doom_loop")).toBe("ask") + expect(evalPerm(build, "external_directory")).toBe("ask") + }), +) + +it.instance("webfetch is allowed by default", () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(evalPerm(build, "webfetch")).toBe("allow") + }), +) + +it.instance( + "legacy tools config converts to permissions", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(evalPerm(build, "bash")).toBe("deny") + expect(evalPerm(build, "read")).toBe("deny") + }), + { config: { agent: { build: { @@ -539,19 +496,17 @@ test("legacy tools config converts to permissions", async () => { }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(evalPerm(build, "bash")).toBe("deny") - expect(evalPerm(build, "read")).toBe("deny") - }, - }) -}) + }, +) -test("legacy tools config maps write/edit/patch to edit permission", async () => { - await using tmp = await tmpdir({ +it.instance( + "legacy tools config maps write/edit/patch to edit permission", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(evalPerm(build, "edit")).toBe("deny") + }), + { config: { agent: { build: { @@ -561,53 +516,47 @@ test("legacy tools config maps write/edit/patch to edit permission", async () => }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(evalPerm(build, "edit")).toBe("deny") - }, - }) -}) + }, +) -test("Truncate.GLOB is allowed even when user denies external_directory globally", async () => { - const { Truncate } = await import("../../src/tool/truncate") - await using tmp = await tmpdir({ +it.instance( + "Truncate.GLOB is allowed even when user denies external_directory globally", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(Permission.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("allow") + expect(Permission.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") + expect(Permission.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("deny") + }), + { config: { permission: { external_directory: "deny", }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) + }, +) + +it.instance("global tmp directory children are allowed for external_directory", () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect( + Permission.evaluate("external_directory", path.join(Global.Path.tmp, "scratch"), build!.permission).action, + ).toBe("allow") + expect(Permission.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("ask") + }), +) + +it.instance( + "Truncate.GLOB is allowed even when user denies external_directory per-agent", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) expect(Permission.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("allow") expect(Permission.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") expect(Permission.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("deny") - }, - }) -}) - -test("global tmp directory children are allowed for external_directory", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect( - Permission.evaluate("external_directory", path.join(Global.Path.tmp, "scratch"), build!.permission).action, - ).toBe("allow") - expect(Permission.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("ask") - }, - }) -}) - -test("Truncate.GLOB is allowed even when user denies external_directory per-agent", async () => { - const { Truncate } = await import("../../src/tool/truncate") - await using tmp = await tmpdir({ + }), + { config: { agent: { build: { @@ -617,21 +566,18 @@ test("Truncate.GLOB is allowed even when user denies external_directory per-agen }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(Permission.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("allow") - expect(Permission.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") - expect(Permission.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("deny") - }, - }) -}) + }, +) -test("explicit Truncate.GLOB deny is respected", async () => { - const { Truncate } = await import("../../src/tool/truncate") - await using tmp = await tmpdir({ +it.instance( + "explicit Truncate.GLOB deny is respected", + () => + Effect.gen(function* () { + const build = yield* load((svc) => svc.get("build")) + expect(Permission.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("deny") + expect(Permission.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") + }), + { config: { permission: { external_directory: { @@ -640,81 +586,80 @@ test("explicit Truncate.GLOB deny is respected", async () => { }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - expect(Permission.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("deny") - expect(Permission.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") - }, - }) -}) - -test("skill directories are allowed for external_directory", async () => { - await using tmp = await tmpdir({ - git: true, - init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "perm-skill") - await Bun.write( - path.join(skillDir, "SKILL.md"), - `--- + }, +) + +it.instance( + "skill directories are allowed for external_directory", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const skillDir = path.join(test.directory, ".opencode", "skill", "perm-skill") + yield* Effect.promise(() => + Bun.write( + path.join(skillDir, "SKILL.md"), + `--- name: perm-skill description: Permission skill. --- # Permission Skill `, + ), ) - }, - }) - - const home = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path - - try { - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const build = await load(tmp.path, (svc) => svc.get("build")) - const skillDir = path.join(tmp.path, ".opencode", "skill", "perm-skill") - const target = path.join(skillDir, "reference", "notes.md") - expect(Permission.evaluate("external_directory", target, build!.permission).action).toBe("allow") - }, - }) - } finally { - process.env.OPENCODE_TEST_HOME = home - } -}) -test("defaultAgent returns build when no default_agent config", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agent = await load(tmp.path, (svc) => svc.defaultAgent()) - expect(agent).toBe("build") - }, - }) -}) + const home = process.env.OPENCODE_TEST_HOME + process.env.OPENCODE_TEST_HOME = test.directory + yield* Effect.addFinalizer(() => + Effect.sync(() => { + process.env.OPENCODE_TEST_HOME = home + }), + ) -test("defaultAgent respects default_agent config set to plan", async () => { - await using tmp = await tmpdir({ + const build = yield* load((svc) => svc.get("build")) + const target = path.join(skillDir, "reference", "notes.md") + expect(Permission.evaluate("external_directory", target, build!.permission).action).toBe("allow") + }), + { git: true }, +) + +it.instance("defaultAgent returns build when no default_agent config", () => + Effect.gen(function* () { + const agent = yield* load((svc) => svc.defaultAgent()) + expect(agent).toBe("build") + }), +) + +it.instance("defaultInfo returns resolved build agent when no default_agent config", () => + Effect.gen(function* () { + const agent = yield* load((svc) => svc.defaultInfo()) + expect(agent.name).toBe("build") + expect(agent.mode).toBe("primary") + }), +) + +it.instance( + "defaultAgent respects default_agent config set to plan", + () => + Effect.gen(function* () { + const agent = yield* load((svc) => svc.defaultAgent()) + expect(agent).toBe("plan") + }), + { config: { default_agent: "plan", }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agent = await load(tmp.path, (svc) => svc.defaultAgent()) - expect(agent).toBe("plan") - }, - }) -}) + }, +) -test("defaultAgent respects default_agent config set to custom agent with mode all", async () => { - await using tmp = await tmpdir({ +it.instance( + "defaultAgent respects default_agent config set to custom agent with mode all", + () => + Effect.gen(function* () { + const agent = yield* load((svc) => svc.defaultAgent()) + expect(agent).toBe("my_custom") + }), + { config: { default_agent: "my_custom", agent: { @@ -723,92 +668,65 @@ test("defaultAgent respects default_agent config set to custom agent with mode a }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agent = await load(tmp.path, (svc) => svc.defaultAgent()) - expect(agent).toBe("my_custom") - }, - }) -}) + }, +) -test("defaultAgent throws when default_agent points to subagent", async () => { - await using tmp = await tmpdir({ +it.instance( + "defaultAgent throws when default_agent points to subagent", + () => expectDefaultAgentError('default agent "explore" is a subagent'), + { config: { default_agent: "explore", }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(load(tmp.path, (svc) => svc.defaultAgent())).rejects.toThrow('default agent "explore" is a subagent') - }, - }) -}) + }, +) -test("defaultAgent throws when default_agent points to hidden agent", async () => { - await using tmp = await tmpdir({ +it.instance( + "defaultAgent throws when default_agent points to hidden agent", + () => expectDefaultAgentError('default agent "compaction" is hidden'), + { config: { default_agent: "compaction", }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(load(tmp.path, (svc) => svc.defaultAgent())).rejects.toThrow('default agent "compaction" is hidden') - }, - }) -}) + }, +) -test("defaultAgent throws when default_agent points to non-existent agent", async () => { - await using tmp = await tmpdir({ +it.instance( + "defaultAgent throws when default_agent points to non-existent agent", + () => expectDefaultAgentError('default agent "does_not_exist" not found'), + { config: { default_agent: "does_not_exist", }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(load(tmp.path, (svc) => svc.defaultAgent())).rejects.toThrow( - 'default agent "does_not_exist" not found', - ) - }, - }) -}) + }, +) -test("defaultAgent returns plan when build is disabled and default_agent not set", async () => { - await using tmp = await tmpdir({ +it.instance( + "defaultAgent returns plan when build is disabled and default_agent not set", + () => + Effect.gen(function* () { + const agent = yield* load((svc) => svc.defaultAgent()) + // build is disabled, so it should return plan (next primary agent) + expect(agent).toBe("plan") + }), + { config: { agent: { build: { disable: true }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const agent = await load(tmp.path, (svc) => svc.defaultAgent()) - // build is disabled, so it should return plan (next primary agent) - expect(agent).toBe("plan") - }, - }) -}) + }, +) -test("defaultAgent throws when all primary agents are disabled", async () => { - await using tmp = await tmpdir({ +it.instance( + "defaultAgent throws when all primary agents are disabled", + () => expectDefaultAgentError("no primary visible agent found"), + { config: { agent: { build: { disable: true }, plan: { disable: true }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // build and plan are disabled, no primary-capable agents remain - await expect(load(tmp.path, (svc) => svc.defaultAgent())).rejects.toThrow("no primary visible agent found") - }, - }) -}) + }, +) diff --git a/packages/opencode/test/agent/plan-mode-subagent-bypass.test.ts b/packages/opencode/test/agent/plan-mode-subagent-bypass.test.ts index 5ba6b54834b2..641a929aeb2c 100644 --- a/packages/opencode/test/agent/plan-mode-subagent-bypass.test.ts +++ b/packages/opencode/test/agent/plan-mode-subagent-bypass.test.ts @@ -18,110 +18,98 @@ * permissions are passed through, and Plan Mode's restrictions live on the * agent, not the session. */ -import { test, expect, afterEach } from "bun:test" +import { expect } from "bun:test" import { Effect } from "effect" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" -import { WithInstance } from "../../src/project/with-instance" import { Agent } from "../../src/agent/agent" import { deriveSubagentSessionPermission } from "../../src/agent/subagent-permissions" import { Permission } from "../../src/permission" +import { testEffect } from "../lib/effect" -afterEach(async () => { - await disposeAllInstances() -}) +const it = testEffect(Agent.defaultLayer) -function load(dir: string, fn: (svc: Agent.Interface) => Effect.Effect) { - return Effect.runPromise(provideInstance(dir)(Agent.Service.use(fn)).pipe(Effect.provide(Agent.defaultLayer))) +function testAgent(input: { + name: string + mode: Agent.Info["mode"] + permission: Parameters[0] +}) { + return { + name: input.name, + mode: input.mode, + permission: Permission.fromConfig(input.permission), + options: {}, + } satisfies Agent.Info } // `deriveSubagentSessionPermission` is imported from production. The test // exercises the actual helper that task.ts uses to build the subagent's // session permission, so any regression in that helper trips this test. -test("[#26514] subagent spawned from plan mode inherits read-only restriction (edit denied)", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const planAgent = await load(tmp.path, (svc) => svc.get("plan")) - const generalAgent = await load(tmp.path, (svc) => svc.get("general")) +it.instance("[#26514] subagent spawned from plan mode inherits read-only restriction (edit denied)", () => + Effect.gen(function* () { + const planAgent = yield* Agent.Service.use((svc) => svc.get("plan")) + const generalAgent = yield* Agent.Service.use((svc) => svc.get("general")) - expect(planAgent).toBeDefined() - expect(generalAgent).toBeDefined() - // Sanity: the plan agent itself blocks edit. (Note: `write` and - // `apply_patch` route through the `edit` permission at the runtime - // tool layer — see Permission.disabled / EDIT_TOOLS.) - expect(Permission.evaluate("edit", "/some/file.ts", planAgent!.permission).action).toBe("deny") - - // Simulate the plan-mode parent session: in real flow the plan - // session's `permission` field is empty (Plan Mode lives on the agent - // ruleset, not the session). So we pass [] through as the parent - // session permission, exactly like the actual code path. - const parentSessionPermission: Permission.Ruleset = [] + expect(planAgent).toBeDefined() + expect(generalAgent).toBeDefined() + // Sanity: the plan agent itself blocks edit. (Note: `write` and + // `apply_patch` route through the `edit` permission at the runtime + // tool layer — see Permission.disabled / EDIT_TOOLS.) + expect(Permission.evaluate("edit", "/some/file.ts", planAgent!.permission).action).toBe("deny") - const subagentSessionPermission = deriveSubagentSessionPermission({ - parentSessionPermission, - parentAgent: planAgent, - subagent: generalAgent!, - }) + // Simulate the plan-mode parent session: in real flow the plan + // session's `permission` field is empty (Plan Mode lives on the agent + // ruleset, not the session). So we pass [] through as the parent + // session permission, exactly like the actual code path. + const parentSessionPermission: Permission.Ruleset = [] - // Mirror the runtime evaluation in session/prompt.ts (~line 410, 639): - // ruleset: Permission.merge(agent.permission, session.permission ?? []) - const effective = Permission.merge(generalAgent!.permission, subagentSessionPermission) + const subagentSessionPermission = deriveSubagentSessionPermission({ + parentSessionPermission, + parentAgent: planAgent, + subagent: generalAgent!, + }) - expect(Permission.evaluate("edit", "/some/file.ts", effective).action).toBe("deny") - expect(Permission.evaluate("edit", "/another/path/index.tsx", effective).action).toBe("deny") - }, - }) -}) + // Mirror the runtime evaluation in session/prompt.ts (~line 410, 639): + // ruleset: Permission.merge(agent.permission, session.permission ?? []) + const effective = Permission.merge(generalAgent!.permission, subagentSessionPermission) + + expect(Permission.evaluate("edit", "/some/file.ts", effective).action).toBe("deny") + expect(Permission.evaluate("edit", "/another/path/index.tsx", effective).action).toBe("deny") + }), +) -test("[#26514] explore subagent launched from plan mode also stays read-only", async () => { +it.instance("[#26514] explore subagent launched from plan mode also stays read-only", () => // Sibling check: even though `explore` is intrinsically read-only, the // bug surface is the same. Including this case to document that the fix // should propagate the parent **agent** permissions, not just deny edit // when the subagent happens to already deny it. - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const planAgent = await load(tmp.path, (svc) => svc.get("plan")) - const explore = await load(tmp.path, (svc) => svc.get("explore")) - expect(planAgent).toBeDefined() - expect(explore).toBeDefined() + Effect.gen(function* () { + const planAgent = yield* Agent.Service.use((svc) => svc.get("plan")) + const explore = yield* Agent.Service.use((svc) => svc.get("explore")) + expect(planAgent).toBeDefined() + expect(explore).toBeDefined() - const parentSessionPermission: Permission.Ruleset = [] - const subagentSessionPermission = deriveSubagentSessionPermission({ - parentSessionPermission, - parentAgent: planAgent, - subagent: explore!, - }) - const effective = Permission.merge(explore!.permission, subagentSessionPermission) + const parentSessionPermission: Permission.Ruleset = [] + const subagentSessionPermission = deriveSubagentSessionPermission({ + parentSessionPermission, + parentAgent: planAgent, + subagent: explore!, + }) + const effective = Permission.merge(explore!.permission, subagentSessionPermission) - // Already deny — sanity check. - expect(Permission.evaluate("edit", "/x.ts", effective).action).toBe("deny") - }, - }) -}) + // Already deny — sanity check. + expect(Permission.evaluate("edit", "/x.ts", effective).action).toBe("deny") + }), +) -test("[#26514] custom user subagent launched from plan mode bypasses Plan Mode read-only", async () => { +it.instance( + "[#26514] custom user subagent launched from plan mode bypasses Plan Mode read-only", // The most damaging case: a user-defined subagent with default // permissions (allow-by-default, like `general`). The subagent must NOT // be able to edit when the parent agent is `plan`. - await using tmp = await tmpdir({ - config: { - agent: { - my_subagent: { - description: "A user-defined subagent", - mode: "subagent", - }, - }, - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const planAgent = await load(tmp.path, (svc) => svc.get("plan")) - const my = await load(tmp.path, (svc) => svc.get("my_subagent")) + () => + Effect.gen(function* () { + const planAgent = yield* Agent.Service.use((svc) => svc.get("plan")) + const my = yield* Agent.Service.use((svc) => svc.get("my_subagent")) expect(planAgent).toBeDefined() expect(my).toBeDefined() @@ -136,6 +124,89 @@ test("[#26514] custom user subagent launched from plan mode bypasses Plan Mode r // BUG: on origin/dev edit resolves to "allow" because the plan // agent's `edit: deny *` rule never reaches the subagent. expect(Permission.evaluate("edit", "/some/file.ts", effective).action).toBe("deny") + }), + { + config: { + agent: { + my_subagent: { + description: "A user-defined subagent", + mode: "subagent", + }, + }, }, - }) -}) + }, +) + +it.effect("[#26700] controller self-restrictions do not erase executor permissions", () => + Effect.sync(() => { + const controller = testAgent({ + name: "controller", + mode: "primary", + permission: { + "*": "deny", + read: "deny", + bash: "deny", + task: { + "*": "deny", + executor: "allow", + }, + edit: "deny", + write: "deny", + }, + }) + const executor = testAgent({ + name: "executor", + mode: "subagent", + permission: { + "*": "deny", + read: "allow", + bash: "allow", + task: { + "*": "deny", + worker: "allow", + }, + edit: "deny", + write: "deny", + }, + }) + + const effective = Permission.merge( + executor.permission, + deriveSubagentSessionPermission({ + parentSessionPermission: [], + parentAgent: controller, + subagent: executor, + }), + ) + + expect(Permission.evaluate("read", "README.md", effective).action).toBe("allow") + expect(Permission.evaluate("bash", "git status", effective).action).toBe("allow") + expect(Permission.evaluate("task", "worker", effective).action).toBe("allow") + expect(Permission.evaluate("task", "other", effective).action).toBe("deny") + expect(Permission.disabled(["edit", "write", "apply_patch"], effective)).toEqual( + new Set(["edit", "write", "apply_patch"]), + ) + }), +) + +it.effect("subagent inherits parent session deny rules as hard runtime ceilings", () => + Effect.sync(() => { + const executor = testAgent({ + name: "executor", + mode: "subagent", + permission: { + bash: "allow", + }, + }) + const effective = Permission.merge( + executor.permission, + deriveSubagentSessionPermission({ + parentSessionPermission: Permission.fromConfig({ bash: "deny" }), + parentAgent: undefined, + subagent: executor, + }), + ) + + expect(Permission.evaluate("bash", "git status", effective).action).toBe("deny") + }), +) diff --git a/packages/opencode/test/agent/plugin-agent-regression.test.ts b/packages/opencode/test/agent/plugin-agent-regression.test.ts index e2dd8a5f7c89..c437281cc6b6 100644 --- a/packages/opencode/test/agent/plugin-agent-regression.test.ts +++ b/packages/opencode/test/agent/plugin-agent-regression.test.ts @@ -7,6 +7,7 @@ import { Agent } from "../../src/agent/agent" import { Bus } from "../../src/bus" import { Config } from "../../src/config/config" import { Env } from "../../src/env" +import { RuntimeFlags } from "../../src/effect/runtime-flags" import { Plugin } from "../../src/plugin" import { AccountTest } from "../fake/account" import { AuthTest } from "../fake/auth" @@ -29,13 +30,18 @@ const configLayer = Config.layer.pipe( Layer.provide(AccountTest.empty), Layer.provide(NpmTest.noop), ) -const pluginLayer = Plugin.layer.pipe(Layer.provide(Bus.layer), Layer.provide(configLayer)) +const pluginLayer = Plugin.layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(configLayer), + Layer.provide(RuntimeFlags.layer({ disableDefaultPlugins: true })), +) const agentLayer = Agent.layer.pipe( Layer.provide(configLayer), Layer.provide(AuthTest.empty), Layer.provide(SkillTest.empty), Layer.provide(provider.layer), Layer.provide(pluginLayer), + Layer.provide(RuntimeFlags.layer({ disableDefaultPlugins: true })), ) const it = testEffect(Layer.mergeAll(agentLayer, pluginLayer)) diff --git a/packages/opencode/test/background/job.test.ts b/packages/opencode/test/background/job.test.ts new file mode 100644 index 000000000000..afc7260bb82c --- /dev/null +++ b/packages/opencode/test/background/job.test.ts @@ -0,0 +1,127 @@ +import { describe, expect } from "bun:test" +import { Deferred, Effect } from "effect" +import { BackgroundJob } from "@/background/job" +import { testEffect } from "../lib/effect" + +const it = testEffect(BackgroundJob.defaultLayer) + +describe("background.job", () => { + it.instance("tracks started jobs through completion", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const latch = yield* Deferred.make() + const job = yield* jobs.start({ + type: "test", + title: "test job", + run: Deferred.await(latch).pipe(Effect.as("done")), + }) + + expect(job.id.startsWith("job_")).toBe(true) + expect(job.status).toBe("running") + expect(job.title).toBe("test job") + + yield* Deferred.succeed(latch, undefined) + const done = yield* jobs.wait({ id: job.id }) + + expect(done.timedOut).toBe(false) + expect(done.info?.status).toBe("completed") + expect(done.info?.output).toBe("done") + expect((yield* jobs.list()).map((item) => item.id)).toEqual([job.id]) + }), + ) + + it.instance("returns a running snapshot when wait times out", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const job = yield* jobs.start({ + type: "test", + run: Effect.never, + }) + + const result = yield* jobs.wait({ id: job.id, timeout: 1 }) + + expect(result.timedOut).toBe(true) + expect(result.info?.status).toBe("running") + }), + ) + + it.instance("deduplicates concurrent starts for a running id", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const started = yield* Deferred.make() + const id = "job_test" + const [first, second] = yield* Effect.all( + [ + jobs.start({ + id, + type: "test", + run: Deferred.succeed(started, undefined).pipe(Effect.andThen(Effect.never)), + }), + jobs.start({ + id, + type: "test", + run: Effect.fail(new Error("duplicate started")), + }), + ], + { concurrency: "unbounded" }, + ) + + yield* Deferred.await(started) + + expect(first.id).toBe(id) + expect(second.id).toBe(id) + expect(first.status).toBe("running") + expect(second.status).toBe("running") + expect((yield* jobs.list()).map((item) => item.id)).toEqual([id]) + + yield* jobs.cancel(id) + }), + ) + + it.instance("records failed jobs", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const job = yield* jobs.start({ + type: "test", + run: Effect.fail(new Error("boom")), + }) + + const result = yield* jobs.wait({ id: job.id }) + + expect(result.info?.status).toBe("error") + expect(result.info?.error).toBe("boom") + }), + ) + + it.instance("can cancel running jobs", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const interrupted = yield* Deferred.make() + const job = yield* jobs.start({ + type: "test", + run: Effect.never.pipe(Effect.ensuring(Deferred.succeed(interrupted, undefined))), + }) + + const cancelled = yield* jobs.cancel(job.id) + + expect(cancelled?.status).toBe("cancelled") + yield* Deferred.await(interrupted).pipe(Effect.timeout("1 second")) + expect((yield* jobs.get(job.id))?.status).toBe("cancelled") + }), + ) + + it.instance("returns immutable snapshots", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const job = yield* jobs.start({ + type: "test", + metadata: { value: "initial" }, + run: Effect.succeed("done"), + }) + + if (job.metadata) job.metadata.value = "changed" + + expect((yield* jobs.get(job.id))?.metadata?.value).toBe("initial") + }), + ) +}) diff --git a/packages/opencode/test/bus/bus-effect.test.ts b/packages/opencode/test/bus/bus-effect.test.ts index 377c54109692..0dc58ecdae59 100644 --- a/packages/opencode/test/bus/bus-effect.test.ts +++ b/packages/opencode/test/bus/bus-effect.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from "bun:test" -import { Deferred, Effect, Layer, Schema, Stream } from "effect" +import { Deferred, Effect, Fiber, Latch, Layer, Schema, Stream } from "effect" import { Bus } from "../../src/bus" import { BusEvent } from "../../src/bus/bus-event" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" @@ -9,6 +9,7 @@ import { testEffect } from "../lib/effect" const TestEvent = { Ping: BusEvent.define("test.effect.ping", Schema.Struct({ value: Schema.Number })), Pong: BusEvent.define("test.effect.pong", Schema.Struct({ message: Schema.String })), + Warmup: BusEvent.define("test.effect.warmup", Schema.Struct({})), } const node = CrossSpawnSpawner.defaultLayer @@ -17,21 +18,44 @@ const live = Layer.mergeAll(Bus.layer, node) const it = testEffect(live) +// Publishes warmup events until the latch opens, proving the forked subscriber +// fiber has actually wired up its PubSub subscription. +const awaitSubscriberReady = Effect.fn("test.awaitSubscriberReady")(function* ( + ready: Latch.Latch, + warmup: Effect.Effect, +) { + const pump = yield* Effect.forkScoped( + Effect.gen(function* () { + while (true) { + yield* warmup + yield* Effect.sleep("5 millis") + } + }), + ) + yield* ready.await.pipe(Effect.timeout("2 seconds")) + yield* Fiber.interrupt(pump) +}) + describe("Bus (Effect-native)", () => { it.instance("publish + subscribe stream delivers events", () => Effect.gen(function* () { const bus = yield* Bus.Service const received: number[] = [] const done = yield* Deferred.make() + const ready = yield* Latch.make() yield* Stream.runForEach(bus.subscribe(TestEvent.Ping), (evt) => - Effect.sync(() => { + Effect.gen(function* () { + if (evt.properties.value < 0) { + yield* ready.open + return + } received.push(evt.properties.value) if (received.length === 2) Deferred.doneUnsafe(done, Effect.void) }), ).pipe(Effect.forkScoped) - yield* Effect.sleep("10 millis") + yield* awaitSubscriberReady(ready, bus.publish(TestEvent.Ping, { value: -1 })) yield* bus.publish(TestEvent.Ping, { value: 1 }) yield* bus.publish(TestEvent.Ping, { value: 2 }) yield* Deferred.await(done) @@ -45,15 +69,20 @@ describe("Bus (Effect-native)", () => { const bus = yield* Bus.Service const pings: number[] = [] const done = yield* Deferred.make() + const ready = yield* Latch.make() yield* Stream.runForEach(bus.subscribe(TestEvent.Ping), (evt) => - Effect.sync(() => { + Effect.gen(function* () { + if (evt.properties.value < 0) { + yield* ready.open + return + } pings.push(evt.properties.value) Deferred.doneUnsafe(done, Effect.void) }), ).pipe(Effect.forkScoped) - yield* Effect.sleep("10 millis") + yield* awaitSubscriberReady(ready, bus.publish(TestEvent.Ping, { value: -1 })) yield* bus.publish(TestEvent.Pong, { message: "ignored" }) yield* bus.publish(TestEvent.Ping, { value: 42 }) yield* Deferred.await(done) @@ -67,15 +96,20 @@ describe("Bus (Effect-native)", () => { const bus = yield* Bus.Service const types: string[] = [] const done = yield* Deferred.make() + const ready = yield* Latch.make() yield* Stream.runForEach(bus.subscribeAll(), (evt) => - Effect.sync(() => { + Effect.gen(function* () { + if (evt.type === TestEvent.Warmup.type) { + yield* ready.open + return + } types.push(evt.type) if (types.length === 2) Deferred.doneUnsafe(done, Effect.void) }), ).pipe(Effect.forkScoped) - yield* Effect.sleep("10 millis") + yield* awaitSubscriberReady(ready, bus.publish(TestEvent.Warmup, {})) yield* bus.publish(TestEvent.Ping, { value: 1 }) yield* bus.publish(TestEvent.Pong, { message: "hi" }) yield* Deferred.await(done) @@ -92,22 +126,33 @@ describe("Bus (Effect-native)", () => { const b: number[] = [] const doneA = yield* Deferred.make() const doneB = yield* Deferred.make() + const readyA = yield* Latch.make() + const readyB = yield* Latch.make() yield* Stream.runForEach(bus.subscribe(TestEvent.Ping), (evt) => - Effect.sync(() => { + Effect.gen(function* () { + if (evt.properties.value < 0) { + yield* readyA.open + return + } a.push(evt.properties.value) Deferred.doneUnsafe(doneA, Effect.void) }), ).pipe(Effect.forkScoped) yield* Stream.runForEach(bus.subscribe(TestEvent.Ping), (evt) => - Effect.sync(() => { + Effect.gen(function* () { + if (evt.properties.value < 0) { + yield* readyB.open + return + } b.push(evt.properties.value) Deferred.doneUnsafe(doneB, Effect.void) }), ).pipe(Effect.forkScoped) - yield* Effect.sleep("10 millis") + yield* awaitSubscriberReady(readyA, bus.publish(TestEvent.Ping, { value: -1 })) + yield* awaitSubscriberReady(readyB, bus.publish(TestEvent.Ping, { value: -1 })) yield* bus.publish(TestEvent.Ping, { value: 99 }) yield* Deferred.await(doneA) yield* Deferred.await(doneB) @@ -123,20 +168,25 @@ describe("Bus (Effect-native)", () => { const types: string[] = [] const seen = yield* Deferred.make() const disposed = yield* Deferred.make() + const ready = yield* Latch.make() // Set up subscriber inside the instance yield* Effect.gen(function* () { const bus = yield* Bus.Service yield* Stream.runForEach(bus.subscribeAll(), (evt) => - Effect.sync(() => { + Effect.gen(function* () { + if (evt.type === TestEvent.Warmup.type) { + yield* ready.open + return + } types.push(evt.type) if (evt.type === TestEvent.Ping.type) Deferred.doneUnsafe(seen, Effect.void) if (evt.type === Bus.InstanceDisposed.type) Deferred.doneUnsafe(disposed, Effect.void) }), ).pipe(Effect.forkScoped) - yield* Effect.sleep("10 millis") + yield* awaitSubscriberReady(ready, bus.publish(TestEvent.Warmup, {})) yield* bus.publish(TestEvent.Ping, { value: 1 }) yield* Deferred.await(seen) }).pipe(provideInstance(dir)) diff --git a/packages/opencode/test/bus/bus-integration.test.ts b/packages/opencode/test/bus/bus-integration.test.ts index 3e3d7a3e9055..645a94fb3b6f 100644 --- a/packages/opencode/test/bus/bus-integration.test.ts +++ b/packages/opencode/test/bus/bus-integration.test.ts @@ -1,88 +1,88 @@ -import { afterEach, describe, expect, test } from "bun:test" -import { Schema } from "effect" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { afterEach, describe, expect } from "bun:test" +import { Deferred, Effect, Layer, Schema } from "effect" import { Bus } from "../../src/bus" import { BusEvent } from "../../src/bus/bus-event" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, provideInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" const TestEvent = BusEvent.define("test.integration", Schema.Struct({ value: Schema.Number })) - -function withInstance(directory: string, fn: () => Promise) { - return WithInstance.provide({ directory, fn }) -} +const it = testEffect(Layer.mergeAll(Bus.layer, CrossSpawnSpawner.defaultLayer)) describe("Bus integration: acquireRelease subscriber pattern", () => { afterEach(() => disposeAllInstances()) - test("subscriber via callback facade receives events and cleans up on unsub", async () => { - await using tmp = await tmpdir() - const received: number[] = [] + it.instance("subscriber via callback facade receives events and cleans up on unsub", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: number[] = [] + const receivedTwo = yield* Deferred.make() - await withInstance(tmp.path, async () => { - const unsub = Bus.subscribe(TestEvent, (evt) => { + const unsub = yield* bus.subscribeCallback(TestEvent, (evt) => { received.push(evt.properties.value) + if (received.length === 2) Deferred.doneUnsafe(receivedTwo, Effect.void) }) - await Bun.sleep(10) - await Bus.publish(TestEvent, { value: 1 }) - await Bus.publish(TestEvent, { value: 2 }) - await Bun.sleep(10) + yield* bus.publish(TestEvent, { value: 1 }) + yield* bus.publish(TestEvent, { value: 2 }) + yield* Deferred.await(receivedTwo).pipe(Effect.timeout("2 seconds")) expect(received).toEqual([1, 2]) - unsub() - await Bun.sleep(10) - await Bus.publish(TestEvent, { value: 3 }) - await Bun.sleep(10) + yield* Effect.sync(unsub) + yield* bus.publish(TestEvent, { value: 3 }) + yield* Effect.sleep("10 millis") expect(received).toEqual([1, 2]) - }) - }) - - test("subscribeAll receives events from multiple types", async () => { - await using tmp = await tmpdir() - const received: Array<{ type: string; value?: number }> = [] + }), + ) - const OtherEvent = BusEvent.define("test.other", Schema.Struct({ value: Schema.Number })) + it.instance("subscribeAll receives events from multiple types", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: Array<{ type: string; value?: number }> = [] + const OtherEvent = BusEvent.define("test.other", Schema.Struct({ value: Schema.Number })) + const receivedTwo = yield* Deferred.make() - await withInstance(tmp.path, async () => { - Bus.subscribeAll((evt) => { + yield* bus.subscribeAllCallback((evt) => { received.push({ type: evt.type, value: evt.properties.value }) + if (received.length === 2) Deferred.doneUnsafe(receivedTwo, Effect.void) }) - await Bun.sleep(10) - await Bus.publish(TestEvent, { value: 10 }) - await Bus.publish(OtherEvent, { value: 20 }) - await Bun.sleep(10) - }) - - expect(received).toEqual([ - { type: "test.integration", value: 10 }, - { type: "test.other", value: 20 }, - ]) - }) - - test("subscriber cleanup on instance disposal interrupts the stream", async () => { - await using tmp = await tmpdir() - const received: number[] = [] - let disposed = false - - await withInstance(tmp.path, async () => { - Bus.subscribeAll((evt) => { - if (evt.type === Bus.InstanceDisposed.type) { - disposed = true - return - } - received.push(evt.properties.value) - }) - await Bun.sleep(10) - await Bus.publish(TestEvent, { value: 1 }) - await Bun.sleep(10) - }) - - await disposeAllInstances() - await Bun.sleep(50) - - expect(received).toEqual([1]) - expect(disposed).toBe(true) - }) + yield* bus.publish(TestEvent, { value: 10 }) + yield* bus.publish(OtherEvent, { value: 20 }) + yield* Deferred.await(receivedTwo).pipe(Effect.timeout("2 seconds")) + + expect(received).toEqual([ + { type: "test.integration", value: 10 }, + { type: "test.other", value: 20 }, + ]) + }), + ) + + it.live("subscriber cleanup on instance disposal interrupts the stream", () => + Effect.gen(function* () { + const dir = yield* tmpdirScoped() + const received: number[] = [] + const seen = yield* Deferred.make() + const disposed = yield* Deferred.make() + + yield* Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.subscribeAllCallback((evt) => { + if (evt.type === Bus.InstanceDisposed.type) { + Deferred.doneUnsafe(disposed, Effect.void) + return + } + received.push(evt.properties.value) + Deferred.doneUnsafe(seen, Effect.void) + }) + yield* bus.publish(TestEvent, { value: 1 }) + yield* Deferred.await(seen).pipe(Effect.timeout("2 seconds")) + }).pipe(provideInstance(dir)) + + yield* Effect.promise(() => disposeAllInstances()) + yield* Deferred.await(disposed).pipe(Effect.timeout("2 seconds")) + + expect(received).toEqual([1]) + }), + ) }) diff --git a/packages/opencode/test/bus/bus.test.ts b/packages/opencode/test/bus/bus.test.ts index 876cb1ed7419..08449861621c 100644 --- a/packages/opencode/test/bus/bus.test.ts +++ b/packages/opencode/test/bus/bus.test.ts @@ -1,220 +1,240 @@ -import { afterEach, describe, expect, test } from "bun:test" -import { Schema } from "effect" +import { afterEach, describe, expect } from "bun:test" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { Deferred, Effect, Layer, Schema } from "effect" import { Bus } from "../../src/bus" import { BusEvent } from "../../src/bus/bus-event" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, provideInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" const TestEvent = { Ping: BusEvent.define("test.ping", Schema.Struct({ value: Schema.Number })), Pong: BusEvent.define("test.pong", Schema.Struct({ message: Schema.String })), } -function withInstance(directory: string, fn: () => Promise) { - return WithInstance.provide({ directory, fn }) -} +const it = testEffect(Layer.mergeAll(Bus.layer, CrossSpawnSpawner.defaultLayer)) describe("Bus", () => { afterEach(() => disposeAllInstances()) describe("publish + subscribe", () => { - test("subscriber is live immediately after subscribe returns", async () => { - await using tmp = await tmpdir() - const received: number[] = [] + it.instance("subscriber is live immediately after subscribe returns", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: number[] = [] + const done = yield* Deferred.make() - await withInstance(tmp.path, async () => { - Bus.subscribe(TestEvent.Ping, (evt) => { + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { received.push(evt.properties.value) + Deferred.doneUnsafe(done, Effect.void) }) - await Bus.publish(TestEvent.Ping, { value: 42 }) - await Bun.sleep(10) - }) + yield* bus.publish(TestEvent.Ping, { value: 42 }) + yield* Deferred.await(done).pipe(Effect.timeout("2 seconds")) - expect(received).toEqual([42]) - }) + expect(received).toEqual([42]) + }), + ) - test("subscriber receives matching events", async () => { - await using tmp = await tmpdir() - const received: number[] = [] + it.instance("subscriber receives matching events", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: number[] = [] + const done = yield* Deferred.make() - await withInstance(tmp.path, async () => { - Bus.subscribe(TestEvent.Ping, (evt) => { + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { received.push(evt.properties.value) + if (received.length === 2) Deferred.doneUnsafe(done, Effect.void) }) - // Give the subscriber fiber time to start consuming - await Bun.sleep(10) - await Bus.publish(TestEvent.Ping, { value: 42 }) - await Bus.publish(TestEvent.Ping, { value: 99 }) - // Give subscriber time to process - await Bun.sleep(10) - }) - - expect(received).toEqual([42, 99]) - }) - - test("subscriber does not receive events of other types", async () => { - await using tmp = await tmpdir() - const pings: number[] = [] - - await withInstance(tmp.path, async () => { - Bus.subscribe(TestEvent.Ping, (evt) => { + yield* bus.publish(TestEvent.Ping, { value: 42 }) + yield* bus.publish(TestEvent.Ping, { value: 99 }) + yield* Deferred.await(done).pipe(Effect.timeout("2 seconds")) + + expect(received).toEqual([42, 99]) + }), + ) + + it.instance("subscriber does not receive events of other types", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const pings: number[] = [] + const done = yield* Deferred.make() + + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { pings.push(evt.properties.value) + Deferred.doneUnsafe(done, Effect.void) }) - await Bun.sleep(10) - await Bus.publish(TestEvent.Pong, { message: "hello" }) - await Bus.publish(TestEvent.Ping, { value: 1 }) - await Bun.sleep(10) - }) - - expect(pings).toEqual([1]) - }) - - test("publish with no subscribers does not throw", async () => { - await using tmp = await tmpdir() - - await withInstance(tmp.path, async () => { - await Bus.publish(TestEvent.Ping, { value: 1 }) - }) - }) + yield* bus.publish(TestEvent.Pong, { message: "hello" }) + yield* bus.publish(TestEvent.Ping, { value: 1 }) + yield* Deferred.await(done).pipe(Effect.timeout("2 seconds")) + + expect(pings).toEqual([1]) + }), + ) + + it.instance("publish with no subscribers does not throw", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.publish(TestEvent.Ping, { value: 1 }) + }), + ) }) describe("unsubscribe", () => { - test("unsubscribe stops delivery", async () => { - await using tmp = await tmpdir() - const received: number[] = [] + it.instance("unsubscribe stops delivery", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: number[] = [] + const first = yield* Deferred.make() - await withInstance(tmp.path, async () => { - const unsub = Bus.subscribe(TestEvent.Ping, (evt) => { + const unsub = yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { received.push(evt.properties.value) + if (evt.properties.value === 1) Deferred.doneUnsafe(first, Effect.void) }) - await Bun.sleep(10) - await Bus.publish(TestEvent.Ping, { value: 1 }) - await Bun.sleep(10) - unsub() - await Bun.sleep(10) - await Bus.publish(TestEvent.Ping, { value: 2 }) - await Bun.sleep(10) - }) - - expect(received).toEqual([1]) - }) + yield* bus.publish(TestEvent.Ping, { value: 1 }) + yield* Deferred.await(first).pipe(Effect.timeout("2 seconds")) + yield* Effect.sync(unsub) + yield* bus.publish(TestEvent.Ping, { value: 2 }) + yield* Effect.sleep("10 millis") + + expect(received).toEqual([1]) + }), + ) }) describe("subscribeAll", () => { - test("subscribeAll is live immediately after subscribe returns", async () => { - await using tmp = await tmpdir() - const received: string[] = [] + it.instance("subscribeAll is live immediately after subscribe returns", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: string[] = [] + const done = yield* Deferred.make() - await withInstance(tmp.path, async () => { - Bus.subscribeAll((evt) => { + yield* bus.subscribeAllCallback((evt) => { received.push(evt.type) + Deferred.doneUnsafe(done, Effect.void) }) - await Bus.publish(TestEvent.Ping, { value: 1 }) - await Bun.sleep(10) - }) + yield* bus.publish(TestEvent.Ping, { value: 1 }) + yield* Deferred.await(done).pipe(Effect.timeout("2 seconds")) - expect(received).toEqual(["test.ping"]) - }) + expect(received).toEqual(["test.ping"]) + }), + ) - test("receives all event types", async () => { - await using tmp = await tmpdir() - const received: string[] = [] + it.instance("receives all event types", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const received: string[] = [] + const done = yield* Deferred.make() - await withInstance(tmp.path, async () => { - Bus.subscribeAll((evt) => { + yield* bus.subscribeAllCallback((evt) => { received.push(evt.type) + if (received.length === 2) Deferred.doneUnsafe(done, Effect.void) }) - await Bun.sleep(10) - await Bus.publish(TestEvent.Ping, { value: 1 }) - await Bus.publish(TestEvent.Pong, { message: "hi" }) - await Bun.sleep(10) - }) - - expect(received).toContain("test.ping") - expect(received).toContain("test.pong") - }) + yield* bus.publish(TestEvent.Ping, { value: 1 }) + yield* bus.publish(TestEvent.Pong, { message: "hi" }) + yield* Deferred.await(done).pipe(Effect.timeout("2 seconds")) + + expect(received).toContain("test.ping") + expect(received).toContain("test.pong") + }), + ) }) describe("multiple subscribers", () => { - test("all subscribers for same event type are called", async () => { - await using tmp = await tmpdir() - const a: number[] = [] - const b: number[] = [] - - await withInstance(tmp.path, async () => { - Bus.subscribe(TestEvent.Ping, (evt) => { + it.instance("all subscribers for same event type are called", () => + Effect.gen(function* () { + const bus = yield* Bus.Service + const a: number[] = [] + const b: number[] = [] + const doneA = yield* Deferred.make() + const doneB = yield* Deferred.make() + + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { a.push(evt.properties.value) + Deferred.doneUnsafe(doneA, Effect.void) }) - Bus.subscribe(TestEvent.Ping, (evt) => { + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { b.push(evt.properties.value) + Deferred.doneUnsafe(doneB, Effect.void) }) - await Bun.sleep(10) - await Bus.publish(TestEvent.Ping, { value: 7 }) - await Bun.sleep(10) - }) - - expect(a).toEqual([7]) - expect(b).toEqual([7]) - }) + yield* bus.publish(TestEvent.Ping, { value: 7 }) + yield* Deferred.await(doneA).pipe(Effect.timeout("2 seconds")) + yield* Deferred.await(doneB).pipe(Effect.timeout("2 seconds")) + + expect(a).toEqual([7]) + expect(b).toEqual([7]) + }), + ) }) describe("instance isolation", () => { - test("events in one directory do not reach subscribers in another", async () => { - await using tmpA = await tmpdir() - await using tmpB = await tmpdir() - const receivedA: number[] = [] - const receivedB: number[] = [] - - await withInstance(tmpA.path, async () => { - Bus.subscribe(TestEvent.Ping, (evt) => { - receivedA.push(evt.properties.value) - }) - await Bun.sleep(10) - }) - - await withInstance(tmpB.path, async () => { - Bus.subscribe(TestEvent.Ping, (evt) => { - receivedB.push(evt.properties.value) - }) - await Bun.sleep(10) - }) - - await withInstance(tmpA.path, async () => { - await Bus.publish(TestEvent.Ping, { value: 1 }) - await Bun.sleep(10) - }) - - await withInstance(tmpB.path, async () => { - await Bus.publish(TestEvent.Ping, { value: 2 }) - await Bun.sleep(10) - }) - - expect(receivedA).toEqual([1]) - expect(receivedB).toEqual([2]) - }) + it.live("events in one directory do not reach subscribers in another", () => + Effect.gen(function* () { + const tmpA = yield* tmpdirScoped() + const tmpB = yield* tmpdirScoped() + const receivedA: number[] = [] + const receivedB: number[] = [] + const doneA = yield* Deferred.make() + const doneB = yield* Deferred.make() + + yield* Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { + receivedA.push(evt.properties.value) + Deferred.doneUnsafe(doneA, Effect.void) + }) + }).pipe(provideInstance(tmpA)) + + yield* Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.subscribeCallback(TestEvent.Ping, (evt) => { + receivedB.push(evt.properties.value) + Deferred.doneUnsafe(doneB, Effect.void) + }) + }).pipe(provideInstance(tmpB)) + + yield* Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.publish(TestEvent.Ping, { value: 1 }) + }).pipe(provideInstance(tmpA)) + + yield* Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.publish(TestEvent.Ping, { value: 2 }) + }).pipe(provideInstance(tmpB)) + + yield* Deferred.await(doneA).pipe(Effect.timeout("2 seconds")) + yield* Deferred.await(doneB).pipe(Effect.timeout("2 seconds")) + + expect(receivedA).toEqual([1]) + expect(receivedB).toEqual([2]) + }), + ) }) describe("instance disposal", () => { - test("InstanceDisposed is delivered to wildcard subscribers before stream ends", async () => { - await using tmp = await tmpdir() - const received: string[] = [] - - await withInstance(tmp.path, async () => { - Bus.subscribeAll((evt) => { - received.push(evt.type) - }) - await Bun.sleep(10) - await Bus.publish(TestEvent.Ping, { value: 1 }) - await Bun.sleep(10) - }) - - // disposeAllInstances triggers the finalizer which publishes InstanceDisposed - await disposeAllInstances() - await Bun.sleep(50) - - expect(received).toContain("test.ping") - expect(received).toContain(Bus.InstanceDisposed.type) - }) + it.live("InstanceDisposed is delivered to wildcard subscribers before stream ends", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + const received: string[] = [] + const seen = yield* Deferred.make() + const disposed = yield* Deferred.make() + + yield* Effect.gen(function* () { + const bus = yield* Bus.Service + yield* bus.subscribeAllCallback((evt) => { + received.push(evt.type) + if (evt.type === TestEvent.Ping.type) Deferred.doneUnsafe(seen, Effect.void) + if (evt.type === Bus.InstanceDisposed.type) Deferred.doneUnsafe(disposed, Effect.void) + }) + yield* bus.publish(TestEvent.Ping, { value: 1 }) + yield* Deferred.await(seen).pipe(Effect.timeout("2 seconds")) + }).pipe(provideInstance(tmp)) + + yield* Effect.promise(disposeAllInstances) + yield* Deferred.await(disposed).pipe(Effect.timeout("2 seconds")) + + expect(received).toContain("test.ping") + expect(received).toContain(Bus.InstanceDisposed.type) + }), + ) }) }) diff --git a/packages/opencode/test/cli/cmd/tui/attention.test.ts b/packages/opencode/test/cli/cmd/tui/attention.test.ts new file mode 100644 index 000000000000..071aabdd793d --- /dev/null +++ b/packages/opencode/test/cli/cmd/tui/attention.test.ts @@ -0,0 +1,484 @@ +import { describe, expect, test } from "bun:test" +import type { AudioPlayOptions, AudioSound } from "@opentui/core" +import { createTuiAttention } from "@/cli/cmd/tui/attention" +import type { TuiConfig } from "@/cli/cmd/tui/config/tui" + +type FocusEvent = "focus" | "blur" + +type AttentionConfig = Pick + +class FakeRenderer { + isDestroyed = false + notificationResult = true + notificationThrows = false + notifications: { message: string; title: string | undefined }[] = [] + listeners: Record void>> = { + focus: new Set(), + blur: new Set(), + } + + on(event: FocusEvent, listener: () => void) { + this.listeners[event].add(listener) + return this + } + + off(event: FocusEvent, listener: () => void) { + this.listeners[event].delete(listener) + return this + } + + emit(event: FocusEvent) { + for (const listener of this.listeners[event]) listener() + } + + listenerCount(event: FocusEvent) { + return this.listeners[event].size + } + + triggerNotification(message: string, title?: string) { + if (this.notificationThrows) throw new Error("notification failed") + this.notifications.push({ message, title }) + return this.notificationResult + } +} + +class FakeAudioEngine { + loadResult: AudioSound | null = 1 + playResult: number | null = 1 + loadCalls = 0 + playCalls = 0 + volumes: (number | undefined)[] = [] + loadPaths: string[] = [] + rejectLoad = false + rejectPaths = new Set() + + async loadSoundFile(path: string) { + this.loadCalls += 1 + this.loadPaths.push(path) + if (this.rejectLoad || this.rejectPaths.has(path)) throw new Error("decode failed") + return this.loadResult + } + + play(_sound: AudioSound, options?: AudioPlayOptions) { + this.playCalls += 1 + this.volumes.push(options?.volume) + return this.playResult + } +} + +class FakeKV { + store: Record = {} + + get ready() { + return true + } + + get(key: string, fallback?: Value) { + return (this.store[key] ?? fallback) as Value + } + + set(key: string, value: unknown) { + this.store[key] = value + } +} + +function config(attention: Partial = {}): AttentionConfig { + return { + attention: { + enabled: true, + notifications: true, + sound: true, + volume: 0.4, + sound_pack: "opencode.default", + sounds: {}, + ...attention, + }, + } +} + +describe("createTuiAttention", () => { + test("defaults to sound always and notification blurred", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + + expect(await attention.notify({ message: "hello" })).toEqual({ + ok: true, + notification: false, + sound: true, + }) + expect(renderer.notifications).toHaveLength(0) + expect(audio.playCalls).toBe(1) + }) + + test("supports blurred-only requests", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + + expect(await attention.notify({ message: "unknown", sound: { when: "blurred" } })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "focus_unknown", + }) + renderer.emit("focus") + expect(await attention.notify({ message: "focused", sound: { when: "blurred" } })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "focused", + }) + renderer.emit("blur") + expect(await attention.notify({ message: "blurred", sound: { when: "blurred" } })).toEqual({ + ok: true, + notification: true, + sound: true, + }) + expect(audio.playCalls).toBe(1) + }) + + test("supports focused-only requests", async () => { + const renderer = new FakeRenderer() + const attention = createTuiAttention({ renderer, config: config(), audio: new FakeAudioEngine() }) + + expect(await attention.notify({ message: "unknown", notification: { when: "focused" }, sound: false })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "focus_unknown", + }) + renderer.emit("blur") + expect(await attention.notify({ message: "blurred", notification: { when: "focused" }, sound: false })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "blurred", + }) + renderer.emit("focus") + expect(await attention.notify({ message: "focused", notification: { when: "focused" }, sound: false })).toEqual({ + ok: true, + notification: true, + sound: false, + }) + expect(renderer.notifications).toEqual([{ title: "opencode", message: "focused" }]) + }) + + test("notification can deliver while focused when requested", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + renderer.emit("focus") + + expect(await attention.notify({ message: "hello", notification: { when: "always" } })).toEqual({ + ok: true, + notification: true, + sound: true, + }) + expect(audio.playCalls).toBe(1) + expect(renderer.notifications).toEqual([{ title: "opencode", message: "hello" }]) + }) + + test("notifies while blurred", async () => { + const renderer = new FakeRenderer() + const attention = createTuiAttention({ renderer, config: config(), audio: new FakeAudioEngine() }) + renderer.emit("blur") + + expect(await attention.notify({ title: "opencode", message: "hello", sound: false })).toEqual({ + ok: true, + notification: true, + sound: false, + }) + expect(renderer.notifications).toEqual([{ title: "opencode", message: "hello" }]) + }) + + test("when requested, blurred-only calls do not notify or play sound while focused", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + renderer.emit("focus") + + expect(await attention.notify({ message: "hello", sound: { when: "blurred" } })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "focused", + }) + expect(renderer.notifications).toHaveLength(0) + expect(audio.loadCalls).toBe(0) + }) + + test("can play sound always while notification is blurred-only", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + renderer.emit("focus") + + expect( + await attention.notify({ + message: "hello", + sound: { name: "question" }, + }), + ).toEqual({ + ok: true, + notification: false, + sound: true, + }) + expect(renderer.notifications).toHaveLength(0) + expect(audio.playCalls).toBe(1) + + renderer.emit("blur") + expect( + await attention.notify({ + message: "hello again", + sound: { name: "question" }, + }), + ).toEqual({ + ok: true, + notification: true, + sound: true, + }) + expect(renderer.notifications).toEqual([{ title: "opencode", message: "hello again" }]) + }) + + test("can disable notification per call while still playing sound", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + + expect(await attention.notify({ message: "hello", notification: false })).toEqual({ + ok: true, + notification: false, + sound: true, + }) + expect(renderer.notifications).toHaveLength(0) + expect(audio.playCalls).toBe(1) + }) + + test("skips empty messages and disabled attention", async () => { + const empty = new FakeRenderer() + empty.emit("blur") + const disabled = new FakeRenderer() + disabled.emit("blur") + + expect(await createTuiAttention({ renderer: empty, config: config() }).notify({ message: " \n " })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "empty_message", + }) + expect( + await createTuiAttention({ renderer: disabled, config: config({ enabled: false }) }).notify({ message: "hello" }), + ).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "attention_disabled", + }) + }) + + test("respects notification and sound config independently", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config({ notifications: false }), audio }) + renderer.emit("blur") + + expect(await attention.notify({ message: "hello", sound: true })).toEqual({ + ok: true, + notification: false, + sound: true, + }) + expect(renderer.notifications).toHaveLength(0) + expect(audio.playCalls).toBe(1) + + const soundDisabledRenderer = new FakeRenderer() + const soundDisabledAudio = new FakeAudioEngine() + const soundDisabled = createTuiAttention({ + renderer: soundDisabledRenderer, + config: config({ sound: false }), + audio: soundDisabledAudio, + }) + soundDisabledRenderer.emit("blur") + + expect(await soundDisabled.notify({ message: "hello", sound: true })).toEqual({ + ok: true, + notification: true, + sound: false, + }) + expect(soundDisabledAudio.loadCalls).toBe(0) + }) + + test("loads audio lazily only for eligible sound requests", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + + await attention.notify({ message: "unknown", sound: { when: "blurred" } }) + expect(audio.loadCalls).toBe(0) + + renderer.emit("blur") + expect(await attention.notify({ message: "blurred", sound: { volume: 2 } })).toEqual({ + ok: true, + notification: true, + sound: true, + }) + expect(audio.loadCalls).toBe(1) + expect(audio.volumes).toEqual([1]) + }) + + test("handles unavailable playback and delegates sound loading", async () => { + const unavailableRenderer = new FakeRenderer() + const unavailableAudio = new FakeAudioEngine() + unavailableAudio.playResult = null + const unavailable = createTuiAttention({ renderer: unavailableRenderer, config: config(), audio: unavailableAudio }) + unavailableRenderer.emit("blur") + + expect(await unavailable.notify({ message: "hello", sound: true })).toEqual({ + ok: true, + notification: true, + sound: false, + }) + expect(unavailableAudio.loadCalls).toBe(1) + expect(unavailableAudio.playCalls).toBe(1) + + const repeatedRenderer = new FakeRenderer() + const repeatedAudio = new FakeAudioEngine() + const repeated = createTuiAttention({ renderer: repeatedRenderer, config: config(), audio: repeatedAudio }) + repeatedRenderer.emit("blur") + + await repeated.notify({ message: "one", sound: true }) + await repeated.notify({ message: "two", sound: true }) + expect(repeatedAudio.loadCalls).toBe(2) + expect(repeatedAudio.playCalls).toBe(2) + }) + + test("plays named sounds from the active sound pack", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + renderer.emit("blur") + + const dispose = attention.soundboard.registerPack({ + id: "acme.soft", + name: "Soft Alerts", + sounds: { + question: "/tmp/question.mp3", + }, + }) + + expect(attention.soundboard.activate("acme.soft")).toBe(true) + expect(attention.soundboard.current()).toBe("acme.soft") + expect(attention.soundboard.list()).toContainEqual({ + id: "acme.soft", + name: "Soft Alerts", + active: true, + builtin: false, + }) + + expect(await attention.notify({ message: "question", sound: { name: "question" } })).toEqual({ + ok: true, + notification: true, + sound: true, + }) + expect(audio.loadPaths).toEqual(["/tmp/question.mp3"]) + + dispose() + expect(attention.soundboard.current()).toBe("opencode.default") + }) + + test("uses config sound overrides before active pack sounds and falls back on load failure", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + audio.rejectPaths.add("/tmp/bad-question.mp3") + const attention = createTuiAttention({ + renderer, + config: config({ sounds: { question: "/tmp/bad-question.mp3" } }), + audio, + }) + renderer.emit("blur") + + attention.soundboard.registerPack({ + id: "acme.soft", + sounds: { + question: "/tmp/good-question.mp3", + }, + }) + attention.soundboard.activate("acme.soft") + + expect(await attention.notify({ message: "question", sound: { name: "question" } })).toEqual({ + ok: true, + notification: true, + sound: true, + }) + expect(audio.loadPaths).toEqual(["/tmp/bad-question.mp3", "/tmp/good-question.mp3"]) + }) + + test("persists activated sound pack in KV", () => { + const kv = new FakeKV() + const renderer = new FakeRenderer() + const attention = createTuiAttention({ renderer, config: config(), kv }) + + attention.soundboard.registerPack({ id: "acme.soft", sounds: { done: "/tmp/done.mp3" } }) + + expect(attention.soundboard.activate("missing", { persist: true })).toBe(false) + expect(kv.store.attention_sound_pack).toBeUndefined() + expect(attention.soundboard.activate("acme.soft", { persist: true })).toBe(true) + expect(kv.store.attention_sound_pack).toBe("acme.soft") + + const next = createTuiAttention({ renderer: new FakeRenderer(), config: config(), kv }) + next.soundboard.registerPack({ id: "acme.soft", sounds: { done: "/tmp/done.mp3" } }) + expect(next.soundboard.current()).toBe("acme.soft") + }) + + test("does not throw for notification or sound failures", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + renderer.notificationThrows = true + audio.rejectLoad = true + const attention = createTuiAttention({ renderer, config: config(), audio }) + renderer.emit("blur") + + expect(await attention.notify({ message: "hello", sound: true })).toEqual({ + ok: false, + notification: false, + sound: false, + }) + }) + + test("strips unsafe notification text", async () => { + const renderer = new FakeRenderer() + const attention = createTuiAttention({ renderer, config: config(), audio: new FakeAudioEngine() }) + renderer.emit("blur") + + await attention.notify({ + title: "\u001b[31m danger\n title\u0007", + message: "\u001b[32m hello\n world\u0000", + }) + + expect(renderer.notifications).toEqual([{ title: "danger title", message: "hello world" }]) + }) + + test("disposes renderer listeners", async () => { + const renderer = new FakeRenderer() + const audio = new FakeAudioEngine() + const attention = createTuiAttention({ renderer, config: config(), audio }) + renderer.emit("blur") + await attention.notify({ message: "hello", sound: true }) + + expect(renderer.listenerCount("focus")).toBe(1) + expect(renderer.listenerCount("blur")).toBe(1) + + attention.dispose() + renderer.isDestroyed = true + + expect(renderer.listenerCount("focus")).toBe(0) + expect(renderer.listenerCount("blur")).toBe(0) + expect(audio.loadCalls).toBe(1) + expect(await attention.notify({ message: "hello" })).toEqual({ + ok: false, + notification: false, + sound: false, + skipped: "renderer_destroyed", + }) + }) +}) diff --git a/packages/opencode/test/cli/cmd/tui/notifications.test.ts b/packages/opencode/test/cli/cmd/tui/notifications.test.ts new file mode 100644 index 000000000000..17ed54bafd03 --- /dev/null +++ b/packages/opencode/test/cli/cmd/tui/notifications.test.ts @@ -0,0 +1,267 @@ +import { describe, expect, test } from "bun:test" +import Notifications from "@/cli/cmd/tui/feature-plugins/system/notifications" +import type { Event, PermissionRequest, QuestionRequest, Session } from "@opencode-ai/sdk/v2" +import type { TuiAttentionNotifyInput } from "@opencode-ai/plugin/tui" +import { createTuiPluginApi } from "../../../fixture/tui-plugin" + +async function setup() { + const notifications: TuiAttentionNotifyInput[] = [] + const handlers = new Map void)[]>() + const session = (id: string, title: string, parentID?: string): Session => ({ + id, + title, + slug: id, + projectID: "project", + directory: "/workspace", + ...(parentID && { parentID }), + version: "0.0.0-test", + time: { created: 0, updated: 0 }, + }) + const sessions: Record = { + session: session("session", "Demo session"), + subagent: session("subagent", "Subagent session", "session"), + abort: session("abort", "Abort session"), + timeout: session("timeout", "Timeout session"), + } + + await Notifications.tui( + createTuiPluginApi({ + attention: { + async notify(input) { + notifications.push(input) + return { ok: true, notification: true, sound: true } + }, + }, + event: { + on: (type: Type, handler: (event: Extract) => void) => { + const list = handlers.get(type) ?? [] + const wrapped = handler as (event: Event) => void + list.push(wrapped) + handlers.set(type, list) + return () => { + handlers.set( + type, + (handlers.get(type) ?? []).filter((item) => item !== wrapped), + ) + } + }, + }, + state: { + session: { + get: (sessionID: string) => sessions[sessionID], + }, + }, + }), + undefined, + {} as never, + ) + + return { + notifications, + emit(event: Event) { + for (const handler of handlers.get(event.type) ?? []) handler(event) + }, + } +} + +function question(id: string, sessionID = "session"): QuestionRequest { + return { + id, + sessionID, + questions: [], + } +} + +function permission(id: string, sessionID = "session"): PermissionRequest { + return { + id, + sessionID, + permission: "edit", + patterns: [], + metadata: {}, + always: [], + } +} + +const questionNotification: TuiAttentionNotifyInput = { + title: "Demo session", + message: "Question needs input", + notification: { when: "blurred" }, + sound: { name: "question", when: "always" }, +} + +const permissionNotification: TuiAttentionNotifyInput = { + title: "Demo session", + message: "Permission needs input", + notification: { when: "blurred" }, + sound: { name: "permission", when: "always" }, +} + +describe("internal notifications TUI plugin", () => { + test("notifies for question and permission requests with blurred notifications and always-on sounds", async () => { + const harness = await setup() + + harness.emit({ id: "event-1", type: "question.asked", properties: question("question-1") }) + harness.emit({ id: "event-2", type: "permission.asked", properties: permission("permission-1") }) + + expect(harness.notifications).toEqual([questionNotification, permissionNotification]) + }) + + test("dedupes pending questions and permissions until they are resolved", async () => { + const harness = await setup() + + harness.emit({ id: "event-1", type: "question.asked", properties: question("question-1") }) + harness.emit({ id: "event-2", type: "question.asked", properties: question("question-1") }) + harness.emit({ + id: "event-3", + type: "question.replied", + properties: { sessionID: "session", requestID: "question-1", answers: [] }, + }) + harness.emit({ id: "event-4", type: "question.asked", properties: question("question-1") }) + + harness.emit({ id: "event-5", type: "permission.asked", properties: permission("permission-1") }) + harness.emit({ id: "event-6", type: "permission.asked", properties: permission("permission-1") }) + harness.emit({ + id: "event-7", + type: "permission.replied", + properties: { sessionID: "session", requestID: "permission-1", reply: "once" }, + }) + harness.emit({ id: "event-8", type: "permission.asked", properties: permission("permission-1") }) + + expect(harness.notifications).toEqual([ + questionNotification, + questionNotification, + permissionNotification, + permissionNotification, + ]) + }) + + test("notifies when an active session becomes idle and suppresses no-op idle", async () => { + const harness = await setup() + + harness.emit({ + id: "event-1", + type: "session.status", + properties: { sessionID: "session", status: { type: "idle" } }, + }) + harness.emit({ + id: "event-2", + type: "session.status", + properties: { sessionID: "session", status: { type: "busy" } }, + }) + harness.emit({ + id: "event-3", + type: "session.status", + properties: { sessionID: "session", status: { type: "idle" } }, + }) + + expect(harness.notifications).toEqual([ + { + title: "Demo session", + message: "Session done", + notification: { when: "blurred" }, + sound: { name: "done", when: "always" }, + }, + ]) + }) + + test("uses sound-only notifications and subagent_done sound for subagent sessions", async () => { + const harness = await setup() + + harness.emit({ id: "event-1", type: "question.asked", properties: question("question-1", "subagent") }) + harness.emit({ + id: "event-2", + type: "session.status", + properties: { sessionID: "subagent", status: { type: "busy" } }, + }) + harness.emit({ + id: "event-3", + type: "session.status", + properties: { sessionID: "subagent", status: { type: "idle" } }, + }) + + expect(harness.notifications).toEqual([ + { + title: "Subagent session", + message: "Question needs input", + notification: false, + sound: { name: "question", when: "always" }, + }, + { + title: "Subagent session", + message: "Session done", + notification: false, + sound: { name: "subagent_done", when: "always" }, + }, + ]) + }) + + test("notifies session errors once and suppresses the following idle done notification", async () => { + const harness = await setup() + + harness.emit({ + id: "event-1", + type: "session.status", + properties: { sessionID: "session", status: { type: "busy" } }, + }) + harness.emit({ + id: "event-2", + type: "session.error", + properties: { sessionID: "session", error: { name: "UnknownError", data: { message: "boom" } } }, + }) + harness.emit({ + id: "event-3", + type: "session.status", + properties: { sessionID: "session", status: { type: "idle" } }, + }) + + expect(harness.notifications).toEqual([ + { + title: "Demo session", + message: "Session error", + notification: { when: "blurred" }, + sound: { name: "error", when: "always" }, + }, + ]) + }) + + test("special-cases aborts and model response timeouts", async () => { + const harness = await setup() + + harness.emit({ + id: "event-1", + type: "session.status", + properties: { sessionID: "abort", status: { type: "busy" } }, + }) + harness.emit({ + id: "event-2", + type: "session.error", + properties: { sessionID: "abort", error: { name: "MessageAbortedError", data: { message: "Aborted" } } }, + }) + harness.emit({ + id: "event-3", + type: "session.status", + properties: { sessionID: "timeout", status: { type: "busy" } }, + }) + harness.emit({ + id: "event-4", + type: "session.error", + properties: { sessionID: "timeout", error: { name: "UnknownError", data: { message: "SSE read timed out" } } }, + }) + + expect(harness.notifications).toEqual([ + { + title: "Abort session", + message: "Session aborted", + notification: { when: "blurred" }, + sound: { name: "error", when: "always" }, + }, + { + title: "Timeout session", + message: "Model stopped responding", + notification: { when: "blurred" }, + sound: { name: "error", when: "always" }, + }, + ]) + }) +}) diff --git a/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx b/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx index d9ecdbe9d576..5f51374c16c5 100644 --- a/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx +++ b/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx @@ -4,9 +4,10 @@ import { onMount } from "solid-js" import { ArgsProvider } from "../../../../src/cli/cmd/tui/context/args" import { ExitProvider } from "../../../../src/cli/cmd/tui/context/exit" import { KVProvider, useKV } from "../../../../src/cli/cmd/tui/context/kv" -import { ProjectProvider } from "../../../../src/cli/cmd/tui/context/project" +import { ProjectProvider, useProject } from "../../../../src/cli/cmd/tui/context/project" import { SDKProvider, type EventSource } from "../../../../src/cli/cmd/tui/context/sdk" import { SyncProvider, useSync } from "../../../../src/cli/cmd/tui/context/sync" +import type { GlobalEvent } from "@opencode-ai/sdk/v2" export const worktree = "/tmp/opencode" export const directory = `${worktree}/packages/opencode` @@ -30,6 +31,25 @@ export function eventSource(): EventSource { return { subscribe: async () => () => {} } } +export function createEventSource() { + let fn: ((event: GlobalEvent) => void) | undefined + + return { + source: { + subscribe: async (handler: (event: GlobalEvent) => void) => { + fn = handler + return () => { + if (fn === handler) fn = undefined + } + }, + } satisfies EventSource, + emit(event: GlobalEvent) { + if (!fn) throw new Error("event source not ready") + fn(event) + }, + } +} + type FetchHandler = (url: URL) => Response | Promise | undefined export function createFetch(override?: FetchHandler) { @@ -77,11 +97,13 @@ export function createFetch(override?: FetchHandler) { return { fetch, session } } -type Ctx = { kv: ReturnType; sync: ReturnType } +type Ctx = { kv: ReturnType; project: ReturnType; sync: ReturnType } export async function mount(override?: FetchHandler) { const calls = createFetch(override) + const events = createEventSource() let sync!: ReturnType + let project!: ReturnType let kv!: ReturnType let done!: () => void const ready = new Promise((resolve) => { @@ -89,9 +111,10 @@ export async function mount(override?: FetchHandler) { }) function Probe() { - const ctx: Ctx = { kv: useKV(), sync: useSync() } + const ctx: Ctx = { kv: useKV(), project: useProject(), sync: useSync() } onMount(() => { sync = ctx.sync + project = ctx.project kv = ctx.kv done() }) @@ -102,7 +125,7 @@ export async function mount(override?: FetchHandler) { - + @@ -116,5 +139,5 @@ export async function mount(override?: FetchHandler) { await ready await wait(() => sync.status === "complete") - return { app, kv, sync, session: calls.session } + return { app, emit: events.emit, kv, project, sync, session: calls.session } } diff --git a/packages/opencode/test/cli/cmd/tui/sync.test.tsx b/packages/opencode/test/cli/cmd/tui/sync.test.tsx index f67257f6ceb2..714c39a781be 100644 --- a/packages/opencode/test/cli/cmd/tui/sync.test.tsx +++ b/packages/opencode/test/cli/cmd/tui/sync.test.tsx @@ -2,7 +2,21 @@ import { describe, expect, test } from "bun:test" import { Global } from "@opencode-ai/core/global" import { tmpdir } from "../../../fixture/fixture" -import { mount } from "./sync-fixture" +import { mount, wait } from "./sync-fixture" +import type { GlobalEvent } from "@opencode-ai/sdk/v2" + +function branchEvent(branch: string, workspace?: string): GlobalEvent { + return { + directory: "/tmp/other", + project: "proj_test", + workspace, + payload: { + id: `evt_vcs_${branch}`, + type: "vcs.branch.updated", + properties: { branch }, + }, + } +} describe("tui sync", () => { test("refresh scopes sessions by default and lists project sessions when disabled", async () => { @@ -27,4 +41,30 @@ describe("tui sync", () => { Global.Path.state = previous } }) + + test("vcs branch updates only apply for the active workspace", async () => { + const previous = Global.Path.state + await using tmp = await tmpdir() + Global.Path.state = tmp.path + await Bun.write(`${tmp.path}/kv.json`, "{}") + const { app, emit, project, sync } = await mount() + + try { + expect(sync.data.vcs?.branch).toBe("main") + + project.workspace.set("ws_a") + emit(branchEvent("other", "ws_b")) + await Bun.sleep(30) + + expect(sync.data.vcs?.branch).toBe("main") + + emit(branchEvent("feature", "ws_a")) + await wait(() => sync.data.vcs?.branch === "feature") + + expect(sync.data.vcs?.branch).toBe("feature") + } finally { + app.renderer.destroy() + Global.Path.state = previous + } + }) }) diff --git a/packages/opencode/test/cli/effect-cmd-instance-als.test.ts b/packages/opencode/test/cli/effect-cmd-instance-als.test.ts index de6fed8daa68..122b87f1742d 100644 --- a/packages/opencode/test/cli/effect-cmd-instance-als.test.ts +++ b/packages/opencode/test/cli/effect-cmd-instance-als.test.ts @@ -1,8 +1,13 @@ -import { afterEach, expect, test } from "bun:test" +import { afterEach, expect } from "bun:test" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Effect } from "effect" -import fs from "fs/promises" +import { fileURLToPath } from "url" +import { InstanceRef } from "../../src/effect/instance-ref" import { Instance } from "../../src/project/instance" -import { disposeAllInstances, provideTestInstance, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" + +const it = testEffect(AppFileSystem.defaultLayer) afterEach(async () => { await disposeAllInstances() @@ -14,35 +19,40 @@ afterEach(async () => { // has lost the outer InstanceRef. Services that read `InstanceState.context` // then fall back to `Instance.current` ALS, which must be installed at the JS // callback boundary (Node ALS persists across awaits, Effect's fiber context -// does not). `provideTestInstance` mirrors effectCmd's load + ALS-restore wrap. +// does not). `it.instance` provides the loaded InstanceRef; the explicit +// Instance.restore mirrors effectCmd's load + ALS-restore wrap. // Pins effect-cmd.ts directly: the pattern test below exercises the load + -// Instance.restore + dispose triple via the shared `provideTestInstance` fixture, +// Instance.restore boundary via the shared `it.instance` fixture, // so a regression that removed `Instance.restore` from effect-cmd.ts wouldn't // fail it. This grep guards the actual production callsite. -test("effect-cmd.ts wraps the handler body in Instance.restore", async () => { - const source = await fs.readFile(new URL("../../src/cli/effect-cmd.ts", import.meta.url), "utf8") - expect(source).toContain("Instance.restore(ctx") -}) +it.live("effect-cmd.ts wraps the handler body in Instance.restore", () => + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const source = yield* fs.readFileString(fileURLToPath(new URL("../../src/cli/effect-cmd.ts", import.meta.url))) + expect(source).toContain("Instance.restore(ctx") + }), +) + +it.instance( + "Instance.current reachable after await inside restored Effect.promise(async)", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const ctx = yield* InstanceRef + if (!ctx) throw new Error("InstanceRef not provided") -test("Instance.current reachable from inner runPromise inside Effect.promise(async)", async () => { - await using dir = await tmpdir({ git: true }) - await provideTestInstance({ - directory: dir.path, - fn: () => - Effect.runPromise( - Effect.promise(async () => { - await new Promise((r) => setTimeout(r, 5)) - const current = await Effect.runPromise( - Effect.sync(() => { - try { - return Instance.current - } catch { - return undefined - } - }), - ) - expect(current?.directory).toBe(dir.path) + const current = yield* Effect.promise(() => + Instance.restore(ctx, async () => { + await Promise.resolve() + try { + return Instance.current + } catch { + return undefined + } }), - ), - }) -}) + ) + + expect(current?.directory).toBe(test.directory) + }), + { git: true }, +) diff --git a/packages/opencode/test/cli/error.test.ts b/packages/opencode/test/cli/error.test.ts index 6af2633ce622..b29ca2b3bae1 100644 --- a/packages/opencode/test/cli/error.test.ts +++ b/packages/opencode/test/cli/error.test.ts @@ -1,8 +1,56 @@ import { describe, expect, test } from "bun:test" import { AccountTransportError } from "../../src/account/schema" import { FormatError } from "../../src/cli/error" +import { UI } from "../../src/cli/ui" describe("cli.error", () => { + test("formats legacy and tagged config errors the same way", () => { + const cases = [ + { + tag: "ConfigJsonError", + data: { path: "/tmp/opencode.jsonc", message: "Unexpected token" }, + expected: "Config file at /tmp/opencode.jsonc is not valid JSON(C): Unexpected token", + }, + { + tag: "ConfigDirectoryTypoError", + data: { path: "/tmp/opencode.jsonc", dir: ".opencode", suggestion: "opencode" }, + expected: + 'Directory ".opencode" in /tmp/opencode.jsonc is not valid. Rename the directory to "opencode" or remove it. This is a common typo.', + }, + { + tag: "ConfigFrontmatterError", + data: { path: "/tmp/AGENTS.md", message: "failed frontmatter" }, + expected: "failed frontmatter", + }, + { + tag: "ConfigInvalidError", + data: { + path: "/tmp/opencode.jsonc", + message: "schema mismatch", + issues: [{ message: "Expected string", path: ["provider", "id"] }], + }, + expected: "Configuration is invalid at /tmp/opencode.jsonc: schema mismatch\n↳ Expected string provider.id", + }, + ] + + for (const item of cases) { + expect(FormatError({ name: item.tag, data: item.data })).toBe(item.expected) + expect(FormatError({ _tag: item.tag, ...item.data })).toBe(item.expected) + } + }) + + test("preserves multiline JSONC diagnostics for tagged config errors", () => { + const data = { + path: "/tmp/opencode.jsonc", + message: + '\n--- JSONC Input ---\n{\n "model": \n}\n--- Errors ---\nValueExpected at line 3, column 1\n Line 3: }\n ^\n--- End ---', + } + const expected = `Config file at ${data.path} is not valid JSON(C): ${data.message}` + + expect(FormatError({ name: "ConfigJsonError", data })).toBe(expected) + expect(FormatError({ _tag: "ConfigJsonError", ...data })).toBe(expected) + }) + test("formats account transport errors clearly", () => { const error = new AccountTransportError({ method: "POST", @@ -15,4 +63,33 @@ describe("cli.error", () => { expect(formatted).toContain("This failed before the server returned an HTTP response.") expect(formatted).toContain("Check your network, proxy, or VPN configuration and try again.") }) + + test("formats legacy and tagged provider model errors the same way", () => { + const data = { + providerID: "anthropic", + modelID: "claude-sonet-4", + suggestions: ["claude-sonnet-4"], + } + const expected = [ + "Model not found: anthropic/claude-sonet-4", + "Did you mean: claude-sonnet-4", + "Try: `opencode models` to list available models", + "Or check your config (opencode.json) provider/model names", + ].join("\n") + + expect(FormatError({ name: "ProviderModelNotFoundError", data })).toBe(expected) + expect(FormatError({ _tag: "ProviderModelNotFoundError", ...data })).toBe(expected) + }) + + test("formats legacy and tagged provider init errors the same way", () => { + const data = { providerID: "anthropic" } + const expected = 'Failed to initialize provider "anthropic". Check credentials and configuration.' + + expect(FormatError({ name: "ProviderInitError", data })).toBe(expected) + expect(FormatError({ _tag: "ProviderInitError", ...data })).toBe(expected) + }) + + test("formats cancelled UI errors as empty output", () => { + expect(FormatError(new UI.CancelledError())).toBe("") + }) }) diff --git a/packages/opencode/test/cli/run/prompt.shared.test.ts b/packages/opencode/test/cli/run/prompt.shared.test.ts index 85a9dfa40686..299751eaa347 100644 --- a/packages/opencode/test/cli/run/prompt.shared.test.ts +++ b/packages/opencode/test/cli/run/prompt.shared.test.ts @@ -1,8 +1,11 @@ import { describe, expect, test } from "bun:test" import { createPromptHistory, + displayCharAt, + displaySlice, isExitCommand, isNewCommand, + mentionTriggerIndex, movePromptHistory, printableBinding, promptCycle, @@ -85,6 +88,53 @@ describe("run prompt shared", () => { expect(draft.state.index).toBeNull() }) + test("uses display-width cursors for history restoration", () => { + const base = createPromptHistory([prompt("one"), prompt("中文")]) + + const latest = movePromptHistory(base, -1, "草稿", 0) + expect(latest.apply).toBe(true) + expect(latest.text).toBe("中文") + expect(latest.cursor).toBe(0) + + const older = movePromptHistory(latest.state, -1, "中文", 0) + expect(older.apply).toBe(true) + expect(older.text).toBe("one") + expect(older.cursor).toBe(0) + + const newer = movePromptHistory(older.state, 1, "one", Bun.stringWidth("one")) + expect(newer.apply).toBe(true) + expect(newer.text).toBe("中文") + expect(newer.cursor).toBe(Bun.stringWidth("中文")) + + const draft = movePromptHistory(newer.state, 1, "中文", Bun.stringWidth("中文")) + expect(draft.apply).toBe(true) + expect(draft.text).toBe("草稿") + expect(draft.cursor).toBe(Bun.stringWidth("草稿")) + }) + + test("uses display-width offsets for mention helpers", () => { + expect(mentionTriggerIndex("@")).toBe(0) + expect(mentionTriggerIndex("test @")).toBe(5) + expect(mentionTriggerIndex("中文 @")).toBe(5) + expect(mentionTriggerIndex("こんにちは @")).toBe(11) + expect(mentionTriggerIndex("한국어 @")).toBe(7) + expect(mentionTriggerIndex("🙂 @")).toBe(3) + expect(mentionTriggerIndex("中文 @src file", Bun.stringWidth("中文 @src"))).toBe(5) + expect(displayCharAt("中文 @src", Bun.stringWidth("中文 @"))).toBe("s") + expect(displaySlice("中文 @src", 5, Bun.stringWidth("中文 @src"))).toBe("@src") + expect(displaySlice("中文 @src", 6, Bun.stringWidth("中文 @src"))).toBe("src") + expect(mentionTriggerIndex("👨‍👩‍👧‍👦 @src", Bun.stringWidth("👨‍👩‍👧‍👦 @src"))).toBe(3) + expect(displayCharAt("👨‍👩‍👧‍👦 @src", Bun.stringWidth("👨‍👩‍👧‍👦 @"))).toBe("s") + expect(displaySlice("👨‍👩‍👧‍👦 @src", 3, Bun.stringWidth("👨‍👩‍👧‍👦 @src"))).toBe("@src") + expect(mentionTriggerIndex("中文@")).toBeUndefined() + expect(mentionTriggerIndex("こんにちは@")).toBeUndefined() + expect(mentionTriggerIndex("한국어@")).toBeUndefined() + expect(mentionTriggerIndex("🙂@")).toBeUndefined() + expect(mentionTriggerIndex("hello@")).toBeUndefined() + expect(mentionTriggerIndex("foo@bar.com")).toBeUndefined() + expect(mentionTriggerIndex("中文 @src file")).toBeUndefined() + }) + test("handles direct and leader-based variant cycling", () => { const keys = promptKeys(keybinds) diff --git a/packages/opencode/test/cli/run/runtime.boot.test.ts b/packages/opencode/test/cli/run/runtime.boot.test.ts index e2569b0ac6bf..8dd978553248 100644 --- a/packages/opencode/test/cli/run/runtime.boot.test.ts +++ b/packages/opencode/test/cli/run/runtime.boot.test.ts @@ -1,14 +1,9 @@ import { afterEach, describe, expect, mock, spyOn, test } from "bun:test" -import type { KeyEvent, Renderable } from "@opentui/core" -import type { Binding } from "@opentui/keymap" -import { createBindingLookup } from "@opentui/keymap/extras" import { OpencodeClient, type Provider } from "@opencode-ai/sdk/v2" import { TuiConfig, type Resolved } from "@/cli/cmd/tui/config/tui" import { formatBindings } from "@/cli/cmd/run/keymap.shared" -import { TuiKeybind } from "@/cli/cmd/tui/config/keybind" import { resolveDiffStyle, resolveFooterKeybinds, resolveModelInfo } from "@/cli/cmd/run/runtime.boot" - -type RunBinding = Binding +import { createTuiResolvedConfig } from "../../fixture/tui-runtime" function model(id: string, providerID: string, context: number, variants?: Record>) { return { @@ -61,45 +56,37 @@ function model(id: string, providerID: string, context: number, variants?: Recor } } -function bindings(...keys: string[]) { - return keys.map((key) => ({ key })) -} - function config(input?: { leader?: string leaderTimeout?: number diff_style?: "auto" | "stacked" bindings?: Partial<{ - commandList: RunBinding[] - variantCycle: RunBinding[] - interrupt: RunBinding[] - historyPrevious: RunBinding[] - historyNext: RunBinding[] - inputClear: RunBinding[] - inputSubmit: RunBinding[] - inputNewline: RunBinding[] + commandList: string[] + variantCycle: string[] + interrupt: string[] + historyPrevious: string[] + historyNext: string[] + inputClear: string[] + inputSubmit: string[] + inputNewline: string[] }> }): Resolved { const bind = input?.bindings - const keybinds = TuiKeybind.Keybinds.parse({ - ...(input?.leader && { leader: input.leader }), - ...(bind?.commandList && { command_list: bind.commandList }), - ...(bind?.variantCycle && { variant_cycle: bind.variantCycle }), - ...(bind?.interrupt && { session_interrupt: bind.interrupt }), - ...(bind?.historyPrevious && { history_previous: bind.historyPrevious }), - ...(bind?.historyNext && { history_next: bind.historyNext }), - ...(bind?.inputClear && { input_clear: bind.inputClear }), - ...(bind?.inputSubmit && { input_submit: bind.inputSubmit }), - ...(bind?.inputNewline && { input_newline: bind.inputNewline }), - }) - return { + return createTuiResolvedConfig({ diff_style: input?.diff_style, - keybinds: createBindingLookup(TuiKeybind.toBindingConfig(keybinds), { - commandMap: TuiKeybind.CommandMap, - bindingDefaults: TuiKeybind.bindingDefaults(), - }), - leader_timeout: input?.leaderTimeout ?? 2000, - } + leader_timeout: input?.leaderTimeout, + keybinds: { + ...(input?.leader && { leader: input.leader }), + ...(bind?.commandList && { command_list: bind.commandList }), + ...(bind?.variantCycle && { variant_cycle: bind.variantCycle }), + ...(bind?.interrupt && { session_interrupt: bind.interrupt }), + ...(bind?.historyPrevious && { history_previous: bind.historyPrevious }), + ...(bind?.historyNext && { history_next: bind.historyNext }), + ...(bind?.inputClear && { input_clear: bind.inputClear }), + ...(bind?.inputSubmit && { input_submit: bind.inputSubmit }), + ...(bind?.inputNewline && { input_newline: bind.inputNewline }), + }, + }) } describe("run runtime boot", () => { @@ -112,14 +99,14 @@ describe("run runtime boot", () => { config({ leader: "ctrl+g", bindings: { - commandList: bindings("ctrl+p"), - variantCycle: bindings("ctrl+t", "alt+t"), - interrupt: bindings("ctrl+c"), - historyPrevious: bindings("k"), - historyNext: bindings("j"), - inputClear: bindings("ctrl+l"), - inputSubmit: bindings("ctrl+s"), - inputNewline: bindings("alt+return"), + commandList: ["ctrl+p"], + variantCycle: ["ctrl+t", "alt+t"], + interrupt: ["ctrl+c"], + historyPrevious: ["k"], + historyNext: ["j"], + inputClear: ["ctrl+l"], + inputSubmit: ["ctrl+s"], + inputNewline: ["alt+return"], }, }), ) diff --git a/packages/opencode/test/cli/tui/plugin-loader.test.ts b/packages/opencode/test/cli/tui/plugin-loader.test.ts index 493520fc0049..ce62550e12a0 100644 --- a/packages/opencode/test/cli/tui/plugin-loader.test.ts +++ b/packages/opencode/test/cli/tui/plugin-loader.test.ts @@ -3,6 +3,7 @@ import fs from "fs/promises" import path from "path" import { pathToFileURL } from "url" import { createTestKeymap } from "@opentui/keymap/testing" +import type { TuiAttentionSoundPack } from "@opencode-ai/plugin/tui" import { tmpdir } from "../../fixture/fixture" import { createTuiPluginApi } from "../../fixture/tui-plugin" import { createTuiResolvedConfig, mockTuiRuntime } from "../../fixture/tui-runtime" @@ -854,6 +855,85 @@ test("plugin keymap proxy preserves real keymap receiver", async () => { } }) +test("auto-disposes plugin attention sound packs and resolves sound paths", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + const file = path.join(dir, "attention-soundpack-plugin.ts") + const spec = pathToFileURL(file).href + const absolute = path.join(dir, "sounds", "default.mp3") + const url = pathToFileURL(path.join(dir, "sounds", "error.mp3")).href + + await Bun.write( + file, + `export default { + id: "demo.attention.soundpack", + tui: async (api) => { + api.attention.soundboard.registerPack({ + id: "demo.pack", + sounds: { + default: ${JSON.stringify(absolute)}, + question: "sounds/question.mp3", + done: " sounds/done.mp3 ", + subagent_done: "sounds/subagent-done.mp3", + error: ${JSON.stringify(url)}, + nope: "sounds/nope.mp3", + permission: "", + }, + }) + }, +} +`, + ) + + return { spec } + }, + }) + + const packs: TuiAttentionSoundPack[] = [] + let dropped = 0 + const attention = { + soundboard: { + registerPack(pack: TuiAttentionSoundPack) { + packs.push(pack) + return () => { + dropped += 1 + } + }, + }, + } + const wait = spyOn(TuiConfig, "waitForDependencies").mockResolvedValue() + const cwd = spyOn(process, "cwd").mockImplementation(() => tmp.path) + + try { + await TuiPluginRuntime.init({ + api: createTuiPluginApi({ attention }), + config: createTuiResolvedConfig({ + plugin: [tmp.extra.spec], + plugin_origins: [{ spec: tmp.extra.spec, scope: "local", source: path.join(tmp.path, "tui.json") }], + }), + }) + + expect(packs).toEqual([ + { + id: "demo.pack", + sounds: { + default: path.join(tmp.path, "sounds", "default.mp3"), + question: path.join(tmp.path, "sounds", "question.mp3"), + done: path.join(tmp.path, "sounds", "done.mp3"), + subagent_done: path.join(tmp.path, "sounds", "subagent-done.mp3"), + error: path.join(tmp.path, "sounds", "error.mp3"), + }, + }, + ]) + expect(dropped).toBe(0) + } finally { + await TuiPluginRuntime.dispose() + expect(dropped).toBe(1) + cwd.mockRestore() + wait.mockRestore() + } +}) + test("auto-disposes plugin keymap transformers", async () => { await using tmp = await tmpdir({ init: async (dir) => { diff --git a/packages/opencode/test/cli/tui/prompt-submit-race.test.ts b/packages/opencode/test/cli/tui/prompt-submit-race.test.ts new file mode 100644 index 000000000000..df659a01d77a --- /dev/null +++ b/packages/opencode/test/cli/tui/prompt-submit-race.test.ts @@ -0,0 +1,98 @@ +import { describe, expect, test } from "bun:test" + +// Regression test for the prompt submit race in +// packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx (`submit`). +// +// Before the fix, two concurrent `submit()` calls (e.g. a double-pressed +// Enter, or the input's native onSubmit racing another dispatch) each +// passed the `if (!store.prompt.input) return false` guard, each +// `await sdk.client.session.create(...)`, and each only captured +// `inputText = store.prompt.input` AFTER that await. The first invocation +// finished, sent the prompt, and cleared the store; the second invocation, +// now past its await, read the cleared store and sent an empty prompt to a +// second freshly-created session - leaving an orphaned session with the +// user's actual text and a phantom session visible to the user containing +// only an assistant reply. +// +// `submitMirror` below has the exact shape of the production `submit()` +// after the fix: an in-flight `submitting` guard wraps the original body. +// Two concurrent invocations must result in exactly one submission carrying +// the user's text, with no empty-text submission. + +type Store = { input: string } + +type SubmitResult = { sessionID: string; text: string } + +type Harness = { + store: Store + submissions: SubmitResult[] + createSession(): Promise + sendPrompt(sessionID: string, text: string): Promise +} + +function createHarness(opts: { sessionCreateDelayMs: number }): Harness { + let sessionCounter = 0 + const submissions: SubmitResult[] = [] + + return { + store: { input: "" }, + submissions, + async createSession() { + sessionCounter += 1 + const id = `ses_${sessionCounter}` + await Bun.sleep(opts.sessionCreateDelayMs) + return id + }, + async sendPrompt(sessionID, text) { + submissions.push({ sessionID, text }) + }, + } +} + +function createSubmit() { + let submitting = false + return async function submit(h: Harness) { + if (submitting) return false + submitting = true + try { + if (!h.store.input) return false + const sessionID = await h.createSession() + const inputText = h.store.input + await h.sendPrompt(sessionID, inputText) + h.store.input = "" + return true + } finally { + submitting = false + } + } +} + +describe("Prompt.submit race", () => { + test("concurrent submits must not lose the user's text", async () => { + const submit = createSubmit() + const h = createHarness({ sessionCreateDelayMs: 5 }) + h.store.input = "Hello there." + + // Two invocations back-to-back, mimicking a double-Enter. + await Promise.all([submit(h), submit(h)]) + + // Every submission that did make it through must carry the actual user + // text, and no submission may have an empty text payload. + expect(h.submissions.every((s) => s.text === "Hello there.")).toBe(true) + expect(h.submissions.some((s) => s.text === "")).toBe(false) + }) + + test("a sequential second submit after clear is a no-op, not a phantom session", async () => { + const submit = createSubmit() + const h = createHarness({ sessionCreateDelayMs: 1 }) + h.store.input = "Hello there." + + await submit(h) + // After the first submission completes, the store is cleared; a second + // Enter on an empty input must not create a phantom session. + await submit(h) + + expect(h.submissions).toHaveLength(1) + expect(h.submissions[0].text).toBe("Hello there.") + }) +}) diff --git a/packages/opencode/test/cli/tui/use-event.test.tsx b/packages/opencode/test/cli/tui/use-event.test.tsx index 78253361b76c..d690cfd6cec8 100644 --- a/packages/opencode/test/cli/tui/use-event.test.tsx +++ b/packages/opencode/test/cli/tui/use-event.test.tsx @@ -7,6 +7,8 @@ import { ProjectProvider, useProject } from "../../../src/cli/cmd/tui/context/pr import { SDKProvider } from "../../../src/cli/cmd/tui/context/sdk" import { useEvent } from "../../../src/cli/cmd/tui/context/event" +const projectID = "proj_test" + async function wait(fn: () => boolean, timeout = 2000) { const start = Date.now() while (!fn()) { @@ -15,9 +17,10 @@ async function wait(fn: () => boolean, timeout = 2000) { } } -function event(payload: Event, input: { directory: string; workspace?: string }): GlobalEvent { +function event(payload: Event, input: { directory: string; project?: string; workspace?: string }): GlobalEvent { return { directory: input.directory, + project: input.project, workspace: input.workspace, payload, } @@ -65,6 +68,13 @@ function createSource() { async function mount() { const source = createSource() const seen: Event[] = [] + const workspaces: Array = [] + const fetch = (async (input: RequestInfo | URL) => { + const url = new URL(input instanceof Request ? input.url : String(input)) + if (url.pathname === "/path") return Response.json({ home: "", state: "", config: "", directory: "/tmp/root" }) + if (url.pathname === "/project/current") return Response.json({ id: projectID }) + throw new Error(`unexpected request: ${url.pathname}`) + }) as typeof globalThis.fetch let project!: ReturnType let done!: () => void const ready = new Promise((resolve) => { @@ -72,30 +82,37 @@ async function mount() { }) const app = await testRender(() => ( - + { + onReady={async (ctx) => { project = ctx.project + await project.sync() done() }} seen={seen} + workspaces={workspaces} /> )) await ready - return { app, emit: source.emit, project, seen } + return { app, emit: source.emit, project, seen, workspaces } } -function Probe(props: { seen: Event[]; onReady: (ctx: { project: ReturnType }) => void }) { +function Probe(props: { + seen: Event[] + workspaces: Array + onReady: (ctx: { project: ReturnType }) => void +}) { const project = useProject() const event = useEvent() onMount(() => { - event.subscribe((evt) => { + event.subscribe((evt, { workspace }) => { props.seen.push(evt) + props.workspaces.push(workspace) }) props.onReady({ project }) }) @@ -104,25 +121,26 @@ function Probe(props: { seen: Event[]; onReady: (ctx: { project: ReturnType { - test("delivers matching directory events without an active workspace", async () => { - const { app, emit, seen } = await mount() + test("delivers events for the current project", async () => { + const { app, emit, seen, workspaces } = await mount() try { - emit(event(vcs("main"), { directory: "/tmp/root" })) + emit(event(vcs("main"), { directory: "/tmp/other", project: projectID, workspace: "ws_a" })) await wait(() => seen.length === 1) expect(seen).toEqual([vcs("main")]) + expect(workspaces).toEqual(["ws_a"]) } finally { app.renderer.destroy() } }) - test("ignores non-matching directory events without an active workspace", async () => { + test("ignores events for other projects", async () => { const { app, emit, seen } = await mount() try { - emit(event(vcs("other"), { directory: "/tmp/other" })) + emit(event(vcs("other"), { directory: "/tmp/root", project: "proj_other" })) await Bun.sleep(30) expect(seen).toHaveLength(0) @@ -131,12 +149,12 @@ describe("useEvent", () => { } }) - test("delivers matching workspace events when a workspace is active", async () => { + test("delivers current project events regardless of active workspace", async () => { const { app, emit, project, seen } = await mount() try { project.workspace.set("ws_a") - emit(event(vcs("ws"), { directory: "/tmp/other", workspace: "ws_a" })) + emit(event(vcs("ws"), { directory: "/tmp/other", project: projectID, workspace: "ws_b" })) await wait(() => seen.length === 1) @@ -146,20 +164,6 @@ describe("useEvent", () => { } }) - test("ignores non-matching workspace events when a workspace is active", async () => { - const { app, emit, project, seen } = await mount() - - try { - project.workspace.set("ws_a") - emit(event(vcs("ws"), { directory: "/tmp/root", workspace: "ws_b" })) - await Bun.sleep(30) - - expect(seen).toHaveLength(0) - } finally { - app.renderer.destroy() - } - }) - test("delivers truly global events even when a workspace is active", async () => { const { app, emit, project, seen } = await mount() diff --git a/packages/opencode/test/config/agent-color.test.ts b/packages/opencode/test/config/agent-color.test.ts index 49509156ab7e..d198080591b2 100644 --- a/packages/opencode/test/config/agent-color.test.ts +++ b/packages/opencode/test/config/agent-color.test.ts @@ -1,69 +1,47 @@ -import { test, expect } from "bun:test" +import { expect } from "bun:test" import { Effect, Layer } from "effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" -import path from "path" -import { provideInstance, tmpdirScoped } from "../fixture/fixture" import { Config } from "@/config/config" import { Agent as AgentSvc } from "../../src/agent/agent" -import { Color } from "@/util/color" -import { AppRuntime } from "../../src/effect/app-runtime" import { testEffect } from "../lib/effect" -const it = testEffect(Layer.mergeAll(AgentSvc.defaultLayer, CrossSpawnSpawner.defaultLayer)) +const it = testEffect(Layer.mergeAll(Config.defaultLayer, AgentSvc.defaultLayer, CrossSpawnSpawner.defaultLayer)) -const writeConfig = (dir: string, agent: Config.Info["agent"]) => - Effect.promise(() => - Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - agent, - }), - ), - ) - -it.live("agent color parsed from project config", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped() - yield* writeConfig(dir, { - build: { color: "#FFA500" }, - plan: { color: "primary" }, - }) - - yield* Effect.gen(function* () { - const cfg = yield* Effect.promise(() => AppRuntime.runPromise(Config.Service.use((svc) => svc.get()))) +it.instance( + "agent color parsed from project config", + () => + Effect.gen(function* () { + const cfg = yield* Config.Service.use((svc) => svc.get()) expect(cfg.agent?.["build"]?.color).toBe("#FFA500") expect(cfg.agent?.["plan"]?.color).toBe("primary") - }).pipe(provideInstance(dir)) - }), + }), + { + git: true, + config: { + agent: { + build: { color: "#FFA500" }, + plan: { color: "primary" }, + }, + }, + }, ) -it.live("Agent.get includes color from config", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped() - yield* writeConfig(dir, { - plan: { color: "#A855F7" }, - build: { color: "accent" }, - }) - - yield* Effect.gen(function* () { +it.instance( + "Agent.get includes color from config", + () => + Effect.gen(function* () { const plan = yield* AgentSvc.Service.use((svc) => svc.get("plan")) expect(plan?.color).toBe("#A855F7") const build = yield* AgentSvc.Service.use((svc) => svc.get("build")) expect(build?.color).toBe("accent") - }).pipe(provideInstance(dir)) - }), + }), + { + git: true, + config: { + agent: { + plan: { color: "#A855F7" }, + build: { color: "accent" }, + }, + }, + }, ) - -test("Color.hexToAnsiBold converts valid hex to ANSI", () => { - const result = Color.hexToAnsiBold("#FFA500") - expect(result).toBe("\x1b[38;2;255;165;0m\x1b[1m") -}) - -test("Color.hexToAnsiBold returns undefined for invalid hex", () => { - expect(Color.hexToAnsiBold(undefined)).toBeUndefined() - expect(Color.hexToAnsiBold("")).toBeUndefined() - expect(Color.hexToAnsiBold("#FFF")).toBeUndefined() - expect(Color.hexToAnsiBold("FFA500")).toBeUndefined() - expect(Color.hexToAnsiBold("#GGGGGG")).toBeUndefined() -}) diff --git a/packages/opencode/test/config/config.test.ts b/packages/opencode/test/config/config.test.ts index fa9fd332e839..90e78efcdbaa 100644 --- a/packages/opencode/test/config/config.test.ts +++ b/packages/opencode/test/config/config.test.ts @@ -141,6 +141,54 @@ test("loads config with defaults when no files exist", async () => { }) }) +test("creates global jsonc config with schema when no global configs exist", async () => { + await using tmp = await tmpdir() + const prev = Global.Path.config + ;(Global.Path as { config: string }).config = tmp.path + await clear(true) + + try { + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + await load() + }, + }) + + const content = await Filesystem.readText(path.join(tmp.path, "opencode.jsonc")) + expect(content).toContain('"$schema": "https://opencode.ai/config.json"') + } finally { + ;(Global.Path as { config: string }).config = prev + await clear(true) + } +}) + +test("does not create global config when OPENCODE_CONFIG_DIR is set", async () => { + await using tmp = await tmpdir() + await using custom = await tmpdir() + const prevConfig = Global.Path.config + const prevEnv = process.env.OPENCODE_CONFIG_DIR + ;(Global.Path as { config: string }).config = tmp.path + process.env.OPENCODE_CONFIG_DIR = custom.path + await clear(true) + + try { + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + await load() + }, + }) + + expect(await Filesystem.exists(path.join(tmp.path, "opencode.jsonc"))).toBe(false) + } finally { + ;(Global.Path as { config: string }).config = prevConfig + if (prevEnv === undefined) delete process.env.OPENCODE_CONFIG_DIR + else process.env.OPENCODE_CONFIG_DIR = prevEnv + await clear(true) + } +}) + test("loads JSON config file", async () => { await using tmp = await tmpdir({ init: async (dir) => { diff --git a/packages/opencode/test/config/tui.test.ts b/packages/opencode/test/config/tui.test.ts index db045685733e..4eb96b95761d 100644 --- a/packages/opencode/test/config/tui.test.ts +++ b/packages/opencode/test/config/tui.test.ts @@ -1,113 +1,100 @@ -import { afterEach, beforeEach, expect, test } from "bun:test" +import { expect } from "bun:test" import path from "path" -import fs from "fs/promises" -import { provideTestInstance, tmpdir } from "../fixture/fixture" -import { InstanceRuntime } from "@/project/instance-runtime" -import { TuiConfig } from "../../src/cli/cmd/tui/config/tui" -import { Config } from "@/config/config" -import { Global } from "@opencode-ai/core/global" -import { Filesystem } from "@/util/filesystem" -import { AppRuntime } from "../../src/effect/app-runtime" +import { pathToFileURL } from "url" import { Effect, Layer } from "effect" -import { CurrentWorkingDirectory } from "@/cli/cmd/tui/config/cwd" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Global } from "@opencode-ai/core/global" +import { Config } from "@/config/config" import { ConfigPlugin } from "@/config/plugin" +import { CurrentWorkingDirectory } from "@/cli/cmd/tui/config/cwd" +import { TuiConfig } from "../../src/cli/cmd/tui/config/tui" +import { TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" -const wintest = process.platform === "win32" ? test : test.skip -const clear = async (wait = false) => { - await AppRuntime.runPromise(Config.Service.use((svc) => svc.invalidate())) - if (wait) await InstanceRuntime.disposeAllInstances() -} -const load = () => AppRuntime.runPromise(Config.Service.use((svc) => svc.get())) - -beforeEach(async () => { - await clear(true) -}) +const it = testEffect(Layer.mergeAll(Config.defaultLayer, AppFileSystem.defaultLayer)) +const winIt = process.platform === "win32" ? it.instance : it.instance.skip -const getTuiConfig = async (directory: string) => - Effect.runPromise( - TuiConfig.Service.use((svc) => svc.get()).pipe( - Effect.provide(TuiConfig.defaultLayer.pipe(Layer.provide(Layer.succeed(CurrentWorkingDirectory, directory)))), - ), - ) +const globalConfigFiles = ["opencode.json", "opencode.jsonc", "tui.json", "tui.jsonc"].map((file) => + path.join(Global.Path.config, file), +) -async function withPlatform(platform: typeof process.platform, fn: () => Promise) { - const original = Object.getOwnPropertyDescriptor(process, "platform") - Object.defineProperty(process, "platform", { - ...original, - value: platform, - }) - try { - return await fn() - } finally { - if (original) Object.defineProperty(process, "platform", original) - } -} - -afterEach(async () => { +const cleanState = Effect.gen(function* () { + const fs = yield* AppFileSystem.Service delete process.env.OPENCODE_CONFIG delete process.env.OPENCODE_TUI_CONFIG - await fs.rm(path.join(Global.Path.config, "opencode.json"), { force: true }).catch(() => {}) - await fs.rm(path.join(Global.Path.config, "opencode.jsonc"), { force: true }).catch(() => {}) - await fs.rm(path.join(Global.Path.config, "tui.json"), { force: true }).catch(() => {}) - await fs.rm(path.join(Global.Path.config, "tui.jsonc"), { force: true }).catch(() => {}) - await clear(true) + yield* Effect.forEach(globalConfigFiles, (file) => fs.remove(file, { force: true }).pipe(Effect.ignore), { + discard: true, + }) }) -test("keeps server and tui plugin merge semantics aligned", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - const local = path.join(dir, ".opencode") - await fs.mkdir(local, { recursive: true }) - - await Bun.write( - path.join(Global.Path.config, "opencode.json"), - JSON.stringify( - { - plugin: [["shared-plugin@1.0.0", { source: "global" }], "global-only@1.0.0"], - }, - null, - 2, - ), - ) - await Bun.write( - path.join(Global.Path.config, "tui.json"), - JSON.stringify( - { - plugin: [["shared-plugin@1.0.0", { source: "global" }], "global-only@1.0.0"], - }, - null, - 2, - ), - ) +const withCleanState = (self: Effect.Effect) => + Effect.acquireUseRelease( + cleanState, + () => self, + () => cleanState, + ) - await Bun.write( - path.join(local, "opencode.json"), - JSON.stringify( - { - plugin: [["shared-plugin@2.0.0", { source: "local" }], "local-only@1.0.0"], - }, - null, - 2, - ), - ) - await Bun.write( - path.join(local, "tui.json"), - JSON.stringify( - { - plugin: [["shared-plugin@2.0.0", { source: "local" }], "local-only@1.0.0"], - }, - null, - 2, - ), - ) - }, - }) +const withEnv = (name: string, value: string | undefined, self: Effect.Effect) => + Effect.acquireUseRelease( + Effect.sync(() => { + const previous = process.env[name] + if (value === undefined) delete process.env[name] + else process.env[name] = value + return previous + }), + () => self, + (previous) => + Effect.sync(() => { + if (previous === undefined) delete process.env[name] + else process.env[name] = previous + }), + ) + +const withPlatform = (platform: typeof process.platform, self: Effect.Effect) => + Effect.acquireUseRelease( + Effect.sync(() => { + const original = Object.getOwnPropertyDescriptor(process, "platform") + Object.defineProperty(process, "platform", { + ...original, + value: platform, + }) + return original + }), + () => self, + (original) => + Effect.sync(() => { + if (original) Object.defineProperty(process, "platform", original) + }), + ) + +const getTuiConfig = (directory: string) => + TuiConfig.Service.use((svc) => svc.get()).pipe( + Effect.provide(TuiConfig.defaultLayer.pipe(Layer.provide(Layer.succeed(CurrentWorkingDirectory, directory)))), + ) - await provideTestInstance({ - directory: tmp.path, - fn: async () => { - const server = await load() - const tui = await getTuiConfig(tmp.path) +it.instance("keeps server and tui plugin merge semantics aligned", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const local = path.join(test.directory, ".opencode") + yield* fs.makeDirectory(local, { recursive: true }) + + yield* fs.writeJson(path.join(Global.Path.config, "opencode.json"), { + plugin: [["shared-plugin@1.0.0", { source: "global" }], "global-only@1.0.0"], + }) + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { + plugin: [["shared-plugin@1.0.0", { source: "global" }], "global-only@1.0.0"], + }) + yield* fs.writeJson(path.join(local, "opencode.json"), { + plugin: [["shared-plugin@2.0.0", { source: "local" }], "local-only@1.0.0"], + }) + yield* fs.writeJson(path.join(local, "tui.json"), { + plugin: [["shared-plugin@2.0.0", { source: "local" }], "local-only@1.0.0"], + }) + + const server = yield* Config.Service.use((svc) => svc.get()) + const tui = yield* getTuiConfig(test.directory) const serverPlugins = (server.plugin ?? []).map((item) => ConfigPlugin.pluginSpecifier(item)) const tuiPlugins = (tui.plugin ?? []).map((item) => ConfigPlugin.pluginSpecifier(item)) @@ -120,186 +107,228 @@ test("keeps server and tui plugin merge semantics aligned", async () => { expect(serverOrigins.map((item) => ConfigPlugin.pluginSpecifier(item.spec))).toEqual(serverPlugins) expect(tuiOrigins.map((item) => ConfigPlugin.pluginSpecifier(item.spec))).toEqual(tuiPlugins) expect(serverOrigins.map((item) => item.scope)).toEqual(tuiOrigins.map((item) => item.scope)) - }, - }) -}) - -test("loads tui config with the same precedence order as server config paths", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(Global.Path.config, "tui.json"), JSON.stringify({ theme: "global" }, null, 2)) - await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ theme: "project" }, null, 2)) - await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) - await Bun.write( - path.join(dir, ".opencode", "tui.json"), + }), + ), +) + +it.instance("loads tui config with the same precedence order as server config paths", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { theme: "global" }) + yield* fs.writeJson(path.join(test.directory, "tui.json"), { theme: "project" }) + yield* fs.writeWithDirs( + path.join(test.directory, ".opencode", "tui.json"), JSON.stringify({ theme: "local", diff_style: "stacked" }, null, 2), ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("local") - expect(config.diff_style).toBe("stacked") -}) - -test("migrates tui-specific keys from opencode.json when tui.json does not exist", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify( - { - theme: "migrated-theme", - tui: { scroll_speed: 5 }, - keybinds: { app_exit: "ctrl+q" }, - }, - null, - 2, - ), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("migrated-theme") - expect(config.scroll_speed).toBe(5) - expect(config.keybinds.get("app.exit")?.[0]?.key).toBe("ctrl+q") - const text = await Filesystem.readText(path.join(tmp.path, "tui.json")) - expect(JSON.parse(text)).toMatchObject({ - theme: "migrated-theme", - scroll_speed: 5, - }) - const server = JSON.parse(await Filesystem.readText(path.join(tmp.path, "opencode.json"))) - expect(server.theme).toBeUndefined() - expect(server.keybinds).toBeUndefined() - expect(server.tui).toBeUndefined() - expect(await Filesystem.exists(path.join(tmp.path, "opencode.json.tui-migration.bak"))).toBe(true) - expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) -}) -test("migrates project legacy tui keys even when global tui.json already exists", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(Global.Path.config, "tui.json"), JSON.stringify({ theme: "global" }, null, 2)) - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify( - { - theme: "project-migrated", - tui: { scroll_speed: 2 }, + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("local") + expect(config.diff_style).toBe("stacked") + }), + ), +) + +it.instance("resolves attention config defaults and overrides", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + + expect((yield* getTuiConfig(test.directory)).attention).toEqual({ + enabled: false, + notifications: true, + sound: true, + volume: 0.4, + sound_pack: "opencode.default", + sounds: {}, + }) + + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + attention: { + enabled: false, + notifications: false, + sound: false, + volume: 0.7, + sound_pack: "acme.soft", + sounds: { + default: path.join(test.directory, "default.mp3"), + question: pathToFileURL(path.join(test.directory, "question.mp3")).href, + error: "./error.mp3", + subagent_done: "./subagent-done.mp3", }, - null, - 2, - ), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("project-migrated") - expect(config.scroll_speed).toBe(2) - expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) - - const server = JSON.parse(await Filesystem.readText(path.join(tmp.path, "opencode.json"))) - expect(server.theme).toBeUndefined() - expect(server.tui).toBeUndefined() -}) - -test("drops unknown legacy tui keys during migration", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify( - { - theme: "migrated-theme", - tui: { scroll_speed: 2, foo: 1 }, - }, - null, - 2, - ), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("migrated-theme") - expect(config.scroll_speed).toBe(2) - - const text = await Filesystem.readText(path.join(tmp.path, "tui.json")) - const migrated = JSON.parse(text) - expect(migrated.scroll_speed).toBe(2) - expect(migrated.foo).toBeUndefined() -}) - -test("skips migration when opencode.jsonc is syntactically invalid", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.jsonc"), + }, + }) + + expect((yield* getTuiConfig(test.directory)).attention).toEqual({ + enabled: false, + notifications: false, + sound: false, + volume: 0.7, + sound_pack: "acme.soft", + sounds: { + default: path.join(test.directory, "default.mp3"), + question: path.join(test.directory, "question.mp3"), + error: path.join(test.directory, "error.mp3"), + subagent_done: path.join(test.directory, "subagent-done.mp3"), + }, + }) + }), + ), +) + +it.instance("migrates tui-specific keys from opencode.json when tui.json does not exist", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const source = path.join(test.directory, "opencode.json") + yield* fs.writeJson(source, { + theme: "migrated-theme", + tui: { scroll_speed: 5 }, + keybinds: { app_exit: "ctrl+q" }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("migrated-theme") + expect(config.scroll_speed).toBe(5) + expect(config.keybinds.get("app.exit")?.[0]?.key).toBe("ctrl+q") + expect(JSON.parse(yield* fs.readFileString(path.join(test.directory, "tui.json")))).toMatchObject({ + theme: "migrated-theme", + scroll_speed: 5, + }) + const server = JSON.parse(yield* fs.readFileString(source)) + expect(server.theme).toBeUndefined() + expect(server.keybinds).toBeUndefined() + expect(server.tui).toBeUndefined() + expect(yield* fs.existsSafe(path.join(test.directory, "opencode.json.tui-migration.bak"))).toBe(true) + expect(yield* fs.existsSafe(path.join(test.directory, "tui.json"))).toBe(true) + }), + ), +) + +it.instance("migrates project legacy tui keys even when global tui.json already exists", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { theme: "global" }) + yield* fs.writeJson(path.join(test.directory, "opencode.json"), { + theme: "project-migrated", + tui: { scroll_speed: 2 }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("project-migrated") + expect(config.scroll_speed).toBe(2) + expect(yield* fs.existsSafe(path.join(test.directory, "tui.json"))).toBe(true) + + const server = JSON.parse(yield* fs.readFileString(path.join(test.directory, "opencode.json"))) + expect(server.theme).toBeUndefined() + expect(server.tui).toBeUndefined() + }), + ), +) + +it.instance("drops unknown legacy tui keys during migration", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "opencode.json"), { + theme: "migrated-theme", + tui: { scroll_speed: 2, foo: 1 }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("migrated-theme") + expect(config.scroll_speed).toBe(2) + + const migrated = JSON.parse(yield* fs.readFileString(path.join(test.directory, "tui.json"))) + expect(migrated.scroll_speed).toBe(2) + expect(migrated.foo).toBeUndefined() + }), + ), +) + +it.instance("skips migration when opencode.jsonc is syntactically invalid", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeFileString( + path.join(test.directory, "opencode.jsonc"), `{ "theme": "broken-theme", "tui": { "scroll_speed": 2 } "username": "still-broken" }`, ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBeUndefined() - expect(config.scroll_speed).toBeUndefined() - expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(false) - expect(await Filesystem.exists(path.join(tmp.path, "opencode.jsonc.tui-migration.bak"))).toBe(false) - const source = await Filesystem.readText(path.join(tmp.path, "opencode.jsonc")) - expect(source).toContain('"theme": "broken-theme"') - expect(source).toContain('"tui": { "scroll_speed": 2 }') -}) - -test("skips migration when tui.json already exists", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "opencode.json"), JSON.stringify({ theme: "legacy" }, null, 2)) - await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ diff_style: "stacked" }, null, 2)) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.diff_style).toBe("stacked") - expect(config.theme).toBeUndefined() - - const server = JSON.parse(await Filesystem.readText(path.join(tmp.path, "opencode.json"))) - expect(server.theme).toBe("legacy") - expect(await Filesystem.exists(path.join(tmp.path, "opencode.json.tui-migration.bak"))).toBe(false) -}) - -test("continues loading tui config when legacy source cannot be stripped", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "opencode.json"), JSON.stringify({ theme: "readonly-theme" }, null, 2)) - }, - }) - const source = path.join(tmp.path, "opencode.json") - await fs.chmod(source, 0o444) - - try { - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("readonly-theme") - expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) - - const server = JSON.parse(await Filesystem.readText(source)) - expect(server.theme).toBe("readonly-theme") - } finally { - await fs.chmod(source, 0o644) - } -}) - -test("migration backup preserves JSONC comments", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.jsonc"), + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBeUndefined() + expect(config.scroll_speed).toBeUndefined() + expect(yield* fs.existsSafe(path.join(test.directory, "tui.json"))).toBe(false) + expect(yield* fs.existsSafe(path.join(test.directory, "opencode.jsonc.tui-migration.bak"))).toBe(false) + const source = yield* fs.readFileString(path.join(test.directory, "opencode.jsonc")) + expect(source).toContain('"theme": "broken-theme"') + expect(source).toContain('"tui": { "scroll_speed": 2 }') + }), + ), +) + +it.instance("skips migration when tui.json already exists", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "opencode.json"), { theme: "legacy" }) + yield* fs.writeJson(path.join(test.directory, "tui.json"), { diff_style: "stacked" }) + + const config = yield* getTuiConfig(test.directory) + expect(config.diff_style).toBe("stacked") + expect(config.theme).toBeUndefined() + + const server = JSON.parse(yield* fs.readFileString(path.join(test.directory, "opencode.json"))) + expect(server.theme).toBe("legacy") + expect(yield* fs.existsSafe(path.join(test.directory, "opencode.json.tui-migration.bak"))).toBe(false) + }), + ), +) + +it.instance("continues loading tui config when legacy source cannot be stripped", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const source = path.join(test.directory, "opencode.json") + yield* fs.writeJson(source, { theme: "readonly-theme" }) + + yield* Effect.acquireUseRelease( + fs.chmod(source, 0o444), + () => + Effect.gen(function* () { + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("readonly-theme") + expect(yield* fs.existsSafe(path.join(test.directory, "tui.json"))).toBe(true) + + const server = JSON.parse(yield* fs.readFileString(source)) + expect(server.theme).toBe("readonly-theme") + }), + () => fs.chmod(source, 0o644).pipe(Effect.ignore), + ) + }), + ), +) + +it.instance("migration backup preserves JSONC comments", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeFileString( + path.join(test.directory, "opencode.jsonc"), `{ // top-level comment "theme": "jsonc-theme", @@ -309,498 +338,539 @@ test("migration backup preserves JSONC comments", async () => { } }`, ) - }, - }) - - await getTuiConfig(tmp.path) - const backup = await Filesystem.readText(path.join(tmp.path, "opencode.jsonc.tui-migration.bak")) - expect(backup).toContain("// top-level comment") - expect(backup).toContain("// nested comment") - expect(backup).toContain('"theme": "jsonc-theme"') - expect(backup).toContain('"scroll_speed": 1.5') -}) - -test("migrates legacy tui keys across multiple opencode.json levels", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - const nested = path.join(dir, "apps", "client") - await fs.mkdir(nested, { recursive: true }) - await Bun.write(path.join(dir, "opencode.json"), JSON.stringify({ theme: "root-theme" }, null, 2)) - await Bun.write(path.join(nested, "opencode.json"), JSON.stringify({ theme: "nested-theme" }, null, 2)) - }, - }) - const config = await getTuiConfig(path.join(tmp.path, "apps", "client")) - expect(config.theme).toBe("nested-theme") - expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) - expect(await Filesystem.exists(path.join(tmp.path, "apps", "client", "tui.json"))).toBe(true) -}) -test("flattens nested tui key inside tui.json", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - theme: "outer", - tui: { scroll_speed: 3, diff_style: "stacked" }, + yield* getTuiConfig(test.directory) + const backup = yield* fs.readFileString(path.join(test.directory, "opencode.jsonc.tui-migration.bak")) + expect(backup).toContain("// top-level comment") + expect(backup).toContain("// nested comment") + expect(backup).toContain('"theme": "jsonc-theme"') + expect(backup).toContain('"scroll_speed": 1.5') + }), + ), +) + +it.instance("migrates legacy tui keys across multiple opencode.json levels", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const nested = path.join(test.directory, "apps", "client") + yield* fs.makeDirectory(nested, { recursive: true }) + yield* fs.writeJson(path.join(test.directory, "opencode.json"), { theme: "root-theme" }) + yield* fs.writeJson(path.join(nested, "opencode.json"), { theme: "nested-theme" }) + + const config = yield* getTuiConfig(nested) + expect(config.theme).toBe("nested-theme") + expect(yield* fs.existsSafe(path.join(test.directory, "tui.json"))).toBe(true) + expect(yield* fs.existsSafe(path.join(nested, "tui.json"))).toBe(true) + }), + ), +) + +it.instance("flattens nested tui key inside tui.json", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + theme: "outer", + tui: { scroll_speed: 3, diff_style: "stacked" }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.scroll_speed).toBe(3) + expect(config.diff_style).toBe("stacked") + expect(config.theme).toBe("outer") + }), + ), +) + +it.instance("top-level keys in tui.json take precedence over nested tui key", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + diff_style: "auto", + tui: { diff_style: "stacked", scroll_speed: 2 }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.diff_style).toBe("auto") + expect(config.scroll_speed).toBe(2) + }), + ), +) + +it.instance("project config takes precedence over OPENCODE_TUI_CONFIG (matches OPENCODE_CONFIG)", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const custom = path.join(test.directory, "custom-tui.json") + yield* fs.writeJson(path.join(test.directory, "tui.json"), { theme: "project", diff_style: "auto" }) + yield* fs.writeJson(custom, { theme: "custom", diff_style: "stacked" }) + + yield* withEnv( + "OPENCODE_TUI_CONFIG", + custom, + Effect.gen(function* () { + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("project") + expect(config.diff_style).toBe("auto") }), ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.scroll_speed).toBe(3) - expect(config.diff_style).toBe("stacked") - // top-level keys take precedence over nested tui keys - expect(config.theme).toBe("outer") -}) - -test("top-level keys in tui.json take precedence over nested tui key", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - diff_style: "auto", - tui: { diff_style: "stacked", scroll_speed: 2 }, - }), + }), + ), +) + +it.instance("merges keybind overrides across precedence layers", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { keybinds: { app_exit: "ctrl+q" } }) + yield* fs.writeJson(path.join(test.directory, "tui.json"), { keybinds: { theme_list: "ctrl+k" } }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("app.exit")?.[0]?.key).toBe("ctrl+q") + expect(config.keybinds.get("theme.switch")?.[0]?.key).toBe("ctrl+k") + }), + ), +) + +it.instance("ignores unknown keybind names without dropping valid overrides from the same file", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { + keybinds: { + session_delete: "ctrl+d", + not_a_real_keybind: "ctrl+q", + }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("session.delete")?.[0]?.key).toBe("ctrl+d") + expect(config.keybinds.get("not_a_real_keybind")).toEqual([]) + }), + ), +) + +it.instance("resolves keybind lookup from canonical keybinds", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + keybinds: { + leader: { key: { name: "g", ctrl: true } }, + command_list: "alt+p", + which_key_toggle: "alt+k", + editor_open: "ctrl+e", + "prompt.autocomplete.next": "ctrl+j", + "dialog.mcp.toggle": "ctrl+t", + model_favorite_toggle: "ctrl+f", + "dialog.plugins.install": "shift+i", + }, + leader_timeout: 1234, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("leader")?.[0]?.key).toEqual({ name: "g", ctrl: true }) + expect(config.leader_timeout).toBe(1234) + expect(config.keybinds.get("command.palette.show")?.[0]?.key).toBe("alt+p") + expect(config.keybinds.get("session.new")?.[0]?.key).toBe("n") + expect(config.keybinds.get("which-key.toggle")?.[0]?.key).toBe("alt+k") + expect(config.keybinds.get("which-key.layout.toggle")?.[0]?.key).toBe("ctrl+alt+shift+k") + expect(config.keybinds.get("which-key.pending.toggle")?.[0]?.key).toBe("ctrl+alt+shift+p") + expect(config.keybinds.get("which-key.group.next")?.[0]?.key).toBe("ctrl+alt+right,ctrl+alt+]") + expect((config.keybinds.get("which-key.toggle")?.[0] as { desc?: unknown } | undefined)?.desc).toBe( + "Toggle which-key panel", ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.diff_style).toBe("auto") - expect(config.scroll_speed).toBe(2) -}) - -test("project config takes precedence over OPENCODE_TUI_CONFIG (matches OPENCODE_CONFIG)", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ theme: "project", diff_style: "auto" })) - const custom = path.join(dir, "custom-tui.json") - await Bun.write(custom, JSON.stringify({ theme: "custom", diff_style: "stacked" })) - process.env.OPENCODE_TUI_CONFIG = custom - }, - }) - - const config = await getTuiConfig(tmp.path) - // project tui.json overrides the custom path, same as server config precedence - expect(config.theme).toBe("project") - // project also set diff_style, so that wins - expect(config.diff_style).toBe("auto") -}) - -test("merges keybind overrides across precedence layers", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(Global.Path.config, "tui.json"), JSON.stringify({ keybinds: { app_exit: "ctrl+q" } })) - await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ keybinds: { theme_list: "ctrl+k" } })) - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("app.exit")?.[0]?.key).toBe("ctrl+q") - expect(config.keybinds.get("theme.switch")?.[0]?.key).toBe("ctrl+k") -}) - -test("resolves keybind lookup from canonical keybinds", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ + expect(config.keybinds.get("prompt.editor")?.[0]?.key).toBe("ctrl+e") + expect(config.keybinds.get("prompt.autocomplete.next")?.[0]?.key).toBe("ctrl+j") + expect(config.keybinds.get("dialog.mcp.toggle")?.[0]?.key).toBe("ctrl+t") + expect(config.keybinds.get("model.dialog.favorite")?.[0]?.key).toBe("ctrl+f") + expect(config.keybinds.get("dialog.plugins.install")?.[0]?.key).toBe("shift+i") + expect( + config.keybinds.gather("plugins.dialog", ["dialog.plugins.install"]).map((binding) => binding.cmd), + ).toEqual(["dialog.plugins.install"]) + }), + ), +) + +it.instance("keybinds accept OpenTUI binding specs", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + keybinds: { + command_list: [{ key: "alt+p", preventDefault: false }], + editor_open: { key: { name: "e", ctrl: true }, group: "Explicit" }, + "prompt.autocomplete.next": false, + plugin_manager: "ctrl+shift+p", + }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("command.palette.show")).toEqual([ + { key: "alt+p", cmd: "command.palette.show", preventDefault: false, desc: "List available commands" }, + ]) + expect(config.keybinds.get("prompt.editor")?.[0]).toMatchObject({ + key: { name: "e", ctrl: true }, + cmd: "prompt.editor", + group: "Explicit", + }) + expect(config.keybinds.get("prompt.autocomplete.next")).toEqual([]) + expect(config.keybinds.get("plugins.list")?.[0]?.key).toBe("ctrl+shift+p") + }), + ), +) + +winIt("defaults Ctrl+Z to input undo on Windows", () => + withCleanState( + Effect.gen(function* () { + const test = yield* TestInstance + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("terminal.suspend")).toEqual([]) + expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+z,ctrl+-,super+z") + }), + ), +) + +winIt("keeps explicit input undo overrides on Windows", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { keybinds: { input_undo: "ctrl+y" } }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("terminal.suspend")).toEqual([]) + expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+y") + }), + ), +) + +winIt("ignores terminal suspend bindings on Windows", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { keybinds: { terminal_suspend: "alt+z" } }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("terminal.suspend")).toEqual([]) + expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+z,ctrl+-,super+z") + }), + ), +) + +it.instance("applies Windows keybind defaults", () => + withCleanState( + withPlatform( + "win32", + Effect.gen(function* () { + const test = yield* TestInstance + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("terminal.suspend")).toEqual([]) + expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+z,ctrl+-,super+z") + }), + ), + ), +) + +it.instance("ignores explicit keybind terminal suspend binding on Windows", () => + withCleanState( + withPlatform( + "win32", + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { keybinds: { - leader: { key: { name: "g", ctrl: true } }, - command_list: "alt+p", - which_key_toggle: "alt+k", - editor_open: "ctrl+e", - "prompt.autocomplete.next": "ctrl+j", - "dialog.mcp.toggle": "ctrl+t", - model_favorite_toggle: "ctrl+f", - "dialog.plugins.install": "shift+i", + terminal_suspend: "alt+z", }, - leader_timeout: 1234, - }), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("leader")?.[0]?.key).toEqual({ name: "g", ctrl: true }) - expect(config.leader_timeout).toBe(1234) - expect(config.keybinds.get("command.palette.show")?.[0]?.key).toBe("alt+p") - expect(config.keybinds.get("session.new")?.[0]?.key).toBe("n") - expect(config.keybinds.get("which-key.toggle")?.[0]?.key).toBe("alt+k") - expect(config.keybinds.get("which-key.layout.toggle")?.[0]?.key).toBe("ctrl+alt+shift+k") - expect(config.keybinds.get("which-key.pending.toggle")?.[0]?.key).toBe("ctrl+alt+shift+p") - expect(config.keybinds.get("which-key.group.next")?.[0]?.key).toBe("ctrl+alt+right,ctrl+alt+]") - expect((config.keybinds.get("which-key.toggle")?.[0] as { desc?: unknown } | undefined)?.desc).toBe( - "Toggle which-key panel", - ) - expect(config.keybinds.get("prompt.editor")?.[0]?.key).toBe("ctrl+e") - expect(config.keybinds.get("prompt.autocomplete.next")?.[0]?.key).toBe("ctrl+j") - expect(config.keybinds.get("dialog.mcp.toggle")?.[0]?.key).toBe("ctrl+t") - expect(config.keybinds.get("model.dialog.favorite")?.[0]?.key).toBe("ctrl+f") - expect(config.keybinds.get("dialog.plugins.install")?.[0]?.key).toBe("shift+i") - expect(config.keybinds.gather("plugins.dialog", ["dialog.plugins.install"]).map((binding) => binding.cmd)).toEqual([ - "dialog.plugins.install", - ]) -}) + }) -test("keybinds accept OpenTUI binding specs", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("terminal.suspend")).toEqual([]) + }), + ), + ), +) + +it.instance("keeps explicit configured keybind input undo on Windows", () => + withCleanState( + withPlatform( + "win32", + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { keybinds: { - command_list: [{ key: "alt+p", preventDefault: false }], - editor_open: { key: { name: "e", ctrl: true }, group: "Explicit" }, - "prompt.autocomplete.next": false, - plugin_manager: "ctrl+shift+p", + input_undo: "ctrl+y", }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+y") + }), + ), + ), +) + +it.instance("OPENCODE_TUI_CONFIG provides settings when no project config exists", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const custom = path.join(test.directory, "custom-tui.json") + yield* fs.writeJson(custom, { theme: "from-env", diff_style: "stacked" }) + + yield* withEnv( + "OPENCODE_TUI_CONFIG", + custom, + Effect.gen(function* () { + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("from-env") + expect(config.diff_style).toBe("stacked") }), ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("command.palette.show")).toEqual([ - { key: "alt+p", cmd: "command.palette.show", preventDefault: false, desc: "List available commands" }, - ]) - expect(config.keybinds.get("prompt.editor")?.[0]).toMatchObject({ - key: { name: "e", ctrl: true }, - cmd: "prompt.editor", - group: "Explicit", - }) - expect(config.keybinds.get("prompt.autocomplete.next")).toEqual([]) - expect(config.keybinds.get("plugins.list")?.[0]?.key).toBe("ctrl+shift+p") -}) - -wintest("defaults Ctrl+Z to input undo on Windows", async () => { - await using tmp = await tmpdir() - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("terminal.suspend")).toEqual([]) - expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+z,ctrl+-,super+z") -}) - -wintest("keeps explicit input undo overrides on Windows", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ keybinds: { input_undo: "ctrl+y" } })) - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("terminal.suspend")).toEqual([]) - expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+y") -}) - -wintest("ignores terminal suspend bindings on Windows", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ keybinds: { terminal_suspend: "alt+z" } })) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("terminal.suspend")).toEqual([]) - expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+z,ctrl+-,super+z") -}) - -test("applies Windows keybind defaults", async () => { - await withPlatform("win32", async () => { - await using tmp = await tmpdir() - - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("terminal.suspend")).toEqual([]) - expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+z,ctrl+-,super+z") - }) -}) - -test("ignores explicit keybind terminal suspend binding on Windows", async () => { - await withPlatform("win32", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - keybinds: { - terminal_suspend: "alt+z", - }, - }), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("terminal.suspend")).toEqual([]) - }) -}) - -test("keeps explicit configured keybind input undo on Windows", async () => { - await withPlatform("win32", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - keybinds: { - input_undo: "ctrl+y", - }, - }), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.keybinds.get("input.undo")?.[0]?.key).toBe("ctrl+y") - }) -}) - -test("OPENCODE_TUI_CONFIG provides settings when no project config exists", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - const custom = path.join(dir, "custom-tui.json") - await Bun.write(custom, JSON.stringify({ theme: "from-env", diff_style: "stacked" })) - process.env.OPENCODE_TUI_CONFIG = custom - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("from-env") - expect(config.diff_style).toBe("stacked") -}) - -test("does not derive tui path from OPENCODE_CONFIG", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - const customDir = path.join(dir, "custom") - await fs.mkdir(customDir, { recursive: true }) - await Bun.write(path.join(customDir, "opencode.json"), JSON.stringify({ model: "test/model" })) - await Bun.write(path.join(customDir, "tui.json"), JSON.stringify({ theme: "should-not-load" })) - process.env.OPENCODE_CONFIG = path.join(customDir, "opencode.json") - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBeUndefined() -}) - -test("applies env and file substitutions in tui.json", async () => { - const original = process.env.TUI_THEME_TEST - process.env.TUI_THEME_TEST = "env-theme" - try { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "keybind.txt"), "ctrl+q") - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - theme: "{env:TUI_THEME_TEST}", - keybinds: { app_exit: "{file:keybind.txt}" }, - }), - ) - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("env-theme") - expect(config.keybinds.get("app.exit")?.[0]?.key).toBe("ctrl+q") - } finally { - if (original === undefined) delete process.env.TUI_THEME_TEST - else process.env.TUI_THEME_TEST = original - } -}) - -test("applies file substitutions when first identical token is in a commented line", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "theme.txt"), "resolved-theme") - await Bun.write( - path.join(dir, "tui.jsonc"), + }), + ), +) + +it.instance("does not derive tui path from OPENCODE_CONFIG", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + const customDir = path.join(test.directory, "custom") + yield* fs.makeDirectory(customDir, { recursive: true }) + yield* fs.writeJson(path.join(customDir, "opencode.json"), { model: "test/model" }) + yield* fs.writeJson(path.join(customDir, "tui.json"), { theme: "should-not-load" }) + + yield* withEnv( + "OPENCODE_CONFIG", + path.join(customDir, "opencode.json"), + Effect.gen(function* () { + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBeUndefined() + }), + ) + }), + ), +) + +it.instance("applies env and file substitutions in tui.json", () => + withCleanState( + withEnv( + "TUI_THEME_TEST", + "env-theme", + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeFileString(path.join(test.directory, "keybind.txt"), "ctrl+q") + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + theme: "{env:TUI_THEME_TEST}", + keybinds: { app_exit: "{file:keybind.txt}" }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("env-theme") + expect(config.keybinds.get("app.exit")?.[0]?.key).toBe("ctrl+q") + }), + ), + ), +) + +it.instance("applies file substitutions when first identical token is in a commented line", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeFileString(path.join(test.directory, "theme.txt"), "resolved-theme") + yield* fs.writeFileString( + path.join(test.directory, "tui.jsonc"), `{ // "theme": "{file:theme.txt}", "theme": "{file:theme.txt}" }`, ) - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.theme).toBe("resolved-theme") -}) - -test("loads .opencode/tui.json", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) - await Bun.write(path.join(dir, ".opencode", "tui.json"), JSON.stringify({ diff_style: "stacked" }, null, 2)) - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.diff_style).toBe("stacked") -}) - -test("supports tuple plugin specs with options in tui.json", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - plugin: [["acme-plugin@1.2.3", { enabled: true, label: "demo" }]], - }), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.plugin).toEqual([["acme-plugin@1.2.3", { enabled: true, label: "demo" }]]) - expect(config.plugin_origins).toEqual([ - { - spec: ["acme-plugin@1.2.3", { enabled: true, label: "demo" }], - scope: "local", - source: path.join(tmp.path, "tui.json"), - }, - ]) -}) - -test("deduplicates tuple plugin specs by name with higher precedence winning", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(Global.Path.config, "tui.json"), - JSON.stringify({ - plugin: [["acme-plugin@1.0.0", { source: "global" }]], - }), - ) - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - plugin: [ - ["acme-plugin@2.0.0", { source: "project" }], - ["second-plugin@3.0.0", { source: "project" }], - ], - }), - ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.plugin).toEqual([ - ["acme-plugin@2.0.0", { source: "project" }], - ["second-plugin@3.0.0", { source: "project" }], - ]) - expect(config.plugin_origins).toEqual([ - { - spec: ["acme-plugin@2.0.0", { source: "project" }], - scope: "local", - source: path.join(tmp.path, "tui.json"), - }, - { - spec: ["second-plugin@3.0.0", { source: "project" }], - scope: "local", - source: path.join(tmp.path, "tui.json"), - }, - ]) -}) - -test("tracks global and local plugin metadata in merged tui config", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(Global.Path.config, "tui.json"), - JSON.stringify({ - plugin: ["global-plugin@1.0.0"], - }), - ) - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - plugin: ["local-plugin@2.0.0"], - }), - ) - }, - }) - const config = await getTuiConfig(tmp.path) - expect(config.plugin).toEqual(["global-plugin@1.0.0", "local-plugin@2.0.0"]) - expect(config.plugin_origins).toEqual([ - { - spec: "global-plugin@1.0.0", - scope: "global", - source: path.join(Global.Path.config, "tui.json"), - }, - { - spec: "local-plugin@2.0.0", - scope: "local", - source: path.join(tmp.path, "tui.json"), - }, - ]) -}) - -test("merges plugin_enabled flags across config layers", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(Global.Path.config, "tui.json"), - JSON.stringify({ - plugin_enabled: { - "internal:sidebar-context": false, - "demo.plugin": true, - }, - }), - ) - await Bun.write( - path.join(dir, "tui.json"), - JSON.stringify({ - plugin_enabled: { - "demo.plugin": false, - "local.plugin": true, - }, - }), + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("resolved-theme") + }), + ), +) + +it.instance("loads .opencode/tui.json", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeWithDirs( + path.join(test.directory, ".opencode", "tui.json"), + JSON.stringify({ diff_style: "stacked" }, null, 2), ) - }, - }) - - const config = await getTuiConfig(tmp.path) - expect(config.plugin_enabled).toEqual({ - "internal:sidebar-context": false, - "demo.plugin": false, - "local.plugin": true, - }) -}) - -test("silently skips malformed tui.json — load failures degrade to {}", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "tui.json"), '{ "theme": "broken",') - await Bun.write(path.join(dir, ".opencode", "tui.json"), JSON.stringify({ theme: "fallback" })) - }, - }) - - const config = await getTuiConfig(tmp.path) - // Project tui.json is malformed → silently skipped (logs a warning) - // .opencode/tui.json (lower precedence in this path) still loads - expect(config.theme).toBe("fallback") -}) -test("silently skips non-ENOENT read failures (e.g. tui.json is a directory) — fallback layer still loads", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - // tui.json exists as a DIRECTORY rather than a file → readFileString fails - // with EISDIR (PlatformError reason ≠ NotFound). The fix in this PR routes - // that through catchCause → log + skip, so a fallback layer should still load. - await fs.mkdir(path.join(dir, "tui.json"), { recursive: true }) - await Bun.write(path.join(dir, ".opencode", "tui.json"), JSON.stringify({ theme: "fallback" })) - }, - }) - - const config = await getTuiConfig(tmp.path) - // Did NOT crash; .opencode/tui.json (lower precedence) still loads. - expect(config.theme).toBe("fallback") -}) - -test("missing tui.json — silently treated as empty (ENOENT path)", async () => { - await using tmp = await tmpdir({}) - - // No tui.json anywhere. Should not throw. - const config = await getTuiConfig(tmp.path) - expect(config).toBeDefined() - // No theme set anywhere. - expect(config.theme).toBeUndefined() -}) + const config = yield* getTuiConfig(test.directory) + expect(config.diff_style).toBe("stacked") + }), + ), +) + +it.instance("supports tuple plugin specs with options in tui.json", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + plugin: [["acme-plugin@1.2.3", { enabled: true, label: "demo" }]], + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.plugin).toEqual([["acme-plugin@1.2.3", { enabled: true, label: "demo" }]]) + expect(config.plugin_origins).toEqual([ + { + spec: ["acme-plugin@1.2.3", { enabled: true, label: "demo" }], + scope: "local", + source: path.join(test.directory, "tui.json"), + }, + ]) + }), + ), +) + +it.instance("deduplicates tuple plugin specs by name with higher precedence winning", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { + plugin: [["acme-plugin@1.0.0", { source: "global" }]], + }) + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + plugin: [ + ["acme-plugin@2.0.0", { source: "project" }], + ["second-plugin@3.0.0", { source: "project" }], + ], + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.plugin).toEqual([ + ["acme-plugin@2.0.0", { source: "project" }], + ["second-plugin@3.0.0", { source: "project" }], + ]) + expect(config.plugin_origins).toEqual([ + { + spec: ["acme-plugin@2.0.0", { source: "project" }], + scope: "local", + source: path.join(test.directory, "tui.json"), + }, + { + spec: ["second-plugin@3.0.0", { source: "project" }], + scope: "local", + source: path.join(test.directory, "tui.json"), + }, + ]) + }), + ), +) + +it.instance("tracks global and local plugin metadata in merged tui config", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { plugin: ["global-plugin@1.0.0"] }) + yield* fs.writeJson(path.join(test.directory, "tui.json"), { plugin: ["local-plugin@2.0.0"] }) + + const config = yield* getTuiConfig(test.directory) + expect(config.plugin).toEqual(["global-plugin@1.0.0", "local-plugin@2.0.0"]) + expect(config.plugin_origins).toEqual([ + { + spec: "global-plugin@1.0.0", + scope: "global", + source: path.join(Global.Path.config, "tui.json"), + }, + { + spec: "local-plugin@2.0.0", + scope: "local", + source: path.join(test.directory, "tui.json"), + }, + ]) + }), + ), +) + +it.instance("merges plugin_enabled flags across config layers", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeJson(path.join(Global.Path.config, "tui.json"), { + plugin_enabled: { + "internal:sidebar-context": false, + "demo.plugin": true, + }, + }) + yield* fs.writeJson(path.join(test.directory, "tui.json"), { + plugin_enabled: { + "demo.plugin": false, + "local.plugin": true, + }, + }) + + const config = yield* getTuiConfig(test.directory) + expect(config.plugin_enabled).toEqual({ + "internal:sidebar-context": false, + "demo.plugin": false, + "local.plugin": true, + }) + }), + ), +) + +it.instance("silently skips malformed tui.json - load failures degrade to {}", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.writeFileString(path.join(test.directory, "tui.json"), '{ "theme": "broken",') + yield* fs.writeWithDirs(path.join(test.directory, ".opencode", "tui.json"), JSON.stringify({ theme: "fallback" })) + + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("fallback") + }), + ), +) + +it.instance("silently skips non-ENOENT read failures (e.g. tui.json is a directory) - fallback layer still loads", () => + withCleanState( + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fs.makeDirectory(path.join(test.directory, "tui.json"), { recursive: true }) + yield* fs.writeWithDirs(path.join(test.directory, ".opencode", "tui.json"), JSON.stringify({ theme: "fallback" })) + + const config = yield* getTuiConfig(test.directory) + expect(config.theme).toBe("fallback") + }), + ), +) + +it.instance("missing tui.json - silently treated as empty (ENOENT path)", () => + withCleanState( + Effect.gen(function* () { + const test = yield* TestInstance + const config = yield* getTuiConfig(test.directory) + expect(config).toBeDefined() + expect(config.theme).toBeUndefined() + }), + ), +) diff --git a/packages/opencode/test/control-plane/workspace.test.ts b/packages/opencode/test/control-plane/workspace.test.ts index 3c4837e31878..00cd32a3f77a 100644 --- a/packages/opencode/test/control-plane/workspace.test.ts +++ b/packages/opencode/test/control-plane/workspace.test.ts @@ -6,23 +6,23 @@ import path from "node:path" import { setTimeout as delay } from "node:timers/promises" import { NodeHttpServer } from "@effect/platform-node" import { Effect, Layer, Schema } from "effect" -import { HttpServer, HttpServerRequest, HttpServerResponse } from "effect/unstable/http" +import { FetchHttpClient, HttpServer, HttpServerRequest, HttpServerResponse } from "effect/unstable/http" import { eq } from "drizzle-orm" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import * as Log from "@opencode-ai/core/util/log" -import { Flag } from "@opencode-ai/core/flag/flag" import { GlobalBus, type GlobalEvent } from "@/bus/global" import { Database } from "@/storage/db" import { ProjectID } from "@/project/schema" import { ProjectTable } from "@/project/project.sql" -import { Instance } from "@/project/instance" -import { WithInstance } from "../../src/project/with-instance" +import { context, type InstanceContext } from "@/project/instance-context" +import { InstanceRef } from "@/effect/instance-ref" import { Session as SessionNs } from "@/session/session" import { SessionID } from "@/session/schema" import { SessionTable } from "@/session/session.sql" import { SyncEvent } from "@/sync" import { EventSequenceTable } from "@/sync/event.sql" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, provideTmpdirInstance, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, provideTmpdirInstance, TestInstance, tmpdir } from "../fixture/fixture" import { testEffect } from "../lib/effect" import { registerAdapter } from "../../src/control-plane/adapters" import { WorkspaceID } from "../../src/control-plane/schema" @@ -32,24 +32,43 @@ import * as Workspace from "../../src/control-plane/workspace" import { AppRuntime } from "@/effect/app-runtime" import { InstanceStore } from "@/project/instance-store" import { InstanceBootstrap } from "@/project/bootstrap" +import { Auth } from "@/auth" +import { SessionPrompt } from "@/session/prompt" +import { Project } from "@/project/project" +import { Vcs } from "@/project/vcs" +import { RuntimeFlags } from "@/effect/runtime-flags" void Log.init({ print: false }) -const testServerLayer = Layer.mergeAll( - NodeHttpServer.layer(Http.createServer, { host: "127.0.0.1", port: 0 }), - Workspace.defaultLayer.pipe(Layer.provide(InstanceStore.defaultLayer), Layer.provide(InstanceBootstrap.defaultLayer)), - SessionNs.defaultLayer, -) -const it = testEffect(testServerLayer) - -const originalWorkspacesFlag = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES const originalEnv = { OPENCODE_AUTH_CONTENT: process.env.OPENCODE_AUTH_CONTENT, + OPENCODE_EXPERIMENTAL_WORKSPACES: process.env.OPENCODE_EXPERIMENTAL_WORKSPACES, OTEL_EXPORTER_OTLP_HEADERS: process.env.OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_ENDPOINT: process.env.OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_RESOURCE_ATTRIBUTES: process.env.OTEL_RESOURCE_ATTRIBUTES, } +const workspaceLayer = (experimentalWorkspaces: boolean) => + Workspace.layer.pipe( + Layer.provide(Auth.defaultLayer), + Layer.provide(SessionNs.defaultLayer), + Layer.provide(SyncEvent.defaultLayer), + Layer.provide(SessionPrompt.defaultLayer), + Layer.provide(Project.defaultLayer), + Layer.provide(Vcs.defaultLayer), + Layer.provide(FetchHttpClient.layer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalWorkspaces })), + Layer.provide(InstanceStore.defaultLayer.pipe(Layer.provide(InstanceBootstrap.defaultLayer))), + ) + +const testServerLayer = Layer.mergeAll( + NodeHttpServer.layer(Http.createServer, { host: "127.0.0.1", port: 0 }), + workspaceLayer(true), + SessionNs.defaultLayer, +) +const it = testEffect(testServerLayer) + type RecordedCreate = { info: WorkspaceInfo env: Record @@ -91,24 +110,21 @@ function restoreEnv() { beforeEach(() => { Database.close() - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true restoreEnv() + process.env.OPENCODE_EXPERIMENTAL_WORKSPACES = "true" }) afterEach(async () => { mock.restore() await disposeAllInstances() - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspacesFlag restoreEnv() await resetDatabase() }) -async function withInstance(fn: (dir: string) => T | Promise) { +async function withInstance(fn: (ctx: InstanceContext) => T | Promise) { await using tmp = await tmpdir({ git: true }) - return WithInstance.provide({ - directory: tmp.path, - fn: () => fn(tmp.path), - }) + const ctx = await AppRuntime.runPromise(InstanceStore.Service.use((store) => store.load({ directory: tmp.path }))) + return await context.provide(ctx, () => fn(ctx)) } async function initGitRepo(dir: string) { @@ -140,6 +156,12 @@ const isWorkspaceSyncing = (id: WorkspaceID) => const startWorkspaceSyncing = (projectID: ProjectID) => { void runWorkspace(Workspace.Service.use((workspace) => workspace.startWorkspaceSyncing(projectID))) } +const startWorkspaceSyncingWithFlag = (projectID: ProjectID, experimentalWorkspaces: boolean) => + Effect.runPromise( + Workspace.Service.use((workspace) => workspace.startWorkspaceSyncing(projectID)).pipe( + Effect.provide(workspaceLayer(experimentalWorkspaces)), + ), + ) const waitForWorkspaceSync = (workspaceID: WorkspaceID, state: Record, signal?: AbortSignal) => runWorkspace(Workspace.Service.use((workspace) => workspace.waitForSync(workspaceID, state, signal))) @@ -391,16 +413,16 @@ describe("workspace CRUD", () => { }) test("list maps database rows, filters by project, and sorts by id", async () => { - await withInstance(async () => { + await withInstance(async (instance) => { const otherProjectID = ProjectID.make("project-other") insertProject(otherProjectID, "/tmp/other") - const a = workspaceInfo(Instance.project.id, "manual", { + const a = workspaceInfo(instance.project.id, "manual", { id: WorkspaceID.ascending("wrk_a_list"), branch: "a", directory: "/a", extra: { a: true }, }) - const b = workspaceInfo(Instance.project.id, "manual", { + const b = workspaceInfo(instance.project.id, "manual", { id: WorkspaceID.ascending("wrk_b_list"), branch: "b", directory: "/b", @@ -411,12 +433,12 @@ describe("workspace CRUD", () => { insertWorkspace(other) insertWorkspace(a) - expect(await listWorkspaces(Instance.project)).toEqual([a, b]) + expect(await listWorkspaces(instance.project)).toEqual([a, b]) }) }) test("create configures, persists, creates, starts local sync, and passes environment", async () => { - await withInstance(async (dir) => { + await withInstance(async (instance) => { process.env.OPENCODE_AUTH_CONTENT = JSON.stringify({ test: { type: "api", key: "secret" } }) process.env.OTEL_EXPORTER_OTLP_HEADERS = "authorization=otel" process.env.OTEL_EXPORTER_OTLP_ENDPOINT = "https://otel.test" @@ -424,7 +446,7 @@ describe("workspace CRUD", () => { const workspaceID = WorkspaceID.ascending("wrk_create_local") const type = unique("create-local") - const targetDir = path.join(dir, "created-local") + const targetDir = path.join(instance.directory, "created-local") const recorded = recordedAdapter({ configure(info) { return { @@ -442,13 +464,13 @@ describe("workspace CRUD", () => { return { type: "local", directory: targetDir } }, }) - registerAdapter(Instance.project.id, type, recorded.adapter) + registerAdapter(instance.project.id, type, recorded.adapter) const info = await createWorkspace({ id: workspaceID, type, branch: null, - projectID: Instance.project.id, + projectID: instance.project.id, extra: null, }) @@ -459,11 +481,11 @@ describe("workspace CRUD", () => { name: "Configured Name", directory: targetDir, extra: { configured: true }, - projectID: Instance.project.id, + projectID: instance.project.id, timeUsed: info.timeUsed, }) expect(await getWorkspace(workspaceID)).toEqual(info) - expect(await listWorkspaces(Instance.project)).toEqual([info]) + expect(await listWorkspaces(instance.project)).toEqual([info]) expect(recorded.calls.configure).toHaveLength(1) expect(recorded.calls.configure[0]).toMatchObject({ id: workspaceID, type, directory: null }) expect(recorded.calls.create).toHaveLength(1) @@ -474,7 +496,7 @@ describe("workspace CRUD", () => { name: "Configured Name", directory: targetDir, extra: { configured: true }, - projectID: Instance.project.id, + projectID: instance.project.id, }) expect(JSON.parse(recorded.calls.create[0].env.OPENCODE_AUTH_CONTENT ?? "{}")).toEqual({ test: { type: "api", key: "secret" }, @@ -492,10 +514,10 @@ describe("workspace CRUD", () => { }) test("create propagates configure failures and does not insert a workspace", async () => { - await withInstance(async () => { + await withInstance(async (instance) => { const type = unique("configure-failure") registerAdapter( - Instance.project.id, + instance.project.id, type, recordedAdapter({ configure() { @@ -508,14 +530,14 @@ describe("workspace CRUD", () => { ) await expect( - createWorkspace({ type, branch: null, projectID: Instance.project.id, extra: null }), + createWorkspace({ type, branch: null, projectID: instance.project.id, extra: null }), ).rejects.toThrow("configure exploded") - expect(await listWorkspaces(Instance.project)).toEqual([]) + expect(await listWorkspaces(instance.project)).toEqual([]) }) }) test("create leaves the inserted row when adapter create fails", async () => { - await withInstance(async () => { + await withInstance(async (instance) => { const type = unique("create-failure") const recorded = recordedAdapter({ async create() { @@ -525,13 +547,13 @@ describe("workspace CRUD", () => { return { type: "local", directory: "/unused" } }, }) - registerAdapter(Instance.project.id, type, recorded.adapter) + registerAdapter(instance.project.id, type, recorded.adapter) await expect( - createWorkspace({ type, branch: "branch", projectID: Instance.project.id, extra: { x: 1 } }), + createWorkspace({ type, branch: "branch", projectID: instance.project.id, extra: { x: 1 } }), ).rejects.toThrow("create exploded") - const rows = await listWorkspaces(Instance.project) + const rows = await listWorkspaces(instance.project) expect(rows).toHaveLength(1) expect(rows[0]).toMatchObject({ type, branch: "branch", extra: { x: 1 } }) expect(recorded.calls.target).toHaveLength(0) @@ -540,13 +562,13 @@ describe("workspace CRUD", () => { }) test("create returns after a local workspace reports error", async () => { - await withInstance(async (dir) => { + await withInstance(async (instance) => { const type = unique("local-error") - const missing = path.join(dir, "missing-local-target") + const missing = path.join(instance.directory, "missing-local-target") const recorded = localAdapter(missing, { createDir: false }) - registerAdapter(Instance.project.id, type, recorded.adapter) + registerAdapter(instance.project.id, type, recorded.adapter) - const info = await createWorkspace({ type, branch: null, projectID: Instance.project.id, extra: null }) + const info = await createWorkspace({ type, branch: null, projectID: instance.project.id, extra: null }) expect(info.directory).toBe(missing) expect((await workspaceStatus()).find((item) => item.workspaceID === info.id)?.status).toBe("error") @@ -555,12 +577,12 @@ describe("workspace CRUD", () => { }) test("syncList registers adapter-listed workspaces that are missing by name", async () => { - await withInstance(async (dir) => { + await withInstance(async (instance) => { const type = unique("list-sync") - const existing = workspaceInfo(Instance.project.id, type, { + const existing = workspaceInfo(instance.project.id, type, { id: WorkspaceID.ascending("wrk_list_sync_existing"), name: "existing", - directory: path.join(dir, "existing"), + directory: path.join(instance.directory, "existing"), }) insertWorkspace(existing) @@ -568,9 +590,9 @@ describe("workspace CRUD", () => { type, name: "discovered", branch: "feature/discovered", - directory: path.join(dir, "discovered"), + directory: path.join(instance.directory, "discovered"), extra: { source: "adapter" }, - projectID: Instance.project.id, + projectID: instance.project.id, } const recorded = recordedAdapter({ list() { @@ -579,26 +601,26 @@ describe("workspace CRUD", () => { type, name: existing.name, branch: "ignored", - directory: path.join(dir, "ignored"), + directory: path.join(instance.directory, "ignored"), extra: null, - projectID: Instance.project.id, + projectID: instance.project.id, }, discovered, ] }, target(info) { - return { type: "local", directory: info.directory ?? dir } + return { type: "local", directory: info.directory ?? instance.directory } }, }) - registerAdapter(Instance.project.id, type, recorded.adapter) + registerAdapter(instance.project.id, type, recorded.adapter) - await syncListWorkspaces(Instance.project) - const synced = (await listWorkspaces(Instance.project)).filter((item) => item.name === discovered.name) + await syncListWorkspaces(instance.project) + const synced = (await listWorkspaces(instance.project)).filter((item) => item.name === discovered.name) expect(synced).toHaveLength(1) expect(synced[0]).toMatchObject(discovered) expect(synced[0]?.id).toStartWith("wrk_") - expect(await listWorkspaces(Instance.project)).toEqual(expect.arrayContaining([existing, synced[0]])) + expect(await listWorkspaces(instance.project)).toEqual(expect.arrayContaining([existing, synced[0]])) expect(recorded.calls.list).toBe(1) expect(recorded.calls.configure).toHaveLength(0) expect(recorded.calls.create).toHaveLength(0) @@ -607,7 +629,7 @@ describe("workspace CRUD", () => { }) test("syncList calls every registered adapter with a list method", async () => { - await withInstance(async (dir) => { + await withInstance(async (instance) => { const typeA = unique("list-sync-a") const typeB = unique("list-sync-b") const adapterA = recordedAdapter({ @@ -617,14 +639,14 @@ describe("workspace CRUD", () => { type: typeA, name: "adapter-a", branch: null, - directory: path.join(dir, "adapter-a"), + directory: path.join(instance.directory, "adapter-a"), extra: null, - projectID: Instance.project.id, + projectID: instance.project.id, }, ] }, target(info) { - return { type: "local", directory: info.directory ?? dir } + return { type: "local", directory: info.directory ?? instance.directory } }, }) const adapterB = recordedAdapter({ @@ -634,27 +656,27 @@ describe("workspace CRUD", () => { type: typeB, name: "adapter-b", branch: null, - directory: path.join(dir, "adapter-b"), + directory: path.join(instance.directory, "adapter-b"), extra: null, - projectID: Instance.project.id, + projectID: instance.project.id, }, ] }, target(info) { - return { type: "local", directory: info.directory ?? dir } + return { type: "local", directory: info.directory ?? instance.directory } }, }) const noList = recordedAdapter({ target() { - return { type: "local", directory: dir } + return { type: "local", directory: instance.directory } }, }) - registerAdapter(Instance.project.id, typeA, adapterA.adapter) - registerAdapter(Instance.project.id, typeB, adapterB.adapter) - registerAdapter(Instance.project.id, unique("list-sync-none"), noList.adapter) + registerAdapter(instance.project.id, typeA, adapterA.adapter) + registerAdapter(instance.project.id, typeB, adapterB.adapter) + registerAdapter(instance.project.id, unique("list-sync-none"), noList.adapter) - await syncListWorkspaces(Instance.project) - const synced = await listWorkspaces(Instance.project) + await syncListWorkspaces(instance.project) + const synced = await listWorkspaces(instance.project) expect( synced @@ -694,11 +716,13 @@ describe("workspace CRUD", () => { (dir) => Effect.gen(function* () { const workspace = yield* Workspace.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const type = unique("remote-create") const recorded = remoteAdapter(`${url}/base/?ignored=1#hash`, { directory: dir }) - registerAdapter(Instance.project.id, type, recorded.adapter) + registerAdapter(instance.project.id, type, recorded.adapter) - const info = yield* workspace.create({ type, branch: null, projectID: Instance.project.id, extra: null }) + const info = yield* workspace.create({ type, branch: null, projectID: instance.project.id, extra: null }) expect( calls.map((call) => `${call.method} ${call.url.pathname}${call.url.search}${call.url.hash}`), @@ -722,37 +746,46 @@ describe("workspace CRUD", () => { }) }) - test("remove deletes the workspace, associated sessions, adapter resources, and status", async () => { - await withInstance(async (dir) => { - const type = unique("remove-local") - const recorded = localAdapter(path.join(dir, "remove-local")) - registerAdapter(Instance.project.id, type, recorded.adapter) - const info = await createWorkspace({ type, branch: null, projectID: Instance.project.id, extra: null }) - const one = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) - const two = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) - attachSessionToWorkspace(one.id, info.id) - attachSessionToWorkspace(two.id, info.id) - - const removed = await removeWorkspace(info.id) - - expect(removed).toEqual(info) - expect(await getWorkspace(info.id)).toBeUndefined() - expect(recorded.calls.remove).toEqual([info]) - expect((await workspaceStatus()).find((item) => item.workspaceID === info.id)?.status).toBeUndefined() - expect( - Database.use((db) => - db.select({ id: SessionTable.id }).from(SessionTable).where(eq(SessionTable.workspace_id, info.id)).all(), - ), - ).toEqual([]) - }) - }) + it.instance( + "remove deletes the workspace, associated sessions, adapter resources, and status", + () => { + return Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const type = unique("remove-local") + const recorded = localAdapter(path.join(dir, "remove-local")) + registerAdapter(instance.project.id, type, recorded.adapter) + const info = yield* workspace.create({ type, branch: null, projectID: instance.project.id, extra: null }) + const one = yield* sessionSvc.create({}) + const two = yield* sessionSvc.create({}) + attachSessionToWorkspace(one.id, info.id) + attachSessionToWorkspace(two.id, info.id) + + const removed = yield* workspace.remove(info.id) + + expect(removed).toEqual(info) + expect(yield* workspace.get(info.id)).toBeUndefined() + expect(recorded.calls.remove).toEqual([info]) + expect((yield* workspace.status()).find((item) => item.workspaceID === info.id)?.status).toBeUndefined() + expect( + Database.use((db) => + db.select({ id: SessionTable.id }).from(SessionTable).where(eq(SessionTable.workspace_id, info.id)).all(), + ), + ).toEqual([]) + }) + }, + { git: true }, + ) test("remove still deletes the row when the adapter cannot remove resources", async () => { - await withInstance(async () => { + await withInstance(async (instance) => { const type = unique("remove-throws") - const info = workspaceInfo(Instance.project.id, type, { id: WorkspaceID.ascending("wrk_remove_throws") }) + const info = workspaceInfo(instance.project.id, type, { id: WorkspaceID.ascending("wrk_remove_throws") }) registerAdapter( - Instance.project.id, + instance.project.id, type, recordedAdapter({ async remove() { @@ -770,88 +803,115 @@ describe("workspace CRUD", () => { }) }) - test("sessionWarp moves a session into a local workspace and claims ownership", async () => { - await withInstance(async (dir) => { - const previousType = unique("warp-prev-local") - const targetType = unique("warp-target-local") - const previous = workspaceInfo(Instance.project.id, previousType) - const target = workspaceInfo(Instance.project.id, targetType) - insertWorkspace(previous) - insertWorkspace(target) - registerAdapter(Instance.project.id, previousType, localAdapter(path.join(dir, "warp-prev-local")).adapter) - registerAdapter(Instance.project.id, targetType, localAdapter(path.join(dir, "warp-target-local")).adapter) - const session = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) - attachSessionToWorkspace(session.id, previous.id) - - await warpWorkspaceSession({ workspaceID: target.id, sessionID: session.id }) - - expect( - Database.use((db) => - db - .select({ workspaceID: SessionTable.workspace_id }) - .from(SessionTable) - .where(eq(SessionTable.id, session.id)) - .get(), - )?.workspaceID, - ).toBe(target.id) - expect(sessionSequenceOwner(session.id)).toBe(target.id) - }) - }) + it.instance( + "sessionWarp moves a session into a local workspace and claims ownership", + () => { + return Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const previousType = unique("warp-prev-local") + const targetType = unique("warp-target-local") + const previous = workspaceInfo(instance.project.id, previousType) + const target = workspaceInfo(instance.project.id, targetType) + insertWorkspace(previous) + insertWorkspace(target) + registerAdapter(instance.project.id, previousType, localAdapter(path.join(dir, "warp-prev-local")).adapter) + registerAdapter(instance.project.id, targetType, localAdapter(path.join(dir, "warp-target-local")).adapter) + const session = yield* sessionSvc.create({}) + attachSessionToWorkspace(session.id, previous.id) + + yield* workspace.sessionWarp({ workspaceID: target.id, sessionID: session.id }) - test("sessionWarp applies source workspace patch to local target workspace", async () => { - await withInstance(async (dir) => { - const previousType = unique("warp-patch-prev-local") - const targetType = unique("warp-patch-target-local") - const previousDir = path.join(dir, "warp-patch-prev-local") - const targetDir = path.join(dir, "warp-patch-target-local") - await initGitRepo(previousDir) - await initGitRepo(targetDir) - await fs.writeFile(path.join(previousDir, "tracked.txt"), "changed\n") - await fs.writeFile(path.join(previousDir, "new.txt"), "new\n") - - const previous = workspaceInfo(Instance.project.id, previousType) - const target = workspaceInfo(Instance.project.id, targetType) - insertWorkspace(previous) - insertWorkspace(target) - registerAdapter(Instance.project.id, previousType, localAdapter(previousDir, { createDir: false }).adapter) - registerAdapter(Instance.project.id, targetType, localAdapter(targetDir, { createDir: false }).adapter) - const session = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) - attachSessionToWorkspace(session.id, previous.id) - - await warpWorkspaceSession({ workspaceID: target.id, sessionID: session.id, copyChanges: true }) - - expect(await fs.readFile(path.join(targetDir, "tracked.txt"), "utf8")).toBe("changed\n") - expect(await fs.readFile(path.join(targetDir, "new.txt"), "utf8")).toBe("new\n") - }) - }) + expect( + Database.use((db) => + db + .select({ workspaceID: SessionTable.workspace_id }) + .from(SessionTable) + .where(eq(SessionTable.id, session.id)) + .get(), + )?.workspaceID, + ).toBe(target.id) + expect(sessionSequenceOwner(session.id)).toBe(target.id) + }) + }, + { git: true }, + ) - test("sessionWarp detaches a session to the local project and claims project ownership", async () => { - await withInstance(async (dir) => { - const previousType = unique("warp-detach-local") - const previous = workspaceInfo(Instance.project.id, previousType) - insertWorkspace(previous) - registerAdapter(Instance.project.id, previousType, localAdapter(path.join(dir, "warp-detach-local")).adapter) - const session = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) - attachSessionToWorkspace(session.id, previous.id) + it.instance( + "sessionWarp applies source workspace patch to local target workspace", + () => { + return Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const previousType = unique("warp-patch-prev-local") + const targetType = unique("warp-patch-target-local") + const previousDir = path.join(dir, "warp-patch-prev-local") + const targetDir = path.join(dir, "warp-patch-target-local") + yield* Effect.promise(() => initGitRepo(previousDir)) + yield* Effect.promise(() => initGitRepo(targetDir)) + yield* Effect.promise(() => fs.writeFile(path.join(previousDir, "tracked.txt"), "changed\n")) + yield* Effect.promise(() => fs.writeFile(path.join(previousDir, "new.txt"), "new\n")) + + const previous = workspaceInfo(instance.project.id, previousType) + const target = workspaceInfo(instance.project.id, targetType) + insertWorkspace(previous) + insertWorkspace(target) + registerAdapter(instance.project.id, previousType, localAdapter(previousDir, { createDir: false }).adapter) + registerAdapter(instance.project.id, targetType, localAdapter(targetDir, { createDir: false }).adapter) + const session = yield* sessionSvc.create({}) + attachSessionToWorkspace(session.id, previous.id) + + yield* workspace.sessionWarp({ workspaceID: target.id, sessionID: session.id, copyChanges: true }) + + expect(yield* Effect.promise(() => fs.readFile(path.join(targetDir, "tracked.txt"), "utf8"))).toBe("changed\n") + expect(yield* Effect.promise(() => fs.readFile(path.join(targetDir, "new.txt"), "utf8"))).toBe("new\n") + }) + }, + { git: true }, + ) - await warpWorkspaceSession({ workspaceID: null, sessionID: session.id }) + it.instance( + "sessionWarp detaches a session to the local project and claims project ownership", + () => { + return Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const previousType = unique("warp-detach-local") + const previous = workspaceInfo(instance.project.id, previousType) + insertWorkspace(previous) + registerAdapter(instance.project.id, previousType, localAdapter(path.join(dir, "warp-detach-local")).adapter) + const session = yield* sessionSvc.create({}) + attachSessionToWorkspace(session.id, previous.id) + + yield* workspace.sessionWarp({ workspaceID: null, sessionID: session.id }) - expect( - Database.use((db) => - db - .select({ workspaceID: SessionTable.workspace_id }) - .from(SessionTable) - .where(eq(SessionTable.id, session.id)) - .get(), - )?.workspaceID, - ).toBeNull() - expect(sessionSequenceOwner(session.id)).toBe(Instance.project.id) - }) - }) + expect( + Database.use((db) => + db + .select({ workspaceID: SessionTable.workspace_id }) + .from(SessionTable) + .where(eq(SessionTable.id, session.id)) + .get(), + )?.workspaceID, + ).toBeNull() + expect(sessionSequenceOwner(session.id)).toBe(instance.project.id) + }) + }, + { git: true }, + ) test("sessionWarp detaches to the source project when invoked from a workspace instance", async () => { - await withInstance(async () => { - const projectID = Instance.project.id + await withInstance(async (instance) => { + const projectID = instance.project.id await using workspaceTmp = await tmpdir({ git: true }) const previousType = unique("warp-detach-workspace-instance") const previous = workspaceInfo(projectID, previousType) @@ -860,14 +920,14 @@ describe("workspace CRUD", () => { const session = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) attachSessionToWorkspace(session.id, previous.id) - const workspaceProjectID = await WithInstance.provide({ - directory: workspaceTmp.path, - fn: async () => { - const id = Instance.project.id - expect(id).not.toBe(projectID) - await warpWorkspaceSession({ workspaceID: null, sessionID: session.id }) - return id - }, + const workspaceCtx = await AppRuntime.runPromise( + InstanceStore.Service.use((store) => store.load({ directory: workspaceTmp.path })), + ) + const workspaceProjectID = await context.provide(workspaceCtx, async () => { + const id = workspaceCtx.project.id + expect(id).not.toBe(projectID) + await warpWorkspaceSession({ workspaceID: null, sessionID: session.id }) + return id }) expect( @@ -927,14 +987,16 @@ describe("workspace CRUD", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const previousType = unique("warp-remote-source") const targetType = unique("warp-remote-target") - const previous = workspaceInfo(Instance.project.id, previousType) - const target = workspaceInfo(Instance.project.id, targetType, { directory: "remote-target-dir" }) + const previous = workspaceInfo(instance.project.id, previousType) + const target = workspaceInfo(instance.project.id, targetType, { directory: "remote-target-dir" }) insertWorkspace(previous) insertWorkspace(target) - registerAdapter(Instance.project.id, previousType, remoteAdapter(`${url}/warp-source`).adapter) - registerAdapter(Instance.project.id, targetType, remoteAdapter(`${url}/warp-target`).adapter) + registerAdapter(instance.project.id, previousType, remoteAdapter(`${url}/warp-source`).adapter) + registerAdapter(instance.project.id, targetType, remoteAdapter(`${url}/warp-target`).adapter) const session = yield* sessionSvc.create({}) attachSessionToWorkspace(session.id, previous.id) historySessionID = session.id @@ -977,110 +1039,138 @@ describe("workspace CRUD", () => { }) describe("workspace sync state", () => { - test("startWorkspaceSyncing is disabled by the experimental workspace flag", async () => { - await withInstance(async (dir) => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = false - const type = unique("flag-disabled") - const info = workspaceInfo(Instance.project.id, type) - const session = await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({}))) - attachSessionToWorkspace(session.id, info.id) - insertWorkspace(info) - registerAdapter(Instance.project.id, type, localAdapter(path.join(dir, "flag-disabled")).adapter) + it.instance( + "startWorkspaceSyncing is disabled by the experimental workspace flag", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const type = unique("flag-disabled") + const info = workspaceInfo(instance.project.id, type) + const session = yield* sessionSvc.create({}) + attachSessionToWorkspace(session.id, info.id) + insertWorkspace(info) + registerAdapter(instance.project.id, type, localAdapter(path.join(dir, "flag-disabled")).adapter) - startWorkspaceSyncing(Instance.project.id) - await delay(25) + yield* Effect.promise(() => startWorkspaceSyncingWithFlag(instance.project.id, false)) + yield* Effect.sleep("25 millis") - expect((await workspaceStatus()).find((item) => item.workspaceID === info.id)?.status).toBeUndefined() - }) - }) + expect((yield* workspace.status()).find((item) => item.workspaceID === info.id)?.status).toBeUndefined() + }), + { git: true }, + ) - test("startWorkspaceSyncing starts all workspaces", async () => { - await withInstance(async (dir) => { - const firstType = unique("first") - const secondType = unique("second") - const first = workspaceInfo(Instance.project.id, firstType) - const second = workspaceInfo(Instance.project.id, secondType) - await fs.mkdir(path.join(dir, "first"), { recursive: true }) - await fs.mkdir(path.join(dir, "second"), { recursive: true }) - insertWorkspace(first) - insertWorkspace(second) - registerAdapter(Instance.project.id, firstType, localAdapter(path.join(dir, "first")).adapter) - registerAdapter(Instance.project.id, secondType, localAdapter(path.join(dir, "second")).adapter) - - startWorkspaceSyncing(Instance.project.id) - - await eventually(() => - workspaceStatus().then((status) => { - expect(status.find((item) => item.workspaceID === first.id)?.status).toBe("connected") - expect(status.find((item) => item.workspaceID === second.id)?.status).toBe("connected") - }), - ) - await removeWorkspace(first.id) - await removeWorkspace(second.id) - }) - }) + it.instance( + "startWorkspaceSyncing starts all workspaces", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const projectID = instance.project.id + const firstType = unique("first") + const secondType = unique("second") + const first = workspaceInfo(projectID, firstType) + const second = workspaceInfo(projectID, secondType) + yield* Effect.promise(() => fs.mkdir(path.join(dir, "first"), { recursive: true })) + yield* Effect.promise(() => fs.mkdir(path.join(dir, "second"), { recursive: true })) + yield* Effect.sync(() => { + insertWorkspace(first) + insertWorkspace(second) + registerAdapter(projectID, firstType, localAdapter(path.join(dir, "first")).adapter) + registerAdapter(projectID, secondType, localAdapter(path.join(dir, "second")).adapter) + }) + yield* Effect.addFinalizer(() => + Effect.all([workspace.remove(first.id), workspace.remove(second.id)], { discard: true }).pipe(Effect.ignore), + ) - test("local start reports error when the target directory is missing", async () => { - await withInstance(async (dir) => { - const type = unique("missing-local") - const info = workspaceInfo(Instance.project.id, type) - insertWorkspace(info) - registerAdapter( - Instance.project.id, - type, - localAdapter(path.join(dir, "missing-target"), { createDir: false }).adapter, - ) - attachSessionToWorkspace( - (await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({})))).id, - info.id, - ) + yield* workspace.startWorkspaceSyncing(projectID) - startWorkspaceSyncing(Instance.project.id) + yield* eventuallyEffect( + Effect.gen(function* () { + const status = yield* workspace.status() + expect(status.find((item) => item.workspaceID === first.id)?.status).toBe("connected") + expect(status.find((item) => item.workspaceID === second.id)?.status).toBe("connected") + }), + ) + }), + { git: true }, + ) - await eventually(() => - workspaceStatus().then((status) => - expect(status.find((item) => item.workspaceID === info.id)?.status).toBe("error"), - ), - ) - expect(await isWorkspaceSyncing(info.id)).toBe(false) - await removeWorkspace(info.id) - }) - }) + it.instance( + "local start reports error when the target directory is missing", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const type = unique("missing-local") + const info = workspaceInfo(instance.project.id, type) + insertWorkspace(info) + registerAdapter( + instance.project.id, + type, + localAdapter(path.join(dir, "missing-target"), { createDir: false }).adapter, + ) + attachSessionToWorkspace((yield* sessionSvc.create({})).id, info.id) + + yield* workspace.startWorkspaceSyncing(instance.project.id) + + yield* eventuallyEffect( + Effect.gen(function* () { + const status = yield* workspace.status() + expect(status.find((item) => item.workspaceID === info.id)?.status).toBe("error") + }), + ) + expect(yield* workspace.isSyncing(info.id)).toBe(false) + yield* workspace.remove(info.id) + }), + { git: true }, + ) - test("duplicate local status updates are suppressed", async () => { - await withInstance(async (dir) => { - const captured = captureGlobalEvents() - try { + it.instance( + "duplicate local status updates are suppressed", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) + const workspace = yield* Workspace.Service + const sessionSvc = yield* SessionNs.Service + const captured = captureGlobalEvents() + yield* Effect.addFinalizer(() => Effect.sync(() => captured.dispose())) const type = unique("dedupe-local") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) const target = path.join(dir, "dedupe-local") - await fs.mkdir(target, { recursive: true }) + yield* Effect.promise(() => fs.mkdir(target, { recursive: true })) insertWorkspace(info) - registerAdapter(Instance.project.id, type, localAdapter(target).adapter) - attachSessionToWorkspace( - (await AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create({})))).id, - info.id, - ) + registerAdapter(instance.project.id, type, localAdapter(target).adapter) + attachSessionToWorkspace((yield* sessionSvc.create({})).id, info.id) - startWorkspaceSyncing(Instance.project.id) - startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) - await eventually(() => - workspaceStatus().then((status) => - expect(status.find((item) => item.workspaceID === info.id)?.status).toBe("connected"), - ), + yield* eventuallyEffect( + Effect.gen(function* () { + const status = yield* workspace.status() + expect(status.find((item) => item.workspaceID === info.id)?.status).toBe("connected") + }), ) expect( captured.events.filter( (event) => event.workspace === info.id && event.payload.type === Workspace.Event.Status.type, ), ).toHaveLength(1) - await removeWorkspace(info.id) - } finally { - captured.dispose() - } - }) - }) + yield* workspace.remove(info.id) + }), + { git: true }, + ) it.live("remote start emits disconnected, connecting, and connected then refuses duplicate listeners", () => { const calls: FetchCall[] = [] @@ -1108,15 +1198,17 @@ describe("workspace sync state", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const captured = captureGlobalEvents() try { const type = unique("remote-start") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) insertWorkspace(info) - registerAdapter(Instance.project.id, type, remoteAdapter(`${url}/sync`).adapter) + registerAdapter(instance.project.id, type, remoteAdapter(`${url}/sync`).adapter) attachSessionToWorkspace((yield* sessionSvc.create({})).id, info.id) - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* eventuallyEffect( Effect.gen(function* () { expect((yield* workspace.status()).find((item) => item.workspaceID === info.id)?.status).toBe( @@ -1124,7 +1216,7 @@ describe("workspace sync state", () => { ) }), ) - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* Effect.sleep("25 millis") expect( @@ -1163,13 +1255,15 @@ describe("workspace sync state", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const type = unique("remote-connect-fail") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) insertWorkspace(info) - registerAdapter(Instance.project.id, type, remoteAdapter(`${url}/failed`).adapter) + registerAdapter(instance.project.id, type, remoteAdapter(`${url}/failed`).adapter) attachSessionToWorkspace((yield* sessionSvc.create({})).id, info.id) - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* eventuallyEffect( Effect.gen(function* () { @@ -1203,13 +1297,15 @@ describe("workspace sync state", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const type = unique("remote-history-fail") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) insertWorkspace(info) - registerAdapter(Instance.project.id, type, remoteAdapter(`${url}/history-failed`).adapter) + registerAdapter(instance.project.id, type, remoteAdapter(`${url}/history-failed`).adapter) attachSessionToWorkspace((yield* sessionSvc.create({})).id, info.id) - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* eventuallyEffect( Effect.gen(function* () { @@ -1258,18 +1354,20 @@ describe("workspace sync state", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const captured = captureGlobalEvents() try { const type = unique("history-replay") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) insertWorkspace(info) - registerAdapter(Instance.project.id, type, remoteAdapter(`${url}/history`).adapter) + registerAdapter(instance.project.id, type, remoteAdapter(`${url}/history`).adapter) const session = yield* sessionSvc.create({ title: "before history" }) attachSessionToWorkspace(session.id, info.id) historySessionID = session.id historyNextSeq = (sessionSequence(session.id) ?? -1) + 1 - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* eventuallyEffect( Effect.gen(function* () { @@ -1325,15 +1423,17 @@ describe("workspace sync state", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const captured = captureGlobalEvents() try { const type = unique("sse-forward") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) insertWorkspace(info) - registerAdapter(Instance.project.id, type, remoteAdapter(`${url}/sse-forward`).adapter) + registerAdapter(instance.project.id, type, remoteAdapter(`${url}/sse-forward`).adapter) attachSessionToWorkspace((yield* sessionSvc.create({})).id, info.id) - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* eventuallyEffect( Effect.sync(() => @@ -1406,18 +1506,20 @@ describe("workspace sync state", () => { Effect.gen(function* () { const workspace = yield* Workspace.Service const sessionSvc = yield* SessionNs.Service + const instance = yield* InstanceRef + if (!instance) return yield* Effect.die(new Error("missing test instance")) const captured = captureGlobalEvents() try { const type = unique("sse-sync") - const info = workspaceInfo(Instance.project.id, type) + const info = workspaceInfo(instance.project.id, type) insertWorkspace(info) - registerAdapter(Instance.project.id, type, remoteAdapter(`${url}/sse-sync`).adapter) + registerAdapter(instance.project.id, type, remoteAdapter(`${url}/sse-sync`).adapter) const session = yield* sessionSvc.create({ title: "before sse" }) attachSessionToWorkspace(session.id, info.id) sseSessionID = session.id sseNextSeq = (sessionSequence(session.id) ?? -1) + 1 - yield* workspace.startWorkspaceSyncing(Instance.project.id) + yield* workspace.startWorkspaceSyncing(instance.project.id) yield* eventuallyEffect( Effect.gen(function* () { diff --git a/packages/opencode/test/effect/app-runtime-logger.test.ts b/packages/opencode/test/effect/app-runtime-logger.test.ts index fe9516ef99f8..e4ce6511dc58 100644 --- a/packages/opencode/test/effect/app-runtime-logger.test.ts +++ b/packages/opencode/test/effect/app-runtime-logger.test.ts @@ -1,12 +1,13 @@ import { expect } from "bun:test" -import { Context, Effect, Layer, Logger } from "effect" +import { Context, Deferred, Effect, Fiber, Layer, Logger } from "effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" -import { AppRuntime } from "../../src/effect/app-runtime" +import { AppLayer } from "../../src/effect/app-runtime" import { EffectBridge } from "@/effect/bridge" import { InstanceRef } from "../../src/effect/instance-ref" import * as EffectLogger from "@opencode-ai/core/effect/logger" -import { makeRuntime } from "../../src/effect/run-service" -import { provideInstance, tmpdirScoped } from "../fixture/fixture" +import * as Observability from "@opencode-ai/core/effect/observability" +import { attach } from "../../src/effect/run-service" +import { TestInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" const it = testEffect(CrossSpawnSpawner.defaultLayer) @@ -35,64 +36,70 @@ it.live("makeRuntime installs EffectLogger through Observability.layer", () => }), ) - const current = yield* Effect.promise(() => makeRuntime(Dummy, layer).runPromise((svc) => svc.current())) + const current = yield* Dummy.use((svc) => svc.current()).pipe( + Effect.provide(Layer.provideMerge(layer, Observability.layer)), + ) expect(current.effectLogger).toBe(true) expect(current.defaultLogger).toBe(false) }), ) -it.live("AppRuntime also installs EffectLogger through Observability.layer", () => +it.live("AppLayer also installs EffectLogger through Observability.layer", () => Effect.gen(function* () { - const current = yield* Effect.promise(() => - AppRuntime.runPromise(Effect.map(Effect.service(Logger.CurrentLoggers), check)), - ) + const current = yield* Effect.map(Effect.service(Logger.CurrentLoggers), check).pipe(Effect.provide(AppLayer)) expect(current.effectLogger).toBe(true) expect(current.defaultLogger).toBe(false) }), ) -it.live("AppRuntime attaches InstanceRef from ALS", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) - const current = yield* Effect.promise(() => - AppRuntime.runPromise( +it.instance( + "attach preserves InstanceRef from the current fiber context", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const current = yield* attach( Effect.gen(function* () { return (yield* InstanceRef)?.directory }), - ), - ).pipe(provideInstance(dir)) + ) - expect(current).toBe(dir) - }), + expect(current).toBe(test.directory) + }), + { git: true }, ) -it.live("EffectBridge preserves logger and instance context across async boundaries", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) - const result = yield* Effect.promise(() => - AppRuntime.runPromise( - Effect.gen(function* () { - const bridge = yield* EffectBridge.make() - return yield* Effect.promise(() => - Promise.resolve().then(() => - bridge.promise( - Effect.gen(function* () { - return { - directory: (yield* InstanceRef)?.directory, - ...check(yield* Effect.service(Logger.CurrentLoggers)), - } - }), - ), +it.instance( + "EffectBridge preserves logger and instance context across async boundaries", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const bridge = yield* EffectBridge.make() + const started = yield* Deferred.make() + + const fiber = yield* Effect.gen(function* () { + yield* Deferred.succeed(started, undefined) + return yield* Effect.promise(() => + Promise.resolve().then(() => + bridge.promise( + Effect.gen(function* () { + return { + directory: (yield* InstanceRef)?.directory, + ...check(yield* Effect.service(Logger.CurrentLoggers)), + } + }), ), - ) - }), - ), - ).pipe(provideInstance(dir)) + ), + ) + }).pipe(Effect.forkScoped) - expect(result.directory).toBe(dir) - expect(result.effectLogger).toBe(true) - expect(result.defaultLogger).toBe(false) - }), + yield* Deferred.await(started) + const result = yield* Fiber.join(fiber) + + expect(result.directory).toBe(test.directory) + expect(result.effectLogger).toBe(true) + expect(result.defaultLogger).toBe(false) + }).pipe(Effect.provide(Observability.layer)), + { git: true }, ) diff --git a/packages/opencode/test/effect/instance-state.test.ts b/packages/opencode/test/effect/instance-state.test.ts index f5e693388327..b928f16bc6a3 100644 --- a/packages/opencode/test/effect/instance-state.test.ts +++ b/packages/opencode/test/effect/instance-state.test.ts @@ -159,7 +159,7 @@ it.live("InstanceState preserves directory across async boundaries", () => return Test.of({ get: Effect.fn("Test.get")(function* () { - yield* Effect.promise(() => Bun.sleep(1)) + yield* Effect.sleep(Duration.millis(1)) yield* Effect.sleep(Duration.millis(1)) for (let i = 0; i < 100; i++) { yield* Effect.yieldNow @@ -168,7 +168,7 @@ it.live("InstanceState preserves directory across async boundaries", () => yield* Effect.promise(() => Promise.resolve()) } yield* Effect.sleep(Duration.millis(2)) - yield* Effect.promise(() => Bun.sleep(1)) + yield* Effect.sleep(Duration.millis(1)) return yield* InstanceState.get(state) }), }) @@ -212,7 +212,7 @@ it.live("InstanceState survives high-contention concurrent access", () => return Test.of({ get: Effect.fn("Test.get")(function* () { for (let i = 0; i < 10; i++) { - yield* Effect.promise(() => Bun.sleep(Math.random() * 3)) + yield* Effect.sleep(Duration.millis(Math.random() * 3)) yield* Effect.yieldNow yield* Effect.promise(() => Promise.resolve()) } @@ -248,8 +248,8 @@ it.live("InstanceState correct after interleaved init and dispose", () => Test, Effect.gen(function* () { const state = yield* InstanceState.make((ctx) => - Effect.promise(async () => { - await Bun.sleep(5) + Effect.gen(function* () { + yield* Effect.sleep(Duration.millis(5)) return ctx.directory }), ) @@ -305,9 +305,9 @@ it.live("InstanceState dedupes concurrent lookups", () => const dir = yield* tmpdirScoped() let n = 0 const state = yield* InstanceState.make(() => - Effect.promise(async () => { + Effect.gen(function* () { n += 1 - await Bun.sleep(10) + yield* Effect.sleep(Duration.millis(10)) return { n } }), ) diff --git a/packages/opencode/test/effect/runner.test.ts b/packages/opencode/test/effect/runner.test.ts index 0f5783bfc4a6..27fe9e02542e 100644 --- a/packages/opencode/test/effect/runner.test.ts +++ b/packages/opencode/test/effect/runner.test.ts @@ -1,8 +1,13 @@ import { describe, expect } from "bun:test" -import { Deferred, Effect, Exit, Fiber, Ref, Scope } from "effect" +import { Cause, Deferred, Effect, Exit, Fiber, Latch, Ref, Scope } from "effect" import { Runner } from "@/effect/runner" import { it } from "../lib/effect" +const waitForState = (runner: Runner.Runner, tag: Runner.State["_tag"]) => + Effect.gen(function* () { + while (runner.state._tag !== tag) yield* Effect.yieldNow + }).pipe(Effect.timeout("1 second")) + describe("Runner", () => { // --- ensureRunning semantics --- @@ -152,7 +157,7 @@ describe("Runner", () => { const s = yield* Scope.Scope const runner = Runner.make(s, { onInterrupt: Effect.succeed("fallback") }) const fiber = yield* runner.ensureRunning(Effect.never.pipe(Effect.as("never"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Running") yield* runner.cancel @@ -169,9 +174,9 @@ describe("Runner", () => { const runner = Runner.make(s, { onInterrupt: Effect.succeed("fallback") }) const a = yield* runner.ensureRunning(Effect.never.pipe(Effect.as("x"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Running") const b = yield* runner.ensureRunning(Effect.succeed("y")).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* Effect.yieldNow yield* runner.cancel @@ -189,7 +194,7 @@ describe("Runner", () => { const s = yield* Scope.Scope const runner = Runner.make(s) const fiber = yield* runner.ensureRunning(Effect.never.pipe(Effect.as("x"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Running") yield* runner.cancel yield* Fiber.await(fiber) @@ -215,7 +220,7 @@ describe("Runner", () => { ) const a = yield* runner.ensureRunning(first).pipe(Effect.exit, Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Running") const stop = yield* runner.cancel.pipe(Effect.forkChild) yield* Deferred.await(hit).pipe(Effect.timeout("250 millis")) @@ -293,38 +298,17 @@ describe("Runner", () => { const gate = yield* Deferred.make() const sh = yield* runner.startShell(Deferred.await(gate).pipe(Effect.as("first"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Shell") const exit = yield* runner.startShell(Effect.succeed("second")).pipe(Effect.exit) expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Runner.Busy) yield* Deferred.succeed(gate, undefined) yield* Fiber.await(sh) }), ) - it.live( - "shell rejects via busy callback and cancel still stops the first shell", - Effect.gen(function* () { - const s = yield* Scope.Scope - const runner = Runner.make(s, { - busy: () => { - throw new Error("busy") - }, - }) - - const sh = yield* runner.startShell(Effect.never.pipe(Effect.as("aborted"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") - - const exit = yield* runner.startShell(Effect.succeed("second")).pipe(Effect.exit) - expect(Exit.isFailure(exit)).toBe(true) - - yield* runner.cancel - const done = yield* Fiber.await(sh) - expect(Exit.isFailure(done)).toBe(true) - }), - ) - it.live( "cancel interrupts shell", Effect.gen(function* () { @@ -333,7 +317,7 @@ describe("Runner", () => { const gate = yield* Deferred.make() const sh = yield* runner.startShell(Deferred.await(gate).pipe(Effect.as("ignored"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Shell") const stop = yield* runner.cancel.pipe(Effect.forkChild) const stopExit = yield* Fiber.await(stop).pipe(Effect.timeout("250 millis")) @@ -352,11 +336,18 @@ describe("Runner", () => { Effect.gen(function* () { const s = yield* Scope.Scope const runner = Runner.make(s, { onInterrupt: Effect.succeed("interrupted") }) + const ready = yield* Latch.make() const sh = yield* runner - .startShell(Effect.never.pipe(Effect.ensuring(Effect.die("boom")), Effect.as("ignored"))) + .startShell( + Effect.gen(function* () { + yield* ready.open + return yield* Effect.never.pipe(Effect.as("ignored")) + }).pipe(Effect.ensuring(Effect.die("boom"))), + ready, + ) .pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* ready.await.pipe(Effect.timeout("250 millis")) yield* runner.cancel expect(Exit.isFailure(yield* Fiber.await(sh))).toBe(true) @@ -373,11 +364,11 @@ describe("Runner", () => { const gate = yield* Deferred.make() const sh = yield* runner.startShell(Deferred.await(gate).pipe(Effect.as("shell-result"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Shell") expect(runner.state._tag).toBe("Shell") const run = yield* runner.ensureRunning(Effect.succeed("run-result")).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "ShellThenRun") expect(runner.state._tag).toBe("ShellThenRun") yield* Deferred.succeed(gate, undefined) @@ -399,7 +390,7 @@ describe("Runner", () => { const gate = yield* Deferred.make() const sh = yield* runner.startShell(Deferred.await(gate).pipe(Effect.as("shell"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Shell") const work = Effect.gen(function* () { yield* Ref.update(calls, (n) => n + 1) @@ -407,7 +398,7 @@ describe("Runner", () => { }) const a = yield* runner.ensureRunning(work).pipe(Effect.forkChild) const b = yield* runner.ensureRunning(work).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "ShellThenRun") yield* Deferred.succeed(gate, undefined) yield* Fiber.await(sh) @@ -426,10 +417,10 @@ describe("Runner", () => { const runner = Runner.make(s) const sh = yield* runner.startShell(Effect.never.pipe(Effect.as("aborted"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Shell") const run = yield* runner.ensureRunning(Effect.succeed("y")).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "ShellThenRun") expect(runner.state._tag).toBe("ShellThenRun") yield* runner.cancel @@ -465,7 +456,7 @@ describe("Runner", () => { onIdle: Ref.update(count, (n) => n + 1), }) const fiber = yield* runner.ensureRunning(Effect.never.pipe(Effect.as("x"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Running") yield* runner.cancel yield* Fiber.await(fiber) expect(yield* Ref.get(count)).toBeGreaterThanOrEqual(1) @@ -495,7 +486,7 @@ describe("Runner", () => { const gate = yield* Deferred.make() const fiber = yield* runner.ensureRunning(Deferred.await(gate).pipe(Effect.as("ok"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Running") expect(runner.busy).toBe(true) yield* Deferred.succeed(gate, undefined) @@ -512,7 +503,7 @@ describe("Runner", () => { const gate = yield* Deferred.make() const fiber = yield* runner.startShell(Deferred.await(gate).pipe(Effect.as("ok"))).pipe(Effect.forkChild) - yield* Effect.sleep("10 millis") + yield* waitForState(runner, "Shell") expect(runner.busy).toBe(true) yield* Deferred.succeed(gate, undefined) diff --git a/packages/opencode/test/effect/runtime-flags.test.ts b/packages/opencode/test/effect/runtime-flags.test.ts new file mode 100644 index 000000000000..665b546f3d12 --- /dev/null +++ b/packages/opencode/test/effect/runtime-flags.test.ts @@ -0,0 +1,361 @@ +import { describe, expect } from "bun:test" +import { ConfigProvider, Effect, Layer } from "effect" +import { RuntimeFlags } from "../../src/effect/runtime-flags" +import { it } from "../lib/effect" + +const fromConfig = (input: Record) => + RuntimeFlags.defaultLayer.pipe(Layer.provide(ConfigProvider.layer(ConfigProvider.fromUnknown(input)))) + +const readFlags = RuntimeFlags.Service.useSync((flags) => flags) + +describe("RuntimeFlags", () => { + it.effect("defaultLayer defaults autoShare to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.autoShare).toBe(false) + }), + ) + + it.effect("defaultLayer parses plugin flags from the active ConfigProvider", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe( + Effect.provide( + fromConfig({ + OPENCODE_PURE: "true", + OPENCODE_DISABLE_DEFAULT_PLUGINS: "true", + OPENCODE_DISABLE_CHANNEL_DB: "true", + OPENCODE_AUTO_SHARE: "true", + OPENCODE_DISABLE_EMBEDDED_WEB_UI: "true", + OPENCODE_DISABLE_EXTERNAL_SKILLS: "true", + OPENCODE_DISABLE_LSP_DOWNLOAD: "true", + OPENCODE_SKIP_MIGRATIONS: "true", + OPENCODE_EXPERIMENTAL: "true", + OPENCODE_ENABLE_EXA: "true", + OPENCODE_ENABLE_PARALLEL: "true", + OPENCODE_ENABLE_EXPERIMENTAL_MODELS: "true", + OPENCODE_ENABLE_QUESTION_TOOL: "true", + OPENCODE_CLIENT: "desktop", + }), + ), + ) + + expect(flags.pure).toBe(true) + expect(flags.autoShare).toBe(true) + expect(flags.disableDefaultPlugins).toBe(true) + expect(flags.disableChannelDb).toBe(true) + expect(flags.disableEmbeddedWebUi).toBe(true) + expect(flags.disableExternalSkills).toBe(true) + expect(flags.disableLspDownload).toBe(true) + expect(flags.skipMigrations).toBe(true) + expect(flags.disableClaudeCodePrompt).toBe(false) + expect(flags.enableExa).toBe(true) + expect(flags.enableParallel).toBe(true) + expect(flags.enableExperimentalModels).toBe(true) + expect(flags.enableQuestionTool).toBe(true) + expect(flags.experimentalScout).toBe(true) + expect(flags.experimentalBackgroundSubagents).toBe(true) + expect(flags.experimentalLspTy).toBe(false) + expect(flags.experimentalLspTool).toBe(true) + expect(flags.experimentalOxfmt).toBe(true) + expect(flags.experimentalPlanMode).toBe(true) + expect(flags.experimentalEventSystem).toBe(true) + expect(flags.experimentalWorkspaces).toBe(true) + expect(flags.experimentalIconDiscovery).toBe(true) + expect(flags.client).toBe("desktop") + }), + ) + + it.effect("defaultLayer parses OPENCODE_EXPERIMENTAL_LSP_TY", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe( + Effect.provide( + fromConfig({ + OPENCODE_EXPERIMENTAL_LSP_TY: "true", + }), + ), + ) + + expect(flags.experimentalLspTy).toBe(true) + }), + ) + + it.effect("layer accepts partial test overrides and fills defaults from Config definitions", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe( + Effect.provide(RuntimeFlags.layer({ disableDefaultPlugins: true, bashDefaultTimeoutMs: 1_000 })), + ) + + expect(flags.pure).toBe(false) + expect(flags.autoShare).toBe(false) + expect(flags.disableDefaultPlugins).toBe(true) + expect(flags.disableChannelDb).toBe(false) + expect(flags.disableEmbeddedWebUi).toBe(false) + expect(flags.disableExternalSkills).toBe(false) + expect(flags.disableLspDownload).toBe(false) + expect(flags.skipMigrations).toBe(false) + expect(flags.disableClaudeCodePrompt).toBe(false) + expect(flags.disableClaudeCodeSkills).toBe(false) + expect(flags.enableExa).toBe(false) + expect(flags.experimentalIconDiscovery).toBe(false) + expect(flags.experimentalOxfmt).toBe(false) + expect(flags.outputTokenMax).toBeUndefined() + expect(flags.bashDefaultTimeoutMs).toBe(1_000) + expect(flags.enableExperimentalModels).toBe(false) + expect(flags.client).toBe("cli") + }), + ) + + it.effect("experimentalIconDiscovery defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.experimentalIconDiscovery).toBe(false) + }), + ) + + it.effect("disableExternalSkills defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.disableExternalSkills).toBe(false) + }), + ) + + it.effect("disableExternalSkills reads OPENCODE_DISABLE_EXTERNAL_SKILLS", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_EXTERNAL_SKILLS: "true" }))) + + expect(flags.disableExternalSkills).toBe(true) + }), + ) + + it.effect("disableLspDownload defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.disableLspDownload).toBe(false) + }), + ) + + it.effect("disableLspDownload reads OPENCODE_DISABLE_LSP_DOWNLOAD", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_LSP_DOWNLOAD: "true" }))) + + expect(flags.disableLspDownload).toBe(true) + }), + ) + + it.effect("skipMigrations defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.skipMigrations).toBe(false) + }), + ) + + it.effect("skipMigrations reads OPENCODE_SKIP_MIGRATIONS", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_SKIP_MIGRATIONS: "true" }))) + + expect(flags.skipMigrations).toBe(true) + }), + ) + + it.effect("disableClaudeCodePrompt defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.disableClaudeCodePrompt).toBe(false) + }), + ) + + it.effect("disableClaudeCodePrompt reads OPENCODE_DISABLE_CLAUDE_CODE_PROMPT", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_CLAUDE_CODE_PROMPT: "true" }))) + + expect(flags.disableClaudeCodePrompt).toBe(true) + }), + ) + + it.effect("disableClaudeCodePrompt inherits OPENCODE_DISABLE_CLAUDE_CODE", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_CLAUDE_CODE: "true" }))) + + expect(flags.disableClaudeCodePrompt).toBe(true) + }), + ) + + it.effect("experimentalIconDiscovery reads OPENCODE_EXPERIMENTAL_ICON_DISCOVERY", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_EXPERIMENTAL_ICON_DISCOVERY: "true" }))) + + expect(flags.experimentalIconDiscovery).toBe(true) + }), + ) + + it.effect("experimentalIconDiscovery inherits OPENCODE_EXPERIMENTAL", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_EXPERIMENTAL: "true" }))) + + expect(flags.experimentalIconDiscovery).toBe(true) + }), + ) + + it.effect("experimentalOxfmt defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.experimentalOxfmt).toBe(false) + }), + ) + + it.effect("experimentalOxfmt is enabled by OPENCODE_EXPERIMENTAL_OXFMT", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe( + Effect.provide( + fromConfig({ + OPENCODE_EXPERIMENTAL_OXFMT: "true", + }), + ), + ) + + expect(flags.experimentalOxfmt).toBe(true) + }), + ) + + it.effect("experimentalOxfmt inherits OPENCODE_EXPERIMENTAL", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe( + Effect.provide( + fromConfig({ + OPENCODE_EXPERIMENTAL: "true", + }), + ), + ) + + expect(flags.experimentalOxfmt).toBe(true) + }), + ) + + for (const input of [ + { name: "absent", config: {}, expected: undefined }, + { + name: "valid positive integer", + config: { OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "1234" }, + expected: 1234, + }, + { + name: "invalid string", + config: { OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "nope" }, + expected: undefined, + }, + { name: "zero", config: { OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "0" }, expected: undefined }, + { name: "negative", config: { OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "-1" }, expected: undefined }, + { + name: "non-integer", + config: { OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "1.5" }, + expected: undefined, + }, + ]) { + it.effect(`parses bashDefaultTimeoutMs from config: ${input.name}`, () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig(input.config))) + + expect(flags.bashDefaultTimeoutMs).toBe(input.expected) + }), + ) + } + + for (const input of [ + { name: "absent", config: {}, expected: undefined }, + { + name: "valid positive integer", + config: { OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX: "1234" }, + expected: 1234, + }, + { + name: "invalid string", + config: { OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX: "nope" }, + expected: undefined, + }, + { name: "zero", config: { OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX: "0" }, expected: undefined }, + { name: "negative", config: { OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX: "-1" }, expected: undefined }, + { + name: "non-integer", + config: { OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX: "1.5" }, + expected: undefined, + }, + ]) { + it.effect(`parses outputTokenMax from config: ${input.name}`, () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig(input.config))) + + expect(flags.outputTokenMax).toBe(input.expected) + }), + ) + } + + it.effect("layer ignores the active ConfigProvider for omitted test overrides", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe( + Effect.provide(RuntimeFlags.layer()), + Effect.provide( + ConfigProvider.layer( + ConfigProvider.fromUnknown({ + OPENCODE_PURE: "true", + OPENCODE_DISABLE_DEFAULT_PLUGINS: "true", + OPENCODE_DISABLE_EXTERNAL_SKILLS: "true", + OPENCODE_DISABLE_LSP_DOWNLOAD: "true", + OPENCODE_SKIP_MIGRATIONS: "true", + OPENCODE_EXPERIMENTAL: "true", + OPENCODE_ENABLE_EXA: "true", + OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "1234", + OPENCODE_CLIENT: "desktop", + }), + ), + ), + ) + + expect(flags.pure).toBe(false) + expect(flags.disableDefaultPlugins).toBe(false) + expect(flags.disableChannelDb).toBe(false) + expect(flags.disableEmbeddedWebUi).toBe(false) + expect(flags.disableExternalSkills).toBe(false) + expect(flags.disableLspDownload).toBe(false) + expect(flags.skipMigrations).toBe(false) + expect(flags.disableClaudeCodePrompt).toBe(false) + expect(flags.disableClaudeCodeSkills).toBe(false) + expect(flags.enableExa).toBe(false) + expect(flags.experimentalIconDiscovery).toBe(false) + expect(flags.experimentalOxfmt).toBe(false) + expect(flags.outputTokenMax).toBeUndefined() + expect(flags.bashDefaultTimeoutMs).toBeUndefined() + expect(flags.client).toBe("cli") + }), + ) + + it.effect("disableClaudeCodeSkills defaults to false", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({}))) + + expect(flags.disableClaudeCodeSkills).toBe(false) + }), + ) + + it.effect("disableClaudeCodeSkills reads OPENCODE_DISABLE_CLAUDE_CODE_SKILLS", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_CLAUDE_CODE_SKILLS: "true" }))) + + expect(flags.disableClaudeCodeSkills).toBe(true) + }), + ) + + it.effect("disableClaudeCodeSkills inherits OPENCODE_DISABLE_CLAUDE_CODE", () => + Effect.gen(function* () { + const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_CLAUDE_CODE: "true" }))) + + expect(flags.disableClaudeCodeSkills).toBe(true) + }), + ) +}) diff --git a/packages/opencode/test/file/fsmonitor.test.ts b/packages/opencode/test/file/fsmonitor.test.ts index f345cd0850e4..b8d3bd605520 100644 --- a/packages/opencode/test/file/fsmonitor.test.ts +++ b/packages/opencode/test/file/fsmonitor.test.ts @@ -3,67 +3,71 @@ import { describe, expect, test } from "bun:test" import { Effect } from "effect" import fs from "fs/promises" import path from "path" -import { File } from "../../src/file" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { provideInstance, tmpdir } from "../fixture/fixture" -const run = (eff: Effect.Effect) => - Effect.runPromise(provideInstance(Instance.directory)(eff.pipe(Effect.provide(File.defaultLayer)))) -const status = () => run(File.Service.use((svc) => svc.status())) -const read = (file: string) => run(File.Service.use((svc) => svc.read(file))) - -const wintest = process.platform === "win32" ? test : test.skip +const it = + process.platform === "win32" + ? (await import("../lib/effect")).testEffect((await import("../../src/file")).File.defaultLayer) + : undefined describe("file fsmonitor", () => { - wintest("status does not start fsmonitor for readonly git checks", async () => { - await using tmp = await tmpdir({ git: true }) - const target = path.join(tmp.path, "tracked.txt") + if (!it) { + test.skip("status does not start fsmonitor for readonly git checks", () => {}) + test.skip("read does not start fsmonitor for git diffs", () => {}) + return + } + + it.instance( + "status does not start fsmonitor for readonly git checks", + () => + Effect.gen(function* () { + const { File } = yield* Effect.promise(() => import("../../src/file")) + const { TestInstance } = yield* Effect.promise(() => import("../fixture/fixture")) + const directory = (yield* TestInstance).directory + const target = path.join(directory, "tracked.txt") - await fs.writeFile(target, "base\n") - await $`git add tracked.txt`.cwd(tmp.path).quiet() - await $`git commit -m init`.cwd(tmp.path).quiet() - await $`git config core.fsmonitor true`.cwd(tmp.path).quiet() - await $`git fsmonitor--daemon stop`.cwd(tmp.path).quiet().nothrow() - await fs.writeFile(target, "next\n") - await fs.writeFile(path.join(tmp.path, "new.txt"), "new\n") + yield* Effect.promise(() => fs.writeFile(target, "base\n")) + yield* Effect.promise(() => $`git add tracked.txt`.cwd(directory).quiet()) + yield* Effect.promise(() => $`git commit -m init`.cwd(directory).quiet()) + yield* Effect.promise(() => $`git config core.fsmonitor true`.cwd(directory).quiet()) + yield* Effect.promise(() => $`git fsmonitor--daemon stop`.cwd(directory).quiet().nothrow()) + yield* Effect.promise(() => fs.writeFile(target, "next\n")) + yield* Effect.promise(() => fs.writeFile(path.join(directory, "new.txt"), "new\n")) - const before = await $`git fsmonitor--daemon status`.cwd(tmp.path).quiet().nothrow() - expect(before.exitCode).not.toBe(0) + const before = yield* Effect.promise(() => $`git fsmonitor--daemon status`.cwd(directory).quiet().nothrow()) + expect(before.exitCode).not.toBe(0) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await status() - }, - }) + yield* File.Service.use((svc) => svc.status()) - const after = await $`git fsmonitor--daemon status`.cwd(tmp.path).quiet().nothrow() - expect(after.exitCode).not.toBe(0) - }) + const after = yield* Effect.promise(() => $`git fsmonitor--daemon status`.cwd(directory).quiet().nothrow()) + expect(after.exitCode).not.toBe(0) + }), + { git: true }, + ) - wintest("read does not start fsmonitor for git diffs", async () => { - await using tmp = await tmpdir({ git: true }) - const target = path.join(tmp.path, "tracked.txt") + it.instance( + "read does not start fsmonitor for git diffs", + () => + Effect.gen(function* () { + const { File } = yield* Effect.promise(() => import("../../src/file")) + const { TestInstance } = yield* Effect.promise(() => import("../fixture/fixture")) + const directory = (yield* TestInstance).directory + const target = path.join(directory, "tracked.txt") - await fs.writeFile(target, "base\n") - await $`git add tracked.txt`.cwd(tmp.path).quiet() - await $`git commit -m init`.cwd(tmp.path).quiet() - await $`git config core.fsmonitor true`.cwd(tmp.path).quiet() - await $`git fsmonitor--daemon stop`.cwd(tmp.path).quiet().nothrow() - await fs.writeFile(target, "next\n") + yield* Effect.promise(() => fs.writeFile(target, "base\n")) + yield* Effect.promise(() => $`git add tracked.txt`.cwd(directory).quiet()) + yield* Effect.promise(() => $`git commit -m init`.cwd(directory).quiet()) + yield* Effect.promise(() => $`git config core.fsmonitor true`.cwd(directory).quiet()) + yield* Effect.promise(() => $`git fsmonitor--daemon stop`.cwd(directory).quiet().nothrow()) + yield* Effect.promise(() => fs.writeFile(target, "next\n")) - const before = await $`git fsmonitor--daemon status`.cwd(tmp.path).quiet().nothrow() - expect(before.exitCode).not.toBe(0) + const before = yield* Effect.promise(() => $`git fsmonitor--daemon status`.cwd(directory).quiet().nothrow()) + expect(before.exitCode).not.toBe(0) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await read("tracked.txt") - }, - }) + yield* File.Service.use((svc) => svc.read("tracked.txt")) - const after = await $`git fsmonitor--daemon status`.cwd(tmp.path).quiet().nothrow() - expect(after.exitCode).not.toBe(0) - }) + const after = yield* Effect.promise(() => $`git fsmonitor--daemon status`.cwd(directory).quiet().nothrow()) + expect(after.exitCode).not.toBe(0) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/file/index.test.ts b/packages/opencode/test/file/index.test.ts index cdd2e211c25b..b7d531c63d29 100644 --- a/packages/opencode/test/file/index.test.ts +++ b/packages/opencode/test/file/index.test.ts @@ -1,557 +1,514 @@ -import { afterEach, describe, test, expect } from "bun:test" +import { afterEach, describe, expect } from "bun:test" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import { $ } from "bun" -import { Effect } from "effect" +import { Cause, Effect, Exit, Layer } from "effect" import path from "path" import fs from "fs/promises" import { File } from "../../src/file" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { Filesystem } from "@/util/filesystem" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance, withTmpdirInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" afterEach(async () => { await disposeAllInstances() }) -const init = () => run(File.Service.use((svc) => svc.init())) -const run = (eff: Effect.Effect) => - Effect.runPromise(provideInstance(Instance.directory)(eff.pipe(Effect.provide(File.defaultLayer)))) -const status = () => run(File.Service.use((svc) => svc.status())) -const read = (file: string) => run(File.Service.use((svc) => svc.read(file))) -const list = (dir?: string) => run(File.Service.use((svc) => svc.list(dir))) -const search = (input: { query: string; limit?: number; dirs?: boolean; type?: "file" | "directory" }) => - run(File.Service.use((svc) => svc.search(input))) +const it = testEffect(Layer.mergeAll(File.defaultLayer, AppFileSystem.defaultLayer)) + +const init = Effect.fn("FileTest.init")(function* () { + const file = yield* File.Service + return yield* file.init() +}) + +const status = Effect.fn("FileTest.status")(function* () { + const file = yield* File.Service + return yield* file.status() +}) + +const read = Effect.fn("FileTest.read")(function* (input: string) { + const file = yield* File.Service + return yield* file.read(input) +}) + +const list = Effect.fn("FileTest.list")(function* (dir?: string) { + const file = yield* File.Service + return yield* file.list(dir) +}) + +const search = Effect.fn("FileTest.search")(function* (input: { + query: string + limit?: number + dirs?: boolean + type?: "file" | "directory" +}) { + const file = yield* File.Service + return yield* file.search(input) +}) + +const gitAddAll = (directory: string) => Effect.promise(() => $`git add .`.cwd(directory).quiet()) +const gitCommit = (directory: string, message: string) => + Effect.promise(() => $`git commit -m ${message}`.cwd(directory).quiet()) + +const failureMessage = (self: Effect.Effect) => + Effect.gen(function* () { + const exit = yield* self.pipe(Effect.exit) + if (Exit.isFailure(exit)) { + const error = Cause.squash(exit.cause) + return error instanceof Error ? error.message : String(error) + } + throw new Error("expected effect to fail") + }) + +const setupSearchableRepo = Effect.fn("FileTest.setupSearchableRepo")(function* (directory: string) { + const fsys = yield* AppFileSystem.Service + yield* fsys.writeWithDirs(path.join(directory, "index.ts"), "code") + yield* fsys.writeWithDirs(path.join(directory, "utils.ts"), "utils") + yield* fsys.writeWithDirs(path.join(directory, "readme.md"), "readme") + yield* fsys.writeWithDirs(path.join(directory, "src", "main.ts"), "main") + yield* fsys.writeWithDirs(path.join(directory, ".hidden", "secret.ts"), "secret") +}) describe("file/index Filesystem patterns", () => { describe("read() - text content", () => { - test("reads text file via Filesystem.readText()", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.txt") - await fs.writeFile(filepath, "Hello World", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.txt") - expect(result.type).toBe("text") - expect(result.content).toBe("Hello World") - }, - }) - }) - - test("reads with Filesystem.exists() check", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // Non-existent file should return empty content - const result = await read("nonexistent.txt") - expect(result.type).toBe("text") - expect(result.content).toBe("") - }, - }) - }) - - test("trims whitespace from text content", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.txt") - await fs.writeFile(filepath, " content with spaces \n\n", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.txt") - expect(result.content).toBe("content with spaces") - }, - }) - }) - - test("handles empty text file", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "empty.txt") - await fs.writeFile(filepath, "", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("empty.txt") - expect(result.type).toBe("text") - expect(result.content).toBe("") - }, - }) - }) - - test("handles multi-line text files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "multiline.txt") - await fs.writeFile(filepath, "line1\nline2\nline3", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("multiline.txt") - expect(result.content).toBe("line1\nline2\nline3") - }, - }) - }) + it.instance("reads text file via Filesystem.readText()", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "test.txt"), "Hello World", "utf-8")) + + const result = yield* read("test.txt") + expect(result.type).toBe("text") + expect(result.content).toBe("Hello World") + }), + ) + + it.instance("reads with Filesystem.exists() check", () => + Effect.gen(function* () { + const result = yield* read("nonexistent.txt") + expect(result.type).toBe("text") + expect(result.content).toBe("") + }), + ) + + it.instance("trims whitespace from text content", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "test.txt"), " content with spaces \n\n", "utf-8"), + ) + + const result = yield* read("test.txt") + expect(result.content).toBe("content with spaces") + }), + ) + + it.instance("handles empty text file", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "empty.txt"), "", "utf-8")) + + const result = yield* read("empty.txt") + expect(result.type).toBe("text") + expect(result.content).toBe("") + }), + ) + + it.instance("handles multi-line text files", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "multiline.txt"), "line1\nline2\nline3", "utf-8"), + ) + + const result = yield* read("multiline.txt") + expect(result.content).toBe("line1\nline2\nline3") + }), + ) }) describe("read() - binary content", () => { - test("reads binary file via Filesystem.readArrayBuffer()", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "image.png") - const binaryContent = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) - await fs.writeFile(filepath, binaryContent) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("image.png") - expect(result.type).toBe("text") // Images return as text with base64 encoding - expect(result.encoding).toBe("base64") - expect(result.mimeType).toBe("image/png") - expect(result.content).toBe(binaryContent.toString("base64")) - }, - }) - }) - - test("returns empty for binary non-image files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "binary.so") - await fs.writeFile(filepath, Buffer.from([0x7f, 0x45, 0x4c, 0x46]), "binary") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("binary.so") - expect(result.type).toBe("binary") - expect(result.content).toBe("") - }, - }) - }) + it.instance("reads binary file via Filesystem.readArrayBuffer()", () => + Effect.gen(function* () { + const test = yield* TestInstance + const binaryContent = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "image.png"), binaryContent)) + + const result = yield* read("image.png") + expect(result.type).toBe("text") + expect(result.encoding).toBe("base64") + expect(result.mimeType).toBe("image/png") + expect(result.content).toBe(binaryContent.toString("base64")) + }), + ) + + it.instance("returns empty for binary non-image files", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "binary.so"), Buffer.from([0x7f, 0x45, 0x4c, 0x46])), + ) + + const result = yield* read("binary.so") + expect(result.type).toBe("binary") + expect(result.content).toBe("") + }), + ) }) describe("read() - Filesystem.mimeType()", () => { - test("detects MIME type via Filesystem.mimeType()", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.json") - await fs.writeFile(filepath, '{"key": "value"}', "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - expect(await Filesystem.mimeType(filepath)).toContain("application/json") - - const result = await read("test.json") - expect(result.type).toBe("text") - }, - }) - }) - - test("handles various image MIME types", async () => { - await using tmp = await tmpdir() - const testCases = [ - { ext: "jpg", mime: "image/jpeg" }, - { ext: "png", mime: "image/png" }, - { ext: "gif", mime: "image/gif" }, - { ext: "webp", mime: "image/webp" }, - ] - - for (const { ext, mime } of testCases) { - const filepath = path.join(tmp.path, `test.${ext}`) - await fs.writeFile(filepath, Buffer.from([0x00, 0x00, 0x00, 0x00]), "binary") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - expect(await Filesystem.mimeType(filepath)).toContain(mime) - }, - }) - } - }) + it.instance("detects MIME type via Filesystem.mimeType()", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "test.json") + yield* Effect.promise(() => fs.writeFile(filepath, '{"key": "value"}', "utf-8")) + + expect(AppFileSystem.mimeType(filepath)).toContain("application/json") + + const result = yield* read("test.json") + expect(result.type).toBe("text") + }), + ) + + it.instance("handles various image MIME types", () => + Effect.gen(function* () { + const test = yield* TestInstance + const testCases = [ + { ext: "jpg", mime: "image/jpeg" }, + { ext: "png", mime: "image/png" }, + { ext: "gif", mime: "image/gif" }, + { ext: "webp", mime: "image/webp" }, + ] + + for (const testCase of testCases) { + const filepath = path.join(test.directory, `test.${testCase.ext}`) + yield* Effect.promise(() => fs.writeFile(filepath, Buffer.from([0x00, 0x00, 0x00, 0x00]))) + expect(AppFileSystem.mimeType(filepath)).toContain(testCase.mime) + } + }), + ) }) describe("list() - Filesystem.exists() and readText()", () => { - test("reads .gitignore via Filesystem.exists() and readText()", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const gitignorePath = path.join(tmp.path, ".gitignore") - await fs.writeFile(gitignorePath, "node_modules\ndist\n", "utf-8") - - // This is used internally in list() - expect(await Filesystem.exists(gitignorePath)).toBe(true) - - const content = await Filesystem.readText(gitignorePath) - expect(content).toContain("node_modules") - }, - }) - }) - - test("reads .ignore file similarly", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const ignorePath = path.join(tmp.path, ".ignore") - await fs.writeFile(ignorePath, "*.log\n.env\n", "utf-8") - - expect(await Filesystem.exists(ignorePath)).toBe(true) - expect(await Filesystem.readText(ignorePath)).toContain("*.log") - }, - }) - }) - - test("handles missing .gitignore gracefully", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const gitignorePath = path.join(tmp.path, ".gitignore") - expect(await Filesystem.exists(gitignorePath)).toBe(false) - - // list() should still work - const nodes = await list() + it.instance( + "reads .gitignore via AppFileSystem.existsSafe() and readFileString()", + () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const test = yield* TestInstance + const gitignorePath = path.join(test.directory, ".gitignore") + yield* fsys.writeFileString(gitignorePath, "node_modules\ndist\n") + + expect(yield* fsys.existsSafe(gitignorePath)).toBe(true) + expect(yield* fsys.readFileString(gitignorePath)).toContain("node_modules") + }), + { git: true }, + ) + + it.instance( + "reads .ignore file similarly", + () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const test = yield* TestInstance + const ignorePath = path.join(test.directory, ".ignore") + yield* fsys.writeFileString(ignorePath, "*.log\n.env\n") + + expect(yield* fsys.existsSafe(ignorePath)).toBe(true) + expect(yield* fsys.readFileString(ignorePath)).toContain("*.log") + }), + { git: true }, + ) + + it.instance( + "handles missing .gitignore gracefully", + () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const test = yield* TestInstance + const gitignorePath = path.join(test.directory, ".gitignore") + expect(yield* fsys.existsSafe(gitignorePath)).toBe(false) + + const nodes = yield* list() expect(Array.isArray(nodes)).toBe(true) - }, - }) - }) + }), + { git: true }, + ) }) - describe("File.changed() - Filesystem.readText() for untracked files", () => { - test("reads untracked files via Filesystem.readText()", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const untrackedPath = path.join(tmp.path, "untracked.txt") - await fs.writeFile(untrackedPath, "new content\nwith multiple lines", "utf-8") - - // This is how File.changed() reads untracked files - const content = await Filesystem.readText(untrackedPath) - const lines = content.split("\n").length - expect(lines).toBe(2) - }, - }) - }) + describe("File.changed() - AppFileSystem.readFileString() for untracked files", () => { + it.instance( + "reads untracked files via AppFileSystem.readFileString()", + () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const test = yield* TestInstance + const untrackedPath = path.join(test.directory, "untracked.txt") + yield* fsys.writeFileString(untrackedPath, "new content\nwith multiple lines") + + const content = yield* fsys.readFileString(untrackedPath) + expect(content.split("\n").length).toBe(2) + }), + { git: true }, + ) }) describe("Error handling", () => { - test("handles errors gracefully in Filesystem.readText()", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "readonly.txt") - await fs.writeFile(filepath, "content", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nonExistentPath = path.join(tmp.path, "does-not-exist.txt") - // Filesystem.readText() on non-existent file throws - await expect(Filesystem.readText(nonExistentPath)).rejects.toThrow() - - // But read() handles this gracefully - const result = await read("does-not-exist.txt") - expect(result.content).toBe("") - }, - }) - }) - - test("handles errors in Filesystem.readArrayBuffer()", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nonExistentPath = path.join(tmp.path, "does-not-exist.bin") - const buffer = await Filesystem.readArrayBuffer(nonExistentPath).catch(() => new ArrayBuffer(0)) - expect(buffer.byteLength).toBe(0) - }, - }) - }) - - test("returns empty array buffer on error for images", async () => { - await using tmp = await tmpdir() - const _filepath = path.join(tmp.path, "broken.png") - // Don't create the file - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // read() handles missing images gracefully - const result = await read("broken.png") - expect(result.type).toBe("text") - expect(result.content).toBe("") - }, - }) - }) + it.instance("handles errors gracefully in AppFileSystem.readFileString()", () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const test = yield* TestInstance + yield* fsys.writeFileString(path.join(test.directory, "readonly.txt"), "content") + + const nonExistentPath = path.join(test.directory, "does-not-exist.txt") + expect(Exit.isFailure(yield* fsys.readFileString(nonExistentPath).pipe(Effect.exit))).toBe(true) + + const result = yield* read("does-not-exist.txt") + expect(result.content).toBe("") + }), + ) + + it.instance("handles errors in AppFileSystem.readFile()", () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const test = yield* TestInstance + const nonExistentPath = path.join(test.directory, "does-not-exist.bin") + const buffer = yield* fsys.readFile(nonExistentPath).pipe(Effect.orElseSucceed(() => new Uint8Array(0))) + expect(buffer.byteLength).toBe(0) + }), + ) + + it.instance("returns empty array buffer on error for images", () => + Effect.gen(function* () { + const result = yield* read("broken.png") + expect(result.type).toBe("text") + expect(result.content).toBe("") + }), + ) }) describe("shouldEncode() logic", () => { - test("treats .ts files as text", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.ts") - await fs.writeFile(filepath, "export const value = 1", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.ts") - expect(result.type).toBe("text") - expect(result.content).toBe("export const value = 1") - }, - }) - }) - - test("treats .mts files as text", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.mts") - await fs.writeFile(filepath, "export const value = 1", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.mts") - expect(result.type).toBe("text") - expect(result.content).toBe("export const value = 1") - }, - }) - }) - - test("treats .sh files as text", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.sh") - await fs.writeFile(filepath, "#!/usr/bin/env bash\necho hello", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.sh") - expect(result.type).toBe("text") - expect(result.content).toBe("#!/usr/bin/env bash\necho hello") - }, - }) - }) - - test("treats Dockerfile as text", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "Dockerfile") - await fs.writeFile(filepath, "FROM alpine:3.20", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("Dockerfile") - expect(result.type).toBe("text") - expect(result.content).toBe("FROM alpine:3.20") - }, - }) - }) - - test("returns encoding info for text files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.txt") - await fs.writeFile(filepath, "simple text", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.txt") - expect(result.encoding).toBeUndefined() - expect(result.type).toBe("text") - }, - }) - }) - - test("returns base64 encoding for images", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "test.jpg") - await fs.writeFile(filepath, Buffer.from([0xff, 0xd8, 0xff, 0xe0]), "binary") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("test.jpg") - expect(result.encoding).toBe("base64") - expect(result.mimeType).toBe("image/jpeg") - }, - }) - }) + it.instance("treats .ts files as text", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "test.ts"), "export const value = 1", "utf-8"), + ) + + const result = yield* read("test.ts") + expect(result.type).toBe("text") + expect(result.content).toBe("export const value = 1") + }), + ) + + it.instance("treats .mts files as text", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "test.mts"), "export const value = 1", "utf-8"), + ) + + const result = yield* read("test.mts") + expect(result.type).toBe("text") + expect(result.content).toBe("export const value = 1") + }), + ) + + it.instance("treats .sh files as text", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "test.sh"), "#!/usr/bin/env bash\necho hello", "utf-8"), + ) + + const result = yield* read("test.sh") + expect(result.type).toBe("text") + expect(result.content).toBe("#!/usr/bin/env bash\necho hello") + }), + ) + + it.instance("treats Dockerfile as text", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "Dockerfile"), "FROM alpine:3.20", "utf-8")) + + const result = yield* read("Dockerfile") + expect(result.type).toBe("text") + expect(result.content).toBe("FROM alpine:3.20") + }), + ) + + it.instance("returns encoding info for text files", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "test.txt"), "simple text", "utf-8")) + + const result = yield* read("test.txt") + expect(result.encoding).toBeUndefined() + expect(result.type).toBe("text") + }), + ) + + it.instance("returns base64 encoding for images", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "test.jpg"), Buffer.from([0xff, 0xd8, 0xff, 0xe0])), + ) + + const result = yield* read("test.jpg") + expect(result.encoding).toBe("base64") + expect(result.mimeType).toBe("image/jpeg") + }), + ) }) describe("Path security", () => { - test("throws for paths outside project directory", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(read("../outside.txt")).rejects.toThrow("Access denied") - }, - }) - }) - - test("throws for paths outside project directory", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(read("../outside.txt")).rejects.toThrow("Access denied") - }, - }) - }) + it.instance("throws for paths outside project directory", () => + Effect.gen(function* () { + expect(yield* failureMessage(read("../outside.txt"))).toContain("Access denied") + }), + ) + + it.instance("throws for paths outside project directory", () => + Effect.gen(function* () { + expect(yield* failureMessage(read("../outside.txt"))).toContain("Access denied") + }), + ) }) describe("status()", () => { - test("detects modified file", async () => { - await using tmp = await tmpdir({ git: true }) - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "original\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "add file"`.cwd(tmp.path).quiet() - await fs.writeFile(filepath, "modified\nextra line\n", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - const entry = result.find((f) => f.path === "file.txt") + it.instance( + "detects modified file", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* Effect.promise(() => fs.writeFile(filepath, "original\n", "utf-8")) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "add file") + yield* Effect.promise(() => fs.writeFile(filepath, "modified\nextra line\n", "utf-8")) + + const result = yield* status() + const entry = result.find((file) => file.path === "file.txt") expect(entry).toBeDefined() expect(entry!.status).toBe("modified") expect(entry!.added).toBeGreaterThan(0) expect(entry!.removed).toBeGreaterThan(0) - }, - }) - }) - - test("detects untracked file as added", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "new.txt"), "line1\nline2\nline3\n", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - const entry = result.find((f) => f.path === "new.txt") + }), + { git: true }, + ) + + it.instance( + "detects untracked file as added", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "new.txt"), "line1\nline2\nline3\n", "utf-8"), + ) + + const result = yield* status() + const entry = result.find((file) => file.path === "new.txt") expect(entry).toBeDefined() expect(entry!.status).toBe("added") - expect(entry!.added).toBe(4) // 3 lines + trailing newline splits to 4 + expect(entry!.added).toBe(4) expect(entry!.removed).toBe(0) - }, - }) - }) - - test("detects deleted file", async () => { - await using tmp = await tmpdir({ git: true }) - const filepath = path.join(tmp.path, "gone.txt") - await fs.writeFile(filepath, "content\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "add file"`.cwd(tmp.path).quiet() - await fs.rm(filepath) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - // Deleted files appear in both numstat (as "modified") and diff-filter=D (as "deleted") - const entries = result.filter((f) => f.path === "gone.txt") - expect(entries.some((e) => e.status === "deleted")).toBe(true) - }, - }) - }) - - test("detects mixed changes", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "keep.txt"), "keep\n", "utf-8") - await fs.writeFile(path.join(tmp.path, "remove.txt"), "remove\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "initial"`.cwd(tmp.path).quiet() - - // Modify one, delete one, add one - await fs.writeFile(path.join(tmp.path, "keep.txt"), "changed\n", "utf-8") - await fs.rm(path.join(tmp.path, "remove.txt")) - await fs.writeFile(path.join(tmp.path, "brand-new.txt"), "hello\n", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - expect(result.some((f) => f.path === "keep.txt" && f.status === "modified")).toBe(true) - expect(result.some((f) => f.path === "remove.txt" && f.status === "deleted")).toBe(true) - expect(result.some((f) => f.path === "brand-new.txt" && f.status === "added")).toBe(true) - }, - }) - }) - - test("returns empty for non-git project", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - expect(result).toEqual([]) - }, - }) - }) - - test("returns empty for clean repo", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - expect(result).toEqual([]) - }, - }) - }) - - test("parses binary numstat as 0", async () => { - await using tmp = await tmpdir({ git: true }) - const filepath = path.join(tmp.path, "data.bin") - // Write content with null bytes so git treats it as binary - const binaryData = Buffer.alloc(256) - for (let i = 0; i < 256; i++) binaryData[i] = i - await fs.writeFile(filepath, binaryData) - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "add binary"`.cwd(tmp.path).quiet() - // Modify the binary - const modified = Buffer.alloc(512) - for (let i = 0; i < 512; i++) modified[i] = i % 256 - await fs.writeFile(filepath, modified) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await status() - const entry = result.find((f) => f.path === "data.bin") + }), + { git: true }, + ) + + it.instance( + "detects deleted file", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "gone.txt") + yield* Effect.promise(() => fs.writeFile(filepath, "content\n", "utf-8")) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "add file") + yield* Effect.promise(() => fs.rm(filepath)) + + const result = yield* status() + const entries = result.filter((file) => file.path === "gone.txt") + expect(entries.some((entry) => entry.status === "deleted")).toBe(true) + }), + { git: true }, + ) + + it.instance( + "detects mixed changes", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "keep.txt"), "keep\n", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "remove.txt"), "remove\n", "utf-8")) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "initial") + + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "keep.txt"), "changed\n", "utf-8")) + yield* Effect.promise(() => fs.rm(path.join(test.directory, "remove.txt"))) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "brand-new.txt"), "hello\n", "utf-8")) + + const result = yield* status() + expect(result.some((file) => file.path === "keep.txt" && file.status === "modified")).toBe(true) + expect(result.some((file) => file.path === "remove.txt" && file.status === "deleted")).toBe(true) + expect(result.some((file) => file.path === "brand-new.txt" && file.status === "added")).toBe(true) + }), + { git: true }, + ) + + it.instance("returns empty for non-git project", () => + Effect.gen(function* () { + expect(yield* status()).toEqual([]) + }), + ) + + it.instance( + "returns empty for clean repo", + () => + Effect.gen(function* () { + expect(yield* status()).toEqual([]) + }), + { git: true }, + ) + + it.instance( + "parses binary numstat as 0", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "data.bin") + yield* Effect.promise(() => + fs.writeFile(filepath, Buffer.from(Array.from({ length: 256 }, (_, index) => index))), + ) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "add binary") + yield* Effect.promise(() => + fs.writeFile(filepath, Buffer.from(Array.from({ length: 512 }, (_, index) => index % 256))), + ) + + const result = yield* status() + const entry = result.find((file) => file.path === "data.bin") expect(entry).toBeDefined() expect(entry!.status).toBe("modified") expect(entry!.added).toBe(0) expect(entry!.removed).toBe(0) - }, - }) - }) + }), + { git: true }, + ) }) describe("list()", () => { - test("returns files and directories with correct shape", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.mkdir(path.join(tmp.path, "subdir")) - await fs.writeFile(path.join(tmp.path, "file.txt"), "content", "utf-8") - await fs.writeFile(path.join(tmp.path, "subdir", "nested.txt"), "nested", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nodes = await list() + it.instance( + "returns files and directories with correct shape", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.mkdir(path.join(test.directory, "subdir"))) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "file.txt"), "content", "utf-8")) + yield* Effect.promise(() => + fs.writeFile(path.join(test.directory, "subdir", "nested.txt"), "nested", "utf-8"), + ) + + const nodes = yield* list() expect(nodes.length).toBeGreaterThanOrEqual(2) for (const node of nodes) { expect(node).toHaveProperty("name") @@ -561,289 +518,264 @@ describe("file/index Filesystem patterns", () => { expect(node).toHaveProperty("ignored") expect(["file", "directory"]).toContain(node.type) } - }, - }) - }) - - test("sorts directories before files, alphabetical within each", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.mkdir(path.join(tmp.path, "beta")) - await fs.mkdir(path.join(tmp.path, "alpha")) - await fs.writeFile(path.join(tmp.path, "zz.txt"), "", "utf-8") - await fs.writeFile(path.join(tmp.path, "aa.txt"), "", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nodes = await list() - const dirs = nodes.filter((n) => n.type === "directory") - const files = nodes.filter((n) => n.type === "file") - // Dirs come first - const firstFile = nodes.findIndex((n) => n.type === "file") - const lastDir = nodes.findLastIndex((n) => n.type === "directory") + }), + { git: true }, + ) + + it.instance( + "sorts directories before files, alphabetical within each", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.mkdir(path.join(test.directory, "beta"))) + yield* Effect.promise(() => fs.mkdir(path.join(test.directory, "alpha"))) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "zz.txt"), "", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "aa.txt"), "", "utf-8")) + + const nodes = yield* list() + const dirs = nodes.filter((node) => node.type === "directory") + const files = nodes.filter((node) => node.type === "file") + const firstFile = nodes.findIndex((node) => node.type === "file") + const lastDir = nodes.findLastIndex((node) => node.type === "directory") if (lastDir >= 0 && firstFile >= 0) { expect(lastDir).toBeLessThan(firstFile) } - // Alphabetical within dirs - expect(dirs.map((d) => d.name)).toEqual(dirs.map((d) => d.name).toSorted()) - // Alphabetical within files - expect(files.map((f) => f.name)).toEqual(files.map((f) => f.name).toSorted()) - }, - }) - }) - - test("excludes .git and .DS_Store", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, ".DS_Store"), "", "utf-8") - await fs.writeFile(path.join(tmp.path, "visible.txt"), "", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nodes = await list() - const names = nodes.map((n) => n.name) + expect(dirs.map((dir) => dir.name)).toEqual(dirs.map((dir) => dir.name).toSorted()) + expect(files.map((file) => file.name)).toEqual(files.map((file) => file.name).toSorted()) + }), + { git: true }, + ) + + it.instance( + "excludes .git and .DS_Store", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, ".DS_Store"), "", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "visible.txt"), "", "utf-8")) + + const names = (yield* list()).map((node) => node.name) expect(names).not.toContain(".git") expect(names).not.toContain(".DS_Store") expect(names).toContain("visible.txt") - }, - }) - }) - - test("marks gitignored files as ignored", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, ".gitignore"), "*.log\nbuild/\n", "utf-8") - await fs.writeFile(path.join(tmp.path, "app.log"), "log data", "utf-8") - await fs.writeFile(path.join(tmp.path, "main.ts"), "code", "utf-8") - await fs.mkdir(path.join(tmp.path, "build")) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nodes = await list() - const logNode = nodes.find((n) => n.name === "app.log") - const tsNode = nodes.find((n) => n.name === "main.ts") - const buildNode = nodes.find((n) => n.name === "build") - expect(logNode?.ignored).toBe(true) - expect(tsNode?.ignored).toBe(false) - expect(buildNode?.ignored).toBe(true) - }, - }) - }) - - test("lists subdirectory contents", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.mkdir(path.join(tmp.path, "sub")) - await fs.writeFile(path.join(tmp.path, "sub", "a.txt"), "", "utf-8") - await fs.writeFile(path.join(tmp.path, "sub", "b.txt"), "", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nodes = await list("sub") + }), + { git: true }, + ) + + it.instance( + "marks gitignored files as ignored", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, ".gitignore"), "*.log\nbuild/\n", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "app.log"), "log data", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "main.ts"), "code", "utf-8")) + yield* Effect.promise(() => fs.mkdir(path.join(test.directory, "build"))) + + const nodes = yield* list() + expect(nodes.find((node) => node.name === "app.log")?.ignored).toBe(true) + expect(nodes.find((node) => node.name === "main.ts")?.ignored).toBe(false) + expect(nodes.find((node) => node.name === "build")?.ignored).toBe(true) + }), + { git: true }, + ) + + it.instance( + "lists subdirectory contents", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.mkdir(path.join(test.directory, "sub"))) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "sub", "a.txt"), "", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "sub", "b.txt"), "", "utf-8")) + + const nodes = yield* list("sub") expect(nodes.length).toBe(2) - expect(nodes.map((n) => n.name).sort()).toEqual(["a.txt", "b.txt"]) - // Paths should be relative to project root (normalize for Windows) + expect(nodes.map((node) => node.name).sort()).toEqual(["a.txt", "b.txt"]) expect(nodes[0].path.replaceAll("\\", "/").startsWith("sub/")).toBe(true) - }, - }) - }) - - test("throws for paths outside project directory", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(list("../outside")).rejects.toThrow("Access denied") - }, - }) - }) - - test("works without git", async () => { - await using tmp = await tmpdir() - await fs.writeFile(path.join(tmp.path, "file.txt"), "hi", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const nodes = await list() - expect(nodes.length).toBeGreaterThanOrEqual(1) - // Without git, ignored should be false for all - for (const node of nodes) { - expect(node.ignored).toBe(false) - } - }, - }) - }) + }), + { git: true }, + ) + + it.instance( + "throws for paths outside project directory", + () => + Effect.gen(function* () { + expect(yield* failureMessage(list("../outside"))).toContain("Access denied") + }), + { git: true }, + ) + + it.instance("works without git", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "file.txt"), "hi", "utf-8")) + + const nodes = yield* list() + expect(nodes.length).toBeGreaterThanOrEqual(1) + for (const node of nodes) { + expect(node.ignored).toBe(false) + } + }), + ) }) describe("search()", () => { - async function setupSearchableRepo() { - const tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "index.ts"), "code", "utf-8") - await fs.writeFile(path.join(tmp.path, "utils.ts"), "utils", "utf-8") - await fs.writeFile(path.join(tmp.path, "readme.md"), "readme", "utf-8") - await fs.mkdir(path.join(tmp.path, "src")) - await fs.mkdir(path.join(tmp.path, ".hidden")) - await fs.writeFile(path.join(tmp.path, "src", "main.ts"), "main", "utf-8") - await fs.writeFile(path.join(tmp.path, ".hidden", "secret.ts"), "secret", "utf-8") - return tmp - } - - test("empty query returns files", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: "", type: "file" }) + it.instance( + "empty query returns files", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: "", type: "file" }) expect(result.length).toBeGreaterThan(0) - }, - }) - }) - - test("search works before explicit init", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await search({ query: "main", type: "file" }) - expect(result.some((f) => f.includes("main"))).toBe(true) - }, - }) - }) - - test("empty query returns dirs sorted with hidden last", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: "", type: "directory" }) + }), + { git: true }, + ) + + it.instance( + "search works before explicit init", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + + const result = yield* search({ query: "main", type: "file" }) + expect(result.some((file) => file.includes("main"))).toBe(true) + }), + { git: true }, + ) + + it.instance( + "empty query returns dirs sorted with hidden last", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: "", type: "directory" }) expect(result.length).toBeGreaterThan(0) - // Find first hidden dir index - const firstHidden = result.findIndex((d) => d.split("/").some((p) => p.startsWith(".") && p.length > 1)) - const lastVisible = result.findLastIndex((d) => !d.split("/").some((p) => p.startsWith(".") && p.length > 1)) + const firstHidden = result.findIndex((dir) => + dir.split("/").some((part) => part.startsWith(".") && part.length > 1), + ) + const lastVisible = result.findLastIndex( + (dir) => !dir.split("/").some((part) => part.startsWith(".") && part.length > 1), + ) if (firstHidden >= 0 && lastVisible >= 0) { expect(firstHidden).toBeGreaterThan(lastVisible) } - }, - }) - }) - - test("fuzzy matches file names", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: "main", type: "file" }) - expect(result.some((f) => f.includes("main"))).toBe(true) - }, - }) - }) - - test("type filter returns only files", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: "", type: "file" }) - // Files don't end with / - for (const f of result) { - expect(f.endsWith("/")).toBe(false) + }), + { git: true }, + ) + + it.instance( + "fuzzy matches file names", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: "main", type: "file" }) + expect(result.some((file) => file.includes("main"))).toBe(true) + }), + { git: true }, + ) + + it.instance( + "type filter returns only files", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: "", type: "file" }) + for (const file of result) { + expect(file.endsWith("/")).toBe(false) } - }, - }) - }) - - test("type filter returns only directories", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: "", type: "directory" }) - // Directories end with / - for (const d of result) { - expect(d.endsWith("/")).toBe(true) + }), + { git: true }, + ) + + it.instance( + "type filter returns only directories", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: "", type: "directory" }) + for (const dir of result) { + expect(dir.endsWith("/")).toBe(true) } - }, - }) - }) - - test("respects limit", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: "", type: "file", limit: 2 }) + }), + { git: true }, + ) + + it.instance( + "respects limit", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: "", type: "file", limit: 2 }) expect(result.length).toBeLessThanOrEqual(2) - }, - }) - }) - - test("query starting with dot prefers hidden files", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - - const result = await search({ query: ".hidden", type: "directory" }) + }), + { git: true }, + ) + + it.instance( + "query starting with dot prefers hidden files", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + + const result = yield* search({ query: ".hidden", type: "directory" }) expect(result.length).toBeGreaterThan(0) expect(result[0]).toContain(".hidden") - }, - }) - }) - - test("search refreshes after init when files change", async () => { - await using tmp = await setupSearchableRepo() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - expect(await search({ query: "fresh", type: "file" })).toEqual([]) - - await fs.writeFile(path.join(tmp.path, "fresh.ts"), "fresh", "utf-8") - - const result = await search({ query: "fresh", type: "file" }) - expect(result).toContain("fresh.ts") - }, - }) - }) + }), + { git: true }, + ) + + it.instance( + "search refreshes after init when files change", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* setupSearchableRepo(test.directory) + yield* init() + expect(yield* search({ query: "fresh", type: "file" })).toEqual([]) + + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "fresh.ts"), "fresh", "utf-8")) + + expect(yield* search({ query: "fresh", type: "file" })).toContain("fresh.ts") + }), + { git: true }, + ) }) describe("read() - diff/patch", () => { - test("returns diff and patch for modified tracked file", async () => { - await using tmp = await tmpdir({ git: true }) - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "original content\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "add file"`.cwd(tmp.path).quiet() - await fs.writeFile(filepath, "modified content\n", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("file.txt") + it.instance( + "returns diff and patch for modified tracked file", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* Effect.promise(() => fs.writeFile(filepath, "original content\n", "utf-8")) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "add file") + yield* Effect.promise(() => fs.writeFile(filepath, "modified content\n", "utf-8")) + + const result = yield* read("file.txt") expect(result.type).toBe("text") expect(result.content).toBe("modified content") expect(result.diff).toBeDefined() @@ -851,107 +783,90 @@ describe("file/index Filesystem patterns", () => { expect(result.diff).toContain("modified content") expect(result.patch).toBeDefined() expect(result.patch!.hunks.length).toBeGreaterThan(0) - }, - }) - }) - - test("returns diff for staged changes", async () => { - await using tmp = await tmpdir({ git: true }) - const filepath = path.join(tmp.path, "staged.txt") - await fs.writeFile(filepath, "before\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "add file"`.cwd(tmp.path).quiet() - await fs.writeFile(filepath, "after\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("staged.txt") + }), + { git: true }, + ) + + it.instance( + "returns diff for staged changes", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "staged.txt") + yield* Effect.promise(() => fs.writeFile(filepath, "before\n", "utf-8")) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "add file") + yield* Effect.promise(() => fs.writeFile(filepath, "after\n", "utf-8")) + yield* gitAddAll(test.directory) + + const result = yield* read("staged.txt") expect(result.diff).toBeDefined() expect(result.patch).toBeDefined() - }, - }) - }) - - test("returns no diff for unmodified file", async () => { - await using tmp = await tmpdir({ git: true }) - const filepath = path.join(tmp.path, "clean.txt") - await fs.writeFile(filepath, "unchanged\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit -m "add file"`.cwd(tmp.path).quiet() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("clean.txt") + }), + { git: true }, + ) + + it.instance( + "returns no diff for unmodified file", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "clean.txt") + yield* Effect.promise(() => fs.writeFile(filepath, "unchanged\n", "utf-8")) + yield* gitAddAll(test.directory) + yield* gitCommit(test.directory, "add file") + + const result = yield* read("clean.txt") expect(result.type).toBe("text") expect(result.content).toBe("unchanged") expect(result.diff).toBeUndefined() expect(result.patch).toBeUndefined() - }, - }) - }) + }), + { git: true }, + ) }) describe("InstanceState isolation", () => { - test("two directories get independent file caches", async () => { - await using one = await tmpdir({ git: true }) - await using two = await tmpdir({ git: true }) - await fs.writeFile(path.join(one.path, "a.ts"), "one", "utf-8") - await fs.writeFile(path.join(two.path, "b.ts"), "two", "utf-8") - - await WithInstance.provide({ - directory: one.path, - fn: async () => { - await init() - const results = await search({ query: "a.ts", type: "file" }) - expect(results).toContain("a.ts") - const results2 = await search({ query: "b.ts", type: "file" }) - expect(results2).not.toContain("b.ts") - }, - }) - - await WithInstance.provide({ - directory: two.path, - fn: async () => { - await init() - const results = await search({ query: "b.ts", type: "file" }) - expect(results).toContain("b.ts") - const results2 = await search({ query: "a.ts", type: "file" }) - expect(results2).not.toContain("a.ts") - }, - }) - }) - - test("disposal gives fresh state on next access", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "before.ts"), "before", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - const results = await search({ query: "before", type: "file" }) - expect(results).toContain("before.ts") - }, - }) - - await disposeAllInstances() - - await fs.writeFile(path.join(tmp.path, "after.ts"), "after", "utf-8") - await fs.rm(path.join(tmp.path, "before.ts")) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await init() - const results = await search({ query: "after", type: "file" }) - expect(results).toContain("after.ts") - const stale = await search({ query: "before", type: "file" }) - expect(stale).not.toContain("before.ts") - }, - }) - }) + it.instance( + "two directories get independent file caches", + () => + Effect.gen(function* () { + const one = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(one.directory, "a.ts"), "one", "utf-8")) + yield* init() + expect(yield* search({ query: "a.ts", type: "file" })).toContain("a.ts") + expect(yield* search({ query: "b.ts", type: "file" })).not.toContain("b.ts") + + yield* Effect.gen(function* () { + const two = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(two.directory, "b.ts"), "two", "utf-8")) + yield* init() + expect(yield* search({ query: "b.ts", type: "file" })).toContain("b.ts") + expect(yield* search({ query: "a.ts", type: "file" })).not.toContain("a.ts") + }).pipe(withTmpdirInstance({ git: true })) + }), + { git: true }, + ) + + it.instance( + "disposal gives fresh state on next access", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "before.ts"), "before", "utf-8")) + yield* init() + expect(yield* search({ query: "before", type: "file" })).toContain("before.ts") + + yield* Effect.promise(() => disposeAllInstances()) + + yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "after.ts"), "after", "utf-8")) + yield* Effect.promise(() => fs.rm(path.join(test.directory, "before.ts"))) + + yield* init() + expect(yield* search({ query: "after", type: "file" })).toContain("after.ts") + expect(yield* search({ query: "before", type: "file" })).not.toContain("before.ts") + }), + { git: true }, + ) }) }) diff --git a/packages/opencode/test/file/path-traversal.test.ts b/packages/opencode/test/file/path-traversal.test.ts index 5b59929ea581..336f214d1aec 100644 --- a/packages/opencode/test/file/path-traversal.test.ts +++ b/packages/opencode/test/file/path-traversal.test.ts @@ -1,42 +1,55 @@ -import { test, expect, describe } from "bun:test" -import { Effect } from "effect" +import { expect, describe } from "bun:test" +import { Cause, Effect, Exit } from "effect" import path from "path" import fs from "fs/promises" import { Filesystem } from "@/util/filesystem" import { File } from "../../src/file" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" +import { InstanceState } from "../../src/effect/instance-state" import { containsPath } from "../../src/project/instance-context" -import { provideInstance, tmpdir } from "../fixture/fixture" - -const run = (eff: Effect.Effect) => - Effect.runPromise(provideInstance(Instance.directory)(eff.pipe(Effect.provide(File.defaultLayer)))) -const read = (file: string) => run(File.Service.use((svc) => svc.read(file))) -const list = (dir?: string) => run(File.Service.use((svc) => svc.list(dir))) - -describe("Filesystem.contains", () => { - test("allows paths within project", () => { - expect(Filesystem.contains("/project", "/project/src")).toBe(true) - expect(Filesystem.contains("/project", "/project/src/file.ts")).toBe(true) - expect(Filesystem.contains("/project", "/project")).toBe(true) - }) - - test("blocks ../ traversal", () => { - expect(Filesystem.contains("/project", "/project/../etc")).toBe(false) - expect(Filesystem.contains("/project", "/project/src/../../etc")).toBe(false) - expect(Filesystem.contains("/project", "/etc/passwd")).toBe(false) - }) - - test("blocks absolute paths outside project", () => { - expect(Filesystem.contains("/project", "/etc/passwd")).toBe(false) - expect(Filesystem.contains("/project", "/tmp/file")).toBe(false) - expect(Filesystem.contains("/home/user/project", "/home/user/other")).toBe(false) +import { TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" + +const it = testEffect(File.defaultLayer) +const read = (file: string) => File.Service.use((svc) => svc.read(file)) +const list = (dir?: string) => File.Service.use((svc) => svc.list(dir)) +const expectAccessDenied = (effect: Effect.Effect) => + Effect.gen(function* () { + const exit = yield* effect.pipe(Effect.exit) + if (Exit.isSuccess(exit)) throw new Error("expected access denied") + expect(Cause.squash(exit.cause)).toHaveProperty("message", "Access denied: path escapes project directory") }) - test("handles prefix collision edge cases", () => { - expect(Filesystem.contains("/project", "/project-other/file")).toBe(false) - expect(Filesystem.contains("/project", "/projectfile")).toBe(false) - }) +describe("Filesystem.contains", () => { + it.effect("allows paths within project", () => + Effect.sync(() => { + expect(Filesystem.contains("/project", "/project/src")).toBe(true) + expect(Filesystem.contains("/project", "/project/src/file.ts")).toBe(true) + expect(Filesystem.contains("/project", "/project")).toBe(true) + }), + ) + + it.effect("blocks ../ traversal", () => + Effect.sync(() => { + expect(Filesystem.contains("/project", "/project/../etc")).toBe(false) + expect(Filesystem.contains("/project", "/project/src/../../etc")).toBe(false) + expect(Filesystem.contains("/project", "/etc/passwd")).toBe(false) + }), + ) + + it.effect("blocks absolute paths outside project", () => + Effect.sync(() => { + expect(Filesystem.contains("/project", "/etc/passwd")).toBe(false) + expect(Filesystem.contains("/project", "/tmp/file")).toBe(false) + expect(Filesystem.contains("/home/user/project", "/home/user/other")).toBe(false) + }), + ) + + it.effect("handles prefix collision edge cases", () => + Effect.sync(() => { + expect(Filesystem.contains("/project", "/project-other/file")).toBe(false) + expect(Filesystem.contains("/project", "/projectfile")).toBe(false) + }), + ) }) /* @@ -49,158 +62,124 @@ describe("Filesystem.contains", () => { * This is a SEPARATE code path from ReadTool, which has its own checks. */ describe("File.read path traversal protection", () => { - test("rejects ../ traversal attempting to read /etc/passwd", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "allowed.txt"), "allowed content") - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(read("../../../etc/passwd")).rejects.toThrow("Access denied: path escapes project directory") - }, - }) - }) - - test("rejects deeply nested traversal", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(read("src/nested/../../../../../../../etc/passwd")).rejects.toThrow( - "Access denied: path escapes project directory", - ) - }, - }) - }) - - test("allows valid paths within project", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "valid.txt"), "valid content") - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await read("valid.txt") - expect(result.content).toBe("valid content") - }, - }) - }) + it.instance("rejects ../ traversal attempting to read /etc/passwd", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => Bun.write(path.join(test.directory, "allowed.txt"), "allowed content")) + yield* expectAccessDenied(read("../../../etc/passwd")) + }), + ) + + it.instance("rejects deeply nested traversal", () => + Effect.gen(function* () { + yield* expectAccessDenied(read("src/nested/../../../../../../../etc/passwd")) + }), + ) + + it.instance("allows valid paths within project", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => Bun.write(path.join(test.directory, "valid.txt"), "valid content")) + + const result = yield* read("valid.txt") + expect(result.content).toBe("valid content") + }), + ) }) describe("File.list path traversal protection", () => { - test("rejects ../ traversal attempting to list /etc", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await expect(list("../../../etc")).rejects.toThrow("Access denied: path escapes project directory") - }, - }) - }) - - test("allows valid subdirectory listing", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "subdir", "file.txt"), "content") - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await list("subdir") - expect(Array.isArray(result)).toBe(true) - }, - }) - }) + it.instance("rejects ../ traversal attempting to list /etc", () => + Effect.gen(function* () { + yield* expectAccessDenied(list("../../../etc")) + }), + ) + + it.instance("allows valid subdirectory listing", () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => Bun.write(path.join(test.directory, "subdir", "file.txt"), "content")) + + const result = yield* list("subdir") + expect(Array.isArray(result)).toBe(true) + }), + ) }) describe("containsPath", () => { - test("returns true for path inside directory", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: () => { - expect(containsPath(path.join(tmp.path, "foo.txt"), Instance.current)).toBe(true) - expect(containsPath(path.join(tmp.path, "src", "file.ts"), Instance.current)).toBe(true) - }, - }) - }) - - test("returns true for path inside worktree but outside directory (monorepo subdirectory scenario)", async () => { - await using tmp = await tmpdir({ git: true }) - const subdir = path.join(tmp.path, "packages", "lib") - await fs.mkdir(subdir, { recursive: true }) + it.instance( + "returns true for path inside directory", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const ctx = yield* InstanceState.context + expect(containsPath(path.join(test.directory, "foo.txt"), ctx)).toBe(true) + expect(containsPath(path.join(test.directory, "src", "file.ts"), ctx)).toBe(true) + }), + { git: true }, + ) + + it.instance( + "returns true for path inside worktree but outside directory (monorepo subdirectory scenario)", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const subdir = path.join(test.directory, "packages", "lib") + yield* Effect.promise(() => fs.mkdir(subdir, { recursive: true })) + const ctx = { ...(yield* InstanceState.context), directory: subdir } - await WithInstance.provide({ - directory: subdir, - fn: () => { // .opencode at worktree root, but we're running from packages/lib - expect(containsPath(path.join(tmp.path, ".opencode", "state"), Instance.current)).toBe(true) + expect(containsPath(path.join(test.directory, ".opencode", "state"), ctx)).toBe(true) // sibling package should also be accessible - expect(containsPath(path.join(tmp.path, "packages", "other", "file.ts"), Instance.current)).toBe(true) + expect(containsPath(path.join(test.directory, "packages", "other", "file.ts"), ctx)).toBe(true) // worktree root itself - expect(containsPath(tmp.path, Instance.current)).toBe(true) - }, - }) - }) - - test("returns false for path outside both directory and worktree", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: () => { - expect(containsPath("/etc/passwd", Instance.current)).toBe(false) - expect(containsPath("/tmp/other-project", Instance.current)).toBe(false) - }, - }) - }) - - test("returns false for path with .. escaping worktree", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: () => { - expect(containsPath(path.join(tmp.path, "..", "escape.txt"), Instance.current)).toBe(false) - }, - }) - }) - - test("handles directory === worktree (running from repo root)", async () => { - await using tmp = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: () => { - expect(Instance.directory).toBe(Instance.worktree) - expect(containsPath(path.join(tmp.path, "file.txt"), Instance.current)).toBe(true) - expect(containsPath("/etc/passwd", Instance.current)).toBe(false) - }, - }) - }) - - test("non-git project does not allow arbitrary paths via worktree='/'", async () => { - await using tmp = await tmpdir() // no git: true - - await WithInstance.provide({ - directory: tmp.path, - fn: () => { - // worktree is "/" for non-git projects, but containsPath should NOT allow all paths - expect(containsPath(path.join(tmp.path, "file.txt"), Instance.current)).toBe(true) - expect(containsPath("/etc/passwd", Instance.current)).toBe(false) - expect(containsPath("/tmp/other", Instance.current)).toBe(false) - }, - }) - }) + expect(containsPath(test.directory, ctx)).toBe(true) + }), + { git: true }, + ) + + it.instance( + "returns false for path outside both directory and worktree", + () => + Effect.gen(function* () { + const ctx = yield* InstanceState.context + expect(containsPath("/etc/passwd", ctx)).toBe(false) + expect(containsPath("/tmp/other-project", ctx)).toBe(false) + }), + { git: true }, + ) + + it.instance( + "returns false for path with .. escaping worktree", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const ctx = yield* InstanceState.context + expect(containsPath(path.join(test.directory, "..", "escape.txt"), ctx)).toBe(false) + }), + { git: true }, + ) + + it.instance( + "handles directory === worktree (running from repo root)", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const ctx = yield* InstanceState.context + expect(ctx.directory).toBe(ctx.worktree) + expect(containsPath(path.join(test.directory, "file.txt"), ctx)).toBe(true) + expect(containsPath("/etc/passwd", ctx)).toBe(false) + }), + { git: true }, + ) + + it.instance("non-git project does not allow arbitrary paths via worktree='/'", () => + Effect.gen(function* () { + const test = yield* TestInstance + const ctx = yield* InstanceState.context + // worktree is "/" for non-git projects, but containsPath should NOT allow all paths + expect(containsPath(path.join(test.directory, "file.txt"), ctx)).toBe(true) + expect(containsPath("/etc/passwd", ctx)).toBe(false) + expect(containsPath("/tmp/other", ctx)).toBe(false) + }), + ) }) diff --git a/packages/opencode/test/file/ripgrep.test.ts b/packages/opencode/test/file/ripgrep.test.ts index a76c7ebe2633..d71ce205ea7b 100644 --- a/packages/opencode/test/file/ripgrep.test.ts +++ b/packages/opencode/test/file/ripgrep.test.ts @@ -1,214 +1,220 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import { Effect } from "effect" import * as Stream from "effect/Stream" import fs from "fs/promises" +import os from "os" import path from "path" -import { tmpdir } from "../fixture/fixture" import { Ripgrep } from "../../src/file/ripgrep" - -const run = (effect: Effect.Effect) => - effect.pipe(Effect.provide(Ripgrep.defaultLayer), Effect.runPromise) +import { testEffect } from "../lib/effect" + +const it = testEffect(Ripgrep.defaultLayer) + +const tmpdir = (init?: (dir: string) => Effect.Effect) => + Effect.acquireRelease( + Effect.promise(async () => fs.realpath(await fs.mkdtemp(path.join(os.tmpdir(), "opencode-test-")))), + (dir) => + Effect.promise(() => + fs.rm(dir, { + recursive: true, + force: true, + maxRetries: 5, + retryDelay: 100, + }), + ).pipe(Effect.ignore), + ).pipe(Effect.tap((dir) => init?.(dir) ?? Effect.void)) + +const write = (file: string, data: string) => Effect.promise(() => Bun.write(file, data)) +const mkdir = (dir: string) => Effect.promise(() => fs.mkdir(dir, { recursive: true })) +const collectFiles = (input: Ripgrep.FilesInput) => + Ripgrep.Service.use((rg) => + rg.files(input).pipe( + Stream.runCollect, + Effect.map((c) => [...c]), + ), + ) + +const withRipgrepConfig = (value: string, effect: Effect.Effect) => + Effect.acquireUseRelease( + Effect.sync(() => { + const prev = process.env["RIPGREP_CONFIG_PATH"] + process.env["RIPGREP_CONFIG_PATH"] = value + return prev + }), + () => effect, + (prev) => + Effect.sync(() => { + if (prev === undefined) delete process.env["RIPGREP_CONFIG_PATH"] + else process.env["RIPGREP_CONFIG_PATH"] = prev + }), + ) describe("file.ripgrep", () => { - test("defaults to include hidden", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "visible.txt"), "hello") - await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) - await Bun.write(path.join(dir, ".opencode", "thing.json"), "{}") - }, - }) - - const files = await run( - Ripgrep.Service.use((rg) => - rg.files({ cwd: tmp.path }).pipe( - Stream.runCollect, - Effect.map((c) => [...c]), - ), - ), - ) - expect(files.includes("visible.txt")).toBe(true) - expect(files.includes(path.join(".opencode", "thing.json"))).toBe(true) - }) - - test("hidden false excludes hidden", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "visible.txt"), "hello") - await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) - await Bun.write(path.join(dir, ".opencode", "thing.json"), "{}") - }, - }) - - const files = await run( - Ripgrep.Service.use((rg) => - rg.files({ cwd: tmp.path, hidden: false }).pipe( - Stream.runCollect, - Effect.map((c) => [...c]), - ), - ), - ) - expect(files.includes("visible.txt")).toBe(true) - expect(files.includes(path.join(".opencode", "thing.json"))).toBe(false) - }) - - test("search returns empty when nothing matches", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "match.ts"), "const value = 'other'\n") - }, - }) - - const result = await run(Ripgrep.Service.use((rg) => rg.search({ cwd: tmp.path, pattern: "needle" }))) - expect(result.partial).toBe(false) - expect(result.items).toEqual([]) - }) - - test("search returns match metadata with normalized path", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await fs.mkdir(path.join(dir, "src"), { recursive: true }) - await Bun.write(path.join(dir, "src", "match.ts"), "const needle = 1\n") - }, - }) - - const result = await run(Ripgrep.Service.use((rg) => rg.search({ cwd: tmp.path, pattern: "needle" }))) - expect(result.partial).toBe(false) - expect(result.items).toHaveLength(1) - expect(result.items[0]?.path.text).toBe(path.join("src", "match.ts")) - expect(result.items[0]?.line_number).toBe(1) - expect(result.items[0]?.lines.text).toContain("needle") - }) - - test("search returns matched rows with glob filter", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "match.ts"), "const value = 'needle'\n") - await Bun.write(path.join(dir, "skip.txt"), "const value = 'other'\n") - }, - }) - - const result = await run( - Ripgrep.Service.use((rg) => rg.search({ cwd: tmp.path, pattern: "needle", glob: ["*.ts"] })), - ) - expect(result.partial).toBe(false) - expect(result.items).toHaveLength(1) - expect(result.items[0]?.path.text).toContain("match.ts") - expect(result.items[0]?.lines.text).toContain("needle") - }) - - test("search supports explicit file targets", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "match.ts"), "const value = 'needle'\n") - await Bun.write(path.join(dir, "skip.ts"), "const value = 'needle'\n") - }, - }) - - const file = path.join(tmp.path, "match.ts") - const result = await run(Ripgrep.Service.use((rg) => rg.search({ cwd: tmp.path, pattern: "needle", file: [file] }))) - expect(result.partial).toBe(false) - expect(result.items).toHaveLength(1) - expect(result.items[0]?.path.text).toBe(file) - }) - - test("files returns empty when glob matches no files", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await fs.mkdir(path.join(dir, "packages", "console"), { recursive: true }) - await Bun.write(path.join(dir, "packages", "console", "package.json"), "{}") - }, - }) - - const files = await run( - Ripgrep.Service.use((rg) => - rg.files({ cwd: tmp.path, glob: ["packages/*"] }).pipe( - Stream.runCollect, - Effect.map((c) => [...c]), - ), - ), - ) - expect(files).toEqual([]) - }) - - test("files returns stream of filenames", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "a.txt"), "hello") - await Bun.write(path.join(dir, "b.txt"), "world") - }, - }) - - const files = await run( - Ripgrep.Service.use((rg) => - rg.files({ cwd: tmp.path }).pipe( - Stream.runCollect, - Effect.map((c) => [...c].sort()), - ), - ), - ) - expect(files).toEqual(["a.txt", "b.txt"]) - }) - - test("files respects glob filter", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "keep.ts"), "yes") - await Bun.write(path.join(dir, "skip.txt"), "no") - }, - }) - - const files = await run( - Ripgrep.Service.use((rg) => - rg.files({ cwd: tmp.path, glob: ["*.ts"] }).pipe( - Stream.runCollect, - Effect.map((c) => [...c]), - ), - ), - ) - expect(files).toEqual(["keep.ts"]) - }) - - test("files dies on nonexistent directory", async () => { - const exit = await Ripgrep.Service.use((rg) => - rg.files({ cwd: "/tmp/nonexistent-dir-12345" }).pipe(Stream.runCollect), - ).pipe(Effect.provide(Ripgrep.defaultLayer), Effect.runPromiseExit) - expect(exit._tag).toBe("Failure") - }) - - test("ignores RIPGREP_CONFIG_PATH in direct mode", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "match.ts"), "const needle = 1\n") - }, - }) - - const prev = process.env["RIPGREP_CONFIG_PATH"] - process.env["RIPGREP_CONFIG_PATH"] = path.join(tmp.path, "missing-ripgreprc") - try { - const result = await run(Ripgrep.Service.use((rg) => rg.search({ cwd: tmp.path, pattern: "needle" }))) + it.live("defaults to include hidden", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* write(path.join(dir, "visible.txt"), "hello") + yield* mkdir(path.join(dir, ".opencode")) + yield* write(path.join(dir, ".opencode", "thing.json"), "{}") + }), + ) + + const files = yield* collectFiles({ cwd: dir }) + expect(files.includes("visible.txt")).toBe(true) + expect(files.includes(path.join(".opencode", "thing.json"))).toBe(true) + }), + ) + + it.live("hidden false excludes hidden", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* write(path.join(dir, "visible.txt"), "hello") + yield* mkdir(path.join(dir, ".opencode")) + yield* write(path.join(dir, ".opencode", "thing.json"), "{}") + }), + ) + + const files = yield* collectFiles({ cwd: dir, hidden: false }) + expect(files.includes("visible.txt")).toBe(true) + expect(files.includes(path.join(".opencode", "thing.json"))).toBe(false) + }), + ) + + it.live("search returns empty when nothing matches", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => write(path.join(dir, "match.ts"), "const value = 'other'\n")) + + const result = yield* Ripgrep.Service.use((rg) => rg.search({ cwd: dir, pattern: "needle" })) + expect(result.partial).toBe(false) + expect(result.items).toEqual([]) + }), + ) + + it.live("search returns match metadata with normalized path", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* mkdir(path.join(dir, "src")) + yield* write(path.join(dir, "src", "match.ts"), "const needle = 1\n") + }), + ) + + const result = yield* Ripgrep.Service.use((rg) => rg.search({ cwd: dir, pattern: "needle" })) + expect(result.partial).toBe(false) + expect(result.items).toHaveLength(1) + expect(result.items[0]?.path.text).toBe(path.join("src", "match.ts")) + expect(result.items[0]?.line_number).toBe(1) + expect(result.items[0]?.lines.text).toContain("needle") + }), + ) + + it.live("search returns matched rows with glob filter", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* write(path.join(dir, "match.ts"), "const value = 'needle'\n") + yield* write(path.join(dir, "skip.txt"), "const value = 'other'\n") + }), + ) + + const result = yield* Ripgrep.Service.use((rg) => rg.search({ cwd: dir, pattern: "needle", glob: ["*.ts"] })) + expect(result.partial).toBe(false) + expect(result.items).toHaveLength(1) + expect(result.items[0]?.path.text).toContain("match.ts") + expect(result.items[0]?.lines.text).toContain("needle") + }), + ) + + it.live("search supports explicit file targets", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* write(path.join(dir, "match.ts"), "const value = 'needle'\n") + yield* write(path.join(dir, "skip.ts"), "const value = 'needle'\n") + }), + ) + + const file = path.join(dir, "match.ts") + const result = yield* Ripgrep.Service.use((rg) => rg.search({ cwd: dir, pattern: "needle", file: [file] })) + expect(result.partial).toBe(false) expect(result.items).toHaveLength(1) - } finally { - if (prev === undefined) delete process.env["RIPGREP_CONFIG_PATH"] - else process.env["RIPGREP_CONFIG_PATH"] = prev - } - }) - - test("ignores RIPGREP_CONFIG_PATH in worker mode", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "match.ts"), "const needle = 1\n") - }, - }) - - const prev = process.env["RIPGREP_CONFIG_PATH"] - process.env["RIPGREP_CONFIG_PATH"] = path.join(tmp.path, "missing-ripgreprc") - try { - const result = await run(Ripgrep.Service.use((rg) => rg.search({ cwd: tmp.path, pattern: "needle" }))) + expect(result.items[0]?.path.text).toBe(file) + }), + ) + + it.live("files returns empty when glob matches no files", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* mkdir(path.join(dir, "packages", "console")) + yield* write(path.join(dir, "packages", "console", "package.json"), "{}") + }), + ) + + const files = yield* collectFiles({ cwd: dir, glob: ["packages/*"] }) + expect(files).toEqual([]) + }), + ) + + it.live("files returns stream of filenames", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* write(path.join(dir, "a.txt"), "hello") + yield* write(path.join(dir, "b.txt"), "world") + }), + ) + + const files = yield* collectFiles({ cwd: dir }).pipe(Effect.map((files) => files.sort())) + expect(files).toEqual(["a.txt", "b.txt"]) + }), + ) + + it.live("files respects glob filter", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => + Effect.gen(function* () { + yield* write(path.join(dir, "keep.ts"), "yes") + yield* write(path.join(dir, "skip.txt"), "no") + }), + ) + + const files = yield* collectFiles({ cwd: dir, glob: ["*.ts"] }) + expect(files).toEqual(["keep.ts"]) + }), + ) + + it.live("files dies on nonexistent directory", () => + Effect.gen(function* () { + const exit = yield* Ripgrep.Service.use((rg) => + rg.files({ cwd: "/tmp/nonexistent-dir-12345" }).pipe(Stream.runCollect), + ).pipe(Effect.exit) + expect(exit._tag).toBe("Failure") + }), + ) + + it.live("ignores RIPGREP_CONFIG_PATH in direct mode", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => write(path.join(dir, "match.ts"), "const needle = 1\n")) + + const result = yield* withRipgrepConfig( + path.join(dir, "missing-ripgreprc"), + Ripgrep.Service.use((rg) => rg.search({ cwd: dir, pattern: "needle" })), + ) + expect(result.items).toHaveLength(1) + }), + ) + + it.live("ignores RIPGREP_CONFIG_PATH in worker mode", () => + Effect.gen(function* () { + const dir = yield* tmpdir((dir) => write(path.join(dir, "match.ts"), "const needle = 1\n")) + + const result = yield* withRipgrepConfig( + path.join(dir, "missing-ripgreprc"), + Ripgrep.Service.use((rg) => rg.search({ cwd: dir, pattern: "needle" })), + ) expect(result.items).toHaveLength(1) - } finally { - if (prev === undefined) delete process.env["RIPGREP_CONFIG_PATH"] - else process.env["RIPGREP_CONFIG_PATH"] = prev - } - }) + }), + ) }) diff --git a/packages/opencode/test/file/watcher.test.ts b/packages/opencode/test/file/watcher.test.ts index 7e47c513517e..be56ad9f23bb 100644 --- a/packages/opencode/test/file/watcher.test.ts +++ b/packages/opencode/test/file/watcher.test.ts @@ -1,15 +1,13 @@ -import { $ } from "bun" -import { afterEach, describe, expect, test } from "bun:test" -import fs from "fs/promises" +import { describe, expect } from "bun:test" import path from "path" -import { ConfigProvider, Deferred, Effect, Layer, ManagedRuntime, Option } from "effect" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { Bus } from "../../src/bus" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { ConfigProvider, Deferred, Effect, Layer, Option } from "effect" +import { TestInstance, provideInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" +import { GlobalBus, type GlobalEvent } from "../../src/bus/global" import { Config } from "@/config/config" import { FileWatcher } from "../../src/file/watcher" import { Git } from "../../src/git" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" // Native @parcel/watcher bindings aren't reliably available in CI (missing on Linux, flaky on Windows) const describeWatcher = FileWatcher.hasNativeBinding() && !process.env.CI ? describe : describe.skip @@ -25,43 +23,43 @@ const watcherConfigLayer = ConfigProvider.layer( }), ) +const watcherLayer = FileWatcher.layer.pipe( + Layer.provide(Config.defaultLayer), + Layer.provide(Git.defaultLayer), + Layer.provide(watcherConfigLayer), +) + +const it = testEffect(Layer.mergeAll(AppFileSystem.defaultLayer, Git.defaultLayer)) + type WatcherEvent = { file: string; event: "add" | "change" | "unlink" } /** Run `body` with a live FileWatcher service. */ -function withWatcher(directory: string, body: Effect.Effect) { - return WithInstance.provide({ - directory, - fn: async () => { - const layer: Layer.Layer = FileWatcher.layer.pipe( - Layer.provide(Config.defaultLayer), - Layer.provide(Git.defaultLayer), - Layer.provide(watcherConfigLayer), - ) - const rt = ManagedRuntime.make(layer) - try { - await rt.runPromise(FileWatcher.Service.use((s) => s.init())) - await Effect.runPromise(ready(directory)) - await Effect.runPromise(body) - } finally { - await rt.dispose() - } - }, - }) +function withWatcher(directory: string, body: Effect.Effect) { + return Effect.gen(function* () { + const watcher = yield* FileWatcher.Service + yield* watcher.init() + yield* ready(directory) + return yield* body + }).pipe(Effect.provide(watcherLayer), provideInstance(directory), Effect.scoped) } function listen(directory: string, check: (evt: WatcherEvent) => boolean, hit: (evt: WatcherEvent) => void) { let done = false - const unsub = Bus.subscribe(FileWatcher.Event.Updated, (evt) => { + const on = (evt: GlobalEvent) => { if (done) return - if (!check(evt.properties)) return - hit(evt.properties) - }) + if (evt.directory !== directory) return + if (evt.payload.type !== FileWatcher.Event.Updated.type) return + if (!check(evt.payload.properties)) return + hit(evt.payload.properties) + } + + GlobalBus.on("event", on) return () => { if (done) return done = true - unsub() + GlobalBus.off("event", on) } } @@ -72,7 +70,7 @@ function wait(directory: string, check: (evt: WatcherEvent) => boolean) { let off = () => {} off = listen(directory, check, (evt) => { off() - Deferred.doneUnsafe(deferred, Effect.succeed(evt)) + Effect.runFork(Deferred.succeed(deferred, evt)) }) return off }) @@ -86,7 +84,12 @@ function nextUpdate(directory: string, check: (evt: WatcherEvent) => boolean, ({ deferred }) => Effect.gen(function* () { yield* trigger - return yield* Deferred.await(deferred).pipe(Effect.timeout("5 seconds")) + return yield* Deferred.await(deferred).pipe( + Effect.timeoutOrElse({ + duration: "5 seconds", + orElse: () => Effect.fail(new Error("timed out waiting for file watcher update")), + }), + ) }), ({ cleanup }) => Effect.sync(cleanup), ) @@ -104,7 +107,11 @@ function noUpdate( ({ deferred }) => Effect.gen(function* () { yield* trigger - expect(yield* Deferred.await(deferred).pipe(Effect.timeoutOption(`${ms} millis`))).toEqual(Option.none()) + const result = yield* Deferred.await(deferred).pipe( + Effect.map((evt) => Option.some(evt)), + Effect.timeoutOrElse({ duration: `${ms} millis`, orElse: () => Effect.succeed(Option.none()) }), + ) + expect(result).toEqual(Option.none()) }), ({ cleanup }) => Effect.sync(cleanup), ) @@ -115,29 +122,25 @@ function ready(directory: string) { const head = path.join(directory, ".git", "HEAD") return Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const git = yield* Git.Service + yield* nextUpdate( directory, (evt) => evt.file === file && evt.event === "add", - Effect.promise(() => fs.writeFile(file, "ready")), - ).pipe(Effect.ensuring(Effect.promise(() => fs.rm(file, { force: true }).catch(() => undefined))), Effect.asVoid) + fs.writeFileString(file, "ready"), + ).pipe(Effect.ensuring(fs.remove(file, { force: true }).pipe(Effect.ignore)), Effect.asVoid) - const git = yield* Effect.promise(() => - fs - .stat(head) - .then(() => true) - .catch(() => false), - ) - if (!git) return + if (!(yield* fs.existsSafe(head))) return const branch = `watch-${Math.random().toString(36).slice(2)}` - const hash = yield* Effect.promise(() => $`git rev-parse HEAD`.cwd(directory).quiet().text()) + const hash = (yield* git.run(["rev-parse", "HEAD"], { cwd: directory })).text() yield* nextUpdate( directory, (evt) => evt.file === head && evt.event !== "unlink", - Effect.promise(async () => { - await fs.writeFile(path.join(directory, ".git", "refs", "heads", branch), hash.trim() + "\n") - await fs.writeFile(head, `ref: refs/heads/${branch}\n`) - }), + fs + .writeFileString(path.join(directory, ".git", "refs", "heads", branch), hash.trim() + "\n") + .pipe(Effect.andThen(fs.writeFileString(head, `ref: refs/heads/${branch}\n`))), ).pipe(Effect.asVoid) }) } @@ -147,104 +150,168 @@ function ready(directory: string) { // --------------------------------------------------------------------------- describeWatcher("FileWatcher", () => { - afterEach(async () => { - await disposeAllInstances() - }) + it.instance( + "publishes root create, update, and delete events", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const file = path.join(test.directory, "watch.txt") + const cases = [ + { event: "add" as const, trigger: fs.writeFileString(file, "a") }, + { event: "change" as const, trigger: fs.writeFileString(file, "b") }, + { event: "unlink" as const, trigger: fs.remove(file) }, + ] + + yield* withWatcher( + test.directory, + Effect.forEach(cases, ({ event, trigger }) => + nextUpdate(test.directory, (evt) => evt.file === file && evt.event === event, trigger).pipe( + Effect.tap((evt) => Effect.sync(() => expect(evt).toEqual({ file, event }))), + ), + ), + ) + }), + { git: true }, + ) - test("publishes root create, update, and delete events", async () => { - await using tmp = await tmpdir({ git: true }) - const file = path.join(tmp.path, "watch.txt") - const dir = tmp.path - const cases = [ - { event: "add" as const, trigger: Effect.promise(() => fs.writeFile(file, "a")) }, - { event: "change" as const, trigger: Effect.promise(() => fs.writeFile(file, "b")) }, - { event: "unlink" as const, trigger: Effect.promise(() => fs.unlink(file)) }, - ] - - await withWatcher( - dir, - Effect.forEach(cases, ({ event, trigger }) => - nextUpdate(dir, (evt) => evt.file === file && evt.event === event, trigger).pipe( - Effect.tap((evt) => Effect.sync(() => expect(evt).toEqual({ file, event }))), + it.instance("watches non-git roots", () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const file = path.join(test.directory, "plain.txt") + + yield* withWatcher( + test.directory, + nextUpdate(test.directory, (e) => e.file === file && e.event === "add", fs.writeFileString(file, "plain")).pipe( + Effect.tap((evt) => Effect.sync(() => expect(evt).toEqual({ file, event: "add" }))), ), - ), - ) - }) + ) + }), + ) - test("watches non-git roots", async () => { - await using tmp = await tmpdir() - const file = path.join(tmp.path, "plain.txt") - const dir = tmp.path - - await withWatcher( - dir, - nextUpdate( - dir, - (e) => e.file === file && e.event === "add", - Effect.promise(() => fs.writeFile(file, "plain")), - ).pipe(Effect.tap((evt) => Effect.sync(() => expect(evt).toEqual({ file, event: "add" })))), - ) - }) + it.instance( + "cleanup stops publishing events", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const file = path.join(test.directory, "after-dispose.txt") - test("cleanup stops publishing events", async () => { - await using tmp = await tmpdir({ git: true }) - const file = path.join(tmp.path, "after-dispose.txt") + // Start and immediately stop the watcher (withWatcher disposes on exit). + yield* withWatcher(test.directory, Effect.void) - // Start and immediately stop the watcher (withWatcher disposes on exit) - await withWatcher(tmp.path, Effect.void) + // Now write a file - no watcher should be listening. + yield* noUpdate(test.directory, (e) => e.file === file, fs.writeFileString(file, "gone")).pipe( + provideInstance(test.directory), + ) + }), + { git: true }, + ) - // Now write a file — no watcher should be listening - await WithInstance.provide({ - directory: tmp.path, - fn: () => - Effect.runPromise( + it.instance( + "ignores .git/index changes", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const git = yield* Git.Service + const gitIndex = path.join(test.directory, ".git", "index") + const edit = path.join(test.directory, "tracked.txt") + + yield* withWatcher( + test.directory, noUpdate( - tmp.path, - (e) => e.file === file, - Effect.promise(() => fs.writeFile(file, "gone")), + test.directory, + (e) => e.file === gitIndex, + fs.writeFileString(edit, "a").pipe(Effect.andThen(git.run(["add", "."], { cwd: test.directory }))), ), - ), - }) - }) + ) + }), + { git: true }, + ) - test("ignores .git/index changes", async () => { - await using tmp = await tmpdir({ git: true }) - const gitIndex = path.join(tmp.path, ".git", "index") - const edit = path.join(tmp.path, "tracked.txt") - - await withWatcher( - tmp.path, - noUpdate( - tmp.path, - (e) => e.file === gitIndex, - Effect.promise(async () => { - await fs.writeFile(edit, "a") - await $`git add .`.cwd(tmp.path).quiet().nothrow() - }), - ), - ) - }) + it.instance( + "publishes .git/HEAD events", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const git = yield* Git.Service + const head = path.join(test.directory, ".git", "HEAD") + const branch = `watch-${Math.random().toString(36).slice(2)}` + yield* git.run(["branch", branch], { cwd: test.directory }) - test("publishes .git/HEAD events", async () => { - await using tmp = await tmpdir({ git: true }) - const head = path.join(tmp.path, ".git", "HEAD") - const branch = `watch-${Math.random().toString(36).slice(2)}` - await $`git branch ${branch}`.cwd(tmp.path).quiet() - - await withWatcher( - tmp.path, - nextUpdate( - tmp.path, - (evt) => evt.file === head && evt.event !== "unlink", - Effect.promise(() => fs.writeFile(head, `ref: refs/heads/${branch}\n`)), - ).pipe( - Effect.tap((evt) => - Effect.sync(() => { - expect(evt.file).toBe(head) - expect(["add", "change"]).toContain(evt.event) - }), - ), - ), + yield* withWatcher( + test.directory, + nextUpdate( + test.directory, + (evt) => evt.file === head && evt.event !== "unlink", + fs.writeFileString(head, `ref: refs/heads/${branch}\n`), + ).pipe( + Effect.tap((evt) => + Effect.sync(() => { + expect(evt.file).toBe(head) + expect(["add", "change"]).toContain(evt.event) + }), + ), + ), + ) + }), + { git: true }, + ) + + // Symlink support varies by platform; skip where unavailable + const describeSymlink = process.platform !== "win32" ? describe : describe.skip + + describeSymlink("symlinked .git", () => { + it.instance( + "publishes .git/HEAD events through a symlinked .git directory", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const git = yield* Git.Service + const dir = test.directory + const actualGit = path.join(dir, "..", "tmp_actual_git_" + Math.random().toString(36).slice(2)) + + // Move .git to a sibling directory and replace with a symlink + yield* Effect.promise(() => import("fs")).pipe( + Effect.flatMap((nodeFs) => + Effect.all([ + Effect.promise(() => nodeFs.promises.rename(path.join(dir, ".git"), actualGit)), + Effect.promise(() => nodeFs.promises.symlink(actualGit, path.join(dir, ".git"))), + ]), + ), + ) + + yield* Effect.acquireRelease(Effect.succeed(actualGit), (p) => + Effect.promise(() => + import("fs").then((f) => f.promises.rm(p, { recursive: true, force: true }).catch(() => undefined)), + ), + ) + + const head = path.join(dir, ".git", "HEAD") + const branch = `watch-${Math.random().toString(36).slice(2)}` + yield* git.run(["branch", branch], { cwd: dir }) + + yield* withWatcher( + dir, + nextUpdate( + dir, + (evt) => evt.file === path.join(actualGit, "HEAD") && evt.event !== "unlink", + fs.writeFileString(head, `ref: refs/heads/${branch}\n`), + ).pipe( + Effect.tap((evt) => + Effect.sync(() => { + expect(evt.file).toBe(path.join(actualGit, "HEAD")) + expect(["add", "change"]).toContain(evt.event) + }), + ), + ), + ) + }), + { git: true }, ) }) }) diff --git a/packages/opencode/test/fixture/db.ts b/packages/opencode/test/fixture/db.ts index 07b42d994629..db4a5df20c4d 100644 --- a/packages/opencode/test/fixture/db.ts +++ b/packages/opencode/test/fixture/db.ts @@ -5,7 +5,8 @@ import { disposeAllInstances } from "./fixture" export async function resetDatabase() { await disposeAllInstances().catch(() => undefined) Database.close() - await rm(Database.Path, { force: true }).catch(() => undefined) - await rm(`${Database.Path}-wal`, { force: true }).catch(() => undefined) - await rm(`${Database.Path}-shm`, { force: true }).catch(() => undefined) + const dbPath = Database.getPath() + await rm(dbPath, { force: true }).catch(() => undefined) + await rm(`${dbPath}-wal`, { force: true }).catch(() => undefined) + await rm(`${dbPath}-shm`, { force: true }).catch(() => undefined) } diff --git a/packages/opencode/test/fixture/fixture.ts b/packages/opencode/test/fixture/fixture.ts index d47620f62351..fedbc246bc1e 100644 --- a/packages/opencode/test/fixture/fixture.ts +++ b/packages/opencode/test/fixture/fixture.ts @@ -135,7 +135,7 @@ export function tmpdirScoped(options?: { git?: boolean; config?: Partial> & { + soundboard?: Partial +} + function themeCurrent(): HostPluginApi["theme"]["current"] { const a = RGBA.fromInts(0, 120, 240) const b = RGBA.fromInts(120, 120, 120) @@ -83,6 +87,8 @@ function themeCurrent(): HostPluginApi["theme"]["current"] { type Opts = { client?: HostPluginApi["client"] | (() => HostPluginApi["client"]) renderer?: HostPluginApi["renderer"] + attention?: AttentionOpts + event?: HostPluginApi["event"] count?: Count keymap?: HostPluginApi["keymap"] tuiConfig?: Partial @@ -183,6 +189,17 @@ export function createTuiPluginApi(opts: Opts = {}): HostPluginApi { return opts.app?.version ?? "0.0.0-test" }, }, + attention: { + async notify(input) { + return opts.attention?.notify?.(input) ?? { ok: false, notification: false, sound: false } + }, + soundboard: { + registerPack: (pack) => opts.attention?.soundboard?.registerPack?.(pack) ?? (() => {}), + activate: (id, options) => opts.attention?.soundboard?.activate?.(id, options) ?? false, + current: () => opts.attention?.soundboard?.current?.() ?? "opencode.default", + list: () => opts.attention?.soundboard?.list?.() ?? [], + }, + }, keys: { formatSequence: () => "", formatBindings: () => undefined, @@ -190,7 +207,7 @@ export function createTuiPluginApi(opts: Opts = {}): HostPluginApi { get client() { return client() }, - event: { + event: opts.event ?? { on: () => { if (count) count.event_add += 1 return () => { @@ -292,6 +309,7 @@ export function createTuiPluginApi(opts: Opts = {}): HostPluginApi { }, session: { count: opts.state?.session?.count ?? (() => 0), + get: opts.state?.session?.get ?? (() => undefined), diff: opts.state?.session?.diff ?? (() => []), todo: opts.state?.session?.todo ?? (() => []), messages: opts.state?.session?.messages ?? (() => []), diff --git a/packages/opencode/test/fixture/tui-runtime.ts b/packages/opencode/test/fixture/tui-runtime.ts index 64537b6c50e2..75fc2fdc44b2 100644 --- a/packages/opencode/test/fixture/tui-runtime.ts +++ b/packages/opencode/test/fixture/tui-runtime.ts @@ -5,7 +5,8 @@ import { TuiConfig } from "../../src/cli/cmd/tui/config/tui" import { TuiKeybind } from "../../src/cli/cmd/tui/config/keybind" type PluginSpec = string | [string, Record] -type ResolvedInput = Omit & { +type ResolvedInput = Omit & { + attention?: Partial keybinds?: Partial leader_timeout?: number } @@ -22,6 +23,15 @@ export function createTuiResolvedConfig(input: ResolvedInput = {}): TuiConfig.Re const keybinds = TuiKeybind.Keybinds.parse(input.keybinds ?? {}) return { ...input, + attention: { + enabled: false, + notifications: true, + sound: true, + volume: 0.4, + sound_pack: "opencode.default", + sounds: {}, + ...input.attention, + }, keybinds: createTuiResolvedKeybinds(keybinds), leader_timeout: input.leader_timeout ?? 2000, } diff --git a/packages/opencode/test/fixture/workspace.ts b/packages/opencode/test/fixture/workspace.ts new file mode 100644 index 000000000000..9c201d39824f --- /dev/null +++ b/packages/opencode/test/fixture/workspace.ts @@ -0,0 +1,28 @@ +import { FetchHttpClient } from "effect/unstable/http" +import { Layer } from "effect" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Auth } from "../../src/auth" +import { Workspace } from "../../src/control-plane/workspace" +import { RuntimeFlags } from "../../src/effect/runtime-flags" +import { InstanceBootstrap } from "../../src/project/bootstrap" +import { InstanceStore } from "../../src/project/instance-store" +import { Project } from "../../src/project/project" +import { Vcs } from "../../src/project/vcs" +import { Session } from "../../src/session/session" +import { SessionPrompt } from "../../src/session/prompt" +import { SyncEvent } from "../../src/sync" + +export const workspaceLayerWithRuntimeFlags = (overrides: Partial) => + Workspace.layer.pipe( + Layer.provide(Auth.defaultLayer), + Layer.provide(Session.defaultLayer), + Layer.provide(SyncEvent.defaultLayer), + Layer.provide(SessionPrompt.defaultLayer), + Layer.provide(Project.defaultLayer), + Layer.provide(Vcs.defaultLayer), + Layer.provide(FetchHttpClient.layer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(RuntimeFlags.layer(overrides)), + Layer.provide(InstanceStore.defaultLayer), + Layer.provide(InstanceBootstrap.defaultLayer), + ) diff --git a/packages/opencode/test/format/format.test.ts b/packages/opencode/test/format/format.test.ts index 674d2767cd07..c9e57d204e07 100644 --- a/packages/opencode/test/format/format.test.ts +++ b/packages/opencode/test/format/format.test.ts @@ -186,14 +186,14 @@ describe("Format", () => { Formatter.gofmt.enabled = async () => { active++ max = Math.max(max, active) - await Bun.sleep(20) + await Promise.resolve() active-- return ["sh", "-c", "true"] } Formatter.mix.enabled = async () => { active++ max = Math.max(max, active) - await Bun.sleep(20) + await Promise.resolve() active-- return ["sh", "-c", "true"] } diff --git a/packages/opencode/test/git/git.test.ts b/packages/opencode/test/git/git.test.ts index 1e56865d7278..e80b8fa9065b 100644 --- a/packages/opencode/test/git/git.test.ts +++ b/packages/opencode/test/git/git.test.ts @@ -1,71 +1,70 @@ import { $ } from "bun" -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import fs from "fs/promises" import path from "path" -import { ManagedRuntime } from "effect" +import { Effect } from "effect" import { Git } from "../../src/git" import { tmpdir } from "../fixture/fixture" +import { testEffect } from "../lib/effect" const weird = process.platform === "win32" ? "space file.txt" : "tab\tfile.txt" +const it = testEffect(Git.defaultLayer) -async function withGit(body: (rt: ManagedRuntime.ManagedRuntime) => Promise) { - const rt = ManagedRuntime.make(Git.defaultLayer) - try { - return await body(rt) - } finally { - await rt.dispose() - } -} +const scopedTmpdir = (options?: Parameters[0]) => + Effect.acquireRelease( + Effect.promise(() => tmpdir(options)), + (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()), + ) describe("Git", () => { - test("branch() returns current branch name", async () => { - await using tmp = await tmpdir({ git: true }) - - await withGit(async (rt) => { - const branch = await rt.runPromise(Git.Service.use((git) => git.branch(tmp.path))) + it.live("branch() returns current branch name", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + const git = yield* Git.Service + const branch = yield* git.branch(tmp.path) expect(branch).toBeDefined() expect(typeof branch).toBe("string") - }) - }) - - test("branch() returns undefined for non-git directories", async () => { - await using tmp = await tmpdir() - - await withGit(async (rt) => { - const branch = await rt.runPromise(Git.Service.use((git) => git.branch(tmp.path))) + }), + ) + + it.live("branch() returns undefined for non-git directories", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir() + const git = yield* Git.Service + const branch = yield* git.branch(tmp.path) expect(branch).toBeUndefined() - }) - }) - - test("branch() returns undefined for detached HEAD", async () => { - await using tmp = await tmpdir({ git: true }) - const hash = (await $`git rev-parse HEAD`.cwd(tmp.path).quiet().text()).trim() - await $`git checkout --detach ${hash}`.cwd(tmp.path).quiet() - - await withGit(async (rt) => { - const branch = await rt.runPromise(Git.Service.use((git) => git.branch(tmp.path))) + }), + ) + + it.live("branch() returns undefined for detached HEAD", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + const hash = (yield* Effect.promise(() => $`git rev-parse HEAD`.cwd(tmp.path).quiet().text())).trim() + yield* Effect.promise(() => $`git checkout --detach ${hash}`.cwd(tmp.path).quiet()) + const git = yield* Git.Service + const branch = yield* git.branch(tmp.path) expect(branch).toBeUndefined() - }) - }) - - test("defaultBranch() uses init.defaultBranch when available", async () => { - await using tmp = await tmpdir({ git: true }) - await $`git branch -M trunk`.cwd(tmp.path).quiet() - await $`git config init.defaultBranch trunk`.cwd(tmp.path).quiet() - - await withGit(async (rt) => { - const branch = await rt.runPromise(Git.Service.use((git) => git.defaultBranch(tmp.path))) + }), + ) + + it.live("defaultBranch() uses init.defaultBranch when available", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + yield* Effect.promise(() => $`git branch -M trunk`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => $`git config init.defaultBranch trunk`.cwd(tmp.path).quiet()) + const git = yield* Git.Service + const branch = yield* git.defaultBranch(tmp.path) expect(branch?.name).toBe("trunk") expect(branch?.ref).toBe("trunk") - }) - }) - - test("status() handles special filenames", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, weird), "hello\n", "utf-8") - - await withGit(async (rt) => { - const status = await rt.runPromise(Git.Service.use((git) => git.status(tmp.path))) + }), + ) + + it.live("status() handles special filenames", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, weird), "hello\n", "utf-8")) + const git = yield* Git.Service + const status = yield* git.status(tmp.path) expect(status).toEqual( expect.arrayContaining([ expect.objectContaining({ @@ -74,23 +73,24 @@ describe("Git", () => { }), ]), ) - }) - }) - - test("diff(), stats(), and mergeBase() parse tracked changes", async () => { - await using tmp = await tmpdir({ git: true }) - await $`git branch -M main`.cwd(tmp.path).quiet() - await fs.writeFile(path.join(tmp.path, weird), "before\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "add file"`.cwd(tmp.path).quiet() - await $`git checkout -b feature/test`.cwd(tmp.path).quiet() - await fs.writeFile(path.join(tmp.path, weird), "after\n", "utf-8") - - await withGit(async (rt) => { - const [base, diff, stats] = await Promise.all([ - rt.runPromise(Git.Service.use((git) => git.mergeBase(tmp.path, "main"))), - rt.runPromise(Git.Service.use((git) => git.diff(tmp.path, "HEAD"))), - rt.runPromise(Git.Service.use((git) => git.stats(tmp.path, "HEAD"))), + }), + ) + + it.live("diff(), stats(), and mergeBase() parse tracked changes", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + yield* Effect.promise(() => $`git branch -M main`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, weird), "before\n", "utf-8")) + yield* Effect.promise(() => $`git add .`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => $`git commit --no-gpg-sign -m "add file"`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => $`git checkout -b feature/test`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, weird), "after\n", "utf-8")) + + const git = yield* Git.Service + const [base, diff, stats] = yield* Effect.all([ + git.mergeBase(tmp.path, "main"), + git.diff(tmp.path, "HEAD"), + git.stats(tmp.path, "HEAD"), ]) expect(base).toBeTruthy() @@ -111,23 +111,24 @@ describe("Git", () => { }), ]), ) - }) - }) - - test("patch() returns capped native patch output", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, weird), "before\n", "utf-8") - await fs.writeFile(path.join(tmp.path, "other.txt"), "old\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "add file"`.cwd(tmp.path).quiet() - await fs.writeFile(path.join(tmp.path, weird), "after\n", "utf-8") - await fs.writeFile(path.join(tmp.path, "other.txt"), "new\n", "utf-8") - - await withGit(async (rt) => { - const [patch, all, capped] = await Promise.all([ - rt.runPromise(Git.Service.use((git) => git.patch(tmp.path, "HEAD", weird, { context: 2_147_483_647 }))), - rt.runPromise(Git.Service.use((git) => git.patchAll(tmp.path, "HEAD", { context: 2_147_483_647 }))), - rt.runPromise(Git.Service.use((git) => git.patch(tmp.path, "HEAD", weird, { maxOutputBytes: 1 }))), + }), + ) + + it.live("patch() returns capped native patch output", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, weird), "before\n", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, "other.txt"), "old\n", "utf-8")) + yield* Effect.promise(() => $`git add .`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => $`git commit --no-gpg-sign -m "add file"`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, weird), "after\n", "utf-8")) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, "other.txt"), "new\n", "utf-8")) + + const git = yield* Git.Service + const [patch, all, capped] = yield* Effect.all([ + git.patch(tmp.path, "HEAD", weird, { context: 2_147_483_647 }), + git.patchAll(tmp.path, "HEAD", { context: 2_147_483_647 }), + git.patch(tmp.path, "HEAD", weird, { maxOutputBytes: 1 }), ]) expect(patch.truncated).toBe(false) @@ -140,17 +141,18 @@ describe("Git", () => { expect(all.text).toContain("+new") expect(capped.truncated).toBe(true) expect(capped.text).toBe("") - }) - }) - - test("patchUntracked() and statUntracked() handle added files", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, weird), "one\ntwo\n", "utf-8") - - await withGit(async (rt) => { - const [patch, stat] = await Promise.all([ - rt.runPromise(Git.Service.use((git) => git.patchUntracked(tmp.path, weird, { context: 2_147_483_647 }))), - rt.runPromise(Git.Service.use((git) => git.statUntracked(tmp.path, weird))), + }), + ) + + it.live("patchUntracked() and statUntracked() handle added files", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, weird), "one\ntwo\n", "utf-8")) + + const git = yield* Git.Service + const [patch, stat] = yield* Effect.all([ + git.patchUntracked(tmp.path, weird, { context: 2_147_483_647 }), + git.statUntracked(tmp.path, weird), ]) expect(patch.truncated).toBe(false) @@ -158,18 +160,19 @@ describe("Git", () => { expect(patch.text).toContain("+one") expect(patch.text).toContain("+two") expect(stat).toEqual(expect.objectContaining({ file: weird, additions: 2, deletions: 0 })) - }) - }) - - test("show() returns empty text for binary blobs", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "bin.dat"), new Uint8Array([0, 1, 2, 3])) - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "add binary"`.cwd(tmp.path).quiet() - - await withGit(async (rt) => { - const text = await rt.runPromise(Git.Service.use((git) => git.show(tmp.path, "HEAD", "bin.dat"))) + }), + ) + + it.live("show() returns empty text for binary blobs", () => + Effect.gen(function* () { + const tmp = yield* scopedTmpdir({ git: true }) + yield* Effect.promise(() => fs.writeFile(path.join(tmp.path, "bin.dat"), new Uint8Array([0, 1, 2, 3]))) + yield* Effect.promise(() => $`git add .`.cwd(tmp.path).quiet()) + yield* Effect.promise(() => $`git commit --no-gpg-sign -m "add binary"`.cwd(tmp.path).quiet()) + + const git = yield* Git.Service + const text = yield* git.show(tmp.path, "HEAD", "bin.dat") expect(text).toBe("") - }) - }) + }), + ) }) diff --git a/packages/opencode/test/image/fixtures/picture-5mb-base64.png b/packages/opencode/test/image/fixtures/picture-5mb-base64.png new file mode 100644 index 000000000000..e8923b9e71c7 Binary files /dev/null and b/packages/opencode/test/image/fixtures/picture-5mb-base64.png differ diff --git a/packages/opencode/test/image/image.test.ts b/packages/opencode/test/image/image.test.ts index bf5c0b3948ef..c5d832cd5e23 100644 --- a/packages/opencode/test/image/image.test.ts +++ b/packages/opencode/test/image/image.test.ts @@ -2,6 +2,7 @@ import { describe, expect } from "bun:test" import { Cause, Effect, Exit, Layer } from "effect" import { Image } from "@/image/image" import { MessageID, PartID, SessionID } from "@/session/schema" +import path from "node:path" import { TestConfig } from "../fixture/config" import { testEffect } from "../lib/effect" @@ -57,6 +58,46 @@ describe("Image", () => { }), ) + it.effect("resizes images that fit the byte limit but exceed dimension limits", () => + Effect.gen(function* () { + const photon = yield* Effect.promise(() => import("@silvia-odwyer/photon-node")) + const source = new photon.PhotonImage(new Uint8Array(Array.from({ length: 9_000 * 4 }, () => 255)), 9_000, 1) + const image = yield* Image.Service + const result = yield* image.normalize(part("image/png", Buffer.from(source.get_bytes()).toString("base64"))) + const resized = photon.PhotonImage.new_from_byteslice( + Buffer.from(result.url.slice(result.url.indexOf(";base64,") + ";base64,".length), "base64"), + ) + + source.free() + expect(resized.get_width()).toBeLessThanOrEqual(2_000) + expect(resized.get_height()).toBeLessThanOrEqual(2_000) + resized.free() + }), + ) + + it.effect("resizes the 5MB base64 picture fixture", () => + Effect.gen(function* () { + const photon = yield* Effect.promise(() => import("@silvia-odwyer/photon-node")) + const data = Buffer.from( + yield* Effect.promise(() => + Bun.file(path.join(import.meta.dir, "fixtures", "picture-5mb-base64.png")).arrayBuffer(), + ), + ) + const input = part("image/png", data.toString("base64")) + const image = yield* Image.Service + const result = yield* image.normalize(input) + const base64 = result.url.slice(result.url.indexOf(";base64,") + ";base64,".length) + const resized = photon.PhotonImage.new_from_byteslice(Buffer.from(base64, "base64")) + + expect(input.url.slice(input.url.indexOf(";base64,") + ";base64,".length).length).toBe(5 * 1024 * 1024) + expect(result.url).not.toBe(input.url) + expect(base64.length).toBeLessThan(5 * 1024 * 1024) + expect(resized.get_width()).toBeLessThanOrEqual(2_000) + expect(resized.get_height()).toBeLessThanOrEqual(2_000) + resized.free() + }), + ) + tiny.effect("fails with a typed size error when no resized candidate fits", () => Effect.gen(function* () { const photon = yield* Effect.promise(() => import("@silvia-odwyer/photon-node")) diff --git a/packages/opencode/test/installation/installation.test.ts b/packages/opencode/test/installation/installation.test.ts index 5b26b0565521..8193ab8d105a 100644 --- a/packages/opencode/test/installation/installation.test.ts +++ b/packages/opencode/test/installation/installation.test.ts @@ -1,9 +1,11 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import { Effect, Layer, Stream } from "effect" import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http" import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" import { Installation } from "../../src/installation" import { InstallationChannel } from "@opencode-ai/core/installation/version" +import { AppProcess } from "@opencode-ai/core/process" +import { testEffect } from "../lib/effect" const encoder = new TextEncoder() @@ -46,91 +48,90 @@ function testLayer( httpHandler: (request: HttpClientRequest.HttpClientRequest) => Response, spawnHandler?: (cmd: string, args: readonly string[]) => string, ) { - return Installation.layer.pipe(Layer.provide(mockHttpClient(httpHandler)), Layer.provide(mockSpawner(spawnHandler))) + const appProcess = AppProcess.layer.pipe(Layer.provide(mockSpawner(spawnHandler))) + return Installation.layer.pipe(Layer.provide(mockHttpClient(httpHandler)), Layer.provide(appProcess)) } describe("installation", () => { describe("latest", () => { - test("reads release version from GitHub releases", async () => { - const layer = testLayer(() => jsonResponse({ tag_name: "v1.2.3" })) - - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("unknown")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("1.2.3") - }) - - test("strips v prefix from GitHub release tag", async () => { - const layer = testLayer(() => jsonResponse({ tag_name: "v4.0.0-beta.1" })) + testEffect(testLayer(() => jsonResponse({ tag_name: "v1.2.3" }))).effect( + "reads release version from GitHub releases", + () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("unknown")) + expect(result).toBe("1.2.3") + }), + ) - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("curl")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("4.0.0-beta.1") - }) + testEffect(testLayer(() => jsonResponse({ tag_name: "v4.0.0-beta.1" }))).effect( + "strips v prefix from GitHub release tag", + () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("curl")) + expect(result).toBe("4.0.0-beta.1") + }), + ) - test("reads npm versions via registry", async () => { - const calls: string[] = [] - const layer = testLayer((request) => { - calls.push(request.url) + const npmCalls: string[] = [] + testEffect( + testLayer((request) => { + npmCalls.push(request.url) return jsonResponse({ version: "1.5.0" }) - }) - - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("npm")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("1.5.0") - expect(calls).toContain(`https://registry.npmjs.org/opencode-ai/${InstallationChannel}`) - }) + }), + ).effect("reads npm versions via registry", () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("npm")) + expect(result).toBe("1.5.0") + expect(npmCalls).toContain(`https://registry.npmjs.org/opencode-ai/${InstallationChannel}`) + }), + ) - test("reads bun versions via registry", async () => { - const calls: string[] = [] - const layer = testLayer((request) => { - calls.push(request.url) + const bunCalls: string[] = [] + testEffect( + testLayer((request) => { + bunCalls.push(request.url) return jsonResponse({ version: "1.6.0" }) - }) - - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("bun")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("1.6.0") - expect(calls).toContain(`https://registry.npmjs.org/opencode-ai/${InstallationChannel}`) - }) + }), + ).effect("reads bun versions via registry", () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("bun")) + expect(result).toBe("1.6.0") + expect(bunCalls).toContain(`https://registry.npmjs.org/opencode-ai/${InstallationChannel}`) + }), + ) - test("reads pnpm versions via registry", async () => { - const calls: string[] = [] - const layer = testLayer((request) => { - calls.push(request.url) + const pnpmCalls: string[] = [] + testEffect( + testLayer((request) => { + pnpmCalls.push(request.url) return jsonResponse({ version: "1.7.0" }) - }) - - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("pnpm")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("1.7.0") - expect(calls).toContain(`https://registry.npmjs.org/opencode-ai/${InstallationChannel}`) - }) - - test("reads scoop manifest versions", async () => { - const layer = testLayer(() => jsonResponse({ version: "2.3.4" })) - - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("scoop")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("2.3.4") - }) + }), + ).effect("reads pnpm versions via registry", () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("pnpm")) + expect(result).toBe("1.7.0") + expect(pnpmCalls).toContain(`https://registry.npmjs.org/opencode-ai/${InstallationChannel}`) + }), + ) - test("reads chocolatey feed versions", async () => { - const layer = testLayer(() => jsonResponse({ d: { results: [{ Version: "3.4.5" }] } })) + testEffect(testLayer(() => jsonResponse({ version: "2.3.4" }))).effect("reads scoop manifest versions", () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("scoop")) + expect(result).toBe("2.3.4") + }), + ) - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("choco")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("3.4.5") - }) + testEffect(testLayer(() => jsonResponse({ d: { results: [{ Version: "3.4.5" }] } }))).effect( + "reads chocolatey feed versions", + () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("choco")) + expect(result).toBe("3.4.5") + }), + ) - test("reads brew formulae API versions", async () => { - const layer = testLayer( + testEffect( + testLayer( () => jsonResponse({ versions: { stable: "2.0.0" } }), (cmd, args) => { // getBrewFormula: return core formula (no tap) @@ -138,31 +139,31 @@ describe("installation", () => { if (cmd === "brew" && args.includes("--formula") && args.includes("opencode")) return "opencode" return "" }, - ) + ), + ).effect("reads brew formulae API versions", () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("brew")) + expect(result).toBe("2.0.0") + }), + ) - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("brew")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("2.0.0") + const brewInfoJson = JSON.stringify({ + formulae: [{ versions: { stable: "2.1.0" } }], }) - - test("reads brew tap info JSON via CLI", async () => { - const brewInfoJson = JSON.stringify({ - formulae: [{ versions: { stable: "2.1.0" } }], - }) - const layer = testLayer( + testEffect( + testLayer( () => jsonResponse({}), // HTTP not used for tap formula (cmd, args) => { if (cmd === "brew" && args.includes("anomalyco/tap/opencode") && args.includes("--formula")) return "opencode" if (cmd === "brew" && args.includes("--json=v2")) return brewInfoJson return "" }, - ) - - const result = await Effect.runPromise( - Installation.Service.use((svc) => svc.latest("brew")).pipe(Effect.provide(layer)), - ) - expect(result).toBe("2.1.0") - }) + ), + ).effect("reads brew tap info JSON via CLI", () => + Effect.gen(function* () { + const result = yield* Installation.Service.use((svc) => svc.latest("brew")) + expect(result).toBe("2.1.0") + }), + ) }) }) diff --git a/packages/opencode/test/lib/effect.ts b/packages/opencode/test/lib/effect.ts index e454fa7e42e9..6ad2838fcae9 100644 --- a/packages/opencode/test/lib/effect.ts +++ b/packages/opencode/test/lib/effect.ts @@ -1,5 +1,5 @@ import { test, type TestOptions } from "bun:test" -import { Cause, Effect, Exit, Layer } from "effect" +import { Cause, Duration, Effect, Exit, Layer } from "effect" import type * as Scope from "effect/Scope" import * as TestClock from "effect/testing/TestClock" import * as TestConsole from "effect/testing/TestConsole" @@ -109,3 +109,33 @@ export const it = make(testEnv, liveEnv) export const testEffect = (layer: Layer.Layer) => make(Layer.provideMerge(layer, testEnv), Layer.provideMerge(layer, liveEnv)) + +export const awaitWithTimeout = ( + self: Effect.Effect, + message: string, + duration: Duration.Input = "2 seconds", +) => + self.pipe( + Effect.timeoutOrElse({ + duration, + orElse: () => Effect.fail(new Error(message)), + }), + ) + +export const pollWithTimeout = ( + self: Effect.Effect, + message: string, + duration: Duration.Input = "5 seconds", +) => + Effect.gen(function* () { + while (true) { + const result = yield* self + if (result !== undefined) return result + yield* Effect.sleep("20 millis") + } + }).pipe( + Effect.timeoutOrElse({ + duration, + orElse: () => Effect.fail(new Error(message)), + }), + ) diff --git a/packages/opencode/test/lsp/index.test.ts b/packages/opencode/test/lsp/index.test.ts index cd6648ae9d45..b69963b30197 100644 --- a/packages/opencode/test/lsp/index.test.ts +++ b/packages/opencode/test/lsp/index.test.ts @@ -1,6 +1,8 @@ import { describe, expect, spyOn } from "bun:test" import path from "path" import { Effect, Layer } from "effect" +import { Config } from "@/config/config" +import { RuntimeFlags } from "@/effect/runtime-flags" import { LSP } from "@/lsp/lsp" import * as LSPServer from "@/lsp/server" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" @@ -8,6 +10,18 @@ import { provideTmpdirInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" const it = testEffect(Layer.mergeAll(LSP.defaultLayer, CrossSpawnSpawner.defaultLayer)) +const experimentalTyIt = testEffect( + Layer.mergeAll( + LSP.layer.pipe(Layer.provide(Config.defaultLayer), Layer.provide(RuntimeFlags.layer({ experimentalLspTy: true }))), + CrossSpawnSpawner.defaultLayer, + ), +) +const disabledDownloadIt = testEffect( + Layer.mergeAll( + LSP.layer.pipe(Layer.provide(Config.defaultLayer), Layer.provide(RuntimeFlags.layer({ disableLspDownload: true }))), + CrossSpawnSpawner.defaultLayer, + ), +) describe("lsp.spawn", () => { it.live("does not spawn builtin LSP for files outside instance", () => @@ -106,4 +120,80 @@ describe("lsp.spawn", () => { }, ), ) + + it.live("uses pyright instead of ty by default", () => + provideTmpdirInstance( + (dir) => + LSP.Service.use((lsp) => + Effect.gen(function* () { + const ty = spyOn(LSPServer.Ty, "spawn").mockResolvedValue(undefined) + const pyright = spyOn(LSPServer.Pyright, "spawn").mockResolvedValue(undefined) + + try { + yield* lsp.hover({ + file: path.join(dir, "src", "inside.py"), + line: 0, + character: 0, + }) + expect(ty).toHaveBeenCalledTimes(0) + expect(pyright).toHaveBeenCalledTimes(1) + } finally { + ty.mockRestore() + pyright.mockRestore() + } + }), + ), + { config: { lsp: true } }, + ), + ) + + experimentalTyIt.live("uses ty instead of pyright when experimentalLspTy is enabled", () => + provideTmpdirInstance( + (dir) => + LSP.Service.use((lsp) => + Effect.gen(function* () { + const ty = spyOn(LSPServer.Ty, "spawn").mockResolvedValue(undefined) + const pyright = spyOn(LSPServer.Pyright, "spawn").mockResolvedValue(undefined) + + try { + yield* lsp.hover({ + file: path.join(dir, "src", "inside.py"), + line: 0, + character: 0, + }) + expect(ty).toHaveBeenCalledTimes(1) + expect(pyright).toHaveBeenCalledTimes(0) + } finally { + ty.mockRestore() + pyright.mockRestore() + } + }), + ), + { config: { lsp: true } }, + ), + ) + + disabledDownloadIt.live("passes disableLspDownload to builtin LSP spawn", () => + provideTmpdirInstance( + (dir) => + LSP.Service.use((lsp) => + Effect.gen(function* () { + const pyright = spyOn(LSPServer.Pyright, "spawn").mockResolvedValue(undefined) + + try { + yield* lsp.hover({ + file: path.join(dir, "src", "inside.py"), + line: 0, + character: 0, + }) + expect(pyright).toHaveBeenCalledTimes(1) + expect(pyright.mock.calls[0]?.[2]).toMatchObject({ disableLspDownload: true }) + } finally { + pyright.mockRestore() + } + }), + ), + { config: { lsp: true } }, + ), + ) }) diff --git a/packages/opencode/test/mcp/headers.test.ts b/packages/opencode/test/mcp/headers.test.ts index 5bc8f803d27b..c51ed00d32f6 100644 --- a/packages/opencode/test/mcp/headers.test.ts +++ b/packages/opencode/test/mcp/headers.test.ts @@ -1,6 +1,6 @@ -import { test, expect, mock, beforeEach } from "bun:test" +import { describe, expect, mock, beforeEach } from "bun:test" import { Effect } from "effect" -import type { MCP as MCPNS } from "../../src/mcp/index" +import { testEffect } from "../lib/effect" // Track what options were passed to each transport constructor const transportCalls: Array<{ @@ -46,53 +46,22 @@ beforeEach(() => { // Import MCP after mocking const { MCP } = await import("../../src/mcp/index") -const { AppRuntime } = await import("../../src/effect/app-runtime") -const { Instance } = await import("../../src/project/instance") -const { WithInstance } = await import("../../src/project/with-instance") -const { tmpdir } = await import("../fixture/fixture") -const service = MCP.Service as unknown as Effect.Effect - -test("headers are passed to transports when oauth is enabled (default)", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: { - "test-server": { - type: "remote", - url: "https://example.com/mcp", - headers: { - Authorization: "Bearer test-token", - "X-Custom-Header": "custom-value", - }, - }, +const it = testEffect(MCP.defaultLayer) + +describe("mcp.headers", () => { + it.instance("headers are passed to transports when oauth is enabled (default)", () => + Effect.gen(function* () { + const mcp = yield* MCP.Service + yield* mcp + .add("test-server", { + type: "remote", + url: "https://example.com/mcp", + headers: { + Authorization: "Bearer test-token", + "X-Custom-Header": "custom-value", }, - }), - ) - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // Trigger MCP initialization - it will fail to connect but we can check the transport options - await AppRuntime.runPromise( - Effect.gen(function* () { - const mcp = yield* service - yield* mcp - .add("test-server", { - type: "remote", - url: "https://example.com/mcp", - headers: { - Authorization: "Bearer test-token", - "X-Custom-Header": "custom-value", - }, - }) - .pipe(Effect.catch(() => Effect.void)) - }), - ) + }) + .pipe(Effect.catch(() => Effect.void)) // Both transports should have been created with headers expect(transportCalls.length).toBeGreaterThanOrEqual(1) @@ -106,33 +75,22 @@ test("headers are passed to transports when oauth is enabled (default)", async ( // OAuth should be enabled by default, so authProvider should exist expect(call.options.authProvider).toBeDefined() } - }, - }) -}) - -test("headers are passed to transports when oauth is explicitly disabled", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - transportCalls.length = 0 - - await AppRuntime.runPromise( - Effect.gen(function* () { - const mcp = yield* service - yield* mcp - .add("test-server-no-oauth", { - type: "remote", - url: "https://example.com/mcp", - oauth: false, - headers: { - Authorization: "Bearer test-token", - }, - }) - .pipe(Effect.catch(() => Effect.void)) - }), - ) + }), + ) + + it.instance("headers are passed to transports when oauth is explicitly disabled", () => + Effect.gen(function* () { + const mcp = yield* MCP.Service + yield* mcp + .add("test-server-no-oauth", { + type: "remote", + url: "https://example.com/mcp", + oauth: false, + headers: { + Authorization: "Bearer test-token", + }, + }) + .pipe(Effect.catch(() => Effect.void)) expect(transportCalls.length).toBeGreaterThanOrEqual(1) @@ -144,29 +102,18 @@ test("headers are passed to transports when oauth is explicitly disabled", async // OAuth is disabled, so no authProvider expect(call.options.authProvider).toBeUndefined() } - }, - }) -}) - -test("no requestInit when headers are not provided", async () => { - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - transportCalls.length = 0 - - await AppRuntime.runPromise( - Effect.gen(function* () { - const mcp = yield* service - yield* mcp - .add("test-server-no-headers", { - type: "remote", - url: "https://example.com/mcp", - }) - .pipe(Effect.catch(() => Effect.void)) - }), - ) + }), + ) + + it.instance("no requestInit when headers are not provided", () => + Effect.gen(function* () { + const mcp = yield* MCP.Service + yield* mcp + .add("test-server-no-headers", { + type: "remote", + url: "https://example.com/mcp", + }) + .pipe(Effect.catch(() => Effect.void)) expect(transportCalls.length).toBeGreaterThanOrEqual(1) @@ -174,6 +121,6 @@ test("no requestInit when headers are not provided", async () => { // No headers means requestInit should be undefined expect(call.options.requestInit).toBeUndefined() } - }, - }) + }), + ) }) diff --git a/packages/opencode/test/mcp/lifecycle.test.ts b/packages/opencode/test/mcp/lifecycle.test.ts index 5afc85e3b5de..185086fe60a9 100644 --- a/packages/opencode/test/mcp/lifecycle.test.ts +++ b/packages/opencode/test/mcp/lifecycle.test.ts @@ -1,7 +1,7 @@ -import { test, expect, mock, beforeEach } from "bun:test" -import { InstanceRuntime } from "../../src/project/instance-runtime" -import { Effect } from "effect" +import { expect, mock, beforeEach } from "bun:test" +import { Effect, Exit } from "effect" import type { MCP as MCPNS } from "../../src/mcp/index" +import { testEffect } from "../lib/effect" // --- Mock infrastructure --- @@ -179,39 +179,9 @@ beforeEach(() => { // Import after mocks const { MCP } = await import("../../src/mcp/index") -const { Instance } = await import("../../src/project/instance") -const { WithInstance } = await import("../../src/project/with-instance") -const { tmpdir } = await import("../fixture/fixture") - -// --- Helper --- - -function withInstance( - config: Record, - fn: (mcp: MCPNS.Interface) => Effect.Effect, -) { - return async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: config, - }), - ) - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await Effect.runPromise(MCP.Service.use(fn).pipe(Effect.provide(MCP.defaultLayer))) - // dispose instance to clean up state between tests - await InstanceRuntime.disposeInstance(Instance.current) - }, - }) - } -} +const { McpOAuthCallback } = await import("../../src/mcp/oauth-callback") + +const it = testEffect(MCP.defaultLayer) function statusName(status: Record | MCPNS.Status, server: string) { if ("status" in status) return status.status @@ -222,82 +192,82 @@ function statusName(status: Record | MCPNS.Status, server: // Test: tools() are cached after connect // ======================================================================== -test( +it.instance( "tools() reuses cached tool definitions after connect", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "my-server" - const serverState = getOrCreateClientState("my-server") - serverState.tools = [ - { name: "do_thing", description: "does a thing", inputSchema: { type: "object", properties: {} } }, - ] - - // First: add the server successfully - const addResult = yield* mcp.add("my-server", { - type: "local", - command: ["echo", "test"], - }) - expect((addResult.status as any)["my-server"]?.status ?? (addResult.status as any).status).toBe("connected") - - expect(serverState.listToolsCalls).toBe(1) - - const toolsA = yield* mcp.tools() - const toolsB = yield* mcp.tools() - expect(Object.keys(toolsA).length).toBeGreaterThan(0) - expect(Object.keys(toolsB).length).toBeGreaterThan(0) - expect(serverState.listToolsCalls).toBe(1) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "my-server" + const serverState = getOrCreateClientState("my-server") + serverState.tools = [ + { name: "do_thing", description: "does a thing", inputSchema: { type: "object", properties: {} } }, + ] + + // First: add the server successfully + const addResult = yield* mcp.add("my-server", { + type: "local", + command: ["echo", "test"], + }) + expect((addResult.status as any)["my-server"]?.status ?? (addResult.status as any).status).toBe("connected") + + expect(serverState.listToolsCalls).toBe(1) + + const toolsA = yield* mcp.tools() + const toolsB = yield* mcp.tools() + expect(Object.keys(toolsA).length).toBeGreaterThan(0) + expect(Object.keys(toolsB).length).toBeGreaterThan(0) + expect(serverState.listToolsCalls).toBe(1) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: tool change notifications refresh the cache // ======================================================================== -test( +it.instance( "tool change notifications refresh cached tool definitions", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "status-server" - const serverState = getOrCreateClientState("status-server") - - yield* mcp.add("status-server", { - type: "local", - command: ["echo", "test"], - }) - - const before = yield* mcp.tools() - expect(Object.keys(before).some((key) => key.includes("test_tool"))).toBe(true) - expect(serverState.listToolsCalls).toBe(1) - - serverState.tools = [{ name: "next_tool", description: "next", inputSchema: { type: "object", properties: {} } }] - - const handler = Array.from(serverState.notificationHandlers.values())[0] - expect(handler).toBeDefined() - yield* Effect.promise(() => handler?.()) - - const after = yield* mcp.tools() - expect(Object.keys(after).some((key) => key.includes("next_tool"))).toBe(true) - expect(Object.keys(after).some((key) => key.includes("test_tool"))).toBe(false) - expect(serverState.listToolsCalls).toBe(2) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "status-server" + const serverState = getOrCreateClientState("status-server") + + yield* mcp.add("status-server", { + type: "local", + command: ["echo", "test"], + }) + + const before = yield* mcp.tools() + expect(Object.keys(before).some((key) => key.includes("test_tool"))).toBe(true) + expect(serverState.listToolsCalls).toBe(1) + + serverState.tools = [ + { name: "next_tool", description: "next", inputSchema: { type: "object", properties: {} } }, + ] + + const handler = Array.from(serverState.notificationHandlers.values())[0] + expect(handler).toBeDefined() + yield* Effect.promise(() => handler?.()) + + const after = yield* mcp.tools() + expect(Object.keys(after).some((key) => key.includes("next_tool"))).toBe(true) + expect(Object.keys(after).some((key) => key.includes("test_tool"))).toBe(false) + expect(serverState.listToolsCalls).toBe(2) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: connect() / disconnect() lifecycle // ======================================================================== -test( +it.instance( "disconnect sets status to disabled and removes client", - withInstance( - { - "disc-server": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "disc-server" getOrCreateClientState("disc-server") @@ -315,24 +285,27 @@ test( const statusAfter = yield* mcp.status() expect(statusAfter["disc-server"]?.status).toBe("disabled") - // Tools should be empty after disconnect const tools = yield* mcp.tools() const serverTools = Object.keys(tools).filter((k) => k.startsWith("disc-server")) expect(serverTools.length).toBe(0) }), - ), + ), + { + config: { + mcp: { + "disc-server": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) -test( +it.instance( "connect() after disconnect() re-establishes the server", - withInstance( - { - "reconn-server": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "reconn-server" const serverState = getOrCreateClientState("reconn-server") @@ -348,70 +321,71 @@ test( yield* mcp.disconnect("reconn-server") expect((yield* mcp.status())["reconn-server"]?.status).toBe("disabled") - // Reconnect yield* mcp.connect("reconn-server") expect((yield* mcp.status())["reconn-server"]?.status).toBe("connected") const tools = yield* mcp.tools() expect(Object.keys(tools).some((k) => k.includes("my_tool"))).toBe(true) }), - ), + ), + { + config: { + mcp: { + "reconn-server": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) // ======================================================================== // Test: add() closes existing client before replacing // ======================================================================== -test( +it.instance( "add() closes the old client when replacing a server", // Don't put the server in config — add it dynamically so we control // exactly which client instance is "first" vs "second". - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "replace-server" - const firstState = getOrCreateClientState("replace-server") - - yield* mcp.add("replace-server", { - type: "local", - command: ["echo", "test"], - }) - - expect(firstState.closed).toBe(false) - - // Create new state for second client - clientStates.delete("replace-server") - const secondState = getOrCreateClientState("replace-server") - - // Re-add should close the first client - yield* mcp.add("replace-server", { - type: "local", - command: ["echo", "test"], - }) - - expect(firstState.closed).toBe(true) - expect(secondState.closed).toBe(false) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "replace-server" + const firstState = getOrCreateClientState("replace-server") + + yield* mcp.add("replace-server", { + type: "local", + command: ["echo", "test"], + }) + + expect(firstState.closed).toBe(false) + + // Create new state for second client + clientStates.delete("replace-server") + const secondState = getOrCreateClientState("replace-server") + + // Re-add should close the first client + yield* mcp.add("replace-server", { + type: "local", + command: ["echo", "test"], + }) + + expect(firstState.closed).toBe(true) + expect(secondState.closed).toBe(false) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: state init with mixed success/failure // ======================================================================== -test( +it.instance( "init connects available servers even when one fails", - withInstance( - { - "good-server": { - type: "local", - command: ["echo", "good"], - }, - "bad-server": { - type: "local", - command: ["echo", "bad"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { // Set up good server const goodState = getOrCreateClientState("good-server") @@ -443,77 +417,88 @@ test( const tools = yield* mcp.tools() expect(Object.keys(tools).some((k) => k.includes("good_tool"))).toBe(true) }), - ), + ), + { + config: { + mcp: { + "good-server": { + type: "local", + command: ["echo", "good"], + }, + "bad-server": { + type: "local", + command: ["echo", "bad"], + }, + }, + }, + }, ) -test( +it.instance( "falls back when MCP output schema refs fail SDK tool discovery", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "stitch-like-server" - const serverState = getOrCreateClientState("stitch-like-server") - serverState.listToolsShouldFail = true - serverState.listToolsError = "can't resolve reference #/$defs/ScreenInstance from id #" - serverState.tools = [ - { - name: "render_screen", - description: "renders a screen", - inputSchema: { type: "object", properties: { prompt: { type: "string" } }, required: ["prompt"] }, - outputSchema: { type: "object", properties: { screen: { $ref: "#/$defs/ScreenInstance" } } }, - }, - ] + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "stitch-like-server" + const serverState = getOrCreateClientState("stitch-like-server") + serverState.listToolsShouldFail = true + serverState.listToolsError = "can't resolve reference #/$defs/ScreenInstance from id #" + serverState.tools = [ + { + name: "render_screen", + description: "renders a screen", + inputSchema: { type: "object", properties: { prompt: { type: "string" } }, required: ["prompt"] }, + outputSchema: { type: "object", properties: { screen: { $ref: "#/$defs/ScreenInstance" } } }, + }, + ] - const addResult = yield* mcp.add("stitch-like-server", { - type: "local", - command: ["echo", "test"], - }) + const addResult = yield* mcp.add("stitch-like-server", { + type: "local", + command: ["echo", "test"], + }) - expect(statusName(addResult.status, "stitch-like-server")).toBe("connected") + expect(statusName(addResult.status, "stitch-like-server")).toBe("connected") - const tools = yield* mcp.tools() - expect(Object.keys(tools).some((key) => key.includes("render_screen"))).toBe(true) - expect(serverState.listToolsCalls).toBe(1) - expect(serverState.requestCalls).toBe(1) - }), - ), + const tools = yield* mcp.tools() + expect(Object.keys(tools).some((key) => key.includes("render_screen"))).toBe(true) + expect(serverState.listToolsCalls).toBe(1) + expect(serverState.requestCalls).toBe(1) + }), + ), + { config: { mcp: {} } }, ) -test( +it.instance( "does not fall back for non-schema MCP tool discovery errors", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "broken-server" - const serverState = getOrCreateClientState("broken-server") - serverState.listToolsShouldFail = true - serverState.listToolsError = "transport closed" - - const addResult = yield* mcp.add("broken-server", { - type: "local", - command: ["echo", "test"], - }) - - expect(statusName(addResult.status, "broken-server")).toBe("failed") - expect(serverState.listToolsCalls).toBe(1) - expect(serverState.requestCalls).toBe(0) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "broken-server" + const serverState = getOrCreateClientState("broken-server") + serverState.listToolsShouldFail = true + serverState.listToolsError = "transport closed" + + const addResult = yield* mcp.add("broken-server", { + type: "local", + command: ["echo", "test"], + }) + + expect(statusName(addResult.status, "broken-server")).toBe("failed") + expect(serverState.listToolsCalls).toBe(1) + expect(serverState.requestCalls).toBe(0) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: disabled server via config // ======================================================================== -test( +it.instance( "disabled server is marked as disabled without attempting connection", - withInstance( - { - "disabled-server": { - type: "local", - command: ["echo", "test"], - enabled: false, - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { const countBefore = clientCreateCount @@ -529,23 +514,28 @@ test( const status = yield* mcp.status() expect(status["disabled-server"]?.status).toBe("disabled") }), - ), + ), + { + config: { + mcp: { + "disabled-server": { + type: "local", + command: ["echo", "test"], + enabled: false, + }, + }, + }, + }, ) // ======================================================================== // Test: prompts() and resources() // ======================================================================== -test( +it.instance( "prompts() returns prompts from connected servers", - withInstance( - { - "prompt-server": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "prompt-server" const serverState = getOrCreateClientState("prompt-server") @@ -562,19 +552,23 @@ test( expect(key).toContain("prompt-server") expect(key).toContain("my-prompt") }), - ), + ), + { + config: { + mcp: { + "prompt-server": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) -test( +it.instance( "resources() returns resources from connected servers", - withInstance( - { - "resource-server": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "resource-server" const serverState = getOrCreateClientState("resource-server") @@ -591,19 +585,23 @@ test( expect(key).toContain("resource-server") expect(key).toContain("my-resource") }), - ), + ), + { + config: { + mcp: { + "resource-server": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) -test( +it.instance( "prompts() skips disconnected servers", - withInstance( - { - "prompt-disc-server": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "prompt-disc-server" const serverState = getOrCreateClientState("prompt-disc-server") @@ -619,67 +617,77 @@ test( const prompts = yield* mcp.prompts() expect(Object.keys(prompts).length).toBe(0) }), - ), + ), + { + config: { + mcp: { + "prompt-disc-server": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) // ======================================================================== // Test: connect() on nonexistent server // ======================================================================== -test( +it.instance( "connect() on nonexistent server does not throw", - withInstance({}, (mcp) => - Effect.gen(function* () { - // Should not throw - yield* mcp.connect("nonexistent") - const status = yield* mcp.status() - expect(status["nonexistent"]).toBeUndefined() - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + // Should not throw + yield* mcp.connect("nonexistent") + const status = yield* mcp.status() + expect(status["nonexistent"]).toBeUndefined() + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: disconnect() on nonexistent server // ======================================================================== -test( +it.instance( "disconnect() on nonexistent server does not throw", - withInstance({}, (mcp) => - Effect.gen(function* () { - yield* mcp.disconnect("nonexistent") - // Should complete without error - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + yield* mcp.disconnect("nonexistent") + // Should complete without error + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: tools() with no MCP servers configured // ======================================================================== -test( +it.instance( "tools() returns empty when no MCP servers are configured", - withInstance({}, (mcp) => - Effect.gen(function* () { - const tools = yield* mcp.tools() - expect(Object.keys(tools).length).toBe(0) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + const tools = yield* mcp.tools() + expect(Object.keys(tools).length).toBe(0) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: connect failure during create() // ======================================================================== -test( +it.instance( "server that fails to connect is marked as failed", - withInstance( - { - "fail-connect": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "fail-connect" getOrCreateClientState("fail-connect") @@ -701,51 +709,55 @@ test( const tools = yield* mcp.tools() expect(Object.keys(tools).length).toBe(0) }), - ), + ), + { + config: { + mcp: { + "fail-connect": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) // ======================================================================== // Bug #5: McpOAuthCallback.cancelPending uses wrong key // ======================================================================== -test("McpOAuthCallback.cancelPending is keyed by mcpName but pendingAuths uses oauthState", async () => { - const { McpOAuthCallback } = await import("../../src/mcp/oauth-callback") - - // Register a pending auth with an oauthState key, associated to an mcpName - const oauthState = "abc123hexstate" - const callbackPromise = McpOAuthCallback.waitForCallback(oauthState, "my-mcp-server") - - // cancelPending is called with mcpName — should find the entry via reverse index - McpOAuthCallback.cancelPending("my-mcp-server") - - // The callback should still be pending because cancelPending looked up - // "my-mcp-server" in a map keyed by "abc123hexstate" - let rejected = false - callbackPromise.then(() => {}).catch(() => (rejected = true)) - - // Give it a tick - await new Promise((r) => setTimeout(r, 50)) - - // cancelPending("my-mcp-server") should have rejected the pending callback - expect(rejected).toBe(true) +it.live("McpOAuthCallback.cancelPending is keyed by mcpName but pendingAuths uses oauthState", () => + Effect.acquireUseRelease( + Effect.sync(() => McpOAuthCallback.waitForCallback("abc123hexstate", "my-mcp-server")), + (callback) => + Effect.gen(function* () { + McpOAuthCallback.cancelPending("my-mcp-server") + + const exit = yield* Effect.tryPromise({ + try: () => callback, + catch: (error) => (error instanceof Error ? error : new Error(String(error))), + }).pipe( + Effect.timeoutOrElse({ + duration: "1 second", + orElse: () => Effect.fail(new Error("timed out waiting for OAuth cancellation")), + }), + Effect.exit, + ) - await McpOAuthCallback.stop() -}) + expect(Exit.isFailure(exit)).toBe(true) + }), + () => Effect.promise(() => McpOAuthCallback.stop()).pipe(Effect.ignore), + ), +) // ======================================================================== // Test: multiple tools from same server get correct name prefixes // ======================================================================== -test( +it.instance( "tools() prefixes tool names with sanitized server name", - withInstance( - { - "my.special-server": { - type: "local", - command: ["echo", "test"], - }, - }, - (mcp) => + () => + MCP.Service.use((mcp: MCPNS.Interface) => Effect.gen(function* () { lastCreatedClientName = "my.special-server" const serverState = getOrCreateClientState("my.special-server") @@ -768,87 +780,103 @@ test( expect(keys.some((k) => k.endsWith("tool_b"))).toBe(true) expect(keys.length).toBe(2) }), - ), + ), + { + config: { + mcp: { + "my.special-server": { + type: "local", + command: ["echo", "test"], + }, + }, + }, + }, ) // ======================================================================== // Test: transport leak — local stdio timeout (#19168) // ======================================================================== -test( +it.instance( "local stdio transport is closed when connect times out (no process leak)", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "hanging-server" - getOrCreateClientState("hanging-server") - connectShouldHang = true - - const addResult = yield* mcp.add("hanging-server", { - type: "local", - command: ["node", "fake.js"], - timeout: 100, - }) - - const serverStatus = (addResult.status as any)["hanging-server"] ?? addResult.status - expect(serverStatus.status).toBe("failed") - expect(serverStatus.error).toContain("timed out") - // Transport must be closed to avoid orphaned child process - expect(transportCloseCount).toBeGreaterThanOrEqual(1) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "hanging-server" + getOrCreateClientState("hanging-server") + connectShouldHang = true + + const addResult = yield* mcp.add("hanging-server", { + type: "local", + command: ["node", "fake.js"], + timeout: 100, + }) + + const serverStatus = (addResult.status as any)["hanging-server"] ?? addResult.status + expect(serverStatus.status).toBe("failed") + expect(serverStatus.error).toContain("timed out") + // Transport must be closed to avoid orphaned child process + expect(transportCloseCount).toBeGreaterThanOrEqual(1) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: transport leak — remote timeout (#19168) // ======================================================================== -test( +it.instance( "remote transport is closed when connect times out", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "hanging-remote" - getOrCreateClientState("hanging-remote") - connectShouldHang = true - - const addResult = yield* mcp.add("hanging-remote", { - type: "remote", - url: "http://localhost:9999/mcp", - timeout: 100, - oauth: false, - }) - - const serverStatus = (addResult.status as any)["hanging-remote"] ?? addResult.status - expect(serverStatus.status).toBe("failed") - // Transport must be closed to avoid leaked HTTP connections - expect(transportCloseCount).toBeGreaterThanOrEqual(1) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "hanging-remote" + getOrCreateClientState("hanging-remote") + connectShouldHang = true + + const addResult = yield* mcp.add("hanging-remote", { + type: "remote", + url: "http://localhost:9999/mcp", + timeout: 100, + oauth: false, + }) + + const serverStatus = (addResult.status as any)["hanging-remote"] ?? addResult.status + expect(serverStatus.status).toBe("failed") + // Transport must be closed to avoid leaked HTTP connections + expect(transportCloseCount).toBeGreaterThanOrEqual(1) + }), + ), + { config: { mcp: {} } }, ) // ======================================================================== // Test: transport leak — failed remote transports not closed (#19168) // ======================================================================== -test( +it.instance( "failed remote transport is closed before trying next transport", - withInstance({}, (mcp) => - Effect.gen(function* () { - lastCreatedClientName = "fail-remote" - getOrCreateClientState("fail-remote") - connectShouldFail = true - connectError = "Connection refused" - - const addResult = yield* mcp.add("fail-remote", { - type: "remote", - url: "http://localhost:9999/mcp", - timeout: 5000, - oauth: false, - }) - - const serverStatus = (addResult.status as any)["fail-remote"] ?? addResult.status - expect(serverStatus.status).toBe("failed") - // Both StreamableHTTP and SSE transports should be closed - expect(transportCloseCount).toBeGreaterThanOrEqual(2) - }), - ), + () => + MCP.Service.use((mcp: MCPNS.Interface) => + Effect.gen(function* () { + lastCreatedClientName = "fail-remote" + getOrCreateClientState("fail-remote") + connectShouldFail = true + connectError = "Connection refused" + + const addResult = yield* mcp.add("fail-remote", { + type: "remote", + url: "http://localhost:9999/mcp", + timeout: 5000, + oauth: false, + }) + + const serverStatus = (addResult.status as any)["fail-remote"] ?? addResult.status + expect(serverStatus.status).toBe("failed") + // Both StreamableHTTP and SSE transports should be closed + expect(transportCloseCount).toBeGreaterThanOrEqual(2) + }), + ), + { config: { mcp: {} } }, ) diff --git a/packages/opencode/test/mcp/oauth-auto-connect.test.ts b/packages/opencode/test/mcp/oauth-auto-connect.test.ts index 3cf67742156d..6fb15c45947a 100644 --- a/packages/opencode/test/mcp/oauth-auto-connect.test.ts +++ b/packages/opencode/test/mcp/oauth-auto-connect.test.ts @@ -1,5 +1,6 @@ -import { test, expect, mock, beforeEach } from "bun:test" -import { Effect } from "effect" +import { expect, mock, beforeEach } from "bun:test" +import { Effect, Layer } from "effect" +import { testEffect } from "../lib/effect" // Mock UnauthorizedError to match the SDK's class class MockUnauthorizedError extends Error { @@ -111,172 +112,125 @@ beforeEach(() => { // Import modules after mocking const { MCP } = await import("../../src/mcp/index") -const { Instance } = await import("../../src/project/instance") -const { WithInstance } = await import("../../src/project/with-instance") -const { tmpdir } = await import("../fixture/fixture") - -test("first connect to OAuth server shows needs_auth instead of failed", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: { - "test-oauth": { - type: "remote", - url: "https://example.com/mcp", - }, - }, - }), - ) - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const result = await Effect.runPromise( - MCP.Service.use((mcp) => - mcp.add("test-oauth", { - type: "remote", - url: "https://example.com/mcp", - }), - ).pipe(Effect.provide(MCP.defaultLayer)), - ) - - const serverStatus = result.status as Record - - // The server should be detected as needing auth, NOT as failed. - // Before the fix, provider.state() would throw a plain Error - // ("No OAuth state saved for MCP server: test-oauth") which was - // not caught as UnauthorizedError, causing status to be "failed". - expect(serverStatus["test-oauth"]).toBeDefined() - expect(serverStatus["test-oauth"].status).toBe("needs_auth") - }, - }) -}) - -test("state() generates a new state when none is saved", async () => { - const { McpOAuthProvider } = await import("../../src/mcp/oauth-provider") - const { McpAuth } = await import("../../src/mcp/auth") - - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const auth = await Effect.runPromise( - Effect.gen(function* () { - return yield* McpAuth.Service - }).pipe(Effect.provide(McpAuth.defaultLayer)), - ) - const provider = new McpOAuthProvider( - "test-state-gen", - "https://example.com/mcp", - {}, - { onRedirect: async () => {} }, - auth, - ) - - const entryBefore = await Effect.runPromise( - McpAuth.Service.use((auth) => auth.get("test-state-gen")).pipe(Effect.provide(McpAuth.defaultLayer)), - ) - expect(entryBefore?.oauthState).toBeUndefined() - - // state() should generate and return a new state, not throw - const state = await provider.state() - expect(typeof state).toBe("string") - expect(state.length).toBe(64) // 32 bytes as hex - - // The generated state should be persisted - const entryAfter = await Effect.runPromise( - McpAuth.Service.use((auth) => auth.get("test-state-gen")).pipe(Effect.provide(McpAuth.defaultLayer)), - ) - expect(entryAfter?.oauthState).toBe(state) - }, - }) -}) - -test("state() returns existing state when one is saved", async () => { - const { McpOAuthProvider } = await import("../../src/mcp/oauth-provider") - const { McpAuth } = await import("../../src/mcp/auth") - - await using tmp = await tmpdir() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const auth = await Effect.runPromise( - Effect.gen(function* () { - return yield* McpAuth.Service - }).pipe(Effect.provide(McpAuth.defaultLayer)), - ) - const provider = new McpOAuthProvider( - "test-state-existing", - "https://example.com/mcp", - {}, - { onRedirect: async () => {} }, - auth, - ) - - // Pre-save a state - const existingState = "pre-saved-state-value" - await Effect.runPromise( - McpAuth.Service.use((auth) => auth.updateOAuthState("test-state-existing", existingState)).pipe( - Effect.provide(McpAuth.defaultLayer), - ), - ) - - // state() should return the existing state - const state = await provider.state() - expect(state).toBe(existingState) +const { Bus } = await import("../../src/bus") +const { Config } = await import("../../src/config/config") +const { McpAuth } = await import("../../src/mcp/auth") +const { McpOAuthProvider } = await import("../../src/mcp/oauth-provider") +const { AppFileSystem } = await import("@opencode-ai/core/filesystem") +const { CrossSpawnSpawner } = await import("@opencode-ai/core/cross-spawn-spawner") + +const mcpTest = testEffect( + Layer.mergeAll( + MCP.layer.pipe( + Layer.provide(McpAuth.defaultLayer), + Layer.provideMerge(Bus.layer), + Layer.provide(Config.defaultLayer), + Layer.provide(CrossSpawnSpawner.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + ), + McpAuth.defaultLayer, + ), +) + +const config = (name: string) => ({ + mcp: { + [name]: { + type: "remote" as const, + url: "https://example.com/mcp", }, - }) + }, }) -test("authenticate() stores a connected client when auth completes without redirect", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: { - "test-oauth-connect": { - type: "remote", - url: "https://example.com/mcp", - }, - }, - }), - ) - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await Effect.runPromise( - MCP.Service.use((mcp) => - Effect.gen(function* () { - const added = yield* mcp.add("test-oauth-connect", { - type: "remote", - url: "https://example.com/mcp", - }) - const before = added.status as Record - expect(before["test-oauth-connect"]?.status).toBe("needs_auth") - - simulateAuthFlow = false - connectSucceedsImmediately = true - - const result = yield* mcp.authenticate("test-oauth-connect") - expect(result.status).toBe("connected") - - const after = yield* mcp.status() - expect(after["test-oauth-connect"]?.status).toBe("connected") - }), - ).pipe(Effect.provide(MCP.defaultLayer)), - ) - }, - }) -}) +mcpTest.instance( + "first connect to OAuth server shows needs_auth instead of failed", + () => + MCP.Service.use((mcp) => + Effect.gen(function* () { + const result = yield* mcp.add("test-oauth", { + type: "remote", + url: "https://example.com/mcp", + }) + + const serverStatus = result.status as Record + + // The server should be detected as needing auth, NOT as failed. + // Before the fix, provider.state() would throw a plain Error + // ("No OAuth state saved for MCP server: test-oauth") which was + // not caught as UnauthorizedError, causing status to be "failed". + expect(serverStatus["test-oauth"]).toBeDefined() + expect(serverStatus["test-oauth"].status).toBe("needs_auth") + }), + ), + { config: config("test-oauth") }, +) + +mcpTest.instance("state() generates a new state when none is saved", () => + Effect.gen(function* () { + const auth = yield* McpAuth.Service + const provider = new McpOAuthProvider( + "test-state-gen", + "https://example.com/mcp", + {}, + { onRedirect: async () => {} }, + auth, + ) + + const entryBefore = yield* McpAuth.Service.use((auth) => auth.get("test-state-gen")) + expect(entryBefore?.oauthState).toBeUndefined() + + // state() should generate and return a new state, not throw + const state = yield* Effect.promise(() => provider.state()) + expect(typeof state).toBe("string") + expect(state.length).toBe(64) // 32 bytes as hex + + // The generated state should be persisted + const entryAfter = yield* McpAuth.Service.use((auth) => auth.get("test-state-gen")) + expect(entryAfter?.oauthState).toBe(state) + }), +) + +mcpTest.instance("state() returns existing state when one is saved", () => + Effect.gen(function* () { + const auth = yield* McpAuth.Service + const provider = new McpOAuthProvider( + "test-state-existing", + "https://example.com/mcp", + {}, + { onRedirect: async () => {} }, + auth, + ) + + // Pre-save a state + const existingState = "pre-saved-state-value" + yield* McpAuth.Service.use((auth) => auth.updateOAuthState("test-state-existing", existingState)) + + // state() should return the existing state + const state = yield* Effect.promise(() => provider.state()) + expect(state).toBe(existingState) + }), +) + +mcpTest.instance( + "authenticate() stores a connected client when auth completes without redirect", + () => + MCP.Service.use((mcp) => + Effect.gen(function* () { + const added = yield* mcp.add("test-oauth-connect", { + type: "remote", + url: "https://example.com/mcp", + }) + const before = added.status as Record + expect(before["test-oauth-connect"]?.status).toBe("needs_auth") + + simulateAuthFlow = false + connectSucceedsImmediately = true + + const result = yield* mcp.authenticate("test-oauth-connect") + expect(result.status).toBe("connected") + + const after = yield* mcp.status() + expect(after["test-oauth-connect"]?.status).toBe("connected") + }), + ), + { config: config("test-oauth-connect") }, +) diff --git a/packages/opencode/test/mcp/oauth-browser.test.ts b/packages/opencode/test/mcp/oauth-browser.test.ts index 20cb90a18e0a..16d6a2d46720 100644 --- a/packages/opencode/test/mcp/oauth-browser.test.ts +++ b/packages/opencode/test/mcp/oauth-browser.test.ts @@ -1,15 +1,18 @@ -import { test, expect, mock, beforeEach } from "bun:test" +import { expect, mock, beforeEach } from "bun:test" import { EventEmitter } from "events" -import { Effect } from "effect" +import { Deferred, Effect, Layer, Option } from "effect" +import { awaitWithTimeout, testEffect } from "../lib/effect" import type { MCP as MCPNS } from "../../src/mcp/index" // Track open() calls and control failure behavior let openShouldFail = false let openCalledWith: string | undefined +let openDeferred: Deferred.Deferred | undefined void mock.module("open", () => ({ default: async (url: string) => { openCalledWith = url + if (openDeferred) Effect.runSync(Deferred.succeed(openDeferred, url).pipe(Effect.ignore)) // Return a mock subprocess that emits an error if openShouldFail is true const subprocess = new EventEmitter() @@ -97,173 +100,127 @@ void mock.module("@modelcontextprotocol/sdk/client/auth.js", () => ({ beforeEach(() => { openShouldFail = false openCalledWith = undefined + openDeferred = undefined transportCalls.length = 0 }) // Import modules after mocking const { MCP } = await import("../../src/mcp/index") -const { AppRuntime } = await import("../../src/effect/app-runtime") const { Bus } = await import("../../src/bus") +const { Config } = await import("../../src/config/config") +const { McpAuth } = await import("../../src/mcp/auth") const { McpOAuthCallback } = await import("../../src/mcp/oauth-callback") -const { Instance } = await import("../../src/project/instance") -const { WithInstance } = await import("../../src/project/with-instance") -const { tmpdir } = await import("../fixture/fixture") +const { AppFileSystem } = await import("@opencode-ai/core/filesystem") +const { CrossSpawnSpawner } = await import("@opencode-ai/core/cross-spawn-spawner") +const mcpTest = testEffect( + MCP.layer.pipe( + Layer.provide(McpAuth.defaultLayer), + Layer.provideMerge(Bus.layer), + Layer.provide(Config.defaultLayer), + Layer.provide(CrossSpawnSpawner.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + ), +) const service = MCP.Service as unknown as Effect.Effect -test("BrowserOpenFailed event is published when open() throws", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: { - "test-oauth-server": { - type: "remote", - url: "https://example.com/mcp", - }, - }, - }), - ) +const config = (name: string) => ({ + mcp: { + [name]: { + type: "remote" as const, + url: "https://example.com/mcp", }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - openShouldFail = true - - const events: Array<{ mcpName: string; url: string }> = [] - const unsubscribe = Bus.subscribe(MCP.BrowserOpenFailed, (evt) => { - events.push(evt.properties) - }) - - // Run authenticate with a timeout to avoid waiting forever for the callback - // Attach a handler immediately so callback shutdown rejections - // don't show up as unhandled between tests. - const authPromise = AppRuntime.runPromise( - Effect.gen(function* () { - const mcp = yield* service - return yield* mcp.authenticate("test-oauth-server") - }), - ).catch(() => undefined) - - // Config.get() can be slow in tests, so give it plenty of time. - await new Promise((resolve) => setTimeout(resolve, 2_000)) - - // Stop the callback server and cancel any pending auth - await McpOAuthCallback.stop() + }, +}) - await authPromise +const withCallbackStop = Effect.addFinalizer(() => Effect.promise(() => McpOAuthCallback.stop()).pipe(Effect.ignore)) - unsubscribe() +const trackBrowserOpen = Effect.gen(function* () { + const opened = yield* Deferred.make() + openDeferred = opened + yield* Effect.addFinalizer(() => Effect.sync(() => (openDeferred = undefined))) + return opened +}) - // Verify the BrowserOpenFailed event was published - expect(events.length).toBe(1) - expect(events[0].mcpName).toBe("test-oauth-server") - expect(events[0].url).toContain("https://") - }, +const trackBrowserOpenFailed = Effect.gen(function* () { + const bus = yield* Bus.Service + const event = yield* Deferred.make<{ mcpName: string; url: string }>() + const unsubscribe = yield* bus.subscribeCallback(MCP.BrowserOpenFailed, (evt) => { + Effect.runSync(Deferred.succeed(event, evt.properties).pipe(Effect.ignore)) }) + yield* Effect.addFinalizer(() => Effect.sync(unsubscribe)) + return event }) -test("BrowserOpenFailed event is NOT published when open() succeeds", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: { - "test-oauth-server-2": { - type: "remote", - url: "https://example.com/mcp", - }, - }, - }), - ) - }, +const authenticateScoped = (name: string) => + Effect.gen(function* () { + const mcp = yield* service + yield* mcp.authenticate(name).pipe( + Effect.ignore, + Effect.catchCause(() => Effect.void), + Effect.forkScoped, + ) }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - openShouldFail = false - - const events: Array<{ mcpName: string; url: string }> = [] - const unsubscribe = Bus.subscribe(MCP.BrowserOpenFailed, (evt) => { - events.push(evt.properties) - }) +mcpTest.instance( + "BrowserOpenFailed event is published when open() throws", + () => + Effect.gen(function* () { + yield* withCallbackStop + openShouldFail = true - // Run authenticate with a timeout to avoid waiting forever for the callback - const authPromise = AppRuntime.runPromise( - Effect.gen(function* () { - const mcp = yield* service - return yield* mcp.authenticate("test-oauth-server-2") - }), - ).catch(() => undefined) + const event = yield* trackBrowserOpenFailed + yield* authenticateScoped("test-oauth-server") - // Config.get() can be slow in tests; also covers the ~500ms open() error-detection window. - await new Promise((resolve) => setTimeout(resolve, 2_000)) + const failure = yield* awaitWithTimeout( + Deferred.await(event), + "Timed out waiting for BrowserOpenFailed event", + "5 seconds", + ) - // Stop the callback server and cancel any pending auth - await McpOAuthCallback.stop() + expect(failure.mcpName).toBe("test-oauth-server") + expect(failure.url).toContain("https://") + }), + { config: config("test-oauth-server") }, +) + +mcpTest.instance( + "BrowserOpenFailed event is NOT published when open() succeeds", + () => + Effect.gen(function* () { + yield* withCallbackStop + openShouldFail = false - await authPromise + const opened = yield* trackBrowserOpen + const event = yield* trackBrowserOpenFailed + yield* authenticateScoped("test-oauth-server-2") - unsubscribe() + yield* awaitWithTimeout(Deferred.await(opened), "Timed out waiting for open()", "5 seconds") + const failure = yield* Deferred.await(event).pipe(Effect.timeoutOption("700 millis")) - // Verify NO BrowserOpenFailed event was published - expect(events.length).toBe(0) - // Verify open() was still called + expect(failure).toEqual(Option.none()) expect(openCalledWith).toBeDefined() - }, - }) -}) - -test("open() is called with the authorization URL", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - `${dir}/opencode.json`, - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - mcp: { - "test-oauth-server-3": { - type: "remote", - url: "https://example.com/mcp", - }, - }, - }), - ) - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { + }), + { config: config("test-oauth-server-2") }, +) + +mcpTest.instance( + "open() is called with the authorization URL", + () => + Effect.gen(function* () { + yield* withCallbackStop openShouldFail = false openCalledWith = undefined - // Run authenticate with a timeout to avoid waiting forever for the callback - const authPromise = AppRuntime.runPromise( - Effect.gen(function* () { - const mcp = yield* service - return yield* mcp.authenticate("test-oauth-server-3") - }), - ).catch(() => undefined) - - // Config.get() can be slow in tests; also covers the ~500ms open() error-detection window. - await new Promise((resolve) => setTimeout(resolve, 2_000)) - - // Stop the callback server and cancel any pending auth - await McpOAuthCallback.stop() + const opened = yield* trackBrowserOpen + const event = yield* trackBrowserOpenFailed + yield* authenticateScoped("test-oauth-server-3") - await authPromise + const url = yield* awaitWithTimeout(Deferred.await(opened), "Timed out waiting for open()", "5 seconds") + const failure = yield* Deferred.await(event).pipe(Effect.timeoutOption("700 millis")) - // Verify open was called with a URL - expect(openCalledWith).toBeDefined() - expect(typeof openCalledWith).toBe("string") - expect(openCalledWith!).toContain("https://") - }, - }) -}) + expect(failure).toEqual(Option.none()) + expect(typeof url).toBe("string") + expect(url).toContain("https://") + }), + { config: config("test-oauth-server-3") }, +) diff --git a/packages/opencode/test/memory/abort-leak-webfetch.ts b/packages/opencode/test/memory/abort-leak-webfetch.ts deleted file mode 100644 index c3197f8dd55d..000000000000 --- a/packages/opencode/test/memory/abort-leak-webfetch.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { abortAfterAny } from "../../src/util/abort" - -const MB = 1024 * 1024 -const ITERATIONS = 50 - -const heap = () => { - Bun.gc(true) - return process.memoryUsage().heapUsed / MB -} - -const server = Bun.serve({ - port: 0, - fetch() { - return new Response("hello from local", { - headers: { - "content-type": "text/plain", - }, - }) - }, -}) - -const url = `http://127.0.0.1:${server.port}` - -async function run() { - const { signal, clearTimeout } = abortAfterAny(30000, new AbortController().signal) - try { - const response = await fetch(url, { signal }) - await response.text() - } finally { - clearTimeout() - } -} - -try { - await run() - Bun.sleepSync(100) - const baseline = heap() - - for (let i = 0; i < ITERATIONS; i++) { - await run() - } - - Bun.sleepSync(100) - const after = heap() - process.stdout.write(JSON.stringify({ baseline, after, growth: after - baseline })) -} finally { - void server.stop(true) - process.exit(0) -} diff --git a/packages/opencode/test/memory/abort-leak.test.ts b/packages/opencode/test/memory/abort-leak.test.ts deleted file mode 100644 index d30ad45e46a9..000000000000 --- a/packages/opencode/test/memory/abort-leak.test.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { describe, test, expect } from "bun:test" -import path from "path" - -const projectRoot = path.join(import.meta.dir, "../..") -const worker = path.join(import.meta.dir, "abort-leak-webfetch.ts") - -const MB = 1024 * 1024 -const ITERATIONS = 50 - -const getHeapMB = () => { - Bun.gc(true) - return process.memoryUsage().heapUsed / MB -} - -describe("memory: abort controller leak", () => { - test("webfetch does not leak memory over many invocations", async () => { - // Measure the abort-timed fetch path in a fresh process so shared tool - // runtime state does not dominate the heap signal. - const proc = Bun.spawn({ - cmd: [process.execPath, worker], - cwd: projectRoot, - stdout: "pipe", - stderr: "pipe", - env: process.env, - }) - - const [code, stdout, stderr] = await Promise.all([ - proc.exited, - new Response(proc.stdout).text(), - new Response(proc.stderr).text(), - ]) - - if (code !== 0) { - throw new Error(stderr.trim() || stdout.trim() || `worker exited with code ${code}`) - } - - const result = JSON.parse(stdout.trim()) as { - baseline: number - after: number - growth: number - } - - console.log(`Baseline: ${result.baseline.toFixed(2)} MB`) - console.log(`After ${ITERATIONS} fetches: ${result.after.toFixed(2)} MB`) - console.log(`Growth: ${result.growth.toFixed(2)} MB`) - - // Memory growth should be minimal - less than 1MB per 10 requests. - expect(result.growth).toBeLessThan(ITERATIONS / 10) - }, 60000) - - test("compare closure vs bind pattern directly", async () => { - const ITERATIONS = 500 - - // Test OLD pattern: arrow function closure - // Store closures in a map keyed by content to force retention - const closureMap = new Map void>() - const timers: Timer[] = [] - const controllers: AbortController[] = [] - - Bun.gc(true) - Bun.sleepSync(100) - const baseline = getHeapMB() - - for (let i = 0; i < ITERATIONS; i++) { - // Simulate large response body like webfetch would have - const content = `${i}:${"x".repeat(50 * 1024)}` // 50KB unique per iteration - const controller = new AbortController() - controllers.push(controller) - - // OLD pattern - closure captures `content` - const handler = () => { - // Actually use content so it can't be optimized away - if (content.length > 1000000000) controller.abort() - } - closureMap.set(content, handler) - const timeoutId = setTimeout(handler, 30000) - timers.push(timeoutId) - } - - Bun.gc(true) - Bun.sleepSync(100) - const after = getHeapMB() - const oldGrowth = after - baseline - - console.log(`OLD pattern (closure): ${oldGrowth.toFixed(2)} MB growth (${closureMap.size} closures)`) - - // Cleanup after measuring - timers.forEach(clearTimeout) - controllers.forEach((c) => c.abort()) - closureMap.clear() - - // Test NEW pattern: bind - Bun.gc(true) - Bun.sleepSync(100) - const baseline2 = getHeapMB() - const handlers2: (() => void)[] = [] - const timers2: Timer[] = [] - const controllers2: AbortController[] = [] - - for (let i = 0; i < ITERATIONS; i++) { - const _content = `${i}:${"x".repeat(50 * 1024)}` // 50KB - won't be captured - const controller = new AbortController() - controllers2.push(controller) - - // NEW pattern - bind doesn't capture surrounding scope - const handler = controller.abort.bind(controller) - handlers2.push(handler) - const timeoutId = setTimeout(handler, 30000) - timers2.push(timeoutId) - } - - Bun.gc(true) - Bun.sleepSync(100) - const after2 = getHeapMB() - const newGrowth = after2 - baseline2 - - // Cleanup after measuring - timers2.forEach(clearTimeout) - controllers2.forEach((c) => c.abort()) - handlers2.length = 0 - - console.log(`NEW pattern (bind): ${newGrowth.toFixed(2)} MB growth`) - console.log(`Improvement: ${(oldGrowth - newGrowth).toFixed(2)} MB saved`) - - expect(newGrowth).toBeLessThanOrEqual(oldGrowth) - }) -}) diff --git a/packages/opencode/test/patch/patch.test.ts b/packages/opencode/test/patch/patch.test.ts index 020253bfe2d1..e4952b9e0039 100644 --- a/packages/opencode/test/patch/patch.test.ts +++ b/packages/opencode/test/patch/patch.test.ts @@ -1,8 +1,13 @@ import { describe, test, expect, beforeEach, afterEach } from "bun:test" -import { Patch } from "../../src/patch" +import { Effect } from "effect" import * as fs from "fs/promises" import * as path from "path" import { tmpdir } from "os" +import { Patch } from "../../src/patch" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { testEffect } from "../lib/effect" + +const it = testEffect(AppFileSystem.defaultLayer) describe("Patch namespace", () => { let tempDir: string @@ -134,46 +139,53 @@ PATCH` }) describe("applyPatch", () => { - test("should add a new file", async () => { - const patchText = `*** Begin Patch + it.live("should add a new file", () => + Effect.gen(function* () { + const patchText = `*** Begin Patch *** Add File: ${tempDir}/new-file.txt +Hello World +This is a new file *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.added).toHaveLength(1) - expect(result.modified).toHaveLength(0) - expect(result.deleted).toHaveLength(0) + const result = yield* Patch.applyPatch(patchText) + expect(result.added).toHaveLength(1) + expect(result.modified).toHaveLength(0) + expect(result.deleted).toHaveLength(0) - const content = await fs.readFile(result.added[0], "utf-8") - expect(content).toBe("Hello World\nThis is a new file") - }) + const content = yield* Effect.promise(() => fs.readFile(result.added[0], "utf-8")) + expect(content).toBe("Hello World\nThis is a new file") + }), + ) - test("should delete an existing file", async () => { - const filePath = path.join(tempDir, "to-delete.txt") - await fs.writeFile(filePath, "This file will be deleted") + it.live("should delete an existing file", () => + Effect.gen(function* () { + const filePath = path.join(tempDir, "to-delete.txt") + yield* Effect.promise(() => fs.writeFile(filePath, "This file will be deleted")) - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Delete File: ${filePath} *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.deleted).toHaveLength(1) - expect(result.deleted[0]).toBe(filePath) - - const exists = await fs - .access(filePath) - .then(() => true) - .catch(() => false) - expect(exists).toBe(false) - }) - - test("should update an existing file", async () => { - const filePath = path.join(tempDir, "to-update.txt") - await fs.writeFile(filePath, "line 1\nline 2\nline 3\n") - - const patchText = `*** Begin Patch + const result = yield* Patch.applyPatch(patchText) + expect(result.deleted).toHaveLength(1) + expect(result.deleted[0]).toBe(filePath) + + const exists = yield* Effect.promise(() => + fs + .access(filePath) + .then(() => true) + .catch(() => false), + ) + expect(exists).toBe(false) + }), + ) + + it.live("should update an existing file", () => + Effect.gen(function* () { + const filePath = path.join(tempDir, "to-update.txt") + yield* Effect.promise(() => fs.writeFile(filePath, "line 1\nline 2\nline 3\n")) + + const patchText = `*** Begin Patch *** Update File: ${filePath} @@ line 1 @@ -182,20 +194,22 @@ PATCH` line 3 *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.modified).toHaveLength(1) - expect(result.modified[0]).toBe(filePath) + const result = yield* Patch.applyPatch(patchText) + expect(result.modified).toHaveLength(1) + expect(result.modified[0]).toBe(filePath) - const content = await fs.readFile(filePath, "utf-8") - expect(content).toBe("line 1\nline 2 updated\nline 3\n") - }) + const content = yield* Effect.promise(() => fs.readFile(filePath, "utf-8")) + expect(content).toBe("line 1\nline 2 updated\nline 3\n") + }), + ) - test("should move and update a file", async () => { - const oldPath = path.join(tempDir, "old-name.txt") - const newPath = path.join(tempDir, "new-name.txt") - await fs.writeFile(oldPath, "old content\n") + it.live("should move and update a file", () => + Effect.gen(function* () { + const oldPath = path.join(tempDir, "old-name.txt") + const newPath = path.join(tempDir, "new-name.txt") + yield* Effect.promise(() => fs.writeFile(oldPath, "old content\n")) - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Update File: ${oldPath} *** Move to: ${newPath} @@ @@ -203,29 +217,33 @@ PATCH` +new content *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.modified).toHaveLength(1) - expect(result.modified[0]).toBe(newPath) - - const oldExists = await fs - .access(oldPath) - .then(() => true) - .catch(() => false) - expect(oldExists).toBe(false) - - const newContent = await fs.readFile(newPath, "utf-8") - expect(newContent).toBe("new content\n") - }) - - test("should handle multiple operations in one patch", async () => { - const file1 = path.join(tempDir, "file1.txt") - const file2 = path.join(tempDir, "file2.txt") - const file3 = path.join(tempDir, "file3.txt") - - await fs.writeFile(file1, "content 1") - await fs.writeFile(file2, "content 2") - - const patchText = `*** Begin Patch + const result = yield* Patch.applyPatch(patchText) + expect(result.modified).toHaveLength(1) + expect(result.modified[0]).toBe(newPath) + + const oldExists = yield* Effect.promise(() => + fs + .access(oldPath) + .then(() => true) + .catch(() => false), + ) + expect(oldExists).toBe(false) + + const newContent = yield* Effect.promise(() => fs.readFile(newPath, "utf-8")) + expect(newContent).toBe("new content\n") + }), + ) + + it.live("should handle multiple operations in one patch", () => + Effect.gen(function* () { + const file1 = path.join(tempDir, "file1.txt") + const file2 = path.join(tempDir, "file2.txt") + const file3 = path.join(tempDir, "file3.txt") + + yield* Effect.promise(() => fs.writeFile(file1, "content 1")) + yield* Effect.promise(() => fs.writeFile(file2, "content 2")) + + const patchText = `*** Begin Patch *** Add File: ${file3} +new file content *** Update File: ${file1} @@ -235,98 +253,114 @@ PATCH` *** Delete File: ${file2} *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.added).toHaveLength(1) - expect(result.modified).toHaveLength(1) - expect(result.deleted).toHaveLength(1) - }) + const result = yield* Patch.applyPatch(patchText) + expect(result.added).toHaveLength(1) + expect(result.modified).toHaveLength(1) + expect(result.deleted).toHaveLength(1) + }), + ) - test("should create parent directories when adding files", async () => { - const nestedPath = path.join(tempDir, "deep", "nested", "file.txt") + it.live("should create parent directories when adding files", () => + Effect.gen(function* () { + const nestedPath = path.join(tempDir, "deep", "nested", "file.txt") - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Add File: ${nestedPath} +Deep nested content *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.added).toHaveLength(1) - expect(result.added[0]).toBe(nestedPath) - - const exists = await fs - .access(nestedPath) - .then(() => true) - .catch(() => false) - expect(exists).toBe(true) - }) + const result = yield* Patch.applyPatch(patchText) + expect(result.added).toHaveLength(1) + expect(result.added[0]).toBe(nestedPath) + + const exists = yield* Effect.promise(() => + fs + .access(nestedPath) + .then(() => true) + .catch(() => false), + ) + expect(exists).toBe(true) + }), + ) }) describe("error handling", () => { - test("should throw error when updating non-existent file", async () => { - const nonExistent = path.join(tempDir, "does-not-exist.txt") + it.live("should fail when updating non-existent file", () => + Effect.gen(function* () { + const nonExistent = path.join(tempDir, "does-not-exist.txt") - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Update File: ${nonExistent} @@ -old line +new line *** End Patch` - await expect(Patch.applyPatch(patchText)).rejects.toThrow() - }) + const exit = yield* Effect.exit(Patch.applyPatch(patchText)) + expect(exit._tag).toBe("Failure") + }), + ) - test("should throw error when deleting non-existent file", async () => { - const nonExistent = path.join(tempDir, "does-not-exist.txt") + it.live("should fail when deleting non-existent file", () => + Effect.gen(function* () { + const nonExistent = path.join(tempDir, "does-not-exist.txt") - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Delete File: ${nonExistent} *** End Patch` - await expect(Patch.applyPatch(patchText)).rejects.toThrow() - }) + const exit = yield* Effect.exit(Patch.applyPatch(patchText)) + expect(exit._tag).toBe("Failure") + }), + ) }) describe("edge cases", () => { - test("should handle empty files", async () => { - const emptyFile = path.join(tempDir, "empty.txt") - await fs.writeFile(emptyFile, "") + it.live("should handle empty files", () => + Effect.gen(function* () { + const emptyFile = path.join(tempDir, "empty.txt") + yield* Effect.promise(() => fs.writeFile(emptyFile, "")) - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Update File: ${emptyFile} @@ +First line *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.modified).toHaveLength(1) + const result = yield* Patch.applyPatch(patchText) + expect(result.modified).toHaveLength(1) - const content = await fs.readFile(emptyFile, "utf-8") - expect(content).toBe("First line\n") - }) + const content = yield* Effect.promise(() => fs.readFile(emptyFile, "utf-8")) + expect(content).toBe("First line\n") + }), + ) - test("should handle files with no trailing newline", async () => { - const filePath = path.join(tempDir, "no-newline.txt") - await fs.writeFile(filePath, "no newline") + it.live("should handle files with no trailing newline", () => + Effect.gen(function* () { + const filePath = path.join(tempDir, "no-newline.txt") + yield* Effect.promise(() => fs.writeFile(filePath, "no newline")) - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Update File: ${filePath} @@ -no newline +has newline now *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.modified).toHaveLength(1) + const result = yield* Patch.applyPatch(patchText) + expect(result.modified).toHaveLength(1) - const content = await fs.readFile(filePath, "utf-8") - expect(content).toBe("has newline now\n") - }) + const content = yield* Effect.promise(() => fs.readFile(filePath, "utf-8")) + expect(content).toBe("has newline now\n") + }), + ) - test("should handle multiple update chunks in single file", async () => { - const filePath = path.join(tempDir, "multi-chunk.txt") - await fs.writeFile(filePath, "line 1\nline 2\nline 3\nline 4\n") + it.live("should handle multiple update chunks in single file", () => + Effect.gen(function* () { + const filePath = path.join(tempDir, "multi-chunk.txt") + yield* Effect.promise(() => fs.writeFile(filePath, "line 1\nline 2\nline 3\nline 4\n")) - const patchText = `*** Begin Patch + const patchText = `*** Begin Patch *** Update File: ${filePath} @@ line 1 @@ -338,11 +372,12 @@ PATCH` +LINE 4 *** End Patch` - const result = await Patch.applyPatch(patchText) - expect(result.modified).toHaveLength(1) + const result = yield* Patch.applyPatch(patchText) + expect(result.modified).toHaveLength(1) - const content = await fs.readFile(filePath, "utf-8") - expect(content).toBe("line 1\nLINE 2\nline 3\nLINE 4\n") - }) + const content = yield* Effect.promise(() => fs.readFile(filePath, "utf-8")) + expect(content).toBe("line 1\nLINE 2\nline 3\nLINE 4\n") + }), + ) }) }) diff --git a/packages/opencode/test/permission-task.test.ts b/packages/opencode/test/permission-task.test.ts index 64b93bb8bcb9..f2084b095d3f 100644 --- a/packages/opencode/test/permission-task.test.ts +++ b/packages/opencode/test/permission-task.test.ts @@ -1,16 +1,12 @@ -import { afterEach, describe, test, expect } from "bun:test" +import { describe, test, expect } from "bun:test" +import { Effect } from "effect" import { Permission } from "../src/permission" import { Config } from "@/config/config" -import { Instance } from "../src/project/instance" -import { WithInstance } from "../src/project/with-instance" -import { disposeAllInstances, tmpdir } from "./fixture/fixture" -import { AppRuntime } from "../src/effect/app-runtime" +import { testEffect } from "./lib/effect" -const load = () => AppRuntime.runPromise(Config.Service.use((svc) => svc.get())) +const it = testEffect(Config.defaultLayer) -afterEach(async () => { - await disposeAllInstances() -}) +const load = Config.Service.use((svc) => svc.get()) describe("Permission.evaluate for permission.task", () => { const createRuleset = (rules: Record): Permission.Ruleset => @@ -147,99 +143,83 @@ describe("Permission.disabled for task tool", () => { // Integration tests that load permissions from real config files describe("permission.task with real config files", () => { - test("loads task permissions from opencode.json config", async () => { - await using tmp = await tmpdir({ - git: true, - config: { - permission: { - task: { - "*": "allow", - "code-reviewer": "deny", - }, - }, - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const config = await load() + it.instance( + "loads task permissions from opencode.json config", + () => + Effect.gen(function* () { + const config = yield* load const ruleset = Permission.fromConfig(config.permission ?? {}) // general and orchestrator-fast should be allowed, code-reviewer denied expect(Permission.evaluate("task", "general", ruleset).action).toBe("allow") expect(Permission.evaluate("task", "orchestrator-fast", ruleset).action).toBe("allow") expect(Permission.evaluate("task", "code-reviewer", ruleset).action).toBe("deny") - }, - }) - }) - - test("loads task permissions with wildcard patterns from config", async () => { - await using tmp = await tmpdir({ + }), + { git: true, config: { permission: { task: { - "*": "ask", - "orchestrator-*": "deny", + "*": "allow", + "code-reviewer": "deny", }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const config = await load() + }, + ) + + it.instance( + "loads task permissions with wildcard patterns from config", + () => + Effect.gen(function* () { + const config = yield* load const ruleset = Permission.fromConfig(config.permission ?? {}) // general and code-reviewer should be ask, orchestrator-* denied expect(Permission.evaluate("task", "general", ruleset).action).toBe("ask") expect(Permission.evaluate("task", "code-reviewer", ruleset).action).toBe("ask") expect(Permission.evaluate("task", "orchestrator-fast", ruleset).action).toBe("deny") - }, - }) - }) - - test("evaluate respects task permission from config", async () => { - await using tmp = await tmpdir({ + }), + { git: true, config: { permission: { task: { - general: "allow", - "code-reviewer": "deny", + "*": "ask", + "orchestrator-*": "deny", }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const config = await load() + }, + ) + + it.instance( + "evaluate respects task permission from config", + () => + Effect.gen(function* () { + const config = yield* load const ruleset = Permission.fromConfig(config.permission ?? {}) expect(Permission.evaluate("task", "general", ruleset).action).toBe("allow") expect(Permission.evaluate("task", "code-reviewer", ruleset).action).toBe("deny") // Unspecified agents default to "ask" expect(Permission.evaluate("task", "unknown-agent", ruleset).action).toBe("ask") - }, - }) - }) - - test("mixed permission config with task and other tools", async () => { - await using tmp = await tmpdir({ + }), + { git: true, config: { permission: { - bash: "allow", - edit: "ask", task: { - "*": "deny", general: "allow", + "code-reviewer": "deny", }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const config = await load() + }, + ) + + it.instance( + "mixed permission config with task and other tools", + () => + Effect.gen(function* () { + const config = yield* load const ruleset = Permission.fromConfig(config.permission ?? {}) // Verify task permissions @@ -257,27 +237,27 @@ describe("permission.task with real config files", () => { // task is NOT disabled because disabled() uses findLast, and the last rule // matching "task" permission is {pattern: "general", action: "allow"}, not pattern: "*" expect(disabled.has("task")).toBe(false) - }, - }) - }) - - test("task tool disabled when global deny comes last in config", async () => { - await using tmp = await tmpdir({ + }), + { git: true, config: { permission: { + bash: "allow", + edit: "ask", task: { - general: "allow", - "code-reviewer": "allow", "*": "deny", + general: "allow", }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const config = await load() + }, + ) + + it.instance( + "task tool disabled when global deny comes last in config", + () => + Effect.gen(function* () { + const config = yield* load const ruleset = Permission.fromConfig(config.permission ?? {}) // Last matching rule wins - "*" deny is last, so all agents are denied @@ -289,26 +269,26 @@ describe("permission.task with real config files", () => { // and sees pattern: "*" with action: "deny", so task is disabled const disabled = Permission.disabled(["task"], ruleset) expect(disabled.has("task")).toBe(true) - }, - }) - }) - - test("task tool NOT disabled when specific allow comes last in config", async () => { - await using tmp = await tmpdir({ + }), + { git: true, config: { permission: { task: { - "*": "deny", general: "allow", + "code-reviewer": "allow", + "*": "deny", }, }, }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const config = await load() + }, + ) + + it.instance( + "task tool NOT disabled when specific allow comes last in config", + () => + Effect.gen(function* () { + const config = yield* load const ruleset = Permission.fromConfig(config.permission ?? {}) // Evaluate uses findLast - "general" allow comes after "*" deny @@ -321,7 +301,17 @@ describe("permission.task with real config files", () => { // So the task tool is NOT disabled (even though most subagents are denied) const disabled = Permission.disabled(["task"], ruleset) expect(disabled.has("task")).toBe(false) + }), + { + git: true, + config: { + permission: { + task: { + "*": "deny", + general: "allow", + }, + }, }, - }) - }) + }, + ) }) diff --git a/packages/opencode/test/permission/next.test.ts b/packages/opencode/test/permission/next.test.ts index 1c3d6fc563f3..1b09c36afdf3 100644 --- a/packages/opencode/test/permission/next.test.ts +++ b/packages/opencode/test/permission/next.test.ts @@ -1,31 +1,26 @@ -import { afterEach, test, expect } from "bun:test" +import { test, expect } from "bun:test" import os from "os" -import { Cause, Effect, Exit, Fiber, Layer } from "effect" +import { Cause, Deferred, Effect, Exit, Fiber, Layer } from "effect" import { Bus } from "../../src/bus" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { Permission } from "../../src/permission" import { PermissionID } from "../../src/permission/schema" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { InstanceRuntime } from "../../src/project/instance-runtime" -import { - disposeAllInstances, - provideInstance, - provideTmpdirInstance, - reloadTestInstance, - tmpdirScoped, -} from "../fixture/fixture" +import { InstanceBootstrap } from "../../src/project/bootstrap-service" +import { InstanceStore } from "../../src/project/instance-store" +import { TestInstance, tmpdirScoped } from "../fixture/fixture" import { testEffect } from "../lib/effect" import { MessageID, SessionID } from "../../src/session/schema" const bus = Bus.layer -const env = Layer.mergeAll(Permission.layer.pipe(Layer.provide(bus)), bus, CrossSpawnSpawner.defaultLayer) +const noopBootstrap = Layer.succeed(InstanceBootstrap.Service, InstanceBootstrap.Service.of({ run: Effect.void })) +const env = Layer.mergeAll( + Permission.layer.pipe(Layer.provide(bus)), + bus, + CrossSpawnSpawner.defaultLayer, + InstanceStore.defaultLayer.pipe(Layer.provide(noopBootstrap)), +) const it = testEffect(env) -afterEach(async () => { - await disposeAllInstances() -}) - const rejectAll = (message?: string) => Effect.gen(function* () { const permission = yield* Permission.Service @@ -41,12 +36,18 @@ const rejectAll = (message?: string) => const waitForPending = (count: number) => Effect.gen(function* () { const permission = yield* Permission.Service - for (let i = 0; i < 100; i++) { - const list = yield* permission.list() - if (list.length === count) return list - yield* Effect.sleep("10 millis") - } - return yield* Effect.fail(new Error(`timed out waiting for ${count} pending permission request(s)`)) + return yield* Effect.gen(function* () { + while (true) { + const list = yield* permission.list() + if (list.length === count) return list + yield* Effect.sleep("10 millis") + } + }).pipe( + Effect.timeoutOrElse({ + duration: "1 second", + orElse: () => Effect.fail(new Error(`timed out waiting for ${count} pending permission request(s)`)), + }), + ) }) const fail = (self: Effect.Effect) => @@ -74,14 +75,6 @@ const list = () => return yield* permission.list() }) -function withDir(options: { git?: boolean } | undefined, self: (dir: string) => Effect.Effect) { - return provideTmpdirInstance(self, options) -} - -function withProvided(dir: string) { - return (self: Effect.Effect) => self.pipe(provideInstance(dir)) -} - // fromConfig tests test("fromConfig - string value becomes wildcard rule", () => { @@ -563,8 +556,9 @@ test("disabled - specific allow overrides wildcard deny", () => { // ask tests -it.live("ask - resolves immediately when action is allow", () => - withDir({ git: true }, () => +it.instance( + "ask - resolves immediately when action is allow", + () => Effect.gen(function* () { const result = yield* ask({ sessionID: SessionID.make("session_test"), @@ -576,11 +570,12 @@ it.live("ask - resolves immediately when action is allow", () => }) expect(result).toBeUndefined() }), - ), + { git: true }, ) -it.live("ask - throws DeniedError when action is deny", () => - withDir({ git: true }, () => +it.instance( + "ask - throws DeniedError when action is deny", + () => Effect.gen(function* () { const err = yield* fail( ask({ @@ -594,11 +589,12 @@ it.live("ask - throws DeniedError when action is deny", () => ) expect(err).toBeInstanceOf(Permission.DeniedError) }), - ), + { git: true }, ) -it.live("ask - stays pending when action is ask", () => - withDir({ git: true }, () => +it.instance( + "ask - stays pending when action is ask", + () => Effect.gen(function* () { const fiber = yield* ask({ sessionID: SessionID.make("session_test"), @@ -613,11 +609,12 @@ it.live("ask - stays pending when action is ask", () => yield* rejectAll() yield* Fiber.await(fiber) }), - ), + { git: true }, ) -it.live("ask - adds request to pending list", () => - withDir({ git: true }, () => +it.instance( + "ask - adds request to pending list", + () => Effect.gen(function* () { const fiber = yield* ask({ sessionID: SessionID.make("session_test"), @@ -649,53 +646,58 @@ it.live("ask - adds request to pending list", () => yield* rejectAll() yield* Fiber.await(fiber) }), - ), + { git: true }, ) -it.live("ask - publishes asked event", () => - withDir({ git: true }, () => +it.instance( + "ask - publishes asked event", + () => Effect.gen(function* () { const bus = yield* Bus.Service - let seen: Permission.Request | undefined + const seen = yield* Deferred.make() const unsub = yield* bus.subscribeCallback(Permission.Event.Asked, (event) => { - seen = event.properties + Deferred.doneUnsafe(seen, Effect.succeed(event.properties)) }) + yield* Effect.addFinalizer(() => Effect.sync(unsub)) - try { - const fiber = yield* ask({ - sessionID: SessionID.make("session_test"), - permission: "bash", - patterns: ["ls"], - metadata: { cmd: "ls" }, - always: ["ls"], - tool: { - messageID: MessageID.make("msg_test"), - callID: "call_test", - }, - ruleset: [], - }).pipe(Effect.forkScoped) + const fiber = yield* ask({ + sessionID: SessionID.make("session_test"), + permission: "bash", + patterns: ["ls"], + metadata: { cmd: "ls" }, + always: ["ls"], + tool: { + messageID: MessageID.make("msg_test"), + callID: "call_test", + }, + ruleset: [], + }).pipe(Effect.forkScoped) - expect(yield* waitForPending(1)).toHaveLength(1) - expect(seen).toBeDefined() - expect(seen).toMatchObject({ - sessionID: SessionID.make("session_test"), - permission: "bash", - patterns: ["ls"], - }) + expect(yield* waitForPending(1)).toHaveLength(1) + expect( + yield* Deferred.await(seen).pipe( + Effect.timeoutOrElse({ + duration: "1 second", + orElse: () => Effect.fail(new Error("timed out waiting for permission asked event")), + }), + ), + ).toMatchObject({ + sessionID: SessionID.make("session_test"), + permission: "bash", + patterns: ["ls"], + }) - yield* rejectAll() - yield* Fiber.await(fiber) - } finally { - unsub() - } + yield* rejectAll() + yield* Fiber.await(fiber) }), - ), + { git: true }, ) // reply tests -it.live("reply - once resolves the pending ask", () => - withDir({ git: true }, () => +it.instance( + "reply - once resolves the pending ask", + () => Effect.gen(function* () { const fiber = yield* ask({ id: PermissionID.make("per_test1"), @@ -711,11 +713,12 @@ it.live("reply - once resolves the pending ask", () => yield* reply({ requestID: PermissionID.make("per_test1"), reply: "once" }) yield* Fiber.join(fiber) }), - ), + { git: true }, ) -it.live("reply - reject throws RejectedError", () => - withDir({ git: true }, () => +it.instance( + "reply - reject throws RejectedError", + () => Effect.gen(function* () { const fiber = yield* ask({ id: PermissionID.make("per_test2"), @@ -734,11 +737,12 @@ it.live("reply - reject throws RejectedError", () => expect(Exit.isFailure(exit)).toBe(true) if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) }), - ), + { git: true }, ) -it.live("reply - reject with message throws CorrectedError", () => - withDir({ git: true }, () => +it.instance( + "reply - reject with message throws CorrectedError", + () => Effect.gen(function* () { const fiber = yield* ask({ id: PermissionID.make("per_test2b"), @@ -765,41 +769,43 @@ it.live("reply - reject with message throws CorrectedError", () => expect(String(err)).toContain("Use a safer command") } }), - ), + { git: true }, ) -it.live("reply - always persists approval and resolves", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) - const run = withProvided(dir) - const fiber = yield* ask({ - id: PermissionID.make("per_test3"), - sessionID: SessionID.make("session_test"), - permission: "bash", - patterns: ["ls"], - metadata: {}, - always: ["ls"], - ruleset: [], - }).pipe(run, Effect.forkScoped) - - yield* waitForPending(1).pipe(run) - yield* reply({ requestID: PermissionID.make("per_test3"), reply: "always" }).pipe(run) - yield* Fiber.join(fiber) - - const result = yield* ask({ - sessionID: SessionID.make("session_test2"), - permission: "bash", - patterns: ["ls"], - metadata: {}, - always: [], - ruleset: [], - }).pipe(run) - expect(result).toBeUndefined() - }), +it.instance( + "reply - always persists approval and resolves", + () => + Effect.gen(function* () { + const fiber = yield* ask({ + id: PermissionID.make("per_test3"), + sessionID: SessionID.make("session_test"), + permission: "bash", + patterns: ["ls"], + metadata: {}, + always: ["ls"], + ruleset: [], + }).pipe(Effect.forkScoped) + + yield* waitForPending(1) + yield* reply({ requestID: PermissionID.make("per_test3"), reply: "always" }) + yield* Fiber.join(fiber) + + const result = yield* ask({ + sessionID: SessionID.make("session_test2"), + permission: "bash", + patterns: ["ls"], + metadata: {}, + always: [], + ruleset: [], + }) + expect(result).toBeUndefined() + }), + { git: true }, ) -it.live("reply - reject cancels all pending for same session", () => - withDir({ git: true }, () => +it.instance( + "reply - reject cancels all pending for same session", + () => Effect.gen(function* () { const a = yield* ask({ id: PermissionID.make("per_test4a"), @@ -830,11 +836,12 @@ it.live("reply - reject cancels all pending for same session", () => if (Exit.isFailure(ea)) expect(Cause.squash(ea.cause)).toBeInstanceOf(Permission.RejectedError) if (Exit.isFailure(eb)) expect(Cause.squash(eb.cause)).toBeInstanceOf(Permission.RejectedError) }), - ), + { git: true }, ) -it.live("reply - always resolves matching pending requests in same session", () => - withDir({ git: true }, () => +it.instance( + "reply - always resolves matching pending requests in same session", + () => Effect.gen(function* () { const a = yield* ask({ id: PermissionID.make("per_test5a"), @@ -863,11 +870,12 @@ it.live("reply - always resolves matching pending requests in same session", () yield* Fiber.join(b) expect(yield* list()).toHaveLength(0) }), - ), + { git: true }, ) -it.live("reply - always keeps other session pending", () => - withDir({ git: true }, () => +it.instance( + "reply - always keeps other session pending", + () => Effect.gen(function* () { const a = yield* ask({ id: PermissionID.make("per_test6a"), @@ -898,24 +906,15 @@ it.live("reply - always keeps other session pending", () => yield* rejectAll() yield* Fiber.await(b) }), - ), + { git: true }, ) -it.live("reply - publishes replied event", () => - withDir({ git: true }, () => +it.instance( + "reply - publishes replied event", + () => Effect.gen(function* () { const bus = yield* Bus.Service - let resolve!: (value: { sessionID: SessionID; requestID: PermissionID; reply: Permission.Reply }) => void - const seen = Effect.promise<{ - sessionID: SessionID - requestID: PermissionID - reply: Permission.Reply - }>( - () => - new Promise((res) => { - resolve = res - }), - ) + const seen = yield* Deferred.make<{ sessionID: SessionID; requestID: PermissionID; reply: Permission.Reply }>() const fiber = yield* ask({ id: PermissionID.make("per_test7"), @@ -930,126 +929,146 @@ it.live("reply - publishes replied event", () => yield* waitForPending(1) const unsub = yield* bus.subscribeCallback(Permission.Event.Replied, (event) => { - resolve(event.properties) + Deferred.doneUnsafe(seen, Effect.succeed(event.properties)) }) + yield* Effect.addFinalizer(() => Effect.sync(unsub)) - try { - yield* reply({ requestID: PermissionID.make("per_test7"), reply: "once" }) - yield* Fiber.join(fiber) - expect(yield* seen).toEqual({ - sessionID: SessionID.make("session_test"), - requestID: PermissionID.make("per_test7"), - reply: "once", - }) - } finally { - unsub() - } + yield* reply({ requestID: PermissionID.make("per_test7"), reply: "once" }) + yield* Fiber.join(fiber) + expect( + yield* Deferred.await(seen).pipe( + Effect.timeoutOrElse({ + duration: "1 second", + orElse: () => Effect.fail(new Error("timed out waiting for permission replied event")), + }), + ), + ).toEqual({ + sessionID: SessionID.make("session_test"), + requestID: PermissionID.make("per_test7"), + reply: "once", + }) }), - ), + { git: true }, ) it.live("permission requests stay isolated by directory", () => Effect.gen(function* () { const one = yield* tmpdirScoped({ git: true }) const two = yield* tmpdirScoped({ git: true }) - const runOne = withProvided(one) - const runTwo = withProvided(two) - - const a = yield* ask({ - id: PermissionID.make("per_dir_a"), - sessionID: SessionID.make("session_dir_a"), - permission: "bash", - patterns: ["ls"], - metadata: {}, - always: [], - ruleset: [], - }).pipe(runOne, Effect.forkScoped) - - const b = yield* ask({ - id: PermissionID.make("per_dir_b"), - sessionID: SessionID.make("session_dir_b"), - permission: "bash", - patterns: ["pwd"], - metadata: {}, - always: [], - ruleset: [], - }).pipe(runTwo, Effect.forkScoped) - - const onePending = yield* waitForPending(1).pipe(runOne) - const twoPending = yield* waitForPending(1).pipe(runTwo) + const store = yield* InstanceStore.Service + + const a = yield* store + .provide( + { directory: one }, + ask({ + id: PermissionID.make("per_dir_a"), + sessionID: SessionID.make("session_dir_a"), + permission: "bash", + patterns: ["ls"], + metadata: {}, + always: [], + ruleset: [], + }), + ) + .pipe(Effect.forkScoped) + + const b = yield* store + .provide( + { directory: two }, + ask({ + id: PermissionID.make("per_dir_b"), + sessionID: SessionID.make("session_dir_b"), + permission: "bash", + patterns: ["pwd"], + metadata: {}, + always: [], + ruleset: [], + }), + ) + .pipe(Effect.forkScoped) + + const onePending = yield* store.provide({ directory: one }, waitForPending(1)) + const twoPending = yield* store.provide({ directory: two }, waitForPending(1)) expect(onePending).toHaveLength(1) expect(twoPending).toHaveLength(1) expect(onePending[0].id).toBe(PermissionID.make("per_dir_a")) expect(twoPending[0].id).toBe(PermissionID.make("per_dir_b")) - yield* reply({ requestID: onePending[0].id, reply: "reject" }).pipe(runOne) - yield* reply({ requestID: twoPending[0].id, reply: "reject" }).pipe(runTwo) + yield* store.provide({ directory: one }, reply({ requestID: onePending[0].id, reply: "reject" })) + yield* store.provide({ directory: two }, reply({ requestID: twoPending[0].id, reply: "reject" })) yield* Fiber.await(a) yield* Fiber.await(b) }), ) -it.live("pending permission rejects on instance dispose", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) - const run = withProvided(dir) - const fiber = yield* ask({ - id: PermissionID.make("per_dispose"), - sessionID: SessionID.make("session_dispose"), - permission: "bash", - patterns: ["ls"], - metadata: {}, - always: [], - ruleset: [], - }).pipe(run, Effect.forkScoped) - - expect(yield* waitForPending(1).pipe(run)).toHaveLength(1) - yield* Effect.promise(() => - WithInstance.provide({ directory: dir, fn: () => void InstanceRuntime.disposeInstance(Instance.current) }), - ) +it.instance( + "pending permission rejects on instance dispose", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const store = yield* InstanceStore.Service + const fiber = yield* ask({ + id: PermissionID.make("per_dispose"), + sessionID: SessionID.make("session_dispose"), + permission: "bash", + patterns: ["ls"], + metadata: {}, + always: [], + ruleset: [], + }).pipe(Effect.forkScoped) - const exit = yield* Fiber.await(fiber) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) - }), + expect(yield* waitForPending(1)).toHaveLength(1) + const ctx = yield* store.load({ directory: test.directory }) + yield* store.dispose(ctx) + + const exit = yield* Fiber.await(fiber) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) + }), + { git: true }, ) -it.live("pending permission rejects on instance reload", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) - const run = withProvided(dir) - const fiber = yield* ask({ - id: PermissionID.make("per_reload"), - sessionID: SessionID.make("session_reload"), - permission: "bash", - patterns: ["ls"], - metadata: {}, - always: [], - ruleset: [], - }).pipe(run, Effect.forkScoped) - - expect(yield* waitForPending(1).pipe(run)).toHaveLength(1) - yield* Effect.promise(() => reloadTestInstance({ directory: dir })) - - const exit = yield* Fiber.await(fiber) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) - }), +it.instance( + "pending permission rejects on instance reload", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const store = yield* InstanceStore.Service + const fiber = yield* ask({ + id: PermissionID.make("per_reload"), + sessionID: SessionID.make("session_reload"), + permission: "bash", + patterns: ["ls"], + metadata: {}, + always: [], + ruleset: [], + }).pipe(Effect.forkScoped) + + expect(yield* waitForPending(1)).toHaveLength(1) + yield* store.reload({ directory: test.directory }) + + const exit = yield* Fiber.await(fiber) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) + }), + { git: true }, ) -it.live("reply - does nothing for unknown requestID", () => - withDir({ git: true }, () => +it.instance( + "reply - does nothing for unknown requestID", + () => Effect.gen(function* () { yield* reply({ requestID: PermissionID.make("per_unknown"), reply: "once" }) expect(yield* list()).toHaveLength(0) }), - ), + { git: true }, ) -it.live("ask - checks all patterns and stops on first deny", () => - withDir({ git: true }, () => +it.instance( + "ask - checks all patterns and stops on first deny", + () => Effect.gen(function* () { const err = yield* fail( ask({ @@ -1066,11 +1085,12 @@ it.live("ask - checks all patterns and stops on first deny", () => ) expect(err).toBeInstanceOf(Permission.DeniedError) }), - ), + { git: true }, ) -it.live("ask - allows all patterns when all match allow rules", () => - withDir({ git: true }, () => +it.instance( + "ask - allows all patterns when all match allow rules", + () => Effect.gen(function* () { const result = yield* ask({ sessionID: SessionID.make("session_test"), @@ -1082,11 +1102,12 @@ it.live("ask - allows all patterns when all match allow rules", () => }) expect(result).toBeUndefined() }), - ), + { git: true }, ) -it.live("ask - should deny even when an earlier pattern is ask", () => - withDir({ git: true }, () => +it.instance( + "ask - should deny even when an earlier pattern is ask", + () => Effect.gen(function* () { const err = yield* fail( ask({ @@ -1105,30 +1126,33 @@ it.live("ask - should deny even when an earlier pattern is ask", () => expect(err).toBeInstanceOf(Permission.DeniedError) expect(yield* list()).toHaveLength(0) }), - ), + { git: true }, ) -it.live("ask - abort should clear pending request", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) - const run = withProvided(dir) - - const fiber = yield* ask({ - id: PermissionID.make("per_reload"), - sessionID: SessionID.make("session_reload"), - permission: "bash", - patterns: ["ls"], - metadata: {}, - always: [], - ruleset: [{ permission: "bash", pattern: "*", action: "ask" }], - }).pipe(run, Effect.forkScoped) - - const pending = yield* waitForPending(1).pipe(run) - expect(pending).toHaveLength(1) - yield* Effect.promise(() => reloadTestInstance({ directory: dir })) - - const exit = yield* Fiber.await(fiber) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) - }), +it.instance( + "ask - abort should clear pending request", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const store = yield* InstanceStore.Service + + const fiber = yield* ask({ + id: PermissionID.make("per_reload"), + sessionID: SessionID.make("session_reload"), + permission: "bash", + patterns: ["ls"], + metadata: {}, + always: [], + ruleset: [{ permission: "bash", pattern: "*", action: "ask" }], + }).pipe(Effect.forkScoped) + + const pending = yield* waitForPending(1) + expect(pending).toHaveLength(1) + yield* store.reload({ directory: test.directory }) + + const exit = yield* Fiber.await(fiber) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Permission.RejectedError) + }), + { git: true }, ) diff --git a/packages/opencode/test/plugin/auth-override.test.ts b/packages/opencode/test/plugin/auth-override.test.ts index c77c0ca1c02a..adc66e48c556 100644 --- a/packages/opencode/test/plugin/auth-override.test.ts +++ b/packages/opencode/test/plugin/auth-override.test.ts @@ -1,15 +1,20 @@ import { describe, expect, test } from "bun:test" import path from "path" -import fs from "fs/promises" import { pathToFileURL } from "url" import { Effect, Layer } from "effect" -import { provideTestInstance, tmpdir } from "../fixture/fixture" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { provideInstance, TestInstance, tmpdirScoped } from "../fixture/fixture" import { ProviderAuth } from "@/provider/auth" import { ProviderID } from "../../src/provider/schema" import { Plugin } from "@/plugin" +import { RuntimeFlags } from "@/effect/runtime-flags" import { Auth } from "@/auth" import { Bus } from "@/bus" import { TestConfig } from "../fixture/config" +import { testEffect } from "../lib/effect" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" + +const it = testEffect(Layer.mergeAll(CrossSpawnSpawner.defaultLayer, AppFileSystem.defaultLayer)) function layer(directory: string, plugins: string[]) { return ProviderAuth.layer.pipe( @@ -17,6 +22,7 @@ function layer(directory: string, plugins: string[]) { Layer.provide( Plugin.layer.pipe( Layer.provide(Bus.layer), + Layer.provide(RuntimeFlags.layer()), Layer.provide( TestConfig.layer({ get: () => @@ -37,13 +43,15 @@ function layer(directory: string, plugins: string[]) { } describe("plugin.auth-override", () => { - test("user plugin overrides built-in github-copilot auth", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - const pluginDir = path.join(dir, ".opencode", "plugin") - await fs.mkdir(pluginDir, { recursive: true }) + it.instance( + "user plugin overrides built-in github-copilot auth", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const fs = yield* AppFileSystem.Service + const pluginDir = path.join(tmp.directory, ".opencode", "plugin") - await Bun.write( + yield* fs.writeWithDirs( path.join(pluginDir, "custom-copilot-auth.ts"), [ "export default {", @@ -61,37 +69,26 @@ describe("plugin.auth-override", () => { "", ].join("\n"), ) - }, - }) - await using plain = await tmpdir() + const plain = yield* tmpdirScoped({ git: true }) + const plugin = pathToFileURL(path.join(pluginDir, "custom-copilot-auth.ts")).href + const methods = yield* ProviderAuth.Service.use((svc) => svc.methods()).pipe( + Effect.provide(layer(tmp.directory, [plugin])), + ) + const plainMethods = yield* ProviderAuth.Service.use((svc) => svc.methods()).pipe( + Effect.provide(layer(plain, [])), + provideInstance(plain), + ) - const plugin = pathToFileURL(path.join(tmp.path, ".opencode", "plugin", "custom-copilot-auth.ts")).href - const [methods, plainMethods] = await Promise.all([ - provideTestInstance({ - directory: tmp.path, - fn: async () => { - return Effect.runPromise( - ProviderAuth.Service.use((svc) => svc.methods()).pipe(Effect.provide(layer(tmp.path, [plugin]))), - ) - }, + const copilot = methods[ProviderID.make("github-copilot")] + expect(copilot).toBeDefined() + expect(copilot.length).toBe(1) + expect(copilot[0].label).toBe("Test Override Auth") + expect(plainMethods[ProviderID.make("github-copilot")][0].label).not.toBe("Test Override Auth") }), - provideTestInstance({ - directory: plain.path, - fn: async () => { - return Effect.runPromise( - ProviderAuth.Service.use((svc) => svc.methods()).pipe(Effect.provide(layer(plain.path, []))), - ) - }, - }), - ]) - - const copilot = methods[ProviderID.make("github-copilot")] - expect(copilot).toBeDefined() - expect(copilot.length).toBe(1) - expect(copilot[0].label).toBe("Test Override Auth") - expect(plainMethods[ProviderID.make("github-copilot")][0].label).not.toBe("Test Override Auth") - }, 30000) + { git: true }, + 30000, + ) }) const file = path.join(import.meta.dir, "../../src/plugin/index.ts") diff --git a/packages/opencode/test/plugin/loader-shared.test.ts b/packages/opencode/test/plugin/loader-shared.test.ts index 8c55950afffc..c283488632c8 100644 --- a/packages/opencode/test/plugin/loader-shared.test.ts +++ b/packages/opencode/test/plugin/loader-shared.test.ts @@ -1,13 +1,12 @@ -import { afterAll, afterEach, describe, expect, spyOn, test } from "bun:test" +import { afterEach, describe, expect, spyOn } from "bun:test" import { Effect, Layer } from "effect" import fs from "fs/promises" import path from "path" import { pathToFileURL } from "url" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" -import { Filesystem } from "@/util/filesystem" - -const disableDefault = process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS -process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS = "1" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { disposeAllInstances, provideInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" const { Plugin } = await import("../../src/plugin/index") const { PluginLoader } = await import("../../src/plugin/loader") @@ -15,51 +14,61 @@ const { readPackageThemes } = await import("../../src/plugin/shared") const { Bus } = await import("../../src/bus") const { Npm } = await import("@opencode-ai/core/npm") const { TestConfig } = await import("../fixture/config") - -afterAll(() => { - if (disableDefault === undefined) { - delete process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS - return - } - process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS = disableDefault -}) +const { RuntimeFlags } = await import("../../src/effect/runtime-flags") afterEach(async () => { await disposeAllInstances() }) -async function load(dir: string) { +const it = testEffect(Layer.mergeAll(CrossSpawnSpawner.defaultLayer, AppFileSystem.defaultLayer)) + +function withTmp( + init: (dir: string) => Promise, + body: (tmp: { path: string; extra: T }) => Effect.Effect, +) { + return Effect.gen(function* () { + const dir = yield* tmpdirScoped() + const extra = yield* Effect.promise(() => init(dir)) + return yield* body({ path: dir, extra }) + }) +} + +function load(dir: string, flags?: Parameters[0]) { const source = path.join(dir, "opencode.json") - const config = (await Bun.file(source).json()) as { plugin?: Array]> } - const plugins = config.plugin ?? [] return Effect.gen(function* () { - const plugin = yield* Plugin.Service - yield* plugin.list() - }).pipe( - Effect.provide( - Plugin.layer.pipe( - Layer.provide(Bus.layer), - Layer.provide( - TestConfig.layer({ - get: () => - Effect.succeed({ - plugin: plugins, - plugin_origins: plugins.map((plugin) => ({ spec: plugin, source, scope: "local" as const })), - }), - directories: () => Effect.succeed([dir]), - }), + const config = yield* Effect.promise( + () => Bun.file(source).json() as Promise<{ plugin?: Array]> }>, + ) + const plugins = config.plugin ?? [] + return yield* Effect.gen(function* () { + const plugin = yield* Plugin.Service + yield* plugin.list() + }).pipe( + Effect.provide( + Plugin.layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(RuntimeFlags.layer({ disableDefaultPlugins: true, ...flags })), + Layer.provide( + TestConfig.layer({ + get: () => + Effect.succeed({ + plugin: plugins, + plugin_origins: plugins.map((plugin) => ({ spec: plugin, source, scope: "local" as const })), + }), + directories: () => Effect.succeed([dir]), + }), + ), ), ), - ), - provideInstance(dir), - Effect.runPromise, - ) + provideInstance(dir), + ) + }) } describe("plugin.loader.shared", () => { - test("loads a file:// plugin function export", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("loads a file:// plugin function export", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const mark = path.join(dir, "called.txt") await Bun.write( @@ -80,15 +89,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await fs.readFile(tmp.extra.mark, "utf8")).toBe("called") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => fs.readFile(tmp.extra.mark, "utf8"))).toBe("called") + }), + ), + ) - test("deduplicates same function exported as default and named", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("deduplicates same function exported as default and named", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const mark = path.join(dir, "count.txt") await Bun.write(mark, "") @@ -113,15 +124,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await fs.readFile(tmp.extra.mark, "utf8")).toBe("1") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => fs.readFile(tmp.extra.mark, "utf8"))).toBe("1") + }), + ), + ) - test("uses only default v1 server plugin when present", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("uses only default v1 server plugin when present", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const mark = path.join(dir, "count.txt") await Bun.write( @@ -149,15 +162,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("default") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("default") + }), + ), + ) - test("rejects v1 file server plugin without id", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("rejects v1 file server plugin without id", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const mark = path.join(dir, "called.txt") await Bun.write( @@ -180,20 +195,24 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - const called = await Bun.file(tmp.extra.mark) - .text() - .then(() => true) - .catch(() => false) - - expect(called).toBe(false) - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + const called = yield* Effect.promise(() => + Bun.file(tmp.extra.mark) + .text() + .then(() => true) + .catch(() => false), + ) + + expect(called).toBe(false) + }), + ), + ) - test("rejects v1 plugin that exports server and tui together", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("rejects v1 plugin that exports server and tui together", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const mark = path.join(dir, "called.txt") await Bun.write( @@ -218,20 +237,24 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - const called = await Bun.file(tmp.extra.mark) - .text() - .then(() => true) - .catch(() => false) - - expect(called).toBe(false) - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + const called = yield* Effect.promise(() => + Bun.file(tmp.extra.mark) + .text() + .then(() => true) + .catch(() => false), + ) + + expect(called).toBe(false) + }), + ), + ) - test("resolves npm plugin specs with explicit and default versions", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("resolves npm plugin specs with explicit and default versions", () => + withTmp( + async (dir) => { const acme = path.join(dir, "node_modules", "acme-plugin") const scope = path.join(dir, "node_modules", "scope-plugin") await fs.mkdir(acme, { recursive: true }) @@ -254,26 +277,28 @@ describe("plugin.loader.shared", () => { return { acme, scope } }, - }) - - const add = spyOn(Npm, "add").mockImplementation(async (pkg) => { - if (pkg === "acme-plugin") return { directory: tmp.extra.acme, entrypoint: undefined } - return { directory: tmp.extra.scope, entrypoint: undefined } - }) - - try { - await load(tmp.path) - - expect(add.mock.calls).toContainEqual(["acme-plugin@latest"]) - expect(add.mock.calls).toContainEqual(["scope-plugin@2.3.4"]) - } finally { - add.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const add = spyOn(Npm, "add").mockImplementation(async (pkg) => { + if (pkg === "acme-plugin") return { directory: tmp.extra.acme, entrypoint: undefined } + return { directory: tmp.extra.scope, entrypoint: undefined } + }) + + try { + yield* load(tmp.path) + + expect(add.mock.calls).toContainEqual(["acme-plugin@latest"]) + expect(add.mock.calls).toContainEqual(["scope-plugin@2.3.4"]) + } finally { + add.mockRestore() + } + }), + ), + ) - test("loads npm server plugin from package ./server export", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("loads npm server plugin from package ./server export", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") const mark = path.join(dir, "server-called.txt") await fs.mkdir(mod, { recursive: true }) @@ -317,21 +342,23 @@ describe("plugin.loader.shared", () => { mark, } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - - try { - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("called") - } finally { - install.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + + try { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("called") + } finally { + install.mockRestore() + } + }), + ), + ) - test("loads npm server plugin from package server export without leading dot", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("loads npm server plugin from package server export without leading dot", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") const dist = path.join(mod, "dist") const mark = path.join(dir, "server-called.txt") @@ -374,21 +401,23 @@ describe("plugin.loader.shared", () => { mark, } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - - try { - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("called") - } finally { - install.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + + try { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("called") + } finally { + install.mockRestore() + } + }), + ), + ) - test("loads npm server plugin from package main without leading dot", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("loads npm server plugin from package main without leading dot", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") const dist = path.join(mod, "dist") const mark = path.join(dir, "main-called.txt") @@ -426,21 +455,23 @@ describe("plugin.loader.shared", () => { mark, } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - - try { - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("called") - } finally { - install.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + + try { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("called") + } finally { + install.mockRestore() + } + }), + ), + ) - test("does not use npm package exports dot for server entry", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("does not use npm package exports dot for server entry", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") const mark = path.join(dir, "dot-server.txt") await fs.mkdir(mod, { recursive: true }) @@ -471,26 +502,30 @@ describe("plugin.loader.shared", () => { return { mod, mark } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - - try { - await load(tmp.path) - const called = await Bun.file(tmp.extra.mark) - .text() - .then(() => true) - .catch(() => false) - - expect(called).toBe(false) - } finally { - install.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + + try { + yield* load(tmp.path) + const called = yield* Effect.promise(() => + Bun.file(tmp.extra.mark) + .text() + .then(() => true) + .catch(() => false), + ) + + expect(called).toBe(false) + } finally { + install.mockRestore() + } + }), + ), + ) - test("rejects npm server export that resolves outside plugin directory", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("rejects npm server export that resolves outside plugin directory", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") const outside = path.join(dir, "outside") const mark = path.join(dir, "outside-server.txt") @@ -534,25 +569,29 @@ describe("plugin.loader.shared", () => { mark, } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - - try { - await load(tmp.path) - const called = await Bun.file(tmp.extra.mark) - .text() - .then(() => true) - .catch(() => false) - expect(called).toBe(false) - } finally { - install.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + + try { + yield* load(tmp.path) + const called = yield* Effect.promise(() => + Bun.file(tmp.extra.mark) + .text() + .then(() => true) + .catch(() => false), + ) + expect(called).toBe(false) + } finally { + install.mockRestore() + } + }), + ), + ) - test("skips legacy codex and copilot auth plugin specs", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("skips legacy codex and copilot auth plugin specs", () => + withTmp( + async (dir) => { await Bun.write( path.join(dir, "opencode.json"), JSON.stringify( @@ -564,25 +603,27 @@ describe("plugin.loader.shared", () => { ), ) }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: "", entrypoint: undefined }) - - try { - await load(tmp.path) - - const pkgs = install.mock.calls.map((call) => call[0]) - expect(pkgs).toContain("regular-plugin@1.0.0") - expect(pkgs).not.toContain("opencode-openai-codex-auth@1.0.0") - expect(pkgs).not.toContain("opencode-copilot-auth@1.0.0") - } finally { - install.mockRestore() - } - }) + (_tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: "", entrypoint: undefined }) + + try { + yield* load(_tmp.path) + + const pkgs = install.mock.calls.map((call) => call[0]) + expect(pkgs).toContain("regular-plugin@1.0.0") + expect(pkgs).not.toContain("opencode-openai-codex-auth@1.0.0") + expect(pkgs).not.toContain("opencode-copilot-auth@1.0.0") + } finally { + install.mockRestore() + } + }), + ), + ) - test("skips broken plugin when install fails", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("skips broken plugin when install fails", () => + withTmp( + async (dir) => { const ok = path.join(dir, "ok.ts") const mark = path.join(dir, "ok.txt") await Bun.write( @@ -604,22 +645,24 @@ describe("plugin.loader.shared", () => { ) return { mark } }, - }) - - const install = spyOn(Npm, "add").mockRejectedValue(new Error("boom")) - - try { - await load(tmp.path) - expect(install).toHaveBeenCalledWith("broken-plugin@9.9.9") - expect(await Bun.file(tmp.extra.mark).text()).toBe("ok") - } finally { - install.mockRestore() - } - }) + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockRejectedValue(new Error("boom")) + + try { + yield* load(tmp.path) + expect(install).toHaveBeenCalledWith("broken-plugin@9.9.9") + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("ok") + } finally { + install.mockRestore() + } + }), + ), + ) - test("continues loading plugins when plugin init throws", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("continues loading plugins when plugin init throws", () => + withTmp( + async (dir) => { const file = pathToFileURL(path.join(dir, "throws.ts")).href const ok = pathToFileURL(path.join(dir, "ok.ts")).href const mark = path.join(dir, "ok.txt") @@ -653,15 +696,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("ok") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("ok") + }), + ), + ) - test("continues loading plugins when plugin module has invalid export", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("continues loading plugins when plugin module has invalid export", () => + withTmp( + async (dir) => { const file = pathToFileURL(path.join(dir, "invalid.ts")).href const ok = pathToFileURL(path.join(dir, "ok.ts")).href const mark = path.join(dir, "ok.txt") @@ -687,15 +732,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("ok") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("ok") + }), + ), + ) - test("continues loading plugins when plugin import fails", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("continues loading plugins when plugin import fails", () => + withTmp( + async (dir) => { const missing = pathToFileURL(path.join(dir, "missing-plugin.ts")).href const ok = pathToFileURL(path.join(dir, "ok.ts")).href const mark = path.join(dir, "ok.txt") @@ -716,15 +763,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await Bun.file(tmp.extra.mark).text()).toBe("ok") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => Bun.file(tmp.extra.mark).text())).toBe("ok") + }), + ), + ) - test("loads object plugin via plugin.server", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("loads object plugin via plugin.server", () => + withTmp( + async (dir) => { const file = path.join(dir, "object-plugin.ts") const mark = path.join(dir, "object-called.txt") await Bun.write( @@ -749,15 +798,17 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await fs.readFile(tmp.extra.mark, "utf8")).toBe("called") - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect(yield* Effect.promise(() => fs.readFile(tmp.extra.mark, "utf8"))).toBe("called") + }), + ), + ) - test("passes tuple plugin options into server plugin", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("passes tuple plugin options into server plugin", () => + withTmp( + async (dir) => { const file = path.join(dir, "options-plugin.ts") const mark = path.join(dir, "options.json") await Bun.write( @@ -782,18 +833,22 @@ describe("plugin.loader.shared", () => { return { mark } }, - }) - - await load(tmp.path) - expect(await Filesystem.readJson<{ source: string; enabled: boolean }>(tmp.extra.mark)).toEqual({ - source: "tuple", - enabled: true, - }) - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + expect( + (yield* (yield* AppFileSystem.Service).readJson(tmp.extra.mark)) as { source: string; enabled: boolean }, + ).toEqual({ + source: "tuple", + enabled: true, + }) + }), + ), + ) - test("initializes server plugins in config order", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("initializes server plugins in config order", () => + withTmp( + async (dir) => { const a = path.join(dir, "a-plugin.ts") const b = path.join(dir, "b-plugin.ts") const marker = path.join(dir, "server-order.txt") @@ -833,16 +888,18 @@ export default { return { marker } }, - }) - - await load(tmp.path) - const lines = (await fs.readFile(tmp.extra.marker, "utf8")).trim().split("\n") - expect(lines).toEqual(["a-start", "a-end", "b"]) - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path) + const lines = (yield* Effect.promise(() => fs.readFile(tmp.extra.marker, "utf8"))).trim().split("\n") + expect(lines).toEqual(["a-start", "a-end", "b"]) + }), + ), + ) - test("skips external plugins in pure mode", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("skips external plugins in pure mode", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const mark = path.join(dir, "called.txt") await Bun.write( @@ -866,30 +923,23 @@ export default { return { mark } }, - }) - - const pure = process.env.OPENCODE_PURE - process.env.OPENCODE_PURE = "1" - - try { - await load(tmp.path) - const called = await fs - .readFile(tmp.extra.mark, "utf8") - .then(() => true) - .catch(() => false) - expect(called).toBe(false) - } finally { - if (pure === undefined) { - delete process.env.OPENCODE_PURE - } else { - process.env.OPENCODE_PURE = pure - } - } - }) + (tmp) => + Effect.gen(function* () { + yield* load(tmp.path, { pure: true }) + const called = yield* Effect.promise(() => + fs + .readFile(tmp.extra.mark, "utf8") + .then(() => true) + .catch(() => false), + ) + expect(called).toBe(false) + }), + ), + ) - test("reads oc-themes from package manifest", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("reads oc-themes from package manifest", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mod") await fs.mkdir(path.join(mod, "themes"), { recursive: true }) await Bun.write( @@ -907,25 +957,28 @@ export default { return { mod } }, - }) - - const file = path.join(tmp.extra.mod, "package.json") - const json = await Filesystem.readJson>(file) - const list = readPackageThemes("acme-plugin", { - dir: tmp.extra.mod, - pkg: file, - json, - }) - - expect(list).toEqual([ - Filesystem.resolve(path.join(tmp.extra.mod, "themes", "one.json")), - Filesystem.resolve(path.join(tmp.extra.mod, "themes", "two.json")), - ]) - }) + (tmp) => + Effect.gen(function* () { + const file = path.join(tmp.extra.mod, "package.json") + const fsys = yield* AppFileSystem.Service + const json = (yield* fsys.readJson(file)) as Record + const list = readPackageThemes("acme-plugin", { + dir: tmp.extra.mod, + pkg: file, + json, + }) + + expect(list).toEqual([ + AppFileSystem.resolve(path.join(tmp.extra.mod, "themes", "one.json")), + AppFileSystem.resolve(path.join(tmp.extra.mod, "themes", "two.json")), + ]) + }), + ), + ) - test("handles no-entrypoint tui packages via missing callback", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("handles no-entrypoint tui packages via missing callback", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") await fs.mkdir(path.join(mod, "themes"), { recursive: true }) await Bun.write( @@ -943,54 +996,58 @@ export default { await Bun.write(path.join(mod, "themes", "night.json"), "{}\n") return { mod } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - const missing: string[] = [] - - try { - const loaded = await PluginLoader.loadExternal({ - items: [ - { - spec: "acme-plugin@1.0.0", - scope: "local" as const, - source: tmp.path, - }, - ], - kind: "tui", - missing: async (item) => { - if (!item.pkg) return - const themes = readPackageThemes(item.spec, item.pkg) - if (!themes.length) return - return { - spec: item.spec, - target: item.target, - themes, + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + const missing: string[] = [] + + try { + const loaded = yield* Effect.promise(() => + PluginLoader.loadExternal({ + items: [ + { + spec: "acme-plugin@1.0.0", + scope: "local" as const, + source: tmp.path, + }, + ], + kind: "tui", + missing: async (item) => { + if (!item.pkg) return + const themes = readPackageThemes(item.spec, item.pkg) + if (!themes.length) return + return { + spec: item.spec, + target: item.target, + themes, + } + }, + report: { + missing(_candidate, _retry, message) { + missing.push(message) + }, + }, + }), + ) + + expect(loaded).toEqual([ + { + spec: "acme-plugin@1.0.0", + target: tmp.extra.mod, + themes: [AppFileSystem.resolve(path.join(tmp.extra.mod, "themes", "night.json"))], + }, + ]) + expect(missing).toHaveLength(0) + } finally { + install.mockRestore() } - }, - report: { - missing(_candidate, _retry, message) { - missing.push(message) - }, - }, - }) - - expect(loaded).toEqual([ - { - spec: "acme-plugin@1.0.0", - target: tmp.extra.mod, - themes: [Filesystem.resolve(path.join(tmp.extra.mod, "themes", "night.json"))], - }, - ]) - expect(missing).toHaveLength(0) - } finally { - install.mockRestore() - } - }) + }), + ), + ) - test("passes package metadata for entrypoint tui plugins", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("passes package metadata for entrypoint tui plugins", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mods", "acme-plugin") await fs.mkdir(path.join(mod, "themes"), { recursive: true }) await Bun.write( @@ -1012,64 +1069,71 @@ export default { await Bun.write(path.join(mod, "themes", "night.json"), "{}\n") return { mod } }, - }) - - const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) - - try { - const loaded = await PluginLoader.loadExternal({ - items: [ - { - spec: "acme-plugin@1.0.0", - scope: "local" as const, - source: tmp.path, - }, - ], - kind: "tui", - finish: async (item) => { - if (!item.pkg) return - return { - spec: item.spec, - themes: readPackageThemes(item.spec, item.pkg), + (tmp) => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockResolvedValue({ directory: tmp.extra.mod, entrypoint: undefined }) + + try { + const loaded = yield* Effect.promise(() => + PluginLoader.loadExternal({ + items: [ + { + spec: "acme-plugin@1.0.0", + scope: "local" as const, + source: tmp.path, + }, + ], + kind: "tui", + finish: async (item) => { + if (!item.pkg) return + return { + spec: item.spec, + themes: readPackageThemes(item.spec, item.pkg), + } + }, + }), + ) + + expect(loaded).toEqual([ + { + spec: "acme-plugin@1.0.0", + themes: [AppFileSystem.resolve(path.join(tmp.extra.mod, "themes", "night.json"))], + }, + ]) + } finally { + install.mockRestore() } - }, - }) - - expect(loaded).toEqual([ - { - spec: "acme-plugin@1.0.0", - themes: [Filesystem.resolve(path.join(tmp.extra.mod, "themes", "night.json"))], - }, - ]) - } finally { - install.mockRestore() - } - }) + }), + ), + ) - test("rejects oc-themes path traversal", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("rejects oc-themes path traversal", () => + withTmp( + async (dir) => { const mod = path.join(dir, "mod") await fs.mkdir(mod, { recursive: true }) const file = path.join(mod, "package.json") await Bun.write(file, JSON.stringify({ name: "acme", "oc-themes": ["../escape.json"] }, null, 2)) return { mod, file } }, - }) - - const json = await Filesystem.readJson>(tmp.extra.file) - expect(() => - readPackageThemes("acme", { - dir: tmp.extra.mod, - pkg: tmp.extra.file, - json, - }), - ).toThrow("outside plugin directory") - }) + (tmp) => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const json = (yield* fsys.readJson(tmp.extra.file)) as Record + expect(() => + readPackageThemes("acme", { + dir: tmp.extra.mod, + pkg: tmp.extra.file, + json, + }), + ).toThrow("outside plugin directory") + }), + ), + ) - test("retries failed file plugins once after wait and keeps order", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("retries failed file plugins once after wait and keeps order", () => + withTmp( + async (dir) => { const a = path.join(dir, "a") const b = path.join(dir, "b") const aSpec = pathToFileURL(a).href @@ -1078,110 +1142,122 @@ export default { await fs.mkdir(b, { recursive: true }) return { a, b, aSpec, bSpec } }, - }) - - let wait = 0 - const calls: Array<[string, boolean]> = [] - - const loaded = await PluginLoader.loadExternal({ - items: [tmp.extra.aSpec, tmp.extra.bSpec].map((spec) => ({ - spec, - scope: "local" as const, - source: tmp.path, - })), - kind: "tui", - wait: async () => { - wait += 1 - await Bun.write(path.join(tmp.extra.a, "index.ts"), "export default {}\n") - await Bun.write(path.join(tmp.extra.b, "index.ts"), "export default {}\n") - }, - report: { - start(candidate, retry) { - calls.push([candidate.plan.spec, retry]) - }, - }, - }) - - expect(wait).toBe(1) - expect(calls).toEqual([ - [tmp.extra.aSpec, false], - [tmp.extra.bSpec, false], - [tmp.extra.aSpec, true], - [tmp.extra.bSpec, true], - ]) - expect(loaded.map((item) => item.spec)).toEqual([tmp.extra.aSpec, tmp.extra.bSpec]) - }) + (tmp) => + Effect.gen(function* () { + let wait = 0 + const calls: Array<[string, boolean]> = [] + + const loaded = yield* Effect.promise(() => + PluginLoader.loadExternal({ + items: [tmp.extra.aSpec, tmp.extra.bSpec].map((spec) => ({ + spec, + scope: "local" as const, + source: tmp.path, + })), + kind: "tui", + wait: async () => { + wait += 1 + await Bun.write(path.join(tmp.extra.a, "index.ts"), "export default {}\n") + await Bun.write(path.join(tmp.extra.b, "index.ts"), "export default {}\n") + }, + report: { + start(candidate, retry) { + calls.push([candidate.plan.spec, retry]) + }, + }, + }), + ) + + expect(wait).toBe(1) + expect(calls).toEqual([ + [tmp.extra.aSpec, false], + [tmp.extra.bSpec, false], + [tmp.extra.aSpec, true], + [tmp.extra.bSpec, true], + ]) + expect(loaded.map((item) => item.spec)).toEqual([tmp.extra.aSpec, tmp.extra.bSpec]) + }), + ), + ) - test("retries file plugins when finish returns undefined", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { + it.live("retries file plugins when finish returns undefined", () => + withTmp( + async (dir) => { const file = path.join(dir, "plugin.ts") const spec = pathToFileURL(file).href await Bun.write(file, "export default {}\n") return { spec } }, - }) - - let wait = 0 - let count = 0 - - const loaded = await PluginLoader.loadExternal({ - items: [ - { - spec: tmp.extra.spec, - scope: "local" as const, - source: tmp.path, - }, - ], - kind: "tui", - wait: async () => { - wait += 1 - }, - finish: async (load, _item, retry) => { - count += 1 - if (!retry) return - return { - retry, - spec: load.spec, - } - }, - }) + (tmp) => + Effect.gen(function* () { + let wait = 0 + let count = 0 + + const loaded = yield* Effect.promise(() => + PluginLoader.loadExternal({ + items: [ + { + spec: tmp.extra.spec, + scope: "local" as const, + source: tmp.path, + }, + ], + kind: "tui", + wait: async () => { + wait += 1 + }, + finish: async (load, _item, retry) => { + count += 1 + if (!retry) return + return { + retry, + spec: load.spec, + } + }, + }), + ) - expect(wait).toBe(1) - expect(count).toBe(2) - expect(loaded).toEqual([{ retry: true, spec: tmp.extra.spec }]) - }) + expect(wait).toBe(1) + expect(count).toBe(2) + expect(loaded).toEqual([{ retry: true, spec: tmp.extra.spec }]) + }), + ), + ) - test("does not wait or retry npm plugin failures", async () => { - const install = spyOn(Npm, "add").mockRejectedValue(new Error("boom")) - let wait = 0 - const errors: Array<[string, boolean]> = [] - - try { - const loaded = await PluginLoader.loadExternal({ - items: [ - { - spec: "acme-plugin@1.0.0", - scope: "local" as const, - source: "test", - }, - ], - kind: "tui", - wait: async () => { - wait += 1 - }, - report: { - error(_candidate, retry, stage) { - errors.push([stage, retry]) - }, - }, - }) - - expect(loaded).toEqual([]) - expect(wait).toBe(0) - expect(errors).toEqual([["install", false]]) - } finally { - install.mockRestore() - } - }) + it.live("does not wait or retry npm plugin failures", () => + Effect.gen(function* () { + const install = spyOn(Npm, "add").mockRejectedValue(new Error("boom")) + let wait = 0 + const errors: Array<[string, boolean]> = [] + + try { + const loaded = yield* Effect.promise(() => + PluginLoader.loadExternal({ + items: [ + { + spec: "acme-plugin@1.0.0", + scope: "local" as const, + source: "test", + }, + ], + kind: "tui", + wait: async () => { + wait += 1 + }, + report: { + error(_candidate, retry, stage) { + errors.push([stage, retry]) + }, + }, + }), + ) + + expect(loaded).toEqual([]) + expect(wait).toBe(0) + expect(errors).toEqual([["install", false]]) + } finally { + install.mockRestore() + } + }), + ) }) diff --git a/packages/opencode/test/plugin/trigger.test.ts b/packages/opencode/test/plugin/trigger.test.ts index 5e16af42be75..94642fba629c 100644 --- a/packages/opencode/test/plugin/trigger.test.ts +++ b/packages/opencode/test/plugin/trigger.test.ts @@ -1,26 +1,48 @@ -import { afterAll, describe, expect } from "bun:test" -import { Effect, Layer } from "effect" +import { describe, expect } from "bun:test" +import { Effect, Layer, Option } from "effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { EffectFlock } from "@opencode-ai/core/util/effect-flock" import path from "path" import { pathToFileURL } from "url" +import { Account } from "../../src/account/account" +import { Auth } from "../../src/auth" +import { Bus } from "../../src/bus" +import { Config } from "../../src/config/config" +import { Env } from "../../src/env" +import { RuntimeFlags } from "../../src/effect/runtime-flags" +import { Plugin } from "../../src/plugin/index" import { ModelID, ProviderID } from "../../src/provider/schema" import { provideTmpdirInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" +import { NpmTest } from "../fake/npm" -const disableDefault = process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS -process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS = "1" - -const { Plugin } = await import("../../src/plugin/index") -const it = testEffect(Layer.mergeAll(Plugin.defaultLayer, CrossSpawnSpawner.defaultLayer)) -const systemHook = "experimental.chat.system.transform" - -afterAll(() => { - if (disableDefault === undefined) { - delete process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS - return - } - process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS = disableDefault +const emptyAccount = Layer.mock(Account.Service)({ + active: () => Effect.succeed(Option.none()), + activeOrg: () => Effect.succeed(Option.none()), }) +const emptyAuth = Layer.mock(Auth.Service)({ + all: () => Effect.succeed({}), +}) +const configLayer = Config.layer.pipe( + Layer.provide(EffectFlock.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Env.defaultLayer), + Layer.provide(emptyAuth), + Layer.provide(emptyAccount), + Layer.provide(NpmTest.noop), +) +const it = testEffect( + Layer.mergeAll( + Plugin.layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(configLayer), + Layer.provide(RuntimeFlags.layer({ disableDefaultPlugins: true })), + ), + CrossSpawnSpawner.defaultLayer, + ), +) +const systemHook = "experimental.chat.system.transform" function withProject(source: string, self: Effect.Effect) { return provideTmpdirInstance((dir) => diff --git a/packages/opencode/test/plugin/workspace-adapter.test.ts b/packages/opencode/test/plugin/workspace-adapter.test.ts index 9199a85a6151..41dbf53445de 100644 --- a/packages/opencode/test/plugin/workspace-adapter.test.ts +++ b/packages/opencode/test/plugin/workspace-adapter.test.ts @@ -1,44 +1,70 @@ -import { afterAll, afterEach, describe, expect } from "bun:test" -import { Effect, Layer } from "effect" +import { afterEach, describe, expect } from "bun:test" +import { Effect, Layer, Option } from "effect" +import { FetchHttpClient } from "effect/unstable/http" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { EffectFlock } from "@opencode-ai/core/util/effect-flock" import path from "path" import { pathToFileURL } from "url" +import { Account } from "../../src/account/account" +import { Auth } from "../../src/auth" +import { Bus } from "../../src/bus" +import { Config } from "../../src/config/config" +import { Env } from "../../src/env" +import { RuntimeFlags } from "../../src/effect/runtime-flags" +import { Workspace } from "../../src/control-plane/workspace" +import { Plugin } from "../../src/plugin/index" +import { InstanceBootstrap } from "../../src/project/bootstrap-service" +import { Instance } from "../../src/project/instance" +import { InstanceStore } from "../../src/project/instance-store" +import { Project } from "../../src/project/project" +import { Vcs } from "../../src/project/vcs" +import { Session } from "../../src/session/session" +import { SessionPrompt } from "../../src/session/prompt" +import { SyncEvent } from "../../src/sync" import { disposeAllInstances, provideTmpdirInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" +import { NpmTest } from "../fake/npm" -const disableDefault = process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS -process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS = "1" - -const { Flag } = await import("@opencode-ai/core/flag/flag") -const { Plugin } = await import("../../src/plugin/index") -const { Workspace } = await import("../../src/control-plane/workspace") -const { InstanceBootstrap } = await import("../../src/project/bootstrap") -const { Instance } = await import("../../src/project/instance") -const { InstanceStore } = await import("../../src/project/instance-store") -const workspaceLayer = Workspace.defaultLayer.pipe( - Layer.provide(InstanceStore.defaultLayer), - Layer.provide(InstanceBootstrap.defaultLayer), +const emptyAccount = Layer.mock(Account.Service)({ + active: () => Effect.succeed(Option.none()), + activeOrg: () => Effect.succeed(Option.none()), +}) +const emptyAuth = Layer.mock(Auth.Service)({ + all: () => Effect.succeed({}), +}) +const configLayer = Config.layer.pipe( + Layer.provide(EffectFlock.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Env.defaultLayer), + Layer.provide(emptyAuth), + Layer.provide(emptyAccount), + Layer.provide(NpmTest.noop), ) -const it = testEffect(Layer.mergeAll(Plugin.defaultLayer, workspaceLayer, CrossSpawnSpawner.defaultLayer)) - -const experimental = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES - -Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true +const pluginLayer = Plugin.layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(configLayer), + Layer.provide(RuntimeFlags.layer({ disableDefaultPlugins: true })), +) +const noopBootstrapLayer = Layer.succeed(InstanceBootstrap.Service, InstanceBootstrap.Service.of({ run: Effect.void })) +const workspaceLayer = Workspace.layer.pipe( + Layer.provide(Auth.defaultLayer), + Layer.provide(Session.defaultLayer), + Layer.provide(SyncEvent.defaultLayer), + Layer.provide(SessionPrompt.defaultLayer), + Layer.provide(Project.defaultLayer), + Layer.provide(Vcs.defaultLayer), + Layer.provide(FetchHttpClient.layer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(InstanceStore.defaultLayer.pipe(Layer.provide(noopBootstrapLayer))), + Layer.provide(RuntimeFlags.layer({ experimentalWorkspaces: true })), +) +const it = testEffect(Layer.mergeAll(pluginLayer, workspaceLayer, CrossSpawnSpawner.defaultLayer)) afterEach(async () => { await disposeAllInstances() }) -afterAll(() => { - if (disableDefault === undefined) { - delete process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS - } else { - process.env.OPENCODE_DISABLE_DEFAULT_PLUGINS = disableDefault - } - - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = experimental -}) - describe("plugin.workspace", () => { it.live("plugin can install a workspace adapter", () => provideTmpdirInstance((dir) => diff --git a/packages/opencode/test/preload.ts b/packages/opencode/test/preload.ts index b408f7ef11b8..24b804819ed3 100644 --- a/packages/opencode/test/preload.ts +++ b/packages/opencode/test/preload.ts @@ -35,6 +35,7 @@ process.env["XDG_CONFIG_HOME"] = path.join(dir, "config") process.env["XDG_STATE_HOME"] = path.join(dir, "state") process.env["OPENCODE_MODELS_PATH"] = path.join(import.meta.dir, "tool", "fixtures", "models-api.json") process.env["OPENCODE_EXPERIMENTAL_EVENT_SYSTEM"] = "true" +process.env["OPENCODE_EXPERIMENTAL_WORKSPACES"] = "true" // Set test home directory to isolate tests from user's actual home directory // This prevents tests from picking up real user configs/skills from ~/.claude/skills @@ -45,7 +46,6 @@ process.env["OPENCODE_TEST_HOME"] = testHome // Set test managed config directory to isolate tests from system managed settings const testManagedConfigDir = path.join(dir, "managed") process.env["OPENCODE_TEST_MANAGED_CONFIG_DIR"] = testManagedConfigDir -process.env["OPENCODE_DISABLE_DEFAULT_PLUGINS"] = "true" // Write the cache version file to prevent global/index.ts from clearing the cache const cacheDir = path.join(dir, "cache", "opencode") diff --git a/packages/opencode/test/project/instance-bootstrap.test.ts b/packages/opencode/test/project/instance-bootstrap.test.ts index 71521a765a70..c5b18cc5b8d0 100644 --- a/packages/opencode/test/project/instance-bootstrap.test.ts +++ b/packages/opencode/test/project/instance-bootstrap.test.ts @@ -1,11 +1,17 @@ -import { afterEach, expect, test } from "bun:test" +import { afterEach, expect } from "bun:test" import { existsSync } from "node:fs" import path from "node:path" import { pathToFileURL } from "node:url" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { Cause, Effect, Exit, Fiber, Layer } from "effect" import { bootstrap as cliBootstrap } from "../../src/cli/bootstrap" -import { WithInstance } from "../../src/project/with-instance" -import { InstanceRuntime } from "../../src/project/instance-runtime" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { InstanceLayer } from "../../src/project/instance-layer" +import { InstanceStore } from "../../src/project/instance-store" +import { disposeAllInstances, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" +import { waitGlobalBusEvent } from "../server/global-bus" + +const it = testEffect(Layer.mergeAll(InstanceLayer.layer, CrossSpawnSpawner.defaultLayer)) // InstanceBootstrap must run before any code touches the instance — // originally tracked by PRs #25389 and #25449, now a permanent @@ -19,58 +25,86 @@ afterEach(async () => { await disposeAllInstances() }) -async function bootstrapFixture() { - return tmpdir({ - init: async (dir) => { - const marker = path.join(dir, "config-hook-fired") - const pluginFile = path.join(dir, "plugin.ts") - await Bun.write( - pluginFile, - [ - `const MARKER = ${JSON.stringify(marker)}`, - "export default async () => ({", - " config: async () => {", - ' await Bun.write(MARKER, "ran")', - " },", - "})", - "", - ].join("\n"), - ) - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - plugin: [pathToFileURL(pluginFile).href], - }), - ) - return marker - }, +const bootstrapFixture = Effect.gen(function* () { + const dir = yield* tmpdirScoped({ git: true }) + const marker = path.join(dir, "config-hook-fired") + const pluginFile = path.join(dir, "plugin.ts") + yield* Effect.promise(() => + Bun.write( + pluginFile, + [ + `const MARKER = ${JSON.stringify(marker)}`, + "export default async () => ({", + " config: async () => {", + ' await Bun.write(MARKER, "ran")', + " },", + "})", + "", + ].join("\n"), + ), + ) + yield* Effect.promise(() => + Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + plugin: [pathToFileURL(pluginFile).href], + }), + ), + ) + return { directory: dir, marker } +}) + +function waitDisposed(directory: string) { + return waitGlobalBusEvent({ + message: "timed out waiting for CLI bootstrap instance disposal", + predicate: (event) => event.payload.type === "server.instance.disposed" && event.directory === directory, }) } -test("WithInstance.provide runs InstanceBootstrap before fn", async () => { - await using tmp = await bootstrapFixture() +it.live("InstanceStore.provide runs InstanceBootstrap before effect", () => + Effect.gen(function* () { + const tmp = yield* bootstrapFixture + const store = yield* InstanceStore.Service - await WithInstance.provide({ - directory: tmp.path, - fn: async () => "ok", - }) + yield* store.provide({ directory: tmp.directory }, Effect.succeed("ok")) - expect(existsSync(tmp.extra)).toBe(true) -}) + expect(existsSync(tmp.marker)).toBe(true) + }), +) -test("CLI bootstrap runs InstanceBootstrap before callback", async () => { - await using tmp = await bootstrapFixture() +it.live("CLI bootstrap runs InstanceBootstrap before callback", () => + Effect.gen(function* () { + const tmp = yield* bootstrapFixture - await cliBootstrap(tmp.path, async () => "ok") + yield* Effect.promise(() => cliBootstrap(tmp.directory, async () => "ok")) - expect(existsSync(tmp.extra)).toBe(true) -}) + expect(existsSync(tmp.marker)).toBe(true) + }), +) -test("InstanceRuntime.reloadInstance runs InstanceBootstrap", async () => { - await using tmp = await bootstrapFixture() +it.live("CLI bootstrap disposes the instance when the callback rejects", () => + Effect.gen(function* () { + const tmp = yield* bootstrapFixture + const disposed = yield* waitDisposed(tmp.directory).pipe(Effect.forkScoped) - await InstanceRuntime.reloadInstance({ directory: tmp.path }) + const exit = yield* Effect.promise(() => + cliBootstrap(tmp.directory, async () => Promise.reject(new Error("boom"))), + ).pipe(Effect.exit) - expect(existsSync(tmp.extra)).toBe(true) -}) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toMatchObject({ message: "boom" }) + yield* Fiber.join(disposed) + }), +) + +it.live("InstanceStore.reload runs InstanceBootstrap", () => + Effect.gen(function* () { + const tmp = yield* bootstrapFixture + const store = yield* InstanceStore.Service + + yield* store.reload({ directory: tmp.directory }) + + expect(existsSync(tmp.marker)).toBe(true) + }), +) diff --git a/packages/opencode/test/project/instance.test.ts b/packages/opencode/test/project/instance.test.ts index 99b0f0666b5d..9c0f9150e10f 100644 --- a/packages/opencode/test/project/instance.test.ts +++ b/packages/opencode/test/project/instance.test.ts @@ -1,13 +1,12 @@ -import { afterEach, describe, expect } from "bun:test" +import { describe, expect } from "bun:test" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" -import { Effect, Fiber, Layer } from "effect" +import { Deferred, Effect, Fiber, Layer } from "effect" import { InstanceRef } from "../../src/effect/instance-ref" import { registerDisposer } from "../../src/effect/instance-registry" import { InstanceBootstrap } from "../../src/project/bootstrap-service" import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { InstanceStore } from "../../src/project/instance-store" -import { disposeAllInstances, tmpdirScoped } from "../fixture/fixture" +import { TestInstance, tmpdirScoped } from "../fixture/fixture" import { testEffect } from "../lib/effect" let bootstrapRun: Effect.Effect = Effect.void @@ -20,10 +19,22 @@ const it = testEffect( Layer.mergeAll(InstanceStore.defaultLayer, CrossSpawnSpawner.defaultLayer).pipe(Layer.provide(noopBootstrap)), ) -afterEach(async () => { - bootstrapRun = Effect.void - await disposeAllInstances() -}) +const setBootstrap = (run: Effect.Effect) => + Effect.acquireRelease( + Effect.sync(() => { + bootstrapRun = run + }), + () => + Effect.sync(() => { + bootstrapRun = Effect.void + }), + ) + +const registerDisposerScoped = (disposer: (directory: string) => Promise) => + Effect.acquireRelease( + Effect.sync(() => registerDisposer(disposer)), + (off) => Effect.sync(off), + ) describe("InstanceStore", () => { it.live("loads instance context without installing ALS for the caller", () => @@ -44,9 +55,11 @@ describe("InstanceStore", () => { const store = yield* InstanceStore.Service let initializedDirectory: string | undefined - bootstrapRun = Effect.gen(function* () { - initializedDirectory = (yield* InstanceRef)?.directory - }) + yield* setBootstrap( + Effect.gen(function* () { + initializedDirectory = (yield* InstanceRef)?.directory + }), + ) yield* store.load({ directory: dir }) expect(initializedDirectory).toBe(dir) @@ -60,9 +73,11 @@ describe("InstanceStore", () => { const store = yield* InstanceStore.Service let initialized = 0 - bootstrapRun = Effect.sync(() => { - initialized++ - }) + yield* setBootstrap( + Effect.sync(() => { + initialized++ + }), + ) const first = yield* store.load({ directory: dir }) const second = yield* store.load({ directory: dir }) @@ -75,26 +90,30 @@ describe("InstanceStore", () => { Effect.gen(function* () { const dir = yield* tmpdirScoped({ git: true }) const store = yield* InstanceStore.Service - const started = Promise.withResolvers() - const release = Promise.withResolvers() + const started = yield* Deferred.make() + const release = yield* Deferred.make() let initialized = 0 - bootstrapRun = Effect.promise(async () => { - initialized++ - started.resolve() - await release.promise - }) + yield* setBootstrap( + Effect.gen(function* () { + initialized++ + yield* Deferred.succeed(started, undefined) + yield* Deferred.await(release) + }), + ) const first = yield* store.load({ directory: dir }).pipe(Effect.forkScoped) - yield* Effect.promise(() => started.promise) + yield* Deferred.await(started) - bootstrapRun = Effect.sync(() => { - initialized++ - }) + yield* setBootstrap( + Effect.sync(() => { + initialized++ + }), + ) const second = yield* store.load({ directory: dir }).pipe(Effect.forkScoped) expect(initialized).toBe(1) - release.resolve() + yield* Deferred.succeed(release, undefined) const [firstCtx, secondCtx] = yield* Effect.all([Fiber.join(first), Fiber.join(second)]) expect(secondCtx).toBe(firstCtx) @@ -108,10 +127,12 @@ describe("InstanceStore", () => { const store = yield* InstanceStore.Service let attempts = 0 - bootstrapRun = Effect.sync(() => { - attempts++ - throw new Error("init failed") - }) + yield* setBootstrap( + Effect.sync(() => { + attempts++ + throw new Error("init failed") + }), + ) const failed = yield* store.load({ directory: dir }).pipe( Effect.as(false), Effect.catchCause(() => Effect.succeed(true)), @@ -119,9 +140,11 @@ describe("InstanceStore", () => { expect(failed).toBe(true) - bootstrapRun = Effect.sync(() => { - attempts++ - }) + yield* setBootstrap( + Effect.sync(() => { + attempts++ + }), + ) const ctx = yield* store.load({ directory: dir }) expect(ctx.directory).toBe(dir) @@ -147,24 +170,25 @@ describe("InstanceStore", () => { Effect.gen(function* () { const dir = yield* tmpdirScoped({ git: true }) const store = yield* InstanceStore.Service - const reloading = Promise.withResolvers() - const releaseReload = Promise.withResolvers() + const reloading = yield* Deferred.make() + const releaseReload = yield* Deferred.make() const disposed: Array = [] - const off = registerDisposer(async (directory) => { + yield* registerDisposerScoped(async (directory) => { disposed.push(directory) }) - yield* Effect.addFinalizer(() => Effect.sync(off)) const first = yield* store.load({ directory: dir }) - bootstrapRun = Effect.promise(async () => { - reloading.resolve() - await releaseReload.promise - }) + yield* setBootstrap( + Effect.gen(function* () { + yield* Deferred.succeed(reloading, undefined) + yield* Deferred.await(releaseReload) + }), + ) const reload = yield* store.reload({ directory: dir }).pipe(Effect.forkScoped) - yield* Effect.promise(() => reloading.promise) + yield* Deferred.await(reloading) const staleDispose = yield* store.dispose(first).pipe(Effect.forkScoped) - releaseReload.resolve() + yield* Deferred.succeed(releaseReload, undefined) const second = yield* Fiber.join(reload) yield* Fiber.join(staleDispose) @@ -178,23 +202,25 @@ describe("InstanceStore", () => { Effect.gen(function* () { const dir = yield* tmpdirScoped({ git: true }) const store = yield* InstanceStore.Service - const disposing = Promise.withResolvers() - const releaseDispose = Promise.withResolvers() + const disposing = yield* Deferred.make() + const releaseDispose = yield* Deferred.make<() => void>() const disposed: Array = [] - const off = registerDisposer(async (directory) => { + yield* registerDisposerScoped((directory) => { disposed.push(directory) - disposing.resolve() - await releaseDispose.promise + Deferred.doneUnsafe(disposing, Effect.void) + return new Promise((resolve) => { + Deferred.doneUnsafe(releaseDispose, Effect.succeed(resolve)) + }) }) - yield* Effect.addFinalizer(() => Effect.sync(off)) yield* store.load({ directory: dir }) const first = yield* store.disposeAll().pipe(Effect.forkScoped) - yield* Effect.promise(() => disposing.promise) + yield* Deferred.await(disposing) + const release = yield* Deferred.await(releaseDispose) const second = yield* store.disposeAll().pipe(Effect.forkScoped) expect(disposed).toEqual([dir]) - releaseDispose.resolve() + yield* Effect.sync(release) yield* Effect.all([Fiber.join(first), Fiber.join(second)]) expect(disposed).toEqual([dir]) }), @@ -206,10 +232,9 @@ describe("InstanceStore", () => { const dir2 = yield* tmpdirScoped({ git: true }) const store = yield* InstanceStore.Service const disposed: Array = [] - const off = registerDisposer(async (directory) => { + yield* registerDisposerScoped(async (directory) => { disposed.push(directory) }) - yield* Effect.addFinalizer(() => Effect.sync(off)) yield* store.load({ directory: dir1 }) yield* store.disposeAll() @@ -221,19 +246,19 @@ describe("InstanceStore", () => { }), ) - it.live("provides legacy Promise callers with instance ALS", () => - Effect.gen(function* () { - const dir = yield* tmpdirScoped({ git: true }) + it.instance( + "provides legacy Promise callers with instance ALS", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const ctx = yield* InstanceRef + if (!ctx) throw new Error("InstanceRef not provided") - const directory = yield* Effect.promise(() => - WithInstance.provide({ - directory: dir, - fn: () => Instance.directory, - }), - ) + const directory = yield* Effect.promise(() => Promise.resolve(Instance.restore(ctx, () => Instance.directory))) - expect(directory).toBe(dir) - expect(() => Instance.current).toThrow() - }), + expect(directory).toBe(test.directory) + expect(() => Instance.current).toThrow() + }), + { git: true }, ) }) diff --git a/packages/opencode/test/project/migrate-global.test.ts b/packages/opencode/test/project/migrate-global.test.ts index c476c108b452..6efd670c5c98 100644 --- a/packages/opencode/test/project/migrate-global.test.ts +++ b/packages/opencode/test/project/migrate-global.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import { Project } from "@/project/project" import { Database } from "@/storage/db" import { eq } from "drizzle-orm" @@ -8,19 +8,14 @@ import { ProjectID } from "../../src/project/schema" import { SessionID } from "../../src/session/schema" import * as Log from "@opencode-ai/core/util/log" import { $ } from "bun" -import { tmpdir } from "../fixture/fixture" -import { Effect } from "effect" +import { tmpdirScoped } from "../fixture/fixture" +import { Effect, Layer } from "effect" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { testEffect } from "../lib/effect" -Log.init({ print: false }) +void Log.init({ print: false }) -function run(fn: (svc: Project.Interface) => Effect.Effect) { - return Effect.runPromise( - Effect.gen(function* () { - const svc = yield* Project.Service - return yield* fn(svc) - }).pipe(Effect.provide(Project.defaultLayer)), - ) -} +const it = testEffect(Layer.mergeAll(Project.defaultLayer, CrossSpawnSpawner.defaultLayer)) function legacySessionID() { // Global-session migration covers persisted IDs from before prefixed session IDs. @@ -63,91 +58,102 @@ function ensureGlobal() { } describe("migrateFromGlobal", () => { - test("migrates global sessions on first project creation", async () => { - // 1. Start with git init but no commits — creates "global" project row - await using tmp = await tmpdir() - await $`git init`.cwd(tmp.path).quiet() - await $`git config user.name "Test"`.cwd(tmp.path).quiet() - await $`git config user.email "test@opencode.test"`.cwd(tmp.path).quiet() - await $`git config commit.gpgsign false`.cwd(tmp.path).quiet() - const { project: pre } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(pre.id).toBe(ProjectID.global) - - // 2. Seed a session under "global" with matching directory - const id = legacySessionID() - seed({ id, dir: tmp.path, project: ProjectID.global }) - - // 3. Make a commit so the project gets a real ID - await $`git commit --allow-empty -m "root"`.cwd(tmp.path).quiet() - - const { project: real } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(real.id).not.toBe(ProjectID.global) - - // 4. The session should have been migrated to the real project ID - const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) - expect(row).toBeDefined() - expect(row!.project_id).toBe(real.id) - }) - - test("migrates global sessions even when project row already exists", async () => { - // 1. Create a repo with a commit — real project ID created immediately - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(project.id).not.toBe(ProjectID.global) - - // 2. Ensure "global" project row exists (as it would from a prior no-git session) - ensureGlobal() - - // 3. Seed a session under "global" with matching directory. - // This simulates a session created before git init that wasn't - // present when the real project row was first created. - const id = legacySessionID() - seed({ id, dir: tmp.path, project: ProjectID.global }) - - // 4. Call fromDirectory again — project row already exists, - // so the current code skips migration entirely. This is the bug. - await run((svc) => svc.fromDirectory(tmp.path)) - - const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) - expect(row).toBeDefined() - expect(row!.project_id).toBe(project.id) - }) - - test("does not claim sessions with empty directory", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(project.id).not.toBe(ProjectID.global) - - ensureGlobal() - - // Legacy sessions may lack a directory value. - // Without a matching origin directory, they should remain global. - const id = legacySessionID() - seed({ id, dir: "", project: ProjectID.global }) - - await run((svc) => svc.fromDirectory(tmp.path)) - - const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) - expect(row).toBeDefined() - expect(row!.project_id).toBe(ProjectID.global) - }) - - test("does not steal sessions from unrelated directories", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(project.id).not.toBe(ProjectID.global) - - ensureGlobal() - - // Seed a session under "global" but for a DIFFERENT directory - const id = legacySessionID() - seed({ id, dir: "/some/other/dir", project: ProjectID.global }) - - await run((svc) => svc.fromDirectory(tmp.path)) - - const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) - expect(row).toBeDefined() - // Should remain under "global" — not stolen - expect(row!.project_id).toBe(ProjectID.global) - }) + it.live("migrates global sessions on first project creation", () => + Effect.gen(function* () { + // 1. Start with git init but no commits — creates "global" project row + const tmp = yield* tmpdirScoped() + yield* Effect.promise(() => $`git init`.cwd(tmp).quiet()) + yield* Effect.promise(() => $`git config user.name "Test"`.cwd(tmp).quiet()) + yield* Effect.promise(() => $`git config user.email "test@opencode.test"`.cwd(tmp).quiet()) + yield* Effect.promise(() => $`git config commit.gpgsign false`.cwd(tmp).quiet()) + const projects = yield* Project.Service + const { project: pre } = yield* projects.fromDirectory(tmp) + expect(pre.id).toBe(ProjectID.global) + + // 2. Seed a session under "global" with matching directory + const id = legacySessionID() + yield* Effect.sync(() => seed({ id, dir: tmp, project: ProjectID.global })) + + // 3. Make a commit so the project gets a real ID + yield* Effect.promise(() => $`git commit --allow-empty -m "root"`.cwd(tmp).quiet()) + + const { project: real } = yield* projects.fromDirectory(tmp) + expect(real.id).not.toBe(ProjectID.global) + + // 4. The session should have been migrated to the real project ID + const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) + expect(row).toBeDefined() + expect(row!.project_id).toBe(real.id) + }), + ) + + it.live("migrates global sessions even when project row already exists", () => + Effect.gen(function* () { + // 1. Create a repo with a commit — real project ID created immediately + const tmp = yield* tmpdirScoped({ git: true }) + const projects = yield* Project.Service + const { project } = yield* projects.fromDirectory(tmp) + expect(project.id).not.toBe(ProjectID.global) + + // 2. Ensure "global" project row exists (as it would from a prior no-git session) + yield* Effect.sync(() => ensureGlobal()) + + // 3. Seed a session under "global" with matching directory. + // This simulates a session created before git init that wasn't + // present when the real project row was first created. + const id = legacySessionID() + yield* Effect.sync(() => seed({ id, dir: tmp, project: ProjectID.global })) + + // 4. Call fromDirectory again — project row already exists, + // so the current code skips migration entirely. This is the bug. + yield* projects.fromDirectory(tmp) + + const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) + expect(row).toBeDefined() + expect(row!.project_id).toBe(project.id) + }), + ) + + it.live("does not claim sessions with empty directory", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const projects = yield* Project.Service + const { project } = yield* projects.fromDirectory(tmp) + expect(project.id).not.toBe(ProjectID.global) + + yield* Effect.sync(() => ensureGlobal()) + + // Legacy sessions may lack a directory value. + // Without a matching origin directory, they should remain global. + const id = legacySessionID() + yield* Effect.sync(() => seed({ id, dir: "", project: ProjectID.global })) + + yield* projects.fromDirectory(tmp) + + const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) + expect(row).toBeDefined() + expect(row!.project_id).toBe(ProjectID.global) + }), + ) + + it.live("does not steal sessions from unrelated directories", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const projects = yield* Project.Service + const { project } = yield* projects.fromDirectory(tmp) + expect(project.id).not.toBe(ProjectID.global) + + yield* Effect.sync(() => ensureGlobal()) + + // Seed a session under "global" but for a DIFFERENT directory + const id = legacySessionID() + yield* Effect.sync(() => seed({ id, dir: "/some/other/dir", project: ProjectID.global })) + + yield* projects.fromDirectory(tmp) + const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, id)).get()) + expect(row).toBeDefined() + // Should remain under "global" — not stolen + expect(row!.project_id).toBe(ProjectID.global) + }), + ) }) diff --git a/packages/opencode/test/project/project.test.ts b/packages/opencode/test/project/project.test.ts index 9906b3164551..5688d13d1ad1 100644 --- a/packages/opencode/test/project/project.test.ts +++ b/packages/opencode/test/project/project.test.ts @@ -4,26 +4,29 @@ import { Project } from "@/project/project" import * as Log from "@opencode-ai/core/util/log" import { $ } from "bun" import path from "path" -import { tmpdir } from "../fixture/fixture" +import { tmpdirScoped } from "../fixture/fixture" import { GlobalBus } from "../../src/bus/global" import { ProjectID } from "../../src/project/schema" -import { Effect, Layer, Stream } from "effect" +import { Cause, Effect, Exit, Layer, Stream } from "effect" import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" import { NodePath } from "@effect/platform-node" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { testEffect } from "../lib/effect" +import { RuntimeFlags } from "@/effect/runtime-flags" void Log.init({ print: false }) const encoder = new TextEncoder() -function run(fn: (svc: Project.Interface) => Effect.Effect, layer = Project.defaultLayer) { - return Effect.runPromise( - Effect.gen(function* () { - const svc = yield* Project.Service - return yield* fn(svc) - }).pipe(Effect.provide(layer)), - ) +const layer = Layer.mergeAll(Project.defaultLayer, CrossSpawnSpawner.defaultLayer) +const it = testEffect(layer) + +function run(fn: (svc: Project.Interface) => Effect.Effect) { + return Effect.gen(function* () { + const svc = yield* Project.Service + return yield* fn(svc) + }) } /** @@ -67,403 +70,500 @@ function projectLayerWithFailure(failArg: string) { Layer.provide(Bus.defaultLayer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(NodePath.layer), + Layer.provide(RuntimeFlags.defaultLayer), ) } -describe("Project.fromDirectory", () => { - test("should handle git repository with no commits", async () => { - await using tmp = await tmpdir() - await $`git init`.cwd(tmp.path).quiet() +function projectLayerWithRuntimeFlags(flags: Parameters[0]) { + return Project.layer.pipe( + Layer.provide(Bus.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(NodePath.layer), + Layer.provide(RuntimeFlags.layer(flags)), + ) +} - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) +const failureIt = (failArg: string) => + testEffect(Layer.mergeAll(projectLayerWithFailure(failArg), CrossSpawnSpawner.defaultLayer)) - expect(project).toBeDefined() - expect(project.id).toBe(ProjectID.global) - expect(project.vcs).toBe("git") - expect(project.worktree).toBe(tmp.path) +const iconDiscoveryIt = testEffect( + Layer.provideMerge(projectLayerWithRuntimeFlags({ experimentalIconDiscovery: true }), CrossSpawnSpawner.defaultLayer), +) - const opencodeFile = path.join(tmp.path, ".git", "opencode") - expect(await Bun.file(opencodeFile).exists()).toBe(false) +function waitForProjectIcon(id: ProjectID, attempts = 50): Effect.Effect { + return Effect.gen(function* () { + const project = Project.get(id) + if (project?.icon?.url) return project + if (attempts <= 0) throw new Error(`Project icon was not discovered: ${id}`) + yield* Effect.sleep("10 millis") + return yield* waitForProjectIcon(id, attempts - 1) }) +} - test("should handle git repository with commits", async () => { - await using tmp = await tmpdir({ git: true }) +describe("Project.fromDirectory", () => { + it.live("should handle git repository with no commits", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* Effect.promise(() => $`git init`.cwd(tmp).quiet()) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - expect(project).toBeDefined() - expect(project.id).not.toBe(ProjectID.global) - expect(project.vcs).toBe("git") - expect(project.worktree).toBe(tmp.path) + expect(project).toBeDefined() + expect(project.id).toBe(ProjectID.global) + expect(project.vcs).toBe("git") + expect(project.worktree).toBe(tmp) - const opencodeFile = path.join(tmp.path, ".git", "opencode") - expect(await Bun.file(opencodeFile).exists()).toBe(true) - }) + const opencodeFile = path.join(tmp, ".git", "opencode") + expect(yield* Effect.promise(() => Bun.file(opencodeFile).exists())).toBe(false) + }), + ) - test("returns global for non-git directory", async () => { - await using tmp = await tmpdir() - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(project.id).toBe(ProjectID.global) - }) + it.live("should handle git repository with commits", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - test("derives stable project ID from root commit", async () => { - await using tmp = await tmpdir({ git: true }) - const { project: a } = await run((svc) => svc.fromDirectory(tmp.path)) - const { project: b } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(b.id).toBe(a.id) - }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + + expect(project).toBeDefined() + expect(project.id).not.toBe(ProjectID.global) + expect(project.vcs).toBe("git") + expect(project.worktree).toBe(tmp) + + const opencodeFile = path.join(tmp, ".git", "opencode") + expect(yield* Effect.promise(() => Bun.file(opencodeFile).exists())).toBe(true) + }), + ) + + it.live("returns global for non-git directory", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + expect(project.id).toBe(ProjectID.global) + }), + ) + + it.live("derives stable project ID from root commit", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project: a } = yield* run((svc) => svc.fromDirectory(tmp)) + const { project: b } = yield* run((svc) => svc.fromDirectory(tmp)) + expect(b.id).toBe(a.id) + }), + ) }) describe("Project.fromDirectory git failure paths", () => { - test("keeps vcs when rev-list exits non-zero (no commits)", async () => { - await using tmp = await tmpdir() - await $`git init`.cwd(tmp.path).quiet() - - // rev-list fails because HEAD doesn't exist yet — this is the natural scenario - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - expect(project.vcs).toBe("git") - expect(project.id).toBe(ProjectID.global) - expect(project.worktree).toBe(tmp.path) - }) + it.live("keeps vcs when rev-list exits non-zero (no commits)", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* Effect.promise(() => $`git init`.cwd(tmp).quiet()) + + // rev-list fails because HEAD doesn't exist yet: this is the natural scenario. + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + expect(project.vcs).toBe("git") + expect(project.id).toBe(ProjectID.global) + expect(project.worktree).toBe(tmp) + }), + ) - test("handles show-toplevel failure gracefully", async () => { - await using tmp = await tmpdir({ git: true }) - const layer = projectLayerWithFailure("--show-toplevel") + failureIt("--show-toplevel").live("handles show-toplevel failure gracefully", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - const { project, sandbox } = await run((svc) => svc.fromDirectory(tmp.path), layer) - expect(project.worktree).toBe(tmp.path) - expect(sandbox).toBe(tmp.path) - }) + const { project, sandbox } = yield* run((svc) => svc.fromDirectory(tmp)) + expect(project.worktree).toBe(tmp) + expect(sandbox).toBe(tmp) + }), + ) - test("handles git-common-dir failure gracefully", async () => { - await using tmp = await tmpdir({ git: true }) - const layer = projectLayerWithFailure("--git-common-dir") + failureIt("--git-common-dir").live("handles git-common-dir failure gracefully", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - const { project, sandbox } = await run((svc) => svc.fromDirectory(tmp.path), layer) - expect(project.worktree).toBe(tmp.path) - expect(sandbox).toBe(tmp.path) - }) + const { project, sandbox } = yield* run((svc) => svc.fromDirectory(tmp)) + expect(project.worktree).toBe(tmp) + expect(sandbox).toBe(tmp) + }), + ) }) describe("Project.fromDirectory with worktrees", () => { - test("should set worktree to root when called from root", async () => { - await using tmp = await tmpdir({ git: true }) - - const { project, sandbox } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should set worktree to root when called from root", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - expect(project.worktree).toBe(tmp.path) - expect(sandbox).toBe(tmp.path) - expect(project.sandboxes).not.toContain(tmp.path) - }) + const { project, sandbox } = yield* run((svc) => svc.fromDirectory(tmp)) - test("should set worktree to root when called from a worktree", async () => { - await using tmp = await tmpdir({ git: true }) + expect(project.worktree).toBe(tmp) + expect(sandbox).toBe(tmp) + expect(project.sandboxes).not.toContain(tmp) + }), + ) - const worktreePath = path.join(tmp.path, "..", path.basename(tmp.path) + "-worktree") - try { - await $`git worktree add ${worktreePath} -b test-branch-${Date.now()}`.cwd(tmp.path).quiet() + it.live("should set worktree to root when called from a worktree", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + + const worktreePath = path.join(tmp, "..", path.basename(tmp) + "-worktree") + yield* Effect.addFinalizer(() => + Effect.promise(() => + $`git worktree remove ${worktreePath}` + .cwd(tmp) + .quiet() + .catch(() => {}), + ), + ) + yield* Effect.promise(() => $`git worktree add ${worktreePath} -b test-branch-${Date.now()}`.cwd(tmp).quiet()) - const { project, sandbox } = await run((svc) => svc.fromDirectory(worktreePath)) + const { project, sandbox } = yield* run((svc) => svc.fromDirectory(worktreePath)) - expect(project.worktree).toBe(tmp.path) + expect(project.worktree).toBe(tmp) expect(sandbox).toBe(worktreePath) expect(project.sandboxes).toContain(worktreePath) - expect(project.sandboxes).not.toContain(tmp.path) - } finally { - await $`git worktree remove ${worktreePath}` - .cwd(tmp.path) - .quiet() - .catch(() => {}) - } - }) - - test("worktree should share project ID with main repo", async () => { - await using tmp = await tmpdir({ git: true }) - - const { project: main } = await run((svc) => svc.fromDirectory(tmp.path)) + expect(project.sandboxes).not.toContain(tmp) + }), + ) - const worktreePath = path.join(tmp.path, "..", path.basename(tmp.path) + "-wt-shared") - try { - await $`git worktree add ${worktreePath} -b shared-${Date.now()}`.cwd(tmp.path).quiet() + it.live("worktree should share project ID with main repo", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + + const { project: main } = yield* run((svc) => svc.fromDirectory(tmp)) + + const worktreePath = path.join(tmp, "..", path.basename(tmp) + "-wt-shared") + yield* Effect.addFinalizer(() => + Effect.promise(() => + $`git worktree remove ${worktreePath}` + .cwd(tmp) + .quiet() + .catch(() => {}), + ), + ) + yield* Effect.promise(() => $`git worktree add ${worktreePath} -b shared-${Date.now()}`.cwd(tmp).quiet()) - const { project: wt } = await run((svc) => svc.fromDirectory(worktreePath)) + const { project: wt } = yield* run((svc) => svc.fromDirectory(worktreePath)) expect(wt.id).toBe(main.id) // Cache should live in the common .git dir, not the worktree's .git file - const cache = path.join(tmp.path, ".git", "opencode") - const exists = await Bun.file(cache).exists() + const cache = path.join(tmp, ".git", "opencode") + const exists = yield* Effect.promise(() => Bun.file(cache).exists()) expect(exists).toBe(true) - } finally { - await $`git worktree remove ${worktreePath}` - .cwd(tmp.path) - .quiet() - .catch(() => {}) - } - }) + }), + ) - test("separate clones of the same repo should share project ID", async () => { - await using tmp = await tmpdir({ git: true }) + it.live("separate clones of the same repo should share project ID", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - // Create a bare remote, push, then clone into a second directory - const bare = tmp.path + "-bare" - const clone = tmp.path + "-clone" - try { - await $`git clone --bare ${tmp.path} ${bare}`.quiet() - await $`git clone ${bare} ${clone}`.quiet() + // Create a bare remote, push, then clone into a second directory + const bare = tmp + "-bare" + const clone = tmp + "-clone" + yield* Effect.addFinalizer(() => + Effect.promise(() => $`rm -rf ${bare} ${clone}`.quiet().nothrow()).pipe(Effect.ignore), + ) + yield* Effect.promise(() => $`git clone --bare ${tmp} ${bare}`.quiet()) + yield* Effect.promise(() => $`git clone ${bare} ${clone}`.quiet()) - const { project: a } = await run((svc) => svc.fromDirectory(tmp.path)) - const { project: b } = await run((svc) => svc.fromDirectory(clone)) + const { project: a } = yield* run((svc) => svc.fromDirectory(tmp)) + const { project: b } = yield* run((svc) => svc.fromDirectory(clone)) expect(b.id).toBe(a.id) - } finally { - await $`rm -rf ${bare} ${clone}`.quiet().nothrow() - } - }) - - test("should accumulate multiple worktrees in sandboxes", async () => { - await using tmp = await tmpdir({ git: true }) + }), + ) - const worktree1 = path.join(tmp.path, "..", path.basename(tmp.path) + "-wt1") - const worktree2 = path.join(tmp.path, "..", path.basename(tmp.path) + "-wt2") - try { - await $`git worktree add ${worktree1} -b branch-${Date.now()}`.cwd(tmp.path).quiet() - await $`git worktree add ${worktree2} -b branch-${Date.now() + 1}`.cwd(tmp.path).quiet() + it.live("should accumulate multiple worktrees in sandboxes", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + + const worktree1 = path.join(tmp, "..", path.basename(tmp) + "-wt1") + const worktree2 = path.join(tmp, "..", path.basename(tmp) + "-wt2") + yield* Effect.addFinalizer(() => + Effect.gen(function* () { + yield* Effect.promise(() => + $`git worktree remove ${worktree1}` + .cwd(tmp) + .quiet() + .catch(() => {}), + ) + yield* Effect.promise(() => + $`git worktree remove ${worktree2}` + .cwd(tmp) + .quiet() + .catch(() => {}), + ) + }), + ) + yield* Effect.promise(() => $`git worktree add ${worktree1} -b branch-${Date.now()}`.cwd(tmp).quiet()) + yield* Effect.promise(() => $`git worktree add ${worktree2} -b branch-${Date.now() + 1}`.cwd(tmp).quiet()) - await run((svc) => svc.fromDirectory(worktree1)) - const { project } = await run((svc) => svc.fromDirectory(worktree2)) + yield* run((svc) => svc.fromDirectory(worktree1)) + const { project } = yield* run((svc) => svc.fromDirectory(worktree2)) - expect(project.worktree).toBe(tmp.path) + expect(project.worktree).toBe(tmp) expect(project.sandboxes).toContain(worktree1) expect(project.sandboxes).toContain(worktree2) - expect(project.sandboxes).not.toContain(tmp.path) - } finally { - await $`git worktree remove ${worktree1}` - .cwd(tmp.path) - .quiet() - .catch(() => {}) - await $`git worktree remove ${worktree2}` - .cwd(tmp.path) - .quiet() - .catch(() => {}) - } - }) + expect(project.sandboxes).not.toContain(tmp) + }), + ) }) describe("Project.discover", () => { - test("should discover favicon.png in root", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + iconDiscoveryIt.live("discovers favicon from fromDirectory when enabled", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const pngData = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) + yield* Effect.promise(() => Bun.write(path.join(tmp, "favicon.png"), pngData)) - const pngData = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) - await Bun.write(path.join(tmp.path, "favicon.png"), pngData) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + const updated = yield* waitForProjectIcon(project.id) - await run((svc) => svc.discover(project)) + expect(updated.icon?.url).toStartWith("data:") + expect(updated.icon?.url).toContain("base64") + }), + ) - const updated = Project.get(project.id) - expect(updated).toBeDefined() - expect(updated!.icon).toBeDefined() - expect(updated!.icon?.url).toStartWith("data:") - expect(updated!.icon?.url).toContain("base64") - expect(updated!.icon?.color).toBeUndefined() - }) + it.live("should discover favicon.png in root", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - test("should not discover non-image files", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + const pngData = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) + yield* Effect.promise(() => Bun.write(path.join(tmp, "favicon.png"), pngData)) - await Bun.write(path.join(tmp.path, "favicon.txt"), "not an image") + yield* run((svc) => svc.discover(project)) - await run((svc) => svc.discover(project)) + const updated = Project.get(project.id) + expect(updated).toBeDefined() + expect(updated!.icon).toBeDefined() + expect(updated!.icon?.url).toStartWith("data:") + expect(updated!.icon?.url).toContain("base64") + expect(updated!.icon?.color).toBeUndefined() + }), + ) - const updated = Project.get(project.id) - expect(updated).toBeDefined() - expect(updated!.icon).toBeUndefined() - }) + it.live("should not discover non-image files", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - test("should not discover favicon when override is set", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + yield* Effect.promise(() => Bun.write(path.join(tmp, "favicon.txt"), "not an image")) - await run((svc) => - svc.update({ - projectID: project.id, - icon: { override: "data:image/png;base64,override" }, - }), - ) + yield* run((svc) => svc.discover(project)) - const updatedProject = await run((svc) => svc.get(project.id)) - if (!updatedProject) throw new Error("Project not found") + const updated = Project.get(project.id) + expect(updated).toBeDefined() + expect(updated!.icon).toBeUndefined() + }), + ) - const pngData = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) - await Bun.write(path.join(tmp.path, "favicon.png"), pngData) + it.live("should not discover favicon when override is set", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - await run((svc) => svc.discover(updatedProject)) + yield* run((svc) => + svc.update({ + projectID: project.id, + icon: { override: "data:image/png;base64,override" }, + }), + ) - const updated = Project.get(project.id) - expect(updated).toBeDefined() - expect(updated!.icon?.override).toBe("data:image/png;base64,override") - expect(updated!.icon?.url).toBeUndefined() - }) + const updatedProject = yield* run((svc) => svc.get(project.id)) + if (!updatedProject) throw new Error("Project not found") + + const pngData = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) + yield* Effect.promise(() => Bun.write(path.join(tmp, "favicon.png"), pngData)) + + yield* run((svc) => svc.discover(updatedProject)) + + const updated = Project.get(project.id) + expect(updated).toBeDefined() + expect(updated!.icon?.override).toBe("data:image/png;base64,override") + expect(updated!.icon?.url).toBeUndefined() + }), + ) }) describe("Project.update", () => { - test("should update name", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should update name", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const updated = await run((svc) => - svc.update({ - projectID: project.id, - name: "New Project Name", - }), - ) + const updated = yield* run((svc) => + svc.update({ + projectID: project.id, + name: "New Project Name", + }), + ) - expect(updated.name).toBe("New Project Name") + expect(updated.name).toBe("New Project Name") - const fromDb = Project.get(project.id) - expect(fromDb?.name).toBe("New Project Name") - }) + const fromDb = Project.get(project.id) + expect(fromDb?.name).toBe("New Project Name") + }), + ) - test("should update icon url", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should update icon url", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const updated = await run((svc) => - svc.update({ - projectID: project.id, - icon: { url: "https://example.com/icon.png" }, - }), - ) + const updated = yield* run((svc) => + svc.update({ + projectID: project.id, + icon: { url: "https://example.com/icon.png" }, + }), + ) - expect(updated.icon?.url).toBe("https://example.com/icon.png") + expect(updated.icon?.url).toBe("https://example.com/icon.png") - const fromDb = Project.get(project.id) - expect(fromDb?.icon?.url).toBe("https://example.com/icon.png") - }) + const fromDb = Project.get(project.id) + expect(fromDb?.icon?.url).toBe("https://example.com/icon.png") + }), + ) - test("should update icon color", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should update icon color", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const updated = await run((svc) => - svc.update({ - projectID: project.id, - icon: { color: "#ff0000" }, - }), - ) + const updated = yield* run((svc) => + svc.update({ + projectID: project.id, + icon: { color: "#ff0000" }, + }), + ) - expect(updated.icon?.color).toBe("#ff0000") + expect(updated.icon?.color).toBe("#ff0000") - const fromDb = Project.get(project.id) - expect(fromDb?.icon?.color).toBe("#ff0000") - }) + const fromDb = Project.get(project.id) + expect(fromDb?.icon?.color).toBe("#ff0000") + }), + ) - test("should update icon override", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should update icon override", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const updated = await run((svc) => - svc.update({ - projectID: project.id, - icon: { override: "data:image/png;base64,abc123" }, - }), - ) + const updated = yield* run((svc) => + svc.update({ + projectID: project.id, + icon: { override: "data:image/png;base64,abc123" }, + }), + ) - expect(updated.icon?.override).toBe("data:image/png;base64,abc123") + expect(updated.icon?.override).toBe("data:image/png;base64,abc123") - const fromDb = Project.get(project.id) - expect(fromDb?.icon?.override).toBe("data:image/png;base64,abc123") - }) + const fromDb = Project.get(project.id) + expect(fromDb?.icon?.override).toBe("data:image/png;base64,abc123") + }), + ) - test("should update commands", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should update commands", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const updated = await run((svc) => - svc.update({ - projectID: project.id, - commands: { start: "npm run dev" }, - }), - ) + const updated = yield* run((svc) => + svc.update({ + projectID: project.id, + commands: { start: "npm run dev" }, + }), + ) - expect(updated.commands?.start).toBe("npm run dev") + expect(updated.commands?.start).toBe("npm run dev") - const fromDb = Project.get(project.id) - expect(fromDb?.commands?.start).toBe("npm run dev") - }) + const fromDb = Project.get(project.id) + expect(fromDb?.commands?.start).toBe("npm run dev") + }), + ) - test("should throw error when project not found", async () => { - await expect( - run((svc) => + it.live("should throw error when project not found", () => + Effect.gen(function* () { + const exit = yield* run((svc) => svc.update({ projectID: ProjectID.make("nonexistent-project-id"), name: "Should Fail", }), - ), - ).rejects.toThrow("Project not found: nonexistent-project-id") - }) + ).pipe(Effect.exit) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const error = Cause.squash(exit.cause) + expect(error instanceof Error ? error.message : String(error)).toContain( + "Project not found: nonexistent-project-id", + ) + } + }), + ) - test("should emit GlobalBus event on update", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("should emit GlobalBus event on update", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - let eventPayload: any = null - const on = (data: any) => { - eventPayload = data - } - GlobalBus.on("event", on) + let eventPayload: any = null + const on = (data: any) => { + eventPayload = data + } + GlobalBus.on("event", on) + yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on))) - try { - await run((svc) => svc.update({ projectID: project.id, name: "Updated Name" })) + yield* run((svc) => svc.update({ projectID: project.id, name: "Updated Name" })) expect(eventPayload).not.toBeNull() expect(eventPayload.payload.type).toBe("project.updated") expect(eventPayload.payload.properties.name).toBe("Updated Name") - } finally { - GlobalBus.off("event", on) - } - }) + }), + ) - test("should update multiple fields at once", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - - const updated = await run((svc) => - svc.update({ - projectID: project.id, - name: "Multi Update", - icon: { url: "https://example.com/favicon.ico", override: "data:image/png;base64,abc123", color: "#00ff00" }, - commands: { start: "make start" }, - }), - ) - - expect(updated.name).toBe("Multi Update") - expect(updated.icon?.url).toBe("https://example.com/favicon.ico") - expect(updated.icon?.override).toBe("data:image/png;base64,abc123") - expect(updated.icon?.color).toBe("#00ff00") - expect(updated.commands?.start).toBe("make start") - }) + it.live("should update multiple fields at once", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + + const updated = yield* run((svc) => + svc.update({ + projectID: project.id, + name: "Multi Update", + icon: { url: "https://example.com/favicon.ico", override: "data:image/png;base64,abc123", color: "#00ff00" }, + commands: { start: "make start" }, + }), + ) + + expect(updated.name).toBe("Multi Update") + expect(updated.icon?.url).toBe("https://example.com/favicon.ico") + expect(updated.icon?.override).toBe("data:image/png;base64,abc123") + expect(updated.icon?.color).toBe("#00ff00") + expect(updated.commands?.start).toBe("make start") + }), + ) }) describe("Project.list and Project.get", () => { - test("list returns all projects", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("list returns all projects", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const all = Project.list() - expect(all.length).toBeGreaterThan(0) - expect(all.find((p) => p.id === project.id)).toBeDefined() - }) + const all = Project.list() + expect(all.length).toBeGreaterThan(0) + expect(all.find((p) => p.id === project.id)).toBeDefined() + }), + ) - test("get returns project by id", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("get returns project by id", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - const found = Project.get(project.id) - expect(found).toBeDefined() - expect(found!.id).toBe(project.id) - }) + const found = Project.get(project.id) + expect(found).toBeDefined() + expect(found!.id).toBe(project.id) + }), + ) test("get returns undefined for unknown id", () => { const found = Project.get(ProjectID.make("nonexistent")) @@ -472,65 +572,74 @@ describe("Project.list and Project.get", () => { }) describe("Project.setInitialized", () => { - test("sets time_initialized on project", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) + it.live("sets time_initialized on project", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) - expect(project.time.initialized).toBeUndefined() + expect(project.time.initialized).toBeUndefined() - Project.setInitialized(project.id) + Project.setInitialized(project.id) - const updated = Project.get(project.id) - expect(updated?.time.initialized).toBeDefined() - }) + const updated = Project.get(project.id) + expect(updated?.time.initialized).toBeDefined() + }), + ) }) describe("Project.addSandbox and Project.removeSandbox", () => { - test("addSandbox adds directory and removeSandbox removes it", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - const sandboxDir = path.join(tmp.path, "sandbox-test") + it.live("addSandbox adds directory and removeSandbox removes it", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + const sandboxDir = path.join(tmp, "sandbox-test") - await run((svc) => svc.addSandbox(project.id, sandboxDir)) + yield* run((svc) => svc.addSandbox(project.id, sandboxDir)) - let found = Project.get(project.id) - expect(found?.sandboxes).toContain(sandboxDir) + let found = Project.get(project.id) + expect(found?.sandboxes).toContain(sandboxDir) - await run((svc) => svc.removeSandbox(project.id, sandboxDir)) + yield* run((svc) => svc.removeSandbox(project.id, sandboxDir)) - found = Project.get(project.id) - expect(found?.sandboxes).not.toContain(sandboxDir) - }) + found = Project.get(project.id) + expect(found?.sandboxes).not.toContain(sandboxDir) + }), + ) - test("addSandbox emits GlobalBus event", async () => { - await using tmp = await tmpdir({ git: true }) - const { project } = await run((svc) => svc.fromDirectory(tmp.path)) - const sandboxDir = path.join(tmp.path, "sandbox-event") + it.live("addSandbox emits GlobalBus event", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const { project } = yield* run((svc) => svc.fromDirectory(tmp)) + const sandboxDir = path.join(tmp, "sandbox-event") - const events: any[] = [] - const on = (evt: any) => events.push(evt) - GlobalBus.on("event", on) + const events: any[] = [] + const on = (evt: any) => events.push(evt) + GlobalBus.on("event", on) + yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on))) - await run((svc) => svc.addSandbox(project.id, sandboxDir)) + yield* run((svc) => svc.addSandbox(project.id, sandboxDir)) - GlobalBus.off("event", on) - expect(events.some((e) => e.payload.type === Project.Event.Updated.type)).toBe(true) - }) + expect(events.some((e) => e.payload.type === Project.Event.Updated.type)).toBe(true) + }), + ) }) describe("Project.fromDirectory with bare repos", () => { - test("worktree from bare repo should cache in bare repo, not parent", async () => { - await using tmp = await tmpdir({ git: true }) + it.live("worktree from bare repo should cache in bare repo, not parent", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - const parentDir = path.dirname(tmp.path) - const barePath = path.join(parentDir, `bare-${Date.now()}.git`) - const worktreePath = path.join(parentDir, `worktree-${Date.now()}`) + const parentDir = path.dirname(tmp) + const barePath = path.join(parentDir, `bare-${Date.now()}.git`) + const worktreePath = path.join(parentDir, `worktree-${Date.now()}`) + yield* Effect.addFinalizer(() => + Effect.promise(() => $`rm -rf ${barePath} ${worktreePath}`.quiet().nothrow()).pipe(Effect.ignore), + ) - try { - await $`git clone --bare ${tmp.path} ${barePath}`.quiet() - await $`git worktree add ${worktreePath} HEAD`.cwd(barePath).quiet() + yield* Effect.promise(() => $`git clone --bare ${tmp} ${barePath}`.quiet()) + yield* Effect.promise(() => $`git worktree add ${worktreePath} HEAD`.cwd(barePath).quiet()) - const { project } = await run((svc) => svc.fromDirectory(worktreePath)) + const { project } = yield* run((svc) => svc.fromDirectory(worktreePath)) expect(project.id).not.toBe(ProjectID.global) expect(project.worktree).toBe(barePath) @@ -538,31 +647,34 @@ describe("Project.fromDirectory with bare repos", () => { const correctCache = path.join(barePath, "opencode") const wrongCache = path.join(parentDir, ".git", "opencode") - expect(await Bun.file(correctCache).exists()).toBe(true) - expect(await Bun.file(wrongCache).exists()).toBe(false) - } finally { - await $`rm -rf ${barePath} ${worktreePath}`.quiet().nothrow() - } - }) - - test("different bare repos under same parent should not share project ID", async () => { - await using tmp1 = await tmpdir({ git: true }) - await using tmp2 = await tmpdir({ git: true }) + expect(yield* Effect.promise(() => Bun.file(correctCache).exists())).toBe(true) + expect(yield* Effect.promise(() => Bun.file(wrongCache).exists())).toBe(false) + }), + ) - const parentDir = path.dirname(tmp1.path) - const bareA = path.join(parentDir, `bare-a-${Date.now()}.git`) - const bareB = path.join(parentDir, `bare-b-${Date.now()}.git`) - const worktreeA = path.join(parentDir, `wt-a-${Date.now()}`) - const worktreeB = path.join(parentDir, `wt-b-${Date.now()}`) + it.live("different bare repos under same parent should not share project ID", () => + Effect.gen(function* () { + const tmp1 = yield* tmpdirScoped({ git: true }) + const tmp2 = yield* tmpdirScoped({ git: true }) + + const parentDir = path.dirname(tmp1) + const bareA = path.join(parentDir, `bare-a-${Date.now()}.git`) + const bareB = path.join(parentDir, `bare-b-${Date.now()}.git`) + const worktreeA = path.join(parentDir, `wt-a-${Date.now()}`) + const worktreeB = path.join(parentDir, `wt-b-${Date.now()}`) + yield* Effect.addFinalizer(() => + Effect.promise(() => $`rm -rf ${bareA} ${bareB} ${worktreeA} ${worktreeB}`.quiet().nothrow()).pipe( + Effect.ignore, + ), + ) - try { - await $`git clone --bare ${tmp1.path} ${bareA}`.quiet() - await $`git clone --bare ${tmp2.path} ${bareB}`.quiet() - await $`git worktree add ${worktreeA} HEAD`.cwd(bareA).quiet() - await $`git worktree add ${worktreeB} HEAD`.cwd(bareB).quiet() + yield* Effect.promise(() => $`git clone --bare ${tmp1} ${bareA}`.quiet()) + yield* Effect.promise(() => $`git clone --bare ${tmp2} ${bareB}`.quiet()) + yield* Effect.promise(() => $`git worktree add ${worktreeA} HEAD`.cwd(bareA).quiet()) + yield* Effect.promise(() => $`git worktree add ${worktreeB} HEAD`.cwd(bareB).quiet()) - const { project: projA } = await run((svc) => svc.fromDirectory(worktreeA)) - const { project: projB } = await run((svc) => svc.fromDirectory(worktreeB)) + const { project: projA } = yield* run((svc) => svc.fromDirectory(worktreeA)) + const { project: projB } = yield* run((svc) => svc.fromDirectory(worktreeB)) expect(projA.id).not.toBe(projB.id) @@ -570,34 +682,33 @@ describe("Project.fromDirectory with bare repos", () => { const cacheB = path.join(bareB, "opencode") const wrongCache = path.join(parentDir, ".git", "opencode") - expect(await Bun.file(cacheA).exists()).toBe(true) - expect(await Bun.file(cacheB).exists()).toBe(true) - expect(await Bun.file(wrongCache).exists()).toBe(false) - } finally { - await $`rm -rf ${bareA} ${bareB} ${worktreeA} ${worktreeB}`.quiet().nothrow() - } - }) + expect(yield* Effect.promise(() => Bun.file(cacheA).exists())).toBe(true) + expect(yield* Effect.promise(() => Bun.file(cacheB).exists())).toBe(true) + expect(yield* Effect.promise(() => Bun.file(wrongCache).exists())).toBe(false) + }), + ) - test("bare repo without .git suffix is still detected via core.bare", async () => { - await using tmp = await tmpdir({ git: true }) + it.live("bare repo without .git suffix is still detected via core.bare", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) - const parentDir = path.dirname(tmp.path) - const barePath = path.join(parentDir, `bare-no-suffix-${Date.now()}`) - const worktreePath = path.join(parentDir, `worktree-${Date.now()}`) + const parentDir = path.dirname(tmp) + const barePath = path.join(parentDir, `bare-no-suffix-${Date.now()}`) + const worktreePath = path.join(parentDir, `worktree-${Date.now()}`) + yield* Effect.addFinalizer(() => + Effect.promise(() => $`rm -rf ${barePath} ${worktreePath}`.quiet().nothrow()).pipe(Effect.ignore), + ) - try { - await $`git clone --bare ${tmp.path} ${barePath}`.quiet() - await $`git worktree add ${worktreePath} HEAD`.cwd(barePath).quiet() + yield* Effect.promise(() => $`git clone --bare ${tmp} ${barePath}`.quiet()) + yield* Effect.promise(() => $`git worktree add ${worktreePath} HEAD`.cwd(barePath).quiet()) - const { project } = await run((svc) => svc.fromDirectory(worktreePath)) + const { project } = yield* run((svc) => svc.fromDirectory(worktreePath)) expect(project.id).not.toBe(ProjectID.global) expect(project.worktree).toBe(barePath) const correctCache = path.join(barePath, "opencode") - expect(await Bun.file(correctCache).exists()).toBe(true) - } finally { - await $`rm -rf ${barePath} ${worktreePath}`.quiet().nothrow() - } - }) + expect(yield* Effect.promise(() => Bun.file(correctCache).exists())).toBe(true) + }), + ) }) diff --git a/packages/opencode/test/project/vcs.test.ts b/packages/opencode/test/project/vcs.test.ts index 82eacfb6df8f..b1d637302df5 100644 --- a/packages/opencode/test/project/vcs.test.ts +++ b/packages/opencode/test/project/vcs.test.ts @@ -1,161 +1,150 @@ -import { $ } from "bun" -import { afterEach, describe, expect, test } from "bun:test" +import { afterEach, describe, expect } from "bun:test" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import { parsePatch } from "diff" -import { Effect } from "effect" +import { Deferred, Effect, Layer } from "effect" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import fs from "fs/promises" import path from "path" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { AppRuntime } from "../../src/effect/app-runtime" +import { disposeAllInstances, provideInstance, TestInstance, tmpdirScoped } from "../fixture/fixture" +import { Bus } from "../../src/bus" import { FileWatcher } from "../../src/file/watcher" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { GlobalBus } from "../../src/bus/global" +import { Git } from "../../src/git" import { Vcs } from "@/project/vcs" - -// Skip in CI — native @parcel/watcher binding needed -const describeVcs = FileWatcher.hasNativeBinding() && !process.env.CI ? describe : describe.skip +import { testEffect } from "../lib/effect" // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- -async function withVcs(directory: string, body: () => Promise) { - return WithInstance.provide({ - directory, - fn: async () => { - await AppRuntime.runPromise( - Effect.gen(function* () { - const watcher = yield* FileWatcher.Service - const vcs = yield* Vcs.Service - yield* watcher.init() - yield* vcs.init() - }), - ) - await Bun.sleep(500) - await body() - }, - }) -} - -function withVcsOnly(directory: string, body: () => Promise) { - return WithInstance.provide({ - directory, - fn: async () => { - await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - yield* vcs.init() - }), - ) - await body() - }, - }) -} - -type BranchEvent = { directory?: string; payload: { type: string; properties: { branch?: string } } } const weird = process.platform === "win32" ? "space file.txt" : "tab\tfile.txt" -/** Wait for a Vcs.Event.BranchUpdated event on GlobalBus, with retry polling as fallback */ -function nextBranchUpdate(directory: string, timeout = 10_000) { - return new Promise((resolve, reject) => { - let settled = false - - const timer = setTimeout(() => { - if (settled) return - settled = true - GlobalBus.off("event", on) - reject(new Error("timed out waiting for BranchUpdated event")) - }, timeout) - - function on(evt: BranchEvent) { - if (evt.directory !== directory) return - if (evt.payload.type !== Vcs.Event.BranchUpdated.type) return - if (settled) return - settled = true - clearTimeout(timer) - GlobalBus.off("event", on) - resolve(evt.payload.properties.branch) - } - - GlobalBus.on("event", on) +const layer = Layer.mergeAll( + Vcs.layer.pipe(Layer.provideMerge(Git.defaultLayer), Layer.provideMerge(Bus.layer)), + CrossSpawnSpawner.defaultLayer, + AppFileSystem.defaultLayer, +) +const it = testEffect(layer) + +const git = Effect.fn("VcsTest.git")(function* (cwd: string, args: string[]) { + const result = yield* Git.Service.use((git) => git.run(args, { cwd })) + if (result.exitCode !== 0) throw new Error(`git ${args.join(" ")} failed: ${result.stderr.toString("utf8")}`) +}) + +const write = Effect.fn("VcsTest.write")(function* (file: string, content: string) { + yield* AppFileSystem.Service.use((fs) => fs.writeWithDirs(file, content)) +}) + +const remove = Effect.fn("VcsTest.remove")(function* (file: string) { + yield* AppFileSystem.Service.use((fs) => fs.remove(file)) +}) + +const symlink = (target: string, file: string) => Effect.promise(() => fs.symlink(target, file)) + +const init = Effect.fn("VcsTest.init")(function* () { + const vcs = yield* Vcs.Service + yield* vcs.init() + return vcs +}) + +const nextBranchUpdate = Effect.fn("VcsTest.nextBranchUpdate")(function* () { + const bus = yield* Bus.Service + const updated = yield* Deferred.make() + + const off = yield* bus.subscribeCallback(Vcs.Event.BranchUpdated, (evt) => { + Effect.runSync(Deferred.succeed(updated, evt.properties.branch)) }) -} + yield* Effect.addFinalizer(() => Effect.sync(off)) + + return updated +}) + +const publishHeadChangeUntil = Effect.fn("VcsTest.publishHeadChangeUntil")(function* ( + pending: Deferred.Deferred, + head: string, +) { + const bus = yield* Bus.Service + for (let i = 0; i < 50; i++) { + yield* bus.publish(FileWatcher.Event.Updated, { file: head, event: "change" }) + if (yield* Deferred.isDone(pending)) return + yield* Effect.sleep("10 millis") + } +}) // --------------------------------------------------------------------------- // Tests // --------------------------------------------------------------------------- -describeVcs("Vcs", () => { +describe("Vcs", () => { afterEach(async () => { await disposeAllInstances() }) - test("branch() returns current branch name", async () => { - await using tmp = await tmpdir({ git: true }) + it.instance( + "branch() returns current branch name", + () => + Effect.gen(function* () { + const vcs = yield* init() + const branch = yield* vcs.branch() - await withVcs(tmp.path, async () => { - const branch = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.branch() - }), - ) - expect(branch).toBeDefined() - expect(typeof branch).toBe("string") - }) - }) + expect(branch).toBeDefined() + expect(typeof branch).toBe("string") + }), + { git: true }, + ) - test("branch() returns undefined for non-git directories", async () => { - await using tmp = await tmpdir() + it.instance("branch() returns undefined for non-git directories", () => + Effect.gen(function* () { + const vcs = yield* init() + const branch = yield* vcs.branch() - await withVcs(tmp.path, async () => { - const branch = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.branch() - }), - ) expect(branch).toBeUndefined() - }) - }) - - test("publishes BranchUpdated when .git/HEAD changes", async () => { - await using tmp = await tmpdir({ git: true }) - const branch = `test-${Math.random().toString(36).slice(2)}` - await $`git branch ${branch}`.cwd(tmp.path).quiet() - - await withVcs(tmp.path, async () => { - const pending = nextBranchUpdate(tmp.path) - - const head = path.join(tmp.path, ".git", "HEAD") - await fs.writeFile(head, `ref: refs/heads/${branch}\n`) - - const updated = await pending - expect(updated).toBe(branch) - }) - }) - - test("branch() reflects the new branch after HEAD change", async () => { - await using tmp = await tmpdir({ git: true }) - const branch = `test-${Math.random().toString(36).slice(2)}` - await $`git branch ${branch}`.cwd(tmp.path).quiet() - - await withVcs(tmp.path, async () => { - const pending = nextBranchUpdate(tmp.path) - - const head = path.join(tmp.path, ".git", "HEAD") - await fs.writeFile(head, `ref: refs/heads/${branch}\n`) - - await pending - const current = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.branch() - }), - ) - expect(current).toBe(branch) - }) - }) + }), + ) + + it.instance( + "publishes BranchUpdated when .git/HEAD changes", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const branch = `test-${Math.random().toString(36).slice(2)}` + yield* git(test.directory, ["branch", branch]) + + const vcs = yield* init() + yield* vcs.branch() + const pending = yield* nextBranchUpdate() + + const head = path.join(test.directory, ".git", "HEAD") + yield* write(head, `ref: refs/heads/${branch}\n`) + yield* publishHeadChangeUntil(pending, head) + + const updated = yield* Deferred.await(pending).pipe(Effect.timeout("2 seconds")) + expect(updated).toBe(branch) + }), + { git: true }, + ) + + it.instance( + "branch() reflects the new branch after HEAD change", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const branch = `test-${Math.random().toString(36).slice(2)}` + yield* git(test.directory, ["branch", branch]) + + const vcs = yield* init() + yield* vcs.branch() + const pending = yield* nextBranchUpdate() + + const head = path.join(test.directory, ".git", "HEAD") + yield* write(head, `ref: refs/heads/${branch}\n`) + yield* publishHeadChangeUntil(pending, head) + yield* Deferred.await(pending).pipe(Effect.timeout("2 seconds")) + + const current = yield* vcs.branch() + expect(current).toBe(branch) + }), + { git: true }, + ) }) describe("Vcs diff", () => { @@ -163,177 +152,176 @@ describe("Vcs diff", () => { await disposeAllInstances() }) - test("defaultBranch() falls back to main", async () => { - await using tmp = await tmpdir({ git: true }) - await $`git branch -M main`.cwd(tmp.path).quiet() - - await withVcsOnly(tmp.path, async () => { - const branch = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.defaultBranch() - }), - ) - expect(branch).toBe("main") - }) - }) - - test("defaultBranch() uses init.defaultBranch when available", async () => { - await using tmp = await tmpdir({ git: true }) - await $`git branch -M trunk`.cwd(tmp.path).quiet() - await $`git config init.defaultBranch trunk`.cwd(tmp.path).quiet() - - await withVcsOnly(tmp.path, async () => { - const branch = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.defaultBranch() - }), - ) - expect(branch).toBe("trunk") - }) - }) + it.instance( + "defaultBranch() falls back to main", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* git(test.directory, ["branch", "-M", "main"]) + + const vcs = yield* init() + const branch = yield* vcs.defaultBranch() + + expect(branch).toBe("main") + }), + { git: true }, + ) + + it.instance( + "defaultBranch() uses init.defaultBranch when available", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* git(test.directory, ["branch", "-M", "trunk"]) + yield* git(test.directory, ["config", "init.defaultBranch", "trunk"]) + + const vcs = yield* init() + const branch = yield* vcs.defaultBranch() + + expect(branch).toBe("trunk") + }), + { git: true }, + ) + + it.live("detects current branch from the active worktree", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ git: true }) + const wt = yield* tmpdirScoped() + yield* git(tmp, ["branch", "-M", "main"]) + const dir = path.join(wt, "feature") + yield* git(tmp, ["worktree", "add", "-b", "feature/test", dir, "HEAD"]) + + const [branch, base] = yield* Effect.gen(function* () { + const vcs = yield* init() + return yield* Effect.all([vcs.branch(), vcs.defaultBranch()], { concurrency: 2 }) + }).pipe(provideInstance(dir)) - test("detects current branch from the active worktree", async () => { - await using tmp = await tmpdir({ git: true }) - await using wt = await tmpdir() - await $`git branch -M main`.cwd(tmp.path).quiet() - const dir = path.join(wt.path, "feature") - await $`git worktree add -b feature/test ${dir} HEAD`.cwd(tmp.path).quiet() - - await withVcsOnly(dir, async () => { - const [branch, base] = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* Effect.all([vcs.branch(), vcs.defaultBranch()], { concurrency: 2 }) - }), - ) + expect(branch).toBeDefined() expect(branch).toBe("feature/test") expect(base).toBe("main") - }) - }) - - test("diff('git') returns uncommitted changes", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "file.txt"), "original\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "add file"`.cwd(tmp.path).quiet() - await fs.writeFile(path.join(tmp.path, "file.txt"), "changed\n", "utf-8") - - await withVcsOnly(tmp.path, async () => { - const diff = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.diff("git") - }), - ) - expect(diff).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - file: "file.txt", - status: "modified", - }), - ]), - ) - expect(diff.find((item) => item.file === "file.txt")?.patch).toContain("diff --git") - }) - }) - - test("diff('git') handles special filenames", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, weird), "hello\n", "utf-8") - - await withVcsOnly(tmp.path, async () => { - const diff = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.diff("git") - }), - ) - expect(diff).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - file: weird, - status: "added", - }), - ]), - ) - }) - }) - - test("diff('git') keeps batched patches aligned for type changes", async () => { - if (process.platform === "win32") return - - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "a.txt"), "old\n", "utf-8") - await fs.writeFile(path.join(tmp.path, "b.txt"), "old\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "add files"`.cwd(tmp.path).quiet() - await fs.unlink(path.join(tmp.path, "a.txt")) - await fs.symlink("target", path.join(tmp.path, "a.txt")) - await fs.writeFile(path.join(tmp.path, "b.txt"), "new\n", "utf-8") - - await withVcsOnly(tmp.path, async () => { - const diff = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.diff("git") - }), - ) - const a = diff.find((item) => item.file === "a.txt") - const b = diff.find((item) => item.file === "b.txt") - - expect(a?.patch).toContain("deleted file mode") - expect(a?.patch).toContain("new file mode") - expect(b?.patch).toContain("+new") - }) - }) - - test("diff('git') keeps carriage returns inside patch hunks", async () => { - await using tmp = await tmpdir({ git: true }) - await fs.writeFile(path.join(tmp.path, "file.txt"), "keep\nsame\rdiff --git inside\ndelete\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "add file"`.cwd(tmp.path).quiet() - await fs.writeFile(path.join(tmp.path, "file.txt"), "keep\nadd\nsame\rdiff --git inside\n", "utf-8") - - await withVcsOnly(tmp.path, async () => { - const diff = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.diff("git") - }), - ) - const file = diff.find((item) => item.file === "file.txt") - - expect(file?.patch).toContain(" same\rdiff --git inside") - expect(file?.patch).toContain("-delete") - expect(() => parsePatch(file?.patch ?? "")).not.toThrow() - }) - }, 20_000) - - test("diff('branch') returns changes against default branch", async () => { - await using tmp = await tmpdir({ git: true }) - await $`git branch -M main`.cwd(tmp.path).quiet() - await $`git checkout -b feature/test`.cwd(tmp.path).quiet() - await fs.writeFile(path.join(tmp.path, "branch.txt"), "hello\n", "utf-8") - await $`git add .`.cwd(tmp.path).quiet() - await $`git commit --no-gpg-sign -m "branch file"`.cwd(tmp.path).quiet() - - await withVcsOnly(tmp.path, async () => { - const diff = await AppRuntime.runPromise( - Effect.gen(function* () { - const vcs = yield* Vcs.Service - return yield* vcs.diff("branch") - }), - ) - expect(diff).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - file: "branch.txt", - status: "added", - }), - ]), - ) - }) - }) + }), + ) + + it.instance( + "diff('git') returns uncommitted changes", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* write(path.join(test.directory, "file.txt"), "original\n") + yield* git(test.directory, ["add", "."]) + yield* git(test.directory, ["commit", "--no-gpg-sign", "-m", "add file"]) + yield* write(path.join(test.directory, "file.txt"), "changed\n") + + const vcs = yield* init() + const diff = yield* vcs.diff("git") + + expect(diff).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + file: "file.txt", + status: "modified", + }), + ]), + ) + expect(diff.find((item) => item.file === "file.txt")?.patch).toContain("diff --git") + }), + { git: true }, + ) + + it.instance( + "diff('git') handles special filenames", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* write(path.join(test.directory, weird), "hello\n") + + const vcs = yield* init() + const diff = yield* vcs.diff("git") + + expect(diff).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + file: weird, + status: "added", + }), + ]), + ) + }), + { git: true }, + ) + + it.instance( + "diff('git') keeps batched patches aligned for type changes", + () => + Effect.gen(function* () { + if (process.platform === "win32") return + + const test = yield* TestInstance + yield* write(path.join(test.directory, "a.txt"), "old\n") + yield* write(path.join(test.directory, "b.txt"), "old\n") + yield* git(test.directory, ["add", "."]) + yield* git(test.directory, ["commit", "--no-gpg-sign", "-m", "add files"]) + yield* remove(path.join(test.directory, "a.txt")) + yield* symlink("target", path.join(test.directory, "a.txt")) + yield* write(path.join(test.directory, "b.txt"), "new\n") + + const vcs = yield* init() + const diff = yield* vcs.diff("git") + const a = diff.find((item) => item.file === "a.txt") + const b = diff.find((item) => item.file === "b.txt") + + expect(a?.patch).toContain("deleted file mode") + expect(a?.patch).toContain("new file mode") + expect(b?.patch).toContain("+new") + }), + { git: true }, + ) + + it.instance( + "diff('git') keeps carriage returns inside patch hunks", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* write(path.join(test.directory, "file.txt"), "keep\nsame\rdiff --git inside\ndelete\n") + yield* git(test.directory, ["add", "."]) + yield* git(test.directory, ["commit", "--no-gpg-sign", "-m", "add file"]) + yield* write(path.join(test.directory, "file.txt"), "keep\nadd\nsame\rdiff --git inside\n") + + const vcs = yield* init() + const diff = yield* vcs.diff("git") + const file = diff.find((item) => item.file === "file.txt") + + expect(file?.patch).toContain(" same\rdiff --git inside") + expect(file?.patch).toContain("-delete") + expect(() => parsePatch(file?.patch ?? "")).not.toThrow() + }), + { git: true }, + 20_000, + ) + + it.instance( + "diff('branch') returns changes against default branch", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* git(test.directory, ["branch", "-M", "main"]) + yield* git(test.directory, ["checkout", "-b", "feature/test"]) + yield* write(path.join(test.directory, "branch.txt"), "hello\n") + yield* git(test.directory, ["add", "."]) + yield* git(test.directory, ["commit", "--no-gpg-sign", "-m", "branch file"]) + + const vcs = yield* init() + const diff = yield* vcs.diff("branch") + + expect(diff).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + file: "branch.txt", + status: "added", + }), + ]), + ) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/project/worktree.test.ts b/packages/opencode/test/project/worktree.test.ts index b1b9d22b7348..308e2f957b44 100644 --- a/packages/opencode/test/project/worktree.test.ts +++ b/packages/opencode/test/project/worktree.test.ts @@ -1,302 +1,308 @@ -import { $ } from "bun" import { afterEach, describe, expect } from "bun:test" -import * as fs from "fs/promises" import path from "path" -import { Cause, Effect, Exit, Layer } from "effect" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { Cause, Deferred, Effect, Exit, Fiber, Layer } from "effect" +import { GlobalBus, type GlobalEvent } from "../../src/bus/global" +import { Git } from "../../src/git" import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { InstanceRuntime } from "../../src/project/instance-runtime" import { Worktree } from "../../src/worktree" -import { disposeAllInstances, provideInstance, provideTmpdirInstance } from "../fixture/fixture" +import { disposeAllInstances, provideInstance, TestInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" -const it = testEffect(Layer.mergeAll(Worktree.defaultLayer, CrossSpawnSpawner.defaultLayer)) -const wintest = process.platform !== "win32" ? it.live : it.live.skip +const it = testEffect( + Layer.mergeAll(Worktree.defaultLayer, AppFileSystem.defaultLayer, CrossSpawnSpawner.defaultLayer, Git.defaultLayer), +) +const wintest = process.platform !== "win32" ? it.instance : it.instance.skip function normalize(input: string) { return input.replace(/\\/g, "/").toLowerCase() } -async function waitReady() { - const { GlobalBus } = await import("../../src/bus/global") +const waitReady = Effect.fn("WorktreeTest.waitReady")(function* () { + const ready = yield* Deferred.make<{ name: string; branch?: string }>() + const on = (evt: GlobalEvent) => { + if (evt.payload.type !== Worktree.Event.Ready.type) return + Deferred.doneUnsafe(ready, Effect.succeed(evt.payload.properties)) + } + + GlobalBus.on("event", on) + yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on))) + + return yield* Deferred.await(ready).pipe( + Effect.timeoutOrElse({ + duration: "10 seconds", + orElse: () => Effect.fail(new Error("timed out waiting for worktree.ready")), + }), + ) +}) - return await new Promise<{ name: string; branch?: string }>((resolve, reject) => { - const timer = setTimeout(() => { - GlobalBus.off("event", on) - reject(new Error("timed out waiting for worktree.ready")) - }, 10_000) +const removeCreatedWorktree = (directory: string) => + Effect.gen(function* () { + const svc = yield* Worktree.Service + const ctx = yield* Effect.sync(() => Instance.current).pipe(provideInstance(directory)) + yield* Effect.promise(() => InstanceRuntime.disposeInstance(ctx)) + const ok = yield* svc.remove({ directory }) + if (!ok) return yield* Effect.fail(new Error(`failed to remove worktree ${directory}`)) + }) - function on(evt: { directory?: string; payload: { type: string; properties: { name: string; branch?: string } } }) { - if (evt.payload.type !== Worktree.Event.Ready.type) return - clearTimeout(timer) - GlobalBus.off("event", on) - resolve(evt.payload.properties) - } +const withCreatedWorktree = ( + input: Parameters[0], + use: (created: { info: Worktree.Info; ready: { name: string; branch?: string } }) => Effect.Effect, +) => + Effect.acquireUseRelease( + Effect.gen(function* () { + const svc = yield* Worktree.Service + const ready = yield* waitReady().pipe(Effect.forkScoped) + const info = yield* svc.create(input) + const props = yield* Fiber.join(ready) + return { info, ready: props } + }), + use, + ({ info }) => removeCreatedWorktree(info.directory), + ) + +const git = Effect.fn("WorktreeTest.git")(function* (cwd: string, args: string[]) { + const service = yield* Git.Service + const result = yield* service.run(args, { cwd }) + if (result.exitCode !== 0) throw new Error(`git ${args.join(" ")} failed: ${result.stderr.toString("utf8")}`) + return result.text() +}) - GlobalBus.on("event", on) - }) -} +const gitResult = Effect.fn("WorktreeTest.gitResult")(function* (cwd: string, args: string[]) { + const service = yield* Git.Service + return yield* service.run(args, { cwd }) +}) describe("Worktree", () => { afterEach(() => disposeAllInstances()) describe("makeWorktreeInfo", () => { - it.live("returns info with name, branch, and directory", () => - provideTmpdirInstance( - () => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const info = yield* svc.makeWorktreeInfo() - - expect(info.name).toBeDefined() - expect(typeof info.name).toBe("string") - expect(info.branch).toBe(`opencode/${info.name}`) - expect(info.directory).toContain(info.name) - }), - { git: true }, - ), - ) - - it.live("uses provided name as base", () => - provideTmpdirInstance( - () => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const info = yield* svc.makeWorktreeInfo({ name: "my-feature" }) + it.instance( + "returns info with name, branch, and directory", + () => + Effect.gen(function* () { + const svc = yield* Worktree.Service + const info = yield* svc.makeWorktreeInfo() - expect(info.name).toBe("my-feature") - expect(info.branch).toBe("opencode/my-feature") - }), - { git: true }, - ), + expect(info.name).toBeDefined() + expect(typeof info.name).toBe("string") + expect(info.branch).toBe(`opencode/${info.name}`) + expect(info.directory).toContain(info.name) + }), + { git: true }, ) - it.live("slugifies the provided name", () => - provideTmpdirInstance( - () => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const info = yield* svc.makeWorktreeInfo({ name: "My Feature Branch!" }) + it.instance( + "uses provided name as base", + () => + Effect.gen(function* () { + const svc = yield* Worktree.Service + const info = yield* svc.makeWorktreeInfo({ name: "my-feature" }) - expect(info.name).toBe("my-feature-branch") - }), - { git: true }, - ), + expect(info.name).toBe("my-feature") + expect(info.branch).toBe("opencode/my-feature") + }), + { git: true }, ) - it.live("omits branch for detached info", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const svc = yield* Worktree.Service - yield* Effect.promise(() => $`git branch opencode/my-feature`.cwd(dir).quiet()) - - const info = yield* svc.makeWorktreeInfo({ name: "my-feature", detached: true }) + it.instance( + "slugifies the provided name", + () => + Effect.gen(function* () { + const svc = yield* Worktree.Service + const info = yield* svc.makeWorktreeInfo({ name: "My Feature Branch!" }) - expect(info.name).toBe("my-feature") - expect(info.branch).toBeUndefined() - }), - { git: true }, - ), + expect(info.name).toBe("my-feature-branch") + }), + { git: true }, ) - it.live("throws NotGitError for non-git directories", () => - provideTmpdirInstance(() => + it.instance( + "omits branch for detached info", + () => Effect.gen(function* () { + const test = yield* TestInstance const svc = yield* Worktree.Service - const exit = yield* Effect.exit(svc.makeWorktreeInfo()) + yield* git(test.directory, ["branch", "opencode/my-feature"]) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Worktree.NotGitError) + const info = yield* svc.makeWorktreeInfo({ name: "my-feature", detached: true }) + + expect(info.name).toBe("my-feature") + expect(info.branch).toBeUndefined() }), - ), + { git: true }, ) - wintest("creates detached git worktree when info has no branch", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const info = yield* svc.makeWorktreeInfo({ name: "detached-test", detached: true }) - const ready = waitReady() - yield* svc.createFromInfo(info) + it.instance("fails with NotGitError for non-git directories", () => + Effect.gen(function* () { + const svc = yield* Worktree.Service + const exit = yield* Effect.exit(svc.makeWorktreeInfo()) + + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const error = Cause.squash(exit.cause) + expect(error).toBeInstanceOf(Worktree.NotGitError) + if (error instanceof Worktree.NotGitError) expect(error._tag).toBe("WorktreeNotGitError") + } + }), + ) - const list = yield* Effect.promise(() => $`git worktree list --porcelain`.cwd(dir).quiet().text()) - const normalizedList = normalize(list) - const normalizedDir = normalize(info.directory) - expect(normalizedList).toContain(normalizedDir) + wintest( + "creates detached git worktree when info has no branch", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const svc = yield* Worktree.Service + const info = yield* svc.makeWorktreeInfo({ name: "detached-test", detached: true }) + const ready = yield* waitReady().pipe(Effect.forkScoped) + yield* svc.createFromInfo(info) - const branch = yield* Effect.promise(() => - $`git symbolic-ref -q --short HEAD`.cwd(info.directory).quiet().nothrow(), - ) - expect(branch.exitCode).not.toBe(0) + const list = yield* git(test.directory, ["worktree", "list", "--porcelain"]) + const normalizedList = normalize(list) + const normalizedDir = normalize(info.directory) + expect(normalizedList).toContain(normalizedDir) - const props = yield* Effect.promise(() => ready) - expect(props.name).toBe(info.name) - expect(props.branch).toBeUndefined() + const branch = yield* gitResult(info.directory, ["symbolic-ref", "-q", "--short", "HEAD"]) + expect(branch.exitCode).not.toBe(0) - yield* svc.remove({ directory: info.directory }) - }), - { git: true }, - ), + const props = yield* Fiber.join(ready) + expect(props.name).toBe(info.name) + expect(props.branch).toBeUndefined() + + yield* svc.remove({ directory: info.directory }) + }), + { git: true }, ) }) describe("create + remove lifecycle", () => { - it.live("create returns worktree info and remove cleans up", () => - provideTmpdirInstance( - () => + it.instance( + "create returns worktree info and remove cleans up", + () => + withCreatedWorktree(undefined, ({ info }) => Effect.gen(function* () { - const svc = yield* Worktree.Service - const info = yield* svc.create() - expect(info.name).toBeDefined() expect(info.branch ?? "").toStartWith("opencode/") expect(info.directory).toBeDefined() - - yield* Effect.promise(() => Bun.sleep(1000)) - - const ok = yield* svc.remove({ directory: info.directory }) - expect(ok).toBe(true) }), - { git: true }, - ), + ), + { git: true }, ) - it.live("create returns after setup and fires Event.Ready after bootstrap", () => - provideTmpdirInstance( - (dir) => + it.instance( + "create returns after setup and fires Event.Ready after bootstrap", + () => + withCreatedWorktree(undefined, ({ info, ready }) => Effect.gen(function* () { const svc = yield* Worktree.Service - const ready = waitReady() - const info = yield* svc.create() expect(info.name).toBeDefined() expect(info.branch ?? "").toStartWith("opencode/") - const text = yield* Effect.promise(() => $`git worktree list --porcelain`.cwd(dir).quiet().text()) - const next = yield* Effect.promise(() => fs.realpath(info.directory).catch(() => info.directory)) - expect(normalize(text)).toContain(normalize(next)) - - const props = yield* Effect.promise(() => ready) - expect(props.name).toBe(info.name) - expect(props.branch).toBe(info.branch) - - yield* Effect.promise(() => - WithInstance.provide({ - directory: info.directory, - fn: () => InstanceRuntime.disposeInstance(Instance.current), - }), - ) - yield* Effect.promise(() => Bun.sleep(100)) - yield* svc.remove({ directory: info.directory }) + expect(ready.name).toBe(info.name) + expect(ready.branch).toBe(info.branch) + + const list = yield* svc.list() + expect(list).toContainEqual(expect.objectContaining({ name: info.name, branch: info.branch })) }), - { git: true }, - ), + ), + { git: true }, ) - it.live("create with custom name", () => - provideTmpdirInstance( - () => + it.instance( + "create with custom name", + () => + withCreatedWorktree({ name: "test-workspace" }, ({ info }) => Effect.gen(function* () { - const svc = yield* Worktree.Service - const ready = waitReady() - const info = yield* svc.create({ name: "test-workspace" }) - expect(info.name).toBe("test-workspace") expect(info.branch).toBe("opencode/test-workspace") - - yield* Effect.promise(() => ready) - yield* Effect.promise(() => - WithInstance.provide({ - directory: info.directory, - fn: () => InstanceRuntime.disposeInstance(Instance.current), - }), - ) - yield* Effect.promise(() => Bun.sleep(100)) - yield* svc.remove({ directory: info.directory }) }), - { git: true }, - ), + ), + { git: true }, ) }) describe("createFromInfo", () => { - wintest("creates git worktree and boots asynchronously", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const info = yield* svc.makeWorktreeInfo({ name: "from-info-test" }) - const ready = waitReady() - yield* svc.createFromInfo(info) + wintest( + "creates git worktree and boots asynchronously", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const svc = yield* Worktree.Service + const info = yield* svc.makeWorktreeInfo({ name: "from-info-test" }) + const ready = yield* waitReady().pipe(Effect.forkScoped) + yield* svc.createFromInfo(info) - const list = yield* Effect.promise(() => $`git worktree list --porcelain`.cwd(dir).quiet().text()) - const normalizedList = list.replace(/\\/g, "/") - const normalizedDir = info.directory.replace(/\\/g, "/") - expect(normalizedList).toContain(normalizedDir) + const list = yield* git(test.directory, ["worktree", "list", "--porcelain"]) + const normalizedList = list.replace(/\\/g, "/") + const normalizedDir = info.directory.replace(/\\/g, "/") + expect(normalizedList).toContain(normalizedDir) - yield* Effect.promise(() => ready) - yield* svc.remove({ directory: info.directory }) - }), - { git: true }, - ), + yield* Fiber.join(ready) + yield* removeCreatedWorktree(info.directory) + }), + { git: true }, ) }) describe("list", () => { - it.live("uses parent folder name when worktree basename matches the primary worktree", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const parent = path.join(path.dirname(dir), `${path.basename(dir)}-parent`) - const target = path.join(parent, path.basename(dir)) - const branch = `same-basename-list-${Date.now()}` + it.instance( + "uses parent folder name when worktree basename matches the primary worktree", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const fs = yield* AppFileSystem.Service + const svc = yield* Worktree.Service + const parent = path.join(path.dirname(test.directory), `${path.basename(test.directory)}-parent`) + const target = path.join(parent, path.basename(test.directory)) + const branch = `same-basename-list-${Date.now()}` - yield* Effect.promise(() => fs.mkdir(parent, { recursive: true })) - yield* Effect.promise(() => $`git worktree add -b ${branch} ${target}`.cwd(dir).quiet()) + yield* fs.ensureDir(parent) + yield* git(test.directory, ["worktree", "add", "-b", branch, target]) - const list = yield* svc.list() - const directory = yield* Effect.promise(() => fs.realpath(target).catch(() => target)) + const list = yield* svc.list() + const directory = yield* fs.realPath(target).pipe(Effect.catch(() => Effect.succeed(target))) - expect(list.map((item) => ({ ...item, directory: normalize(item.directory) }))).toContainEqual({ - name: path.basename(parent), - branch, - directory: normalize(directory), - }) + expect(list.map((item) => ({ ...item, directory: normalize(item.directory) }))).toContainEqual({ + name: path.basename(parent), + branch, + directory: normalize(directory), + }) - yield* svc.remove({ directory: target }) - }), - { git: true }, - ), + yield* svc.remove({ directory: target }) + }), + { git: true }, ) }) describe("remove edge cases", () => { - it.live("remove non-existent directory succeeds silently", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const svc = yield* Worktree.Service - const ok = yield* svc.remove({ directory: path.join(dir, "does-not-exist") }) - expect(ok).toBe(true) - }), - { git: true }, - ), - ) - - it.live("throws NotGitError for non-git directories", () => - provideTmpdirInstance(() => + it.instance( + "remove non-existent directory succeeds silently", + () => Effect.gen(function* () { + const test = yield* TestInstance const svc = yield* Worktree.Service - const exit = yield* Effect.exit(svc.remove({ directory: "/tmp/fake" })) - - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) expect(Cause.squash(exit.cause)).toBeInstanceOf(Worktree.NotGitError) + const ok = yield* svc.remove({ directory: path.join(test.directory, "does-not-exist") }) + expect(ok).toBe(true) }), - ), + { git: true }, + ) + + it.instance("fails with NotGitError for non-git directories", () => + Effect.gen(function* () { + const test = yield* TestInstance + const svc = yield* Worktree.Service + const exit = yield* Effect.exit(svc.remove({ directory: path.join(test.directory, "fake") })) + + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const error = Cause.squash(exit.cause) + expect(error).toBeInstanceOf(Worktree.NotGitError) + if (error instanceof Worktree.NotGitError) expect(error._tag).toBe("WorktreeNotGitError") + } + }), ) }) }) diff --git a/packages/opencode/test/provider/digitalocean.test.ts b/packages/opencode/test/provider/digitalocean.test.ts new file mode 100644 index 000000000000..665c792deb2b --- /dev/null +++ b/packages/opencode/test/provider/digitalocean.test.ts @@ -0,0 +1,122 @@ +import { expect } from "bun:test" +import { Provider } from "../../src/provider/provider" +import { ProviderID } from "../../src/provider/schema" +import { Effect } from "effect" +import { testEffect } from "../lib/effect" + +const DIGITALOCEAN = ProviderID.make("digitalocean") +const it = testEffect(Provider.defaultLayer) + +const withEnv = (values: Record, effect: Effect.Effect) => + Effect.acquireUseRelease( + Effect.sync(() => { + const previous = Object.fromEntries(Object.keys(values).map((key) => [key, process.env[key]] as const)) + Object.assign(process.env, values) + return previous + }), + () => effect, + (previous) => + Effect.sync(() => { + for (const [key, value] of Object.entries(previous)) { + if (value === undefined) delete process.env[key] + else process.env[key] = value + } + }), + ) + +const withAuth = (metadata: Record | undefined, effect: Effect.Effect) => + withEnv( + { + OPENCODE_AUTH_CONTENT: JSON.stringify({ + digitalocean: { + type: "api", + key: "sk_do_test", + ...(metadata ? { metadata } : {}), + }, + }), + }, + effect, + ) + +it.instance( + "digitalocean provider autoloads from DIGITALOCEAN_ACCESS_TOKEN", + () => + withEnv( + { DIGITALOCEAN_ACCESS_TOKEN: "test-token" }, + Effect.gen(function* () { + const provider = yield* Provider.Service + const providers = yield* provider.list() + expect(providers[DIGITALOCEAN]).toBeDefined() + expect(providers[DIGITALOCEAN].source).toBe("env") + const baseModel = Object.values(providers[DIGITALOCEAN].models)[0] + expect(baseModel.api.url).toBe("https://inference.do-ai.run/v1") + expect(baseModel.api.npm).toBe("@ai-sdk/openai-compatible") + const routerEntries = Object.keys(providers[DIGITALOCEAN].models).filter((id) => id.startsWith("router:")) + expect(routerEntries.length).toBe(0) + }), + ), + { config: {} }, +) + +it.instance( + "digitalocean provider.models surfaces cached routers from auth metadata", + () => + withAuth( + { + routers: JSON.stringify([ + { name: "my-router", uuid: "11f1499a-aaaa-bbbb-cccc-4e013e2ddde4" }, + { name: "other-router", uuid: "22f1499a-aaaa-bbbb-cccc-4e013e2ddde4" }, + ]), + routers_fetched_at: String(Date.now()), + oauth_access: "doo_v1_test", + oauth_expires: String(Date.now() + 60 * 60 * 1000), + }, + Effect.gen(function* () { + const provider = yield* Provider.Service + const providers = yield* provider.list() + const models = providers[DIGITALOCEAN].models + expect(models["router:my-router"]).toBeDefined() + expect(models["router:my-router"].api.id).toBe("router:my-router") + expect(models["router:my-router"].api.url).toBe("https://inference.do-ai.run/v1") + expect(models["router:my-router"].api.npm).toBe("@ai-sdk/openai-compatible") + expect(models["router:other-router"]).toBeDefined() + }), + ), + { config: {} }, +) + +it.instance( + "digitalocean provider.models skips refresh when oauth bearer is expired", + () => + withAuth( + { + routers: JSON.stringify([{ name: "stale-router", uuid: "stale" }]), + routers_fetched_at: "0", + oauth_access: "doo_v1_expired", + oauth_expires: "1", + }, + Effect.gen(function* () { + const provider = yield* Provider.Service + const providers = yield* provider.list() + const models = providers[DIGITALOCEAN].models + expect(models["router:stale-router"]).toBeDefined() + }), + ), + { config: {} }, +) + +it.instance( + "digitalocean provider.models passes through base models when no auth metadata", + () => + withEnv( + { DIGITALOCEAN_ACCESS_TOKEN: "test-token" }, + Effect.gen(function* () { + const provider = yield* Provider.Service + const providers = yield* provider.list() + const models = providers[DIGITALOCEAN].models + expect(Object.keys(models).length).toBeGreaterThan(0) + expect(Object.keys(models).filter((id) => id.startsWith("router:")).length).toBe(0) + }), + ), + { config: {} }, +) diff --git a/packages/opencode/test/provider/model-status.test.ts b/packages/opencode/test/provider/model-status.test.ts index e6fa645e7145..96f50a1b542e 100644 --- a/packages/opencode/test/provider/model-status.test.ts +++ b/packages/opencode/test/provider/model-status.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test" import { Schema } from "effect" import { ConfigProvider } from "@/config/provider" import { CatalogModelStatus, ModelStatus } from "@/provider/model-status" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { Provider } from "@/provider/provider" describe("provider model status schemas", () => { diff --git a/packages/opencode/test/provider/provider.test.ts b/packages/opencode/test/provider/provider.test.ts index cdb9d2057245..1c6a8b33779c 100644 --- a/packages/opencode/test/provider/provider.test.ts +++ b/packages/opencode/test/provider/provider.test.ts @@ -7,17 +7,34 @@ import { Global } from "@opencode-ai/core/global" import { Instance } from "../../src/project/instance" import { WithInstance } from "../../src/project/with-instance" import { Plugin } from "../../src/plugin/index" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { Provider } from "@/provider/provider" import { ProviderID, ModelID } from "../../src/provider/schema" import { Filesystem } from "@/util/filesystem" import { Env } from "../../src/env" -import { Effect } from "effect" +import { Effect, Layer } from "effect" import { AppRuntime } from "../../src/effect/app-runtime" import { makeRuntime } from "../../src/effect/run-service" +import { testEffect } from "../lib/effect" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Config } from "@/config/config" +import { Auth } from "@/auth" +import { RuntimeFlags } from "@/effect/runtime-flags" const env = makeRuntime(Env.Service, Env.defaultLayer) const set = (k: string, v: string) => env.runSync((svc) => svc.set(k, v)) +const remove = (k: string) => env.runSync((svc) => svc.remove(k)) + +const providerLayer = (flags: Partial = {}) => + Provider.layer.pipe( + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Env.defaultLayer), + Layer.provide(Config.defaultLayer), + Layer.provide(Auth.defaultLayer), + Layer.provide(Plugin.defaultLayer), + Layer.provide(ModelsDev.defaultLayer), + Layer.provide(RuntimeFlags.layer(flags)), + ) async function run(fn: (provider: Provider.Interface) => Effect.Effect) { return AppRuntime.runPromise( @@ -70,6 +87,31 @@ function paid(providers: Awaited>) { return Object.values(item.models).filter((model) => model.cost.input > 0).length } +const it = testEffect(Provider.defaultLayer) +const experimentalModels = testEffect(providerLayer({ enableExperimentalModels: true })) + +const alphaProviderConfig = { + provider: { + "custom-provider": { + name: "Custom Provider", + npm: "@ai-sdk/openai-compatible", + api: "https://api.custom.com/v1", + models: { + "active-model": { + name: "Active Model", + }, + "alpha-model": { + name: "Alpha Model", + status: "alpha" as const, + }, + }, + options: { + apiKey: "custom-key", + }, + }, + }, +} + test("provider loaded from env variable", async () => { await using tmp = await tmpdir({ init: async (dir) => { @@ -301,6 +343,26 @@ test("custom provider with npm package", async () => { }) }) +it.instance( + "filters alpha provider models by default", + Effect.gen(function* () { + const providers = yield* Provider.Service.use((provider) => provider.list()) + expect(providers[ProviderID.make("custom-provider")].models["active-model"]).toBeDefined() + expect(providers[ProviderID.make("custom-provider")].models["alpha-model"]).toBeUndefined() + }), + { config: alphaProviderConfig }, +) + +experimentalModels.instance( + "includes alpha provider models when experimental models are enabled", + Effect.gen(function* () { + const providers = yield* Provider.Service.use((provider) => provider.list()) + expect(providers[ProviderID.make("custom-provider")].models["active-model"]).toBeDefined() + expect(providers[ProviderID.make("custom-provider")].models["alpha-model"]).toBeDefined() + }), + { config: alphaProviderConfig }, +) + test("custom DeepSeek openai-compatible model defaults interleaved reasoning field", async () => { await using tmp = await tmpdir({ init: async (dir) => { @@ -515,144 +577,116 @@ test("defaultModel respects config model setting", async () => { }) }) -test("provider with baseURL from config", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - provider: { - "custom-openai": { - name: "Custom OpenAI", - npm: "@ai-sdk/openai-compatible", - env: [], - models: { - "gpt-4": { - name: "GPT-4", - tool_call: true, - limit: { context: 128000, output: 4096 }, - }, - }, - options: { - apiKey: "test-key", - baseURL: "https://custom.openai.com/v1", - }, +it.instance( + "provider with baseURL from config", + Effect.gen(function* () { + const providers = yield* Provider.Service.use((provider) => provider.list()) + expect(providers[ProviderID.make("custom-openai")]).toBeDefined() + expect(providers[ProviderID.make("custom-openai")].options.baseURL).toBe("https://custom.openai.com/v1") + }), + { + config: { + provider: { + "custom-openai": { + name: "Custom OpenAI", + npm: "@ai-sdk/openai-compatible", + env: [], + models: { + "gpt-4": { + name: "GPT-4", + tool_call: true, + limit: { context: 128000, output: 4096 }, }, }, - }), - ) - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const providers = await list() - expect(providers[ProviderID.make("custom-openai")]).toBeDefined() - expect(providers[ProviderID.make("custom-openai")].options.baseURL).toBe("https://custom.openai.com/v1") + options: { + apiKey: "test-key", + baseURL: "https://custom.openai.com/v1", + }, + }, + }, }, - }) -}) - -test("model cost defaults to zero when not specified", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - provider: { - "test-provider": { - name: "Test Provider", - npm: "@ai-sdk/openai-compatible", - env: [], - models: { - "test-model": { - name: "Test Model", - tool_call: true, - limit: { context: 128000, output: 4096 }, - }, - }, - options: { - apiKey: "test-key", - }, + }, +) + +it.instance( + "model cost defaults to zero when not specified", + Effect.gen(function* () { + const providers = yield* Provider.Service.use((provider) => provider.list()) + const model = providers[ProviderID.make("test-provider")].models["test-model"] + expect(model.cost.input).toBe(0) + expect(model.cost.output).toBe(0) + expect(model.cost.cache.read).toBe(0) + expect(model.cost.cache.write).toBe(0) + }), + { + config: { + provider: { + "test-provider": { + name: "Test Provider", + npm: "@ai-sdk/openai-compatible", + env: [], + models: { + "test-model": { + name: "Test Model", + tool_call: true, + limit: { context: 128000, output: 4096 }, }, }, - }), - ) - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const providers = await list() - const model = providers[ProviderID.make("test-provider")].models["test-model"] - expect(model.cost.input).toBe(0) - expect(model.cost.output).toBe(0) - expect(model.cost.cache.read).toBe(0) - expect(model.cost.cache.write).toBe(0) + options: { + apiKey: "test-key", + }, + }, + }, }, - }) -}) - -test("model options are merged from existing model", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - provider: { - anthropic: { - models: { - "claude-sonnet-4-20250514": { - options: { - customOption: "custom-value", - }, - }, + }, +) + +it.instance( + "model options are merged from existing model", + Effect.gen(function* () { + const providers = yield* Provider.Service.use((provider) => provider.list()) + const model = providers[ProviderID.anthropic].models["claude-sonnet-4-20250514"] + expect(model.options.customOption).toBe("custom-value") + }), + { + config: { + provider: { + anthropic: { + options: { + apiKey: "test-api-key", + }, + models: { + "claude-sonnet-4-20250514": { + options: { + customOption: "custom-value", }, }, }, - }), - ) - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - set("ANTHROPIC_API_KEY", "test-api-key") - const providers = await list() - const model = providers[ProviderID.anthropic].models["claude-sonnet-4-20250514"] - expect(model.options.customOption).toBe("custom-value") + }, + }, }, - }) -}) - -test("provider removed when all models filtered out", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - provider: { - anthropic: { - whitelist: ["nonexistent-model"], - }, + }, +) + +it.instance( + "provider removed when all models filtered out", + Effect.gen(function* () { + const providers = yield* Provider.Service.use((provider) => provider.list()) + expect(providers[ProviderID.anthropic]).toBeUndefined() + }), + { + config: { + provider: { + anthropic: { + options: { + apiKey: "test-api-key", }, - }), - ) - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - set("ANTHROPIC_API_KEY", "test-api-key") - const providers = await list() - expect(providers[ProviderID.anthropic]).toBeUndefined() + whitelist: ["nonexistent-model"], + }, + }, }, - }) -}) + }, +) test("closest finds model by partial match", async () => { await using tmp = await tmpdir({ @@ -1049,6 +1083,27 @@ test("getSmallModel respects config small_model override", async () => { }) }) +test("getSmallModel ignores invalid config small_model", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + small_model: "anthropic/not-a-real-model", + }), + ) + }, + }) + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + set("ANTHROPIC_API_KEY", "test-api-key") + expect(await getSmallModel(ProviderID.anthropic)).toBeUndefined() + }, + }) +}) + test("provider.sort prioritizes preferred models", () => { const models = [ { id: "random-model", name: "Random" }, @@ -1596,8 +1651,8 @@ test("ModelNotFoundError includes suggestions for typos", async () => { await getModel(ProviderID.anthropic, ModelID.make("claude-sonet-4")) // typo: sonet instead of sonnet expect(true).toBe(false) // Should not reach here } catch (e: any) { - expect(e.data.suggestions).toBeDefined() - expect(e.data.suggestions.length).toBeGreaterThan(0) + expect(e.suggestions).toBeDefined() + expect(e.suggestions.length).toBeGreaterThan(0) } }, }) @@ -1622,8 +1677,34 @@ test("ModelNotFoundError for provider includes suggestions", async () => { await getModel(ProviderID.make("antropic"), ModelID.make("claude-sonnet-4")) // typo: antropic expect(true).toBe(false) // Should not reach here } catch (e: any) { - expect(e.data.suggestions).toBeDefined() - expect(e.data.suggestions).toContain("anthropic") + expect(e.suggestions).toBeDefined() + expect(e.suggestions).toContain("anthropic") + } + }, + }) +}) + +test("ModelNotFoundError suggests catalog models for unloaded providers", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + }), + ) + }, + }) + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + remove("OPENCODE_API_KEY") + try { + await getModel(ProviderID.opencode, ModelID.make("claude-haiku-fake-model")) + throw new Error("expected model lookup to fail") + } catch (e) { + if (!Provider.ModelNotFoundError.isInstance(e)) throw e + expect(e.suggestions).toContain("claude-haiku-4-5") } }, }) @@ -1787,6 +1868,100 @@ test("provider options are deeply merged", async () => { }) }) +test("hosted nvidia provider adds billing origin header", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + provider: { + nvidia: { + options: { + apiKey: "test-api-key", + }, + }, + }, + }), + ) + }, + }) + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + const providers = await list() + expect(providers[ProviderID.make("nvidia")].options.headers).toEqual({ + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + "X-BILLING-INVOKE-ORIGIN": "OpenCode", + }) + }, + }) +}) + +test("custom nvidia baseURL adds billing origin header", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + provider: { + nvidia: { + options: { + apiKey: "test-api-key", + baseURL: "http://localhost:8000/v1", + }, + }, + }, + }), + ) + }, + }) + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + const providers = await list() + expect(providers[ProviderID.make("nvidia")].options.headers).toEqual({ + "HTTP-Referer": "https://opencode.ai/", + "X-Title": "opencode", + "X-BILLING-INVOKE-ORIGIN": "OpenCode", + }) + }, + }) +}) + +test("explicit nvidia billing origin header is preserved", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + provider: { + nvidia: { + options: { + apiKey: "test-api-key", + baseURL: "http://localhost:8000/v1", + headers: { + "X-BILLING-INVOKE-ORIGIN": "CustomOrigin", + }, + }, + }, + }, + }), + ) + }, + }) + await WithInstance.provide({ + directory: tmp.path, + fn: async () => { + const providers = await list() + expect(providers[ProviderID.make("nvidia")].options.headers["X-BILLING-INVOKE-ORIGIN"]).toBe("CustomOrigin") + }, + }) +}) + test("custom model inherits npm package from models.dev provider config", async () => { await using tmp = await tmpdir({ init: async (dir) => { diff --git a/packages/opencode/test/provider/transform.test.ts b/packages/opencode/test/provider/transform.test.ts index df21922b097a..90e2a177fee2 100644 --- a/packages/opencode/test/provider/transform.test.ts +++ b/packages/opencode/test/provider/transform.test.ts @@ -310,6 +310,75 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => { }) }) +describe("ProviderTransform.options - gpt-5 reasoningEffort", () => { + const sessionID = "test-session-123" + + const createModel = (apiId: string) => + ({ + id: `azure/${apiId}`, + providerID: "azure", + api: { + id: apiId, + url: "https://azure.com", + npm: "@ai-sdk/azure", + }, + name: apiId, + capabilities: { + temperature: true, + reasoning: true, + attachment: true, + toolcall: true, + input: { + text: true, + audio: false, + image: true, + video: false, + pdf: false, + }, + output: { + text: true, + audio: false, + image: false, + video: false, + pdf: false, + }, + interleaved: false, + }, + cost: { + input: 0.03, + output: 0.06, + cache: { read: 0.001, write: 0.002 }, + }, + limit: { + context: 128000, + output: 4096, + }, + status: "active", + options: {}, + headers: {}, + }) as any + + test("gpt-5-chat should NOT set reasoningEffort", () => { + const result = ProviderTransform.options({ + model: createModel("gpt-5-chat"), + sessionID, + providerOptions: {}, + }) + + expect(result.reasoningEffort).toBeUndefined() + }) + + test("gpt-5.5 should NOT set reasoningEffort", () => { + const result = ProviderTransform.options({ + model: createModel("gpt-5.5"), + sessionID, + providerOptions: {}, + }) + + expect(result.reasoningEffort).toBeUndefined() + }) +}) + describe("ProviderTransform.options - gateway", () => { const sessionID = "test-session-123" @@ -3602,8 +3671,8 @@ describe("ProviderTransform.variants", () => { }) describe("ProviderTransform.smallOptions - gpt-5 chat/search", () => { - const createModel = (apiId: string) => - ({ + const createModel = (apiId: string) => { + const model = { id: `openai/${apiId}`, providerID: "openai", api: { @@ -3611,13 +3680,43 @@ describe("ProviderTransform.smallOptions - gpt-5 chat/search", () => { url: "https://api.openai.com", npm: "@ai-sdk/openai", }, - }) as any + capabilities: { reasoning: true }, + limit: { output: 64_000 }, + release_date: "2026-01-01", + } as any + model.variants = ProviderTransform.variants(model) + return model + } for (const testCase of [ { id: "gpt-5-chat-latest", options: { store: false } }, - { id: "gpt-5.1-chat-latest", options: { store: false, reasoningEffort: "medium" } }, - { id: "gpt-5.2-chat-latest", options: { store: false, reasoningEffort: "medium" } }, - { id: "gpt-5-search-api", options: { store: false } }, + { + id: "gpt-5.1-chat-latest", + options: { + store: false, + reasoningEffort: "medium", + reasoningSummary: "auto", + include: ["reasoning.encrypted_content"], + }, + }, + { + id: "gpt-5.2-chat-latest", + options: { + store: false, + reasoningEffort: "medium", + reasoningSummary: "auto", + include: ["reasoning.encrypted_content"], + }, + }, + { + id: "gpt-5-search-api", + options: { + store: false, + reasoningEffort: "none", + reasoningSummary: "auto", + include: ["reasoning.encrypted_content"], + }, + }, ]) { test(`${testCase.id} returns only supported small options`, () => { expect(ProviderTransform.smallOptions(createModel(testCase.id))).toEqual(testCase.options) @@ -3626,8 +3725,8 @@ describe("ProviderTransform.smallOptions - gpt-5 chat/search", () => { }) describe("ProviderTransform.smallOptions - google thinking controls", () => { - const createGoogleModel = (apiId: string) => - ({ + const createGoogleModel = (apiId: string) => { + const model = { id: `google/${apiId}`, providerID: "google", api: { @@ -3635,20 +3734,44 @@ describe("ProviderTransform.smallOptions - google thinking controls", () => { url: "https://generativelanguage.googleapis.com", npm: "@ai-sdk/google", }, - }) as any + capabilities: { reasoning: true }, + limit: { output: 64_000 }, + } as any + model.variants = ProviderTransform.variants(model) + return model + } for (const testCase of [ - { id: "gemini-3-pro-preview", options: { thinkingConfig: { thinkingLevel: "low" } } }, - { id: "gemini-3-flash-preview", options: { thinkingConfig: { thinkingLevel: "minimal" } } }, - { id: "gemini-3.1-flash-image-preview", options: { thinkingConfig: { thinkingLevel: "minimal" } } }, - { id: "gemini-3-pro-image-preview", options: { thinkingConfig: { thinkingLevel: "high" } } }, - { id: "gemini-2.5-pro", options: { thinkingConfig: { thinkingBudget: 128 } } }, - { id: "gemini-2.5-flash", options: { thinkingConfig: { thinkingBudget: 0 } } }, + { id: "gemini-3-pro-preview", options: { thinkingConfig: { includeThoughts: true, thinkingLevel: "low" } } }, + { id: "gemini-3-flash-preview", options: { thinkingConfig: { includeThoughts: true, thinkingLevel: "minimal" } } }, + { + id: "gemini-3.1-flash-image-preview", + options: { thinkingConfig: { includeThoughts: true, thinkingLevel: "minimal" } }, + }, + { id: "gemini-3-pro-image-preview", options: { thinkingConfig: { includeThoughts: true, thinkingLevel: "high" } } }, + { id: "gemini-2.5-pro", options: { thinkingConfig: { includeThoughts: true, thinkingBudget: 16000 } } }, + { id: "gemini-2.5-flash", options: { thinkingConfig: { includeThoughts: true, thinkingBudget: 16000 } } }, ]) { test(`${testCase.id} returns supported small thinking options`, () => { expect(ProviderTransform.smallOptions(createGoogleModel(testCase.id))).toEqual(testCase.options) }) } + + test("uses the first configured variant when available", () => { + expect( + ProviderTransform.smallOptions({ + ...createGoogleModel("gemini-2.5-pro"), + variants: { + high: { thinkingConfig: { includeThoughts: true, thinkingBudget: 16000 } }, + max: { thinkingConfig: { includeThoughts: true, thinkingBudget: 32768 } }, + }, + }), + ).toEqual({ thinkingConfig: { includeThoughts: true, thinkingBudget: 16000 } }) + }) + + test("does not synthesize thinking options when variants are empty", () => { + expect(ProviderTransform.smallOptions({ ...createGoogleModel("gemini-2.5-pro"), variants: {} })).toEqual({}) + }) }) describe("ProviderTransform.providerOptions - ai-gateway-provider", () => { diff --git a/packages/opencode/test/pty/pty-output-isolation.test.ts b/packages/opencode/test/pty/pty-output-isolation.test.ts index 662042b64c85..0fa710f02abb 100644 --- a/packages/opencode/test/pty/pty-output-isolation.test.ts +++ b/packages/opencode/test/pty/pty-output-isolation.test.ts @@ -1,147 +1,162 @@ -import { describe, expect, test } from "bun:test" -import { AppRuntime } from "../../src/effect/app-runtime" -import { Effect } from "effect" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" +import { describe, expect } from "bun:test" +import { Bus } from "../../src/bus" +import { Config } from "../../src/config/config" +import { Plugin } from "../../src/plugin" import { Pty } from "../../src/pty" -import { tmpdir } from "../fixture/fixture" -import { setTimeout as sleep } from "node:timers/promises" +import { Duration, Effect, Layer, Queue } from "effect" +import { testEffect } from "../lib/effect" + +type Socket = Parameters[1] + +const it = testEffect( + Pty.layer.pipe( + Layer.provideMerge(Bus.layer), + Layer.provideMerge(Config.defaultLayer), + Layer.provideMerge(Plugin.defaultLayer), + ), +) +const ptyTest = process.platform === "win32" ? it.instance.skip : it.instance + +const createPty = Effect.fn("PtyOutputIsolationTest.createPty")(function* (input: Pty.CreateInput) { + const pty = yield* Pty.Service + return yield* Effect.acquireRelease(pty.create(input), (info) => pty.remove(info.id).pipe(Effect.ignore)) +}) + +const decodeOutput = (data: string | Uint8Array | ArrayBuffer) => + typeof data === "string" + ? data + : Buffer.from(data instanceof Uint8Array ? data : new Uint8Array(data)).toString("utf8") + +const makeSocket = Effect.fn("PtyOutputIsolationTest.makeSocket")(function* (data: unknown) { + const output = yield* Queue.unbounded() + const chunks: string[] = [] + const socket: Socket = { + readyState: 1, + data, + send: (data) => { + const text = decodeOutput(data) + chunks.push(text) + Queue.offerUnsafe(output, text) + }, + close: () => { + // no-op (simulate abrupt drop) + }, + } + + return { socket, output, chunks } +}) + +const waitForOutput = (output: Queue.Queue, text: string, duration: Duration.Input = "5 seconds") => + Effect.gen(function* () { + let received = "" + while (!received.includes(text)) { + received += yield* Queue.take(output) + } + return received + }).pipe( + Effect.timeoutOrElse({ + duration, + orElse: () => Effect.fail(new Error(`timeout waiting for output containing ${JSON.stringify(text)}`)), + }), + ) + +const waitForLeakedOutput = (output: Queue.Queue, text: string) => + Effect.gen(function* () { + let received = "" + while (!received.includes(text)) { + received += yield* Queue.take(output) + } + return received + }).pipe( + Effect.timeoutOrElse({ + duration: "100 millis", + orElse: () => Effect.succeed(undefined), + }), + ) describe("pty", () => { - test("does not leak output when websocket objects are reused", async () => { - await using dir = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const a = yield* pty.create({ command: "cat", title: "a" }) - const b = yield* pty.create({ command: "cat", title: "b" }) - try { - const outA: string[] = [] - const outB: string[] = [] - - const ws = { - readyState: 1, - data: { events: { connection: "a" } }, - send: (data: unknown) => { - outA.push(typeof data === "string" ? data : Buffer.from(data as Uint8Array).toString("utf8")) - }, - close: () => { - // no-op (simulate abrupt drop) - }, - } - - yield* pty.connect(a.id, ws as any) - - ws.data = { events: { connection: "b" } } - ws.send = (data: unknown) => { - outB.push(typeof data === "string" ? data : Buffer.from(data as Uint8Array).toString("utf8")) - } - yield* pty.connect(b.id, ws as any) - - outA.length = 0 - outB.length = 0 - - yield* pty.write(a.id, "AAA\n") - yield* Effect.promise(() => sleep(100)) - - expect(outB.join("")).not.toContain("AAA") - } finally { - yield* pty.remove(a.id) - yield* pty.remove(b.id) - } - }), - ), - }) - }) - - test("does not leak output when Bun recycles websocket objects before re-connect", async () => { - await using dir = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const a = yield* pty.create({ command: "cat", title: "a" }) - try { - const outA: string[] = [] - const outB: string[] = [] - - const ws = { - readyState: 1, - data: { events: { connection: "a" } }, - send: (data: unknown) => { - outA.push(typeof data === "string" ? data : Buffer.from(data as Uint8Array).toString("utf8")) - }, - close: () => { - // no-op (simulate abrupt drop) - }, - } - - yield* pty.connect(a.id, ws as any) - outA.length = 0 - - ws.data = { events: { connection: "b" } } - ws.send = (data: unknown) => { - outB.push(typeof data === "string" ? data : Buffer.from(data as Uint8Array).toString("utf8")) - } - - yield* pty.write(a.id, "AAA\n") - yield* Effect.promise(() => sleep(100)) - - expect(outB.join("")).not.toContain("AAA") - } finally { - yield* pty.remove(a.id) - } - }), - ), - }) - }) - - test("treats in-place socket data mutation as the same connection", async () => { - await using dir = await tmpdir({ git: true }) - - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const a = yield* pty.create({ command: "cat", title: "a" }) - try { - const out: string[] = [] - - const ctx = { connId: 1 } - const ws = { - readyState: 1, - data: ctx, - send: (data: unknown) => { - out.push(typeof data === "string" ? data : Buffer.from(data as Uint8Array).toString("utf8")) - }, - close: () => { - // no-op - }, - } - - yield* pty.connect(a.id, ws as any) - out.length = 0 - - ctx.connId = 2 - - yield* pty.write(a.id, "AAA\n") - yield* Effect.promise(() => sleep(100)) - - expect(out.join("")).toContain("AAA") - } finally { - yield* pty.remove(a.id) - } - }), - ), - }) - }) + ptyTest( + "does not leak output when websocket objects are reused", + () => + Effect.gen(function* () { + const pty = yield* Pty.Service + const a = yield* createPty({ command: "cat", title: "a" }) + const b = yield* createPty({ command: "cat", title: "b" }) + const connectionA = yield* makeSocket({ events: { connection: "a" } }) + const connectionB = { events: { connection: "b" } } + + yield* pty.connect(a.id, connectionA.socket) + + const outBQueue = yield* Queue.unbounded() + const outB: string[] = [] + connectionA.socket.data = connectionB + connectionA.socket.send = (data) => { + const text = decodeOutput(data) + outB.push(text) + Queue.offerUnsafe(outBQueue, text) + } + yield* pty.connect(b.id, connectionA.socket) + + connectionA.chunks.length = 0 + outB.length = 0 + + yield* pty.write(a.id, "AAA\n") + const verifyA = yield* makeSocket({ events: { connection: "verify-a" } }) + yield* pty.connect(a.id, verifyA.socket) + yield* waitForOutput(verifyA.output, "AAA") + + expect(outB.join("")).not.toContain("AAA") + expect(yield* waitForLeakedOutput(outBQueue, "AAA")).toBeUndefined() + }), + { git: true }, + ) + + ptyTest( + "does not leak output when Bun recycles websocket objects before re-connect", + () => + Effect.gen(function* () { + const pty = yield* Pty.Service + const a = yield* createPty({ command: "cat", title: "a" }) + const outA = yield* makeSocket({ events: { connection: "a" } }) + const outB = yield* Queue.unbounded() + + yield* pty.connect(a.id, outA.socket) + outA.chunks.length = 0 + + const connectionB = { events: { connection: "b" } } + outA.socket.data = connectionB + outA.socket.send = (data) => { + Queue.offerUnsafe(outB, decodeOutput(data)) + } + + yield* pty.write(a.id, "AAA\n") + const verifyA = yield* makeSocket({ events: { connection: "verify-a" } }) + yield* pty.connect(a.id, verifyA.socket) + yield* waitForOutput(verifyA.output, "AAA") + + expect(yield* waitForLeakedOutput(outB, "AAA")).toBeUndefined() + }), + { git: true }, + ) + + ptyTest( + "treats in-place socket data mutation as the same connection", + () => + Effect.gen(function* () { + const pty = yield* Pty.Service + const a = yield* createPty({ command: "cat", title: "a" }) + const ctx = { connId: 1 } + const out = yield* makeSocket(ctx) + + yield* pty.connect(a.id, out.socket) + out.chunks.length = 0 + + ctx.connId = 2 + + yield* pty.write(a.id, "AAA\n") + + expect(yield* waitForOutput(out.output, "AAA")).toContain("AAA") + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/pty/pty-session.test.ts b/packages/opencode/test/pty/pty-session.test.ts index 8c5d804b7304..12784baf3159 100644 --- a/packages/opencode/test/pty/pty-session.test.ts +++ b/packages/opencode/test/pty/pty-session.test.ts @@ -1,103 +1,100 @@ -import { describe, expect, test } from "bun:test" -import { AppRuntime } from "../../src/effect/app-runtime" +import { describe, expect } from "bun:test" import { Bus } from "../../src/bus" -import { Effect } from "effect" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" +import { Config } from "../../src/config/config" +import { Plugin } from "../../src/plugin" import { Pty } from "../../src/pty" import type { PtyID } from "../../src/pty/schema" -import { tmpdir } from "../fixture/fixture" -import { setTimeout as sleep } from "node:timers/promises" +import { Effect, Layer, Queue } from "effect" +import { testEffect } from "../lib/effect" -const wait = async (fn: () => boolean, ms = 5000) => { - const end = Date.now() + ms - while (Date.now() < end) { - if (fn()) return - await sleep(25) - } - throw new Error("timeout waiting for pty events") -} - -const pick = (log: Array<{ type: "created" | "exited" | "deleted"; id: PtyID }>, id: PtyID) => { - return log.filter((evt) => evt.id === id).map((evt) => evt.type) -} - -describe("pty", () => { - test("publishes created, exited, deleted in order for a short-lived process", async () => { - if (process.platform === "win32") return +type PtyEvent = { type: "created" | "exited" | "deleted"; id: PtyID } - await using dir = await tmpdir({ git: true }) +const it = testEffect( + Pty.layer.pipe( + Layer.provideMerge(Bus.layer), + Layer.provideMerge(Config.defaultLayer), + Layer.provideMerge(Plugin.defaultLayer), + ), +) +const ptyTest = process.platform === "win32" ? it.instance.skip : it.instance - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const log: Array<{ type: "created" | "exited" | "deleted"; id: PtyID }> = [] - const off = [ - Bus.subscribe(Pty.Event.Created, (evt) => log.push({ type: "created", id: evt.properties.info.id })), - Bus.subscribe(Pty.Event.Exited, (evt) => log.push({ type: "exited", id: evt.properties.id })), - Bus.subscribe(Pty.Event.Deleted, (evt) => log.push({ type: "deleted", id: evt.properties.id })), - ] +const subscribePtyEvents = Effect.fn("PtySessionTest.subscribePtyEvents")(function* () { + const bus = yield* Bus.Service + const events = yield* Queue.unbounded() - let id: PtyID | undefined - try { - const info = yield* pty.create({ - command: "/usr/bin/env", - args: ["sh", "-c", "sleep 0.1"], - title: "sleep", - }) - id = info.id + const subscribe = (effect: Effect.Effect<() => void, never, A>) => + Effect.acquireRelease(effect, (off) => Effect.sync(off)) - yield* Effect.promise(() => wait(() => pick(log, id!).includes("exited"))) + yield* subscribe( + bus.subscribeCallback(Pty.Event.Created, (evt) => { + Queue.offerUnsafe(events, { type: "created", id: evt.properties.info.id }) + }), + ) + yield* subscribe( + bus.subscribeCallback(Pty.Event.Exited, (evt) => { + Queue.offerUnsafe(events, { type: "exited", id: evt.properties.id }) + }), + ) + yield* subscribe( + bus.subscribeCallback(Pty.Event.Deleted, (evt) => { + Queue.offerUnsafe(events, { type: "deleted", id: evt.properties.id }) + }), + ) - yield* pty.remove(id) - yield* Effect.promise(() => wait(() => pick(log, id!).length >= 3)) - expect(pick(log, id!)).toEqual(["created", "exited", "deleted"]) - } finally { - off.forEach((x) => x()) - if (id) yield* pty.remove(id) - } - }), - ), - }) - }) + return events +}) - test("publishes created, exited, deleted in order for /bin/sh + remove", async () => { - if (process.platform === "win32") return +const createPty = Effect.fn("PtySessionTest.createPty")(function* (input: Pty.CreateInput) { + const pty = yield* Pty.Service + return yield* Effect.acquireRelease(pty.create(input), (info) => pty.remove(info.id).pipe(Effect.ignore)) +}) - await using dir = await tmpdir({ git: true }) +const waitForEvents = (events: Queue.Queue, id: PtyID, count: number) => { + return Effect.gen(function* () { + const picked: Array = [] + while (picked.length < count) { + const evt = yield* Queue.take(events) + if (evt.id === id) picked.push(evt.type) + } + return picked + }).pipe( + Effect.timeoutOrElse({ + duration: "5 seconds", + orElse: () => Effect.fail(new Error("timeout waiting for pty events")), + }), + ) +} - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const log: Array<{ type: "created" | "exited" | "deleted"; id: PtyID }> = [] - const off = [ - Bus.subscribe(Pty.Event.Created, (evt) => log.push({ type: "created", id: evt.properties.info.id })), - Bus.subscribe(Pty.Event.Exited, (evt) => log.push({ type: "exited", id: evt.properties.id })), - Bus.subscribe(Pty.Event.Deleted, (evt) => log.push({ type: "deleted", id: evt.properties.id })), - ] +describe("pty", () => { + ptyTest( + "publishes created, exited, deleted in order for a short-lived process", + () => + Effect.gen(function* () { + const events = yield* subscribePtyEvents() + const info = yield* createPty({ + command: "/usr/bin/env", + args: ["sh", "-c", "sleep 0.1"], + title: "sleep", + }) - let id: PtyID | undefined - try { - const info = yield* pty.create({ command: "/bin/sh", title: "sh" }) - id = info.id + expect(yield* waitForEvents(events, info.id, 3)).toEqual(["created", "exited", "deleted"]) + }), + { git: true }, + ) - yield* Effect.promise(() => sleep(100)) + ptyTest( + "publishes created, exited, deleted in order for /bin/sh + remove", + () => + Effect.gen(function* () { + const pty = yield* Pty.Service + const events = yield* subscribePtyEvents() + const info = yield* createPty({ command: "/bin/sh", title: "sh" }) - yield* pty.remove(id) - yield* Effect.promise(() => wait(() => pick(log, id!).length >= 3)) - expect(pick(log, id!)).toEqual(["created", "exited", "deleted"]) - } finally { - off.forEach((x) => x()) - if (id) yield* pty.remove(id) - } - }), - ), - }) - }) + expect(yield* waitForEvents(events, info.id, 1)).toEqual(["created"]) + yield* pty.write(info.id, "exit\n") + expect(yield* waitForEvents(events, info.id, 2)).toEqual(["exited", "deleted"]) + yield* pty.remove(info.id) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/pty/pty-shell.test.ts b/packages/opencode/test/pty/pty-shell.test.ts index 00e965d25ed6..e8132dec767b 100644 --- a/packages/opencode/test/pty/pty-shell.test.ts +++ b/packages/opencode/test/pty/pty-shell.test.ts @@ -1,39 +1,35 @@ -import { describe, expect, test } from "bun:test" -import { AppRuntime } from "../../src/effect/app-runtime" +import { describe, expect } from "bun:test" import { Effect } from "effect" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { Pty } from "../../src/pty" import { Shell } from "../../src/shell/shell" -import { tmpdir } from "../fixture/fixture" +import { testEffect } from "../lib/effect" Shell.preferred.reset() +const it = testEffect(Pty.defaultLayer) + +const createPty = (input: Pty.CreateInput) => + Effect.acquireRelease( + Effect.gen(function* () { + const pty = yield* Pty.Service + const info = yield* pty.create(input) + return { pty, info } + }), + ({ pty, info }) => pty.remove(info.id).pipe(Effect.ignore), + ).pipe(Effect.map(({ info }) => info)) + describe("pty shell args", () => { if (process.platform !== "win32") return const ps = Bun.which("pwsh") || Bun.which("powershell") if (ps) { - test( + it.instance( "does not add login args to pwsh", - async () => { - await using dir = await tmpdir() - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const info = yield* pty.create({ command: ps, title: "pwsh" }) - try { - expect(info.args).toEqual([]) - } finally { - yield* pty.remove(info.id) - } - }), - ), - }) - }, + () => + Effect.gen(function* () { + const info = yield* createPty({ command: ps, title: "pwsh" }) + expect(info.args).toEqual([]) + }), { timeout: 30000 }, ) } @@ -44,62 +40,36 @@ describe("pty shell args", () => { return Shell.gitbash() })() if (bash) { - test( + it.instance( "adds login args to bash", - async () => { - await using dir = await tmpdir() - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const info = yield* pty.create({ command: bash, title: "bash" }) - try { - expect(info.args).toEqual(["-l"]) - } finally { - yield* pty.remove(info.id) - } - }), - ), - }) - }, + () => + Effect.gen(function* () { + const info = yield* createPty({ command: bash, title: "bash" }) + expect(info.args).toEqual(["-l"]) + }), { timeout: 30000 }, ) } }) describe("pty configured shell", () => { - test( + const configured = process.platform === "win32" ? Bun.which("pwsh") || Bun.which("powershell") : Bun.which("bash") + + it.instance( "uses configured shell for default PTY command", - async () => { - const configured = process.platform === "win32" ? Bun.which("pwsh") || Bun.which("powershell") : Bun.which("bash") - if (!configured) return + () => + Effect.gen(function* () { + if (!configured) return - await using dir = await tmpdir({ - config: { shell: Shell.name(configured) }, - }) - await WithInstance.provide({ - directory: dir.path, - fn: () => - AppRuntime.runPromise( - Effect.gen(function* () { - const pty = yield* Pty.Service - const info = yield* pty.create({ title: "configured" }) - try { - if (process.platform === "win32") { - expect(info.command.toLowerCase()).toBe(configured.toLowerCase()) - } else { - expect(info.command).toBe(configured) - } - expect(info.args).toEqual(process.platform === "win32" ? [] : ["-l"]) - } finally { - yield* pty.remove(info.id) - } - }), - ), - }) - }, + const info = yield* createPty({ title: "configured" }) + if (process.platform === "win32") { + expect(info.command.toLowerCase()).toBe(configured.toLowerCase()) + } else { + expect(info.command).toBe(configured) + } + expect(info.args).toEqual(process.platform === "win32" ? [] : ["-l"]) + }), + configured ? { config: { shell: Shell.name(configured) } } : undefined, { timeout: 30000 }, ) }) diff --git a/packages/opencode/test/question/question.test.ts b/packages/opencode/test/question/question.test.ts index 4e2c8ef9bb40..ee3f6dc28a48 100644 --- a/packages/opencode/test/question/question.test.ts +++ b/packages/opencode/test/question/question.test.ts @@ -1,16 +1,18 @@ import { afterEach, expect } from "bun:test" -import { Cause, Effect, Exit, Fiber, Layer } from "effect" +import { Cause, Effect, Exit, Fiber, Layer, Queue } from "effect" import { Question } from "../../src/question" import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { InstanceRuntime } from "../../src/project/instance-runtime" import { QuestionID } from "../../src/question/schema" import { disposeAllInstances, provideInstance, reloadTestInstance, tmpdirScoped } from "../fixture/fixture" import { SessionID } from "../../src/session/schema" import { testEffect } from "../lib/effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { Bus } from "../../src/bus" -const it = testEffect(Layer.mergeAll(Question.defaultLayer, CrossSpawnSpawner.defaultLayer)) +const it = testEffect( + Layer.mergeAll(Question.layer.pipe(Layer.provideMerge(Bus.layer)), CrossSpawnSpawner.defaultLayer), +) const askEffect = Effect.fn("QuestionTest.ask")(function* (input: { sessionID: SessionID @@ -45,15 +47,19 @@ const rejectAll = Effect.gen(function* () { yield* Effect.forEach(yield* listEffect, (req) => rejectEffect(req.id), { discard: true }) }) -const waitForPending = (count: number) => - Effect.gen(function* () { - for (let i = 0; i < 100; i++) { - const pending = yield* listEffect - if (pending.length === count) return pending - yield* Effect.sleep("10 millis") - } - return yield* Effect.fail(new Error(`timed out waiting for ${count} pending question request(s)`)) - }) +const waitForPending = Effect.fn("QuestionTest.waitForPending")(function* (count: number) { + const question = yield* Question.Service + const bus = yield* Bus.Service + const asked = yield* Queue.unbounded() + const off = yield* bus.subscribeCallback(Question.Event.Asked, () => Queue.offerUnsafe(asked, undefined)) + yield* Effect.addFinalizer(() => Effect.sync(off)) + + for (;;) { + const pending = yield* question.list() + if (pending.length === count) return pending + yield* Queue.take(asked).pipe(Effect.timeout("2 seconds")) + } +}) it.instance( "ask - remains pending until answered", @@ -398,9 +404,8 @@ it.live("pending question rejects on instance dispose", () => }).pipe(provideInstance(dir), Effect.forkScoped) expect(yield* waitForPending(1).pipe(provideInstance(dir))).toHaveLength(1) - yield* Effect.promise(() => - WithInstance.provide({ directory: dir, fn: () => InstanceRuntime.disposeInstance(Instance.current) }), - ) + const ctx = yield* Effect.sync(() => Instance.current).pipe(provideInstance(dir)) + yield* Effect.promise(() => InstanceRuntime.disposeInstance(ctx)) const exit = yield* Fiber.await(fiber) expect(Exit.isFailure(exit)).toBe(true) diff --git a/packages/opencode/test/reference/reference.test.ts b/packages/opencode/test/reference/reference.test.ts index 4717c61d25e6..f4a73dbf9fb3 100644 --- a/packages/opencode/test/reference/reference.test.ts +++ b/packages/opencode/test/reference/reference.test.ts @@ -3,8 +3,9 @@ import path from "path" import { Effect, Layer } from "effect" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" -import { Flag } from "@opencode-ai/core/flag/flag" import { Global } from "@opencode-ai/core/global" +import { Config } from "../../src/config/config" +import { RuntimeFlags } from "../../src/effect/runtime-flags" import { Git } from "../../src/git" import { Reference } from "../../src/reference/reference" import { disposeAllInstances, provideTmpdirInstance, tmpdirScoped } from "../fixture/fixture" @@ -14,23 +15,25 @@ afterEach(async () => { await disposeAllInstances() }) +const referenceLayer = (flags: Partial = {}) => + Reference.layer.pipe( + Layer.provide(Config.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Git.defaultLayer), + Layer.provide(RuntimeFlags.layer(flags)), + ) + const it = testEffect( - Layer.mergeAll(AppFileSystem.defaultLayer, CrossSpawnSpawner.defaultLayer, Git.defaultLayer, Reference.defaultLayer), + Layer.mergeAll(AppFileSystem.defaultLayer, CrossSpawnSpawner.defaultLayer, Git.defaultLayer, referenceLayer()), +) +const scout = testEffect( + Layer.mergeAll( + AppFileSystem.defaultLayer, + CrossSpawnSpawner.defaultLayer, + Git.defaultLayer, + referenceLayer({ experimentalScout: true }), + ), ) - -const experimentalScout = (self: Effect.Effect) => - Effect.acquireUseRelease( - Effect.sync(() => { - const previous = Flag.OPENCODE_EXPERIMENTAL_SCOUT - Flag.OPENCODE_EXPERIMENTAL_SCOUT = true - return previous - }), - () => self, - (previous) => - Effect.sync(() => { - Flag.OPENCODE_EXPERIMENTAL_SCOUT = previous - }), - ) const githubBase = (url: string, self: Effect.Effect) => Effect.acquireUseRelease( @@ -127,118 +130,114 @@ describe("reference", () => { }), ) - it.live("materializes configured git references during init", () => - experimentalScout( - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const fs = yield* AppFileSystem.Service - const cache = path.join(Global.Path.repos, "github.com", "opencode-reference-test", "repo") - yield* fs.remove(cache, { recursive: true }).pipe(Effect.ignore) - yield* Effect.addFinalizer(() => fs.remove(cache, { recursive: true }).pipe(Effect.ignore)) - - const source = yield* tmpdirScoped({ git: true }) - const remoteRoot = yield* tmpdirScoped() - const remoteDir = path.join(remoteRoot, "opencode-reference-test") - const remoteRepo = path.join(remoteDir, "repo.git") - - yield* Effect.promise(() => Bun.write(path.join(source, "README.md"), "configured\n")) - yield* git(source, ["add", "."]) - yield* git(source, ["commit", "-m", "add readme"]) - yield* fs.makeDirectory(remoteDir, { recursive: true }).pipe(Effect.orDie) - yield* git(remoteRoot, ["clone", "--bare", source, remoteRepo]) - - const reference = yield* Reference.Service - yield* githubBase( - `file://${remoteRoot}/`, - Effect.gen(function* () { - yield* reference.init() - yield* waitForContent(fs, path.join(cache, "README.md"), "configured\n") - }), - ) - - expect(yield* fs.existsSafe(path.join(cache, ".git"))).toBe(true) - expect(yield* fs.readFileString(path.join(cache, "README.md"))).toBe("configured\n") - - const resolved = yield* reference.get("docs") - expect(resolved?.kind).toBe("git") - if (resolved?.kind === "git") expect(resolved.path).toBe(cache) - }), - { - config: { - reference: { - docs: "opencode-reference-test/repo", - }, + scout.live("materializes configured git references during init", () => + provideTmpdirInstance( + (_dir) => + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const cache = path.join(Global.Path.repos, "github.com", "opencode-reference-test", "repo") + yield* fs.remove(cache, { recursive: true }).pipe(Effect.ignore) + yield* Effect.addFinalizer(() => fs.remove(cache, { recursive: true }).pipe(Effect.ignore)) + + const source = yield* tmpdirScoped({ git: true }) + const remoteRoot = yield* tmpdirScoped() + const remoteDir = path.join(remoteRoot, "opencode-reference-test") + const remoteRepo = path.join(remoteDir, "repo.git") + + yield* Effect.promise(() => Bun.write(path.join(source, "README.md"), "configured\n")) + yield* git(source, ["add", "."]) + yield* git(source, ["commit", "-m", "add readme"]) + yield* fs.makeDirectory(remoteDir, { recursive: true }).pipe(Effect.orDie) + yield* git(remoteRoot, ["clone", "--bare", source, remoteRepo]) + + const reference = yield* Reference.Service + yield* githubBase( + `file://${remoteRoot}/`, + Effect.gen(function* () { + yield* reference.init() + yield* waitForContent(fs, path.join(cache, "README.md"), "configured\n") + }), + ) + + expect(yield* fs.existsSafe(path.join(cache, ".git"))).toBe(true) + expect(yield* fs.readFileString(path.join(cache, "README.md"))).toBe("configured\n") + + const resolved = yield* reference.get("docs") + expect(resolved?.kind).toBe("git") + if (resolved?.kind === "git") expect(resolved.path).toBe(cache) + }), + { + config: { + reference: { + docs: "opencode-reference-test/repo", }, }, - ), + }, ), ) - it.live("refreshes configured git references on new instance init", () => - experimentalScout( - Effect.gen(function* () { - const fs = yield* AppFileSystem.Service - const cache = path.join(Global.Path.repos, "github.com", "opencode-reference-refresh", "repo") - yield* fs.remove(cache, { recursive: true }).pipe(Effect.ignore) - yield* Effect.addFinalizer(() => fs.remove(cache, { recursive: true }).pipe(Effect.ignore)) - - const source = yield* tmpdirScoped({ git: true }) - const remoteRoot = yield* tmpdirScoped() - const remoteDir = path.join(remoteRoot, "opencode-reference-refresh") - const remoteRepo = path.join(remoteDir, "repo.git") - - yield* Effect.promise(() => Bun.write(path.join(source, "README.md"), "v1\n")) - yield* git(source, ["add", "."]) - yield* git(source, ["commit", "-m", "add readme"]) - yield* fs.makeDirectory(remoteDir, { recursive: true }).pipe(Effect.orDie) - yield* git(remoteRoot, ["clone", "--bare", source, remoteRepo]) - - yield* githubBase( - `file://${remoteRoot}/`, - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const reference = yield* Reference.Service - yield* reference.init() - yield* waitForContent(fs, path.join(cache, "README.md"), "v1\n") - }), - { - config: { - reference: { - docs: "opencode-reference-refresh/repo", - }, + scout.live("refreshes configured git references on new instance init", () => + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const cache = path.join(Global.Path.repos, "github.com", "opencode-reference-refresh", "repo") + yield* fs.remove(cache, { recursive: true }).pipe(Effect.ignore) + yield* Effect.addFinalizer(() => fs.remove(cache, { recursive: true }).pipe(Effect.ignore)) + + const source = yield* tmpdirScoped({ git: true }) + const remoteRoot = yield* tmpdirScoped() + const remoteDir = path.join(remoteRoot, "opencode-reference-refresh") + const remoteRepo = path.join(remoteDir, "repo.git") + + yield* Effect.promise(() => Bun.write(path.join(source, "README.md"), "v1\n")) + yield* git(source, ["add", "."]) + yield* git(source, ["commit", "-m", "add readme"]) + yield* fs.makeDirectory(remoteDir, { recursive: true }).pipe(Effect.orDie) + yield* git(remoteRoot, ["clone", "--bare", source, remoteRepo]) + + yield* githubBase( + `file://${remoteRoot}/`, + provideTmpdirInstance( + (_dir) => + Effect.gen(function* () { + const reference = yield* Reference.Service + yield* reference.init() + yield* waitForContent(fs, path.join(cache, "README.md"), "v1\n") + }), + { + config: { + reference: { + docs: "opencode-reference-refresh/repo", }, }, - ), - ) - - const branch = yield* git(source, ["branch", "--show-current"]) - yield* git(source, ["remote", "add", "origin", remoteRepo]) - yield* Effect.promise(() => Bun.write(path.join(source, "README.md"), "v2\n")) - yield* git(source, ["add", "."]) - yield* git(source, ["commit", "-m", "update readme"]) - yield* git(source, ["push", "origin", `${branch}:${branch}`]) - - yield* githubBase( - `file://${remoteRoot}/`, - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const reference = yield* Reference.Service - yield* reference.init() - yield* waitForContent(fs, path.join(cache, "README.md"), "v2\n") - }), - { - config: { - reference: { - docs: "opencode-reference-refresh/repo", - }, + }, + ), + ) + + const branch = yield* git(source, ["branch", "--show-current"]) + yield* git(source, ["remote", "add", "origin", remoteRepo]) + yield* Effect.promise(() => Bun.write(path.join(source, "README.md"), "v2\n")) + yield* git(source, ["add", "."]) + yield* git(source, ["commit", "-m", "update readme"]) + yield* git(source, ["push", "origin", `${branch}:${branch}`]) + + yield* githubBase( + `file://${remoteRoot}/`, + provideTmpdirInstance( + (_dir) => + Effect.gen(function* () { + const reference = yield* Reference.Service + yield* reference.init() + yield* waitForContent(fs, path.join(cache, "README.md"), "v2\n") + }), + { + config: { + reference: { + docs: "opencode-reference-refresh/repo", }, }, - ), - ) - }), - ), + }, + ), + ) + }), ) }) diff --git a/packages/opencode/test/server/global-bus.ts b/packages/opencode/test/server/global-bus.ts index c8d0f92191fe..24e5cf77b5a9 100644 --- a/packages/opencode/test/server/global-bus.ts +++ b/packages/opencode/test/server/global-bus.ts @@ -29,6 +29,3 @@ export function waitGlobalBusEvent(input: { ), ) } - -export const waitGlobalBusEventPromise = (input: Parameters[0]) => - Effect.runPromise(waitGlobalBusEvent(input)) diff --git a/packages/opencode/test/server/global-session-list.test.ts b/packages/opencode/test/server/global-session-list.test.ts index 04348e5c0dbf..0fdba1f66397 100644 --- a/packages/opencode/test/server/global-session-list.test.ts +++ b/packages/opencode/test/server/global-session-list.test.ts @@ -1,104 +1,104 @@ -import { describe, expect, test } from "bun:test" -import { Effect } from "effect" -import { WithInstance } from "../../src/project/with-instance" +import { describe, expect } from "bun:test" +import { Deferred, Effect, Layer } from "effect" import { Project } from "@/project/project" import { Session as SessionNs } from "@/session/session" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import * as Log from "@opencode-ai/core/util/log" -import { tmpdir } from "../fixture/fixture" +import { provideInstance, TestInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) -function run(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer))) -} +const it = testEffect(Layer.mergeAll(SessionNs.defaultLayer, Project.defaultLayer, CrossSpawnSpawner.defaultLayer)) -const svc = { - ...SessionNs, - create(input?: SessionNs.CreateInput) { - return run(SessionNs.Service.use((svc) => svc.create(input))) - }, - setArchived(input: typeof SessionNs.SetArchivedInput.Type) { - return run(SessionNs.Service.use((svc) => svc.setArchived(input))) - }, -} +const withSession = (input?: Parameters[0]) => + Effect.acquireRelease( + SessionNs.Service.use((session) => session.create(input)), + (created) => SessionNs.Service.use((session) => session.remove(created.id).pipe(Effect.ignore)), + ) describe("session.listGlobal", () => { - test("lists sessions across projects with project metadata", async () => { - await using first = await tmpdir({ git: true }) - await using second = await tmpdir({ git: true }) - - const firstSession = await WithInstance.provide({ - directory: first.path, - fn: async () => svc.create({ title: "first-session" }), - }) - const secondSession = await WithInstance.provide({ - directory: second.path, - fn: async () => svc.create({ title: "second-session" }), - }) - - const sessions = [...svc.listGlobal({ limit: 200 })] - const ids = sessions.map((session) => session.id) - - expect(ids).toContain(firstSession.id) - expect(ids).toContain(secondSession.id) - - const firstProject = Project.get(firstSession.projectID) - const secondProject = Project.get(secondSession.projectID) - - const firstItem = sessions.find((session) => session.id === firstSession.id) - const secondItem = sessions.find((session) => session.id === secondSession.id) - - expect(firstItem?.project?.id).toBe(firstProject?.id) - expect(firstItem?.project?.worktree).toBe(firstProject?.worktree) - expect(secondItem?.project?.id).toBe(secondProject?.id) - expect(secondItem?.project?.worktree).toBe(secondProject?.worktree) - }) - - test("excludes archived sessions by default", async () => { - await using tmp = await tmpdir({ git: true }) - - const archived = await WithInstance.provide({ - directory: tmp.path, - fn: async () => svc.create({ title: "archived-session" }), - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => svc.setArchived({ sessionID: archived.id, time: Date.now() }), - }) - - const sessions = [...svc.listGlobal({ limit: 200 })] - const ids = sessions.map((session) => session.id) - - expect(ids).not.toContain(archived.id) - - const allSessions = [...svc.listGlobal({ limit: 200, archived: true })] - const allIds = allSessions.map((session) => session.id) - - expect(allIds).toContain(archived.id) - }) - - test("supports cursor pagination", async () => { - await using tmp = await tmpdir({ git: true }) - - const first = await WithInstance.provide({ - directory: tmp.path, - fn: async () => svc.create({ title: "page-one" }), - }) - await new Promise((resolve) => setTimeout(resolve, 5)) - const second = await WithInstance.provide({ - directory: tmp.path, - fn: async () => svc.create({ title: "page-two" }), - }) - - const page = [...svc.listGlobal({ directory: tmp.path, limit: 1 })] - expect(page.length).toBe(1) - expect(page[0].id).toBe(second.id) - - const next = [...svc.listGlobal({ directory: tmp.path, limit: 10, cursor: page[0].time.updated })] - const ids = next.map((session) => session.id) - - expect(ids).toContain(first.id) - expect(ids).not.toContain(second.id) - }) + it.instance( + "lists sessions across projects with project metadata", + () => + Effect.gen(function* () { + const first = yield* TestInstance + const second = yield* tmpdirScoped({ git: true }) + + const firstSession = yield* withSession({ title: "first-session" }) + const secondSession = yield* withSession({ title: "second-session" }).pipe(provideInstance(second)) + + const sessions = yield* Effect.sync(() => [...SessionNs.listGlobal({ limit: 200 })]) + const ids = sessions.map((session) => session.id) + + expect(ids).toContain(firstSession.id) + expect(ids).toContain(secondSession.id) + + const firstProject = yield* Project.Service.use((project) => project.get(firstSession.projectID)) + const secondProject = yield* Project.Service.use((project) => project.get(secondSession.projectID)) + + const firstItem = sessions.find((session) => session.id === firstSession.id) + const secondItem = sessions.find((session) => session.id === secondSession.id) + + expect(firstItem?.project?.id).toBe(firstProject?.id) + expect(firstItem?.project?.worktree).toBe(firstProject?.worktree) + expect(secondItem?.project?.id).toBe(secondProject?.id) + expect(secondItem?.project?.worktree).toBe(secondProject?.worktree) + expect(first.directory).not.toBe(second) + }), + { git: true }, + ) + + it.instance( + "excludes archived sessions by default", + () => + Effect.gen(function* () { + const archived = yield* withSession({ title: "archived-session" }) + + yield* SessionNs.Service.use((session) => session.setArchived({ sessionID: archived.id, time: Date.now() })) + + const sessions = yield* Effect.sync(() => [...SessionNs.listGlobal({ limit: 200 })]) + const ids = sessions.map((session) => session.id) + + expect(ids).not.toContain(archived.id) + + const allSessions = yield* Effect.sync(() => [...SessionNs.listGlobal({ limit: 200, archived: true })]) + const allIds = allSessions.map((session) => session.id) + + expect(allIds).toContain(archived.id) + }), + { git: true }, + ) + + it.instance( + "supports cursor pagination", + () => + Effect.gen(function* () { + const test = yield* TestInstance + + const first = yield* withSession({ title: "page-one" }) + const ready = yield* Deferred.make() + yield* Deferred.succeed(ready, undefined).pipe(Effect.delay("5 millis"), Effect.forkScoped) + yield* Deferred.await(ready).pipe( + Effect.timeoutOrElse({ + duration: "1 second", + orElse: () => Effect.fail(new Error("timed out waiting between session creates")), + }), + ) + const second = yield* withSession({ title: "page-two" }) + + const page = yield* Effect.sync(() => [...SessionNs.listGlobal({ directory: test.directory, limit: 1 })]) + expect(page.length).toBe(1) + expect(page[0].id).toBe(second.id) + + const next = yield* Effect.sync(() => [ + ...SessionNs.listGlobal({ directory: test.directory, limit: 10, cursor: page[0].time.updated }), + ]) + const ids = next.map((session) => session.id) + + expect(ids).toContain(first.id) + expect(ids).not.toContain(second.id) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/server/httpapi-config.test.ts b/packages/opencode/test/server/httpapi-config.test.ts index 26c0fe03e612..7619a0c88172 100644 --- a/packages/opencode/test/server/httpapi-config.test.ts +++ b/packages/opencode/test/server/httpapi-config.test.ts @@ -1,10 +1,12 @@ -import { afterEach, describe, expect, test } from "bun:test" +import { afterEach, describe, expect } from "bun:test" import path from "path" import { Server } from "../../src/server/server" import * as Log from "@opencode-ai/core/util/log" +import { Effect, Fiber } from "effect" import { resetDatabase } from "../fixture/db" import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { waitGlobalBusEventPromise } from "./global-bus" +import { it } from "../lib/effect" +import { waitGlobalBusEvent } from "./global-bus" void Log.init({ print: false }) @@ -12,76 +14,100 @@ function app() { return Server.Default().app } -async function waitDisposed(directory: string) { - await waitGlobalBusEventPromise({ +function waitDisposed(directory: string) { + return waitGlobalBusEvent({ message: "timed out waiting for instance disposal", predicate: (event) => event.payload.type === "server.instance.disposed" && event.directory === directory, }) } +const tmpdirEffect = (options: Parameters[0]) => + Effect.acquireRelease( + Effect.promise(() => tmpdir(options)), + (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()), + ) + afterEach(async () => { await disposeAllInstances() await resetDatabase() }) describe("config HttpApi", () => { - test("serves config update through the default server app", async () => { - await using tmp = await tmpdir({ config: { formatter: false, lsp: false } }) - const disposed = waitDisposed(tmp.path) - - const response = await app().request("/config", { - method: "PATCH", - headers: { - "content-type": "application/json", - "x-opencode-directory": tmp.path, - }, - body: JSON.stringify({ username: "patched-user", formatter: false, lsp: false }), - }) + it.live( + "serves config update through the default server app", + Effect.gen(function* () { + const tmp = yield* tmpdirEffect({ config: { formatter: false, lsp: false } }) + const disposed = yield* waitDisposed(tmp.path).pipe(Effect.forkScoped) - expect(response.status).toBe(200) - expect(await response.json()).toMatchObject({ username: "patched-user", formatter: false, lsp: false }) - await disposed - expect(await Bun.file(path.join(tmp.path, "config.json")).json()).toMatchObject({ - username: "patched-user", - formatter: false, - lsp: false, - }) - }) + const response = yield* Effect.promise(() => + Promise.resolve( + app().request("/config", { + method: "PATCH", + headers: { + "content-type": "application/json", + "x-opencode-directory": tmp.path, + }, + body: JSON.stringify({ username: "patched-user", formatter: false, lsp: false }), + }), + ), + ) - test("serves config with active provider model status", async () => { - await using tmp = await tmpdir({ - config: { + expect(response.status).toBe(200) + expect(yield* Effect.promise(() => response.json())).toMatchObject({ + username: "patched-user", formatter: false, lsp: false, - provider: { - omniroute: { - models: { - "gpt-4o": { - status: "active", + }) + yield* Fiber.join(disposed) + expect(yield* Effect.promise(() => Bun.file(path.join(tmp.path, "config.json")).json())).toMatchObject({ + username: "patched-user", + formatter: false, + lsp: false, + }) + }), + ) + + it.live( + "serves config with active provider model status", + Effect.gen(function* () { + const tmp = yield* tmpdirEffect({ + config: { + formatter: false, + lsp: false, + provider: { + omniroute: { + models: { + "gpt-4o": { + status: "active", + }, }, }, }, }, - }, - }) + }) - const response = await app().request("/config", { - headers: { - "x-opencode-directory": tmp.path, - }, - }) + const response = yield* Effect.promise(() => + Promise.resolve( + app().request("/config", { + headers: { + "x-opencode-directory": tmp.path, + }, + }), + ), + ) - expect(response.status).toBe(200) - expect(await response.json()).toMatchObject({ - provider: { - omniroute: { - models: { - "gpt-4o": { - status: "active", + expect(response.status).toBe(200) + expect(yield* Effect.promise(() => response.json())).toMatchObject({ + provider: { + omniroute: { + models: { + "gpt-4o": { + status: "active", + }, }, }, }, - }, - }) - }) + }) + }), + ) }) diff --git a/packages/opencode/test/server/httpapi-cors.test.ts b/packages/opencode/test/server/httpapi-cors.test.ts index 6c83b00d53de..4e9680c7ce4b 100644 --- a/packages/opencode/test/server/httpapi-cors.test.ts +++ b/packages/opencode/test/server/httpapi-cors.test.ts @@ -6,7 +6,7 @@ import { HttpClient, HttpClientRequest, HttpRouter, HttpServer } from "effect/un import * as Socket from "effect/unstable/socket/Socket" import { Server } from "../../src/server/server" import { InstancePaths } from "../../src/server/routes/instance/httpapi/groups/instance" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { resetDatabase } from "../fixture/db" import { testEffect } from "../lib/effect" @@ -27,7 +27,7 @@ const testStateLayer = Layer.effectDiscard( ) const servedRoutes: Layer.Layer = HttpRouter.serve( - ExperimentalHttpApiServer.routes, + HttpApiApp.routes, { disableListenLog: true, disableLogger: true }, ) @@ -63,7 +63,7 @@ describe("HttpApi CORS", () => { it.live("adds CORS headers to unauthorized responses", () => Effect.gen(function* () { const handler = HttpRouter.toWebHandler( - ExperimentalHttpApiServer.createRoutes().pipe( + HttpApiApp.createRoutes().pipe( Layer.provide(ConfigProvider.layer(ConfigProvider.fromUnknown({ OPENCODE_SERVER_PASSWORD: "secret" }))), ), { disableLogger: true }, @@ -73,7 +73,7 @@ describe("HttpApi CORS", () => { new Request(new URL("/global/config", "http://localhost"), { headers: { origin: "https://app.opencode.ai" }, }), - ExperimentalHttpApiServer.context, + HttpApiApp.context, ), ) @@ -103,6 +103,20 @@ describe("HttpApi CORS", () => { expect(response.status).toBe(204) expect(response.headers.get("access-control-allow-origin")).toBe("https://custom.example") expect(response.headers.get("access-control-allow-headers")).toBe("authorization") + + const rejected = yield* Effect.promise(() => + fetch(new URL(InstancePaths.path, listener.url), { + method: "OPTIONS", + headers: { + origin: "https://evil.example", + "access-control-request-method": "GET", + "access-control-request-headers": "authorization", + }, + }), + ) + + expect(rejected.status).toBe(204) + expect(rejected.headers.get("access-control-allow-origin")).not.toBe("https://evil.example") }), ) }) diff --git a/packages/opencode/test/server/httpapi-error-middleware.test.ts b/packages/opencode/test/server/httpapi-error-middleware.test.ts new file mode 100644 index 000000000000..15f8aa20260e --- /dev/null +++ b/packages/opencode/test/server/httpapi-error-middleware.test.ts @@ -0,0 +1,71 @@ +import { NodeHttpServer, NodeServices } from "@effect/platform-node" +import { NamedError } from "@opencode-ai/core/util/error" +import { describe, expect } from "bun:test" +import { Effect, Layer } from "effect" +import { HttpClient, HttpClientRequest, HttpRouter } from "effect/unstable/http" +import { errorLayer } from "../../src/server/routes/instance/httpapi/middleware/error" +import { NotFoundError } from "../../src/storage/storage" +import { testEffect } from "../lib/effect" + +const it = testEffect(Layer.mergeAll(NodeHttpServer.layerTest, NodeServices.layer)) + +describe("HttpApi error middleware", () => { + it.live("returns a safe body for unknown 500 defects", () => + Effect.gen(function* () { + yield* HttpRouter.add("GET", "/boom", Effect.die(new Error("secret stack marker"))).pipe( + Layer.provide(errorLayer), + HttpRouter.serve, + Layer.build, + ) + + const response = yield* HttpClientRequest.get("/boom").pipe(HttpClient.execute) + const body = yield* response.json + + expect(response.status).toBe(500) + expect(body).toEqual({ + name: "UnknownError", + data: { message: "Unexpected server error. Check server logs for details." }, + }) + expect(JSON.stringify(body)).not.toContain("secret stack marker") + }), + ) + + it.live("returns a safe body for named defects", () => + Effect.gen(function* () { + yield* HttpRouter.add( + "GET", + "/named", + Effect.die(new NamedError.Unknown({ message: "secret named marker" })), + ).pipe(Layer.provide(errorLayer), HttpRouter.serve, Layer.build) + + const response = yield* HttpClientRequest.get("/named").pipe(HttpClient.execute) + const body = yield* response.json + + expect(response.status).toBe(500) + expect(body).toEqual({ + name: "UnknownError", + data: { message: "Unexpected server error. Check server logs for details." }, + }) + expect(JSON.stringify(body)).not.toContain("secret named marker") + }), + ) + + it.live("does not map storage not-found defects to 404", () => + Effect.gen(function* () { + yield* HttpRouter.add( + "GET", + "/missing", + Effect.die(new NotFoundError({ message: "Resource not found: secret" })), + ).pipe(Layer.provide(errorLayer), HttpRouter.serve, Layer.build) + + const response = yield* HttpClientRequest.get("/missing").pipe(HttpClient.execute) + const body = yield* response.json + + expect(response.status).toBe(500) + expect(body).toEqual({ + name: "UnknownError", + data: { message: "Unexpected server error. Check server logs for details." }, + }) + }), + ) +}) diff --git a/packages/opencode/test/server/httpapi-event.test.ts b/packages/opencode/test/server/httpapi-event.test.ts index df716ed0968e..3f1d1e114074 100644 --- a/packages/opencode/test/server/httpapi-event.test.ts +++ b/packages/opencode/test/server/httpapi-event.test.ts @@ -1,10 +1,13 @@ import { afterEach, describe, expect, test } from "bun:test" +import { Bus } from "../../src/bus" import { Instance } from "../../src/project/instance" import { Server } from "../../src/server/server" -import { EventPaths } from "../../src/server/routes/instance/httpapi/event" +import { EventPaths } from "../../src/server/routes/instance/httpapi/groups/event" +import { Event as ServerEvent } from "../../src/server/event" import * as Log from "@opencode-ai/core/util/log" +import { Schema } from "effect" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, reloadTestInstance, tmpdir } from "../fixture/fixture" void Log.init({ print: false }) @@ -12,22 +15,53 @@ function app() { return Server.Default().app } -async function readFirstChunk(response: Response) { +const EventData = Schema.Struct({ + id: Schema.optional(Schema.String), + type: Schema.String, + properties: Schema.Record(Schema.String, Schema.Any), +}) + +async function readChunk(reader: ReadableStreamDefaultReader) { + let timeout: ReturnType | undefined + try { + return await Promise.race([ + reader.read(), + new Promise((_, reject) => { + timeout = setTimeout(() => reject(new Error("timed out waiting for event")), 5_000) + }), + ]) + } finally { + if (timeout) clearTimeout(timeout) + } +} + +async function readFirstEvent(response: Response) { if (!response.body) throw new Error("missing response body") const reader = response.body.getReader() - const result = await Promise.race([ - reader.read(), - new Promise((_, reject) => setTimeout(() => reject(new Error("timed out waiting for event")), 5_000)), - ]) - await reader.cancel() - return new TextDecoder().decode(result.value) + try { + return await readEvent(reader) + } finally { + await reader.cancel() + } } -async function readFirstEvent(response: Response) { - return JSON.parse((await readFirstChunk(response)).replace(/^data: /, "")) as { - id?: string - type: string - properties: Record +async function readEvent(reader: ReadableStreamDefaultReader) { + const result = await readChunk(reader) + if (result.done || !result.value) throw new Error("event stream closed") + return Schema.decodeUnknownSync(EventData)(JSON.parse(new TextDecoder().decode(result.value).replace(/^data: /, ""))) +} + +async function readStatusWithin(reader: ReadableStreamDefaultReader, delay: number) { + let timeout: ReturnType | undefined + try { + return await Promise.race([ + reader.read().then((result) => (result.done ? "closed" : "event")), + new Promise<"open">((resolve) => { + timeout = setTimeout(() => resolve("open"), delay) + }), + ]) + } finally { + if (timeout) clearTimeout(timeout) } } @@ -49,11 +83,36 @@ describe("event HttpApi", () => { expect(await readFirstEvent(response)).toMatchObject({ type: "server.connected", properties: {} }) }) - test("serves the initial server connected event", async () => { + test("keeps the event stream open after the initial event", async () => { await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) - const headers = { "x-opencode-directory": tmp.path } - const response = await app().request(EventPaths.event, { headers }) + const response = await app().request(EventPaths.event, { headers: { "x-opencode-directory": tmp.path } }) + if (!response.body) throw new Error("missing response body") - expect(await readFirstEvent(response)).toMatchObject({ type: "server.connected", properties: {} }) + const reader = response.body.getReader() + try { + expect(await readEvent(reader)).toMatchObject({ type: "server.connected", properties: {} }) + expect(await readStatusWithin(reader, 250)).toBe("open") + } finally { + await reader.cancel() + } + }) + + test("delivers instance bus events after the initial event", async () => { + await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) + const response = await app().request(EventPaths.event, { headers: { "x-opencode-directory": tmp.path } }) + if (!response.body) throw new Error("missing response body") + + const reader = response.body.getReader() + try { + expect(await readEvent(reader)).toMatchObject({ type: "server.connected", properties: {} }) + + const next = readEvent(reader) + const ctx = await reloadTestInstance({ directory: tmp.path }) + await Instance.restore(ctx, () => Bus.publish(ServerEvent.Connected, {})) + + expect(await next).toMatchObject({ type: "server.connected", properties: {} }) + } finally { + await reader.cancel() + } }) }) diff --git a/packages/opencode/test/server/httpapi-exercise/backend.ts b/packages/opencode/test/server/httpapi-exercise/backend.ts index b306401ccd7b..ce94ddda9167 100644 --- a/packages/opencode/test/server/httpapi-exercise/backend.ts +++ b/packages/opencode/test/server/httpapi-exercise/backend.ts @@ -49,7 +49,7 @@ function app(modules: Runtime, options: CallOptions) { if (appCache[cacheKey]) return appCache[cacheKey] const handler = HttpRouter.toWebHandler( - modules.ExperimentalHttpApiServer.routes.pipe( + modules.HttpApiApp.routes.pipe( Layer.provide( ConfigProvider.layer( ConfigProvider.fromUnknown({ OPENCODE_SERVER_PASSWORD: password, OPENCODE_SERVER_USERNAME: username }), @@ -62,7 +62,7 @@ function app(modules: Runtime, options: CallOptions) { request(input: string | URL | Request, init?: RequestInit) { return handler( input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), - modules.ExperimentalHttpApiServer.context, + modules.HttpApiApp.context, ) }, }) diff --git a/packages/opencode/test/server/httpapi-exercise/index.ts b/packages/opencode/test/server/httpapi-exercise/index.ts index 0d6bec2dfed0..293e2a3449dc 100644 --- a/packages/opencode/test/server/httpapi-exercise/index.ts +++ b/packages/opencode/test/server/httpapi-exercise/index.ts @@ -593,6 +593,12 @@ const scenarios: Scenario[] = [ check(auth.test === undefined, "auth remove should delete provider from isolated auth file") }), ), + http.protected.get("/api/model", "v2.model.list").json(200, array), + http.protected.get("/api/provider", "v2.provider.list").json(200, array), + http.protected + .get("/api/provider/{providerID}", "v2.provider.get") + .at((ctx) => ({ path: route("/api/provider/{providerID}", { providerID: "missing" }), headers: ctx.headers() })) + .json(404, object, "status"), http.protected .get("/api/session", "v2.session.list") .at((ctx) => ({ path: "/api/session?roots=true", headers: ctx.headers() })) diff --git a/packages/opencode/test/server/httpapi-exercise/runner.ts b/packages/opencode/test/server/httpapi-exercise/runner.ts index bc246dbeda6f..b14647680c32 100644 --- a/packages/opencode/test/server/httpapi-exercise/runner.ts +++ b/packages/opencode/test/server/httpapi-exercise/runner.ts @@ -168,9 +168,10 @@ function withContext( ) return { info, part } }), - messages: (sessionID) => run(modules.Session.Service.use((svc) => svc.messages({ sessionID }))), + messages: (sessionID) => + run(modules.Session.Service.use((svc) => svc.messages({ sessionID }).pipe(Effect.orDie))), todos: (sessionID, todos) => run(modules.Todo.Service.use((svc) => svc.update({ sessionID, todos }))), - worktree: (input) => run(modules.Worktree.Service.use((svc) => svc.create(input))), + worktree: (input) => run(modules.Worktree.Service.use((svc) => svc.create(input).pipe(Effect.orDie))), worktreeRemove: (directory) => run(modules.Worktree.Service.use((svc) => svc.remove({ directory })).pipe(Effect.ignore)), llmText: (value) => Effect.suspend(() => llm().text(value)), diff --git a/packages/opencode/test/server/httpapi-exercise/runtime.ts b/packages/opencode/test/server/httpapi-exercise/runtime.ts index 7163cf0c5af8..12c3adc27f34 100644 --- a/packages/opencode/test/server/httpapi-exercise/runtime.ts +++ b/packages/opencode/test/server/httpapi-exercise/runtime.ts @@ -1,6 +1,6 @@ export type Runtime = { PublicApi: (typeof import("../../../src/server/routes/instance/httpapi/public"))["PublicApi"] - ExperimentalHttpApiServer: (typeof import("../../../src/server/routes/instance/httpapi/server"))["ExperimentalHttpApiServer"] + HttpApiApp: (typeof import("../../../src/server/routes/instance/httpapi/server"))["HttpApiApp"] AppLayer: (typeof import("../../../src/effect/app-runtime"))["AppLayer"] InstanceRef: (typeof import("../../../src/effect/instance-ref"))["InstanceRef"] Instance: (typeof import("../../../src/project/instance"))["Instance"] @@ -34,7 +34,7 @@ export function runtime() { const db = await import("../../fixture/db") return { PublicApi: publicApi.PublicApi, - ExperimentalHttpApiServer: httpApiServer.ExperimentalHttpApiServer, + HttpApiApp: httpApiServer.HttpApiApp, AppLayer: appRuntime.AppLayer, InstanceRef: instanceRef.InstanceRef, Instance: instance.Instance, diff --git a/packages/opencode/test/server/httpapi-experimental.test.ts b/packages/opencode/test/server/httpapi-experimental.test.ts index 383442e00ef3..2613ee385083 100644 --- a/packages/opencode/test/server/httpapi-experimental.test.ts +++ b/packages/opencode/test/server/httpapi-experimental.test.ts @@ -1,47 +1,183 @@ -import { afterEach, describe, expect, test } from "bun:test" -import { Effect } from "effect" -import { WithInstance } from "../../src/project/with-instance" +import { afterEach, describe, expect } from "bun:test" +import { Deferred, Effect, Fiber, Layer } from "effect" +import { eq } from "drizzle-orm" +import { GlobalBus, type GlobalEvent } from "@/bus/global" import { Server } from "../../src/server/server" import { ExperimentalPaths } from "../../src/server/routes/instance/httpapi/groups/experimental" import { Session } from "@/session/session" +import { SessionTable } from "@/session/session.sql" import { Database } from "@/storage/db" import * as Log from "@opencode-ai/core/util/log" import { Worktree } from "../../src/worktree" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { waitGlobalBusEventPromise } from "./global-bus" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) -const testWorktreeMutations = process.platform === "win32" ? test.skip : test +const it = testEffect(Layer.mergeAll(Session.defaultLayer)) +const testWorktreeMutations = process.platform === "win32" ? it.instance.skip : it.instance function app() { return Server.Default().app } -function runSession(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(Session.defaultLayer))) +function request(path: string, directory: string, init: RequestInit = {}) { + return Effect.promise(() => { + const headers = new Headers(init.headers) + headers.set("x-opencode-directory", directory) + return Promise.resolve(app().request(path, { ...init, headers })) + }) } function createSession(input?: Session.CreateInput) { - return runSession(Session.Service.use((svc) => svc.create(input))) + return Session.Service.use((svc) => svc.create(input)) +} + +function json(response: Response) { + return Effect.promise(() => response.json() as Promise) } -async function waitReady(directory: string) { - await waitGlobalBusEventPromise({ - message: "timed out waiting for worktree.ready", - predicate: (event) => event.payload.type === Worktree.Event.Ready.type && event.directory === directory, +function waitReady(input: { directory?: string; name?: string }) { + return Effect.gen(function* () { + const ready = yield* Deferred.make() + const on = (event: GlobalEvent) => { + if (event.payload.type !== Worktree.Event.Ready.type) return + if (input.directory && event.directory !== input.directory) return + if (input.name && event.payload.properties.name !== input.name) return + Deferred.doneUnsafe(ready, Effect.void) + } + + GlobalBus.on("event", on) + yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on))) + + return yield* Deferred.await(ready).pipe( + Effect.timeoutOrElse({ + duration: "10 seconds", + orElse: () => Effect.fail(new Error("timed out waiting for worktree.ready")), + }), + ) }) } +function insertAccount() { + return Effect.acquireRelease( + Effect.sync(() => { + Database.Client() + .$client.prepare( + "INSERT INTO account (id, email, url, access_token, refresh_token, time_created, time_updated) VALUES (?, ?, ?, ?, ?, ?, ?)", + ) + .run( + "account-test", + "test@example.com", + "https://console.example.com", + "access", + "refresh", + Date.now(), + Date.now(), + ) + return "account-test" + }), + (id) => + Effect.sync(() => { + Database.Client().$client.prepare("DELETE FROM account WHERE id = ?").run(id) + }), + ) +} + +function setSessionUpdated(session: Session.Info, updated: number) { + return Effect.sync(() => { + Database.use((db) => + db.update(SessionTable).set({ time_updated: updated }).where(eq(SessionTable.id, session.id)).run(), + ) + }) +} + +function withCreatedWorktree(directory: string, use: (info: Worktree.Info) => Effect.Effect) { + const name = "api-test" + const headers = { "content-type": "application/json" } + return Effect.acquireUseRelease( + Effect.gen(function* () { + const ready = yield* waitReady({ name }).pipe(Effect.forkScoped) + const created = yield* request(ExperimentalPaths.worktree, directory, { + method: "POST", + headers, + body: JSON.stringify({ name }), + }) + + expect(created.status).toBe(200) + const info = yield* json(created) + expect(info).toMatchObject({ name, branch: "opencode/api-test" }) + yield* Fiber.join(ready) + return info + }), + use, + (info) => + Effect.gen(function* () { + const removed = yield* request(ExperimentalPaths.worktree, directory, { + method: "DELETE", + headers, + body: JSON.stringify({ directory: info.directory }), + }) + if (removed.status !== 200) return yield* Effect.fail(new Error(`failed to remove worktree: ${removed.status}`)) + const ok = yield* json(removed) + if (!ok) return yield* Effect.fail(new Error(`failed to remove worktree ${info.directory}`)) + }), + ) +} + afterEach(async () => { await disposeAllInstances() await resetDatabase() }) describe("experimental HttpApi", () => { - test("serves read-only experimental endpoints through the default server app", async () => { - await using tmp = await tmpdir({ + it.instance( + "serves read-only experimental endpoints through the default server app", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const directory = tmp.directory + const [consoleState, consoleOrgs, toolList, toolIDs, worktrees, resources] = yield* Effect.all( + [ + request(ExperimentalPaths.console, directory), + request(ExperimentalPaths.consoleOrgs, directory), + request(`${ExperimentalPaths.tool}?provider=opencode&model=gpt-5`, directory), + request(ExperimentalPaths.toolIDs, directory), + request(ExperimentalPaths.worktree, directory), + request(ExperimentalPaths.resource, directory), + ], + { concurrency: "unbounded" }, + ) + + expect(consoleState.status).toBe(200) + expect(yield* json(consoleState)).toEqual({ + consoleManagedProviders: [], + switchableOrgCount: 0, + }) + + expect(consoleOrgs.status).toBe(200) + expect(yield* json(consoleOrgs)).toEqual({ orgs: [] }) + + expect(toolList.status).toBe(200) + expect(yield* json(toolList)).toContainEqual( + expect.objectContaining({ + id: "bash", + description: expect.any(String), + parameters: expect.any(Object), + }), + ) + + expect(toolIDs.status).toBe(200) + expect(yield* json(toolIDs)).toContain("bash") + + expect(worktrees.status).toBe(200) + expect(yield* json(worktrees)).toEqual([]) + + expect(resources.status).toBe(200) + expect(yield* json(resources)).toEqual({}) + }), + { config: { formatter: false, lsp: false, @@ -53,150 +189,105 @@ describe("experimental HttpApi", () => { }, }, }, - }) - - const headers = { "x-opencode-directory": tmp.path } - const [consoleState, consoleOrgs, toolList, toolIDs, worktrees, resources] = await Promise.all([ - app().request(ExperimentalPaths.console, { headers }), - app().request(ExperimentalPaths.consoleOrgs, { headers }), - app().request(`${ExperimentalPaths.tool}?provider=opencode&model=gpt-5`, { headers }), - app().request(ExperimentalPaths.toolIDs, { headers }), - app().request(ExperimentalPaths.worktree, { headers }), - app().request(ExperimentalPaths.resource, { headers }), - ]) - - expect(consoleState.status).toBe(200) - expect(await consoleState.json()).toEqual({ - consoleManagedProviders: [], - switchableOrgCount: 0, - }) - - expect(consoleOrgs.status).toBe(200) - expect(await consoleOrgs.json()).toEqual({ orgs: [] }) - - expect(toolList.status).toBe(200) - expect(await toolList.json()).toContainEqual( - expect.objectContaining({ - id: "bash", - description: expect.any(String), - parameters: expect.any(Object), - }), - ) + }, + ) - expect(toolIDs.status).toBe(200) - expect(await toolIDs.json()).toContain("bash") - - expect(worktrees.status).toBe(200) - expect(await worktrees.json()).toEqual([]) - - expect(resources.status).toBe(200) - expect(await resources.json()).toEqual({}) - }) - - test("serves Console org switch through the default server app", async () => { - await using tmp = await tmpdir({ config: { formatter: false, lsp: false } }) - Database.Client() - .$client.prepare( - "INSERT INTO account (id, email, url, access_token, refresh_token, time_created, time_updated) VALUES (?, ?, ?, ?, ?, ?, ?)", - ) - .run( - "account-test", - "test@example.com", - "https://console.example.com", - "access", - "refresh", - Date.now(), - Date.now(), - ) - - const switched = await app().request(ExperimentalPaths.consoleSwitch, { - method: "POST", - headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" }, - body: JSON.stringify({ accountID: "account-test", orgID: "org-test" }), - }) - - expect(switched.status).toBe(200) - expect(await switched.json()).toBe(true) - }) - - test("serves global session list through the default server app", async () => { - await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) - - const first = await WithInstance.provide({ - directory: tmp.path, - fn: async () => createSession({ title: "page-one" }), - }) - await new Promise((resolve) => setTimeout(resolve, 5)) - const second = await WithInstance.provide({ - directory: tmp.path, - fn: async () => createSession({ title: "page-two" }), - }) - - const headers = { "x-opencode-directory": tmp.path } - const page = await app().request( - `${ExperimentalPaths.session}?${new URLSearchParams({ directory: tmp.path, limit: "1" })}`, - { headers }, - ) - expect(page.status).toBe(200) - expect(page.headers.get("x-next-cursor")).toBeTruthy() - - const body = (await page.json()) as Session.GlobalInfo[] - expect(body.map((session) => session.id)).toEqual([second.id]) - expect(body[0].project?.id).toBe(second.projectID) - - const next = await app().request( - `${ExperimentalPaths.session}?${new URLSearchParams({ - directory: tmp.path, - limit: "10", - cursor: body[0].time.updated.toString(), - })}`, - { headers }, - ) - expect(next.status).toBe(200) - expect(((await next.json()) as Session.GlobalInfo[]).map((session) => session.id)).toContain(first.id) - }) - - testWorktreeMutations("serves worktree mutations through the default server app", async () => { - await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) - - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } - const created = await app().request(ExperimentalPaths.worktree, { - method: "POST", - headers, - body: JSON.stringify({ name: "api-test" }), - }) - - expect(created.status).toBe(200) - const info = (await created.json()) as Worktree.Info - expect(info).toMatchObject({ name: "api-test", branch: "opencode/api-test" }) - await waitReady(info.directory) - - const listed = await app().request(ExperimentalPaths.worktree, { headers }) - expect(listed.status).toBe(200) - expect(await listed.json()).toContain(info.directory) - - if (process.platform !== "win32") { - const reset = await app().request(ExperimentalPaths.worktreeReset, { + it.instance("returns declared worktree errors", () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const response = yield* request(ExperimentalPaths.worktree, tmp.directory, { method: "POST", - headers, - body: JSON.stringify({ directory: info.directory }), + headers: { "content-type": "application/json" }, + body: JSON.stringify({}), }) - expect(reset.status).toBe(200) - expect(await reset.json()).toBe(true) - } - - const removed = await app().request(ExperimentalPaths.worktree, { - method: "DELETE", - headers, - body: JSON.stringify({ directory: info.directory }), - }) - - expect(removed.status).toBe(200) - expect(await removed.json()).toBe(true) - - const afterRemove = await app().request(ExperimentalPaths.worktree, { headers }) - expect(afterRemove.status).toBe(200) - expect(await afterRemove.json()).toEqual([]) - }) + expect(response.status).toBe(400) + expect(yield* json(response)).toEqual({ + name: "WorktreeNotGitError", + data: { message: "Worktrees are only supported for git projects" }, + }) + }), + ) + + it.instance( + "serves Console org switch through the default server app", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const accountID = yield* insertAccount() + const switched = yield* request(ExperimentalPaths.consoleSwitch, tmp.directory, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ accountID, orgID: "org-test" }), + }) + + expect(switched.status).toBe(200) + expect(yield* json(switched)).toBe(true) + }), + { config: { formatter: false, lsp: false } }, + ) + + it.instance( + "serves global session list through the default server app", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const first = yield* createSession({ title: "page-one" }) + const second = yield* createSession({ title: "page-two" }) + yield* setSessionUpdated(first, 1) + yield* setSessionUpdated(second, 2) + + const page = yield* request( + `${ExperimentalPaths.session}?${new URLSearchParams({ directory: tmp.directory, limit: "1" })}`, + tmp.directory, + ) + expect(page.status).toBe(200) + expect(page.headers.get("x-next-cursor")).toBeTruthy() + + const body = yield* json(page) + expect(body.map((session) => session.id)).toEqual([second.id]) + expect(body[0].project?.id).toBe(second.projectID) + + const next = yield* request( + `${ExperimentalPaths.session}?${new URLSearchParams({ + directory: tmp.directory, + limit: "10", + cursor: body[0].time.updated.toString(), + })}`, + tmp.directory, + ) + expect(next.status).toBe(200) + expect((yield* json(next)).map((session) => session.id)).toContain(first.id) + }), + { git: true, config: { formatter: false, lsp: false } }, + ) + + testWorktreeMutations( + "serves worktree mutations through the default server app", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + yield* withCreatedWorktree(tmp.directory, (info) => + Effect.gen(function* () { + const listed = yield* request(ExperimentalPaths.worktree, tmp.directory) + expect(listed.status).toBe(200) + expect(yield* json(listed)).toContain(info.directory) + + const reset = yield* request(ExperimentalPaths.worktreeReset, tmp.directory, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ directory: info.directory }), + }) + + expect(reset.status).toBe(200) + expect(yield* json(reset)).toBe(true) + }), + ) + + const afterRemove = yield* request(ExperimentalPaths.worktree, tmp.directory) + expect(afterRemove.status).toBe(200) + expect(yield* json(afterRemove)).toEqual([]) + }), + { git: true, config: { formatter: false, lsp: false } }, + ) }) diff --git a/packages/opencode/test/server/httpapi-file.test.ts b/packages/opencode/test/server/httpapi-file.test.ts index 81246eb0f00d..00a2d42b1181 100644 --- a/packages/opencode/test/server/httpapi-file.test.ts +++ b/packages/opencode/test/server/httpapi-file.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, test } from "bun:test" import { Context } from "effect" import path from "path" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { FilePaths } from "../../src/server/routes/instance/httpapi/groups/file" import { Instance } from "../../src/project/instance" import * as Log from "@opencode-ai/core/util/log" @@ -17,7 +17,7 @@ function request(route: string, directory: string, query?: Record resetDatabase()) - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true yield* Effect.addFinalizer(() => Effect.promise(async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces await disposeAllInstances() await resetDatabase() }), @@ -40,10 +35,7 @@ const testStateLayer = Layer.effectDiscard( }), ) -const workspaceLayer = Workspace.defaultLayer.pipe( - Layer.provide(InstanceStore.defaultLayer), - Layer.provide(InstanceBootstrap.defaultLayer), -) +const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true }) const it = testEffect( Layer.mergeAll( diff --git a/packages/opencode/test/server/httpapi-instance.test.ts b/packages/opencode/test/server/httpapi-instance.test.ts index 5ec4acb87756..51564a790a1a 100644 --- a/packages/opencode/test/server/httpapi-instance.test.ts +++ b/packages/opencode/test/server/httpapi-instance.test.ts @@ -8,7 +8,7 @@ import { WorkspaceID } from "../../src/control-plane/schema" import { ControlPaths } from "../../src/server/routes/instance/httpapi/groups/control" import { InstancePaths } from "../../src/server/routes/instance/httpapi/groups/instance" import { SessionPaths } from "../../src/server/routes/instance/httpapi/groups/session" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { HEADER as FenceHeader } from "../../src/server/shared/fence" import { resetDatabase } from "../fixture/db" import { tmpdirScoped } from "../fixture/fixture" @@ -37,7 +37,7 @@ const testStateLayer = Layer.effectDiscard( // 127.0.0.1:0 and a fetch-based HttpClient that prepends the server URL. This // keeps the test wired directly through the same route layer production uses. const servedRoutes: Layer.Layer = HttpRouter.serve( - ExperimentalHttpApiServer.routes, + HttpApiApp.routes, { disableListenLog: true, disableLogger: true }, ) @@ -122,7 +122,7 @@ describe("instance HttpApi", () => { const dir = yield* tmpdirScoped({ git: true }) const request = (path: string, init?: RequestInit) => Effect.promise(() => - ExperimentalHttpApiServer.webHandler().handler( + HttpApiApp.webHandler().handler( new Request(`http://localhost${path}`, { ...init, headers: { "x-opencode-directory": dir, "content-type": "application/json", ...init?.headers }, diff --git a/packages/opencode/test/server/httpapi-listen.test.ts b/packages/opencode/test/server/httpapi-listen.test.ts index b2ff28ec6784..f155521384af 100644 --- a/packages/opencode/test/server/httpapi-listen.test.ts +++ b/packages/opencode/test/server/httpapi-listen.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test } from "bun:test" +import net from "node:net" import { Flag } from "@opencode-ai/core/flag/flag" import * as Log from "@opencode-ai/core/util/log" import { Server } from "../../src/server/server" @@ -156,6 +157,16 @@ function waitForMessage(ws: WebSocket, predicate: (message: string) => boolean) }) } +async function openPtySocket(listener: Awaited>, dir: string) { + const info = await createCat(listener, dir) + const ticket = await connectTicket(listener, info.id, dir) + const ws = await openSocket(socketURL(listener, info.id, dir, ticket.ticket)) + return { + ws, + closed: new Promise((resolve) => ws.addEventListener("close", () => resolve(), { once: true })), + } +} + describe("HttpApi Server.listen", () => { testPty("serves HTTP routes and upgrades PTY websocket through Server.listen", async () => { await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) @@ -208,6 +219,116 @@ describe("HttpApi Server.listen", () => { } }) + testPty("stop(true) is safe when called concurrently and repeatedly", async () => { + await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) + const listener = await startListener() + let stopped = false + try { + const socket = await openPtySocket(listener, tmp.path) + + await withTimeout( + Promise.all([listener.stop(true), listener.stop(true)]).then(() => undefined), + 10_000, + "timed out waiting for concurrent listener.stop(true)", + ) + await withTimeout(socket.closed, 5_000, "timed out waiting for websocket close after concurrent stop") + await withTimeout(listener.stop(true), 5_000, "timed out waiting for repeated listener.stop(true)") + stopped = true + } finally { + if (!stopped) await stop(listener, "timed out cleaning up concurrent stop listener").catch(() => undefined) + } + }) + + testPty("stop(true) can force a graceful stop already in progress", async () => { + await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) + const listener = await startListener() + let stopped = false + try { + const socket = await openPtySocket(listener, tmp.path) + + const graceful = listener.stop() + const forced = listener.stop(true) + await withTimeout( + Promise.all([graceful, forced]).then(() => undefined), + 10_000, + "timed out waiting for forced listener stop", + ) + await withTimeout(socket.closed, 5_000, "timed out waiting for websocket close after forced stop") + stopped = true + } finally { + if (!stopped) await stop(listener, "timed out cleaning up forced stop listener").catch(() => undefined) + } + }) + + testPty("graceful stop waits for an overlapping forced stop", async () => { + await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) + const listener = await startListener() + let stopped = false + try { + const socket = await openPtySocket(listener, tmp.path) + const forced = listener.stop(true) + await withTimeout(listener.stop(), 10_000, "timed out waiting for graceful stop after forced stop") + stopped = true + await withTimeout(forced, 5_000, "timed out waiting for overlapping forced stop") + await withTimeout(socket.closed, 5_000, "timed out waiting for websocket close before graceful stop resolved") + } finally { + if (!stopped) await stop(listener, "timed out cleaning up overlapping stop listener").catch(() => undefined) + } + }) + + test("stop() gracefully closes an idle listener and is repeat-safe", async () => { + const listener = await startListener() + await withTimeout(listener.stop(), 10_000, "timed out waiting for graceful listener.stop()") + await withTimeout(listener.stop(), 5_000, "timed out waiting for repeated graceful listener.stop()") + await expect( + fetch(new URL(PtyPaths.shells, listener.url), { headers: { authorization: authorization() } }), + ).rejects.toThrow() + }) + + test("default in-process handler does not emit Effect HTTP response logs", async () => { + let output = "" + // oxlint-disable-next-line typescript-eslint/unbound-method -- restored in finally after temporarily capturing stderr. + const original = process.stderr.write + process.stderr.write = ((chunk) => { + output += String(chunk) + return true + }) as typeof process.stderr.write + try { + const response = await Server.Default().app.request("/status") + expect(response.status).toBe(200) + } finally { + process.stderr.write = original + } + + expect(output).not.toContain("Sent HTTP response") + }) + + test("port 0 prefers 4096 when free", async () => { + if (!(await isPortFree(4096))) return + const listener = await startListener() + try { + expect(listener.port).toBe(4096) + } finally { + await stop(listener, "timed out cleaning up port-0 prefers-4096 listener") + } + }) + + test("port 0 falls back when 4096 is taken", async () => { + const blocker = await occupyPort(4096) + if (!blocker) return + try { + const listener = await startListener() + try { + expect(listener.port).not.toBe(4096) + expect(listener.port).toBeGreaterThan(0) + } finally { + await stop(listener, "timed out cleaning up port-0 fallback listener") + } + } finally { + await new Promise((resolve) => blocker.close(() => resolve())) + } + }) + testPty("rejects unsafe PTY ticket mint and connect requests", async () => { await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) const listener = await startListener() @@ -295,3 +416,20 @@ describe("HttpApi Server.listen", () => { } }) }) + +function isPortFree(port: number) { + return new Promise((resolve) => { + const probe = net.createServer() + probe.once("error", () => resolve(false)) + probe.once("listening", () => probe.close(() => resolve(true))) + probe.listen(port, "127.0.0.1") + }) +} + +function occupyPort(port: number) { + return new Promise((resolve) => { + const server = net.createServer() + server.once("error", () => resolve(undefined)) + server.listen(port, "127.0.0.1", () => resolve(server)) + }) +} diff --git a/packages/opencode/test/server/httpapi-mcp.test.ts b/packages/opencode/test/server/httpapi-mcp.test.ts index b6c7aebcd2ae..3f7f54f294ee 100644 --- a/packages/opencode/test/server/httpapi-mcp.test.ts +++ b/packages/opencode/test/server/httpapi-mcp.test.ts @@ -1,69 +1,57 @@ -import { afterEach, describe, expect, test } from "bun:test" -import { Context, Effect, FileSystem, Layer, Path } from "effect" -import { NodeFileSystem, NodePath } from "@effect/platform-node" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { describe, expect } from "bun:test" +import { Context, Effect, Layer } from "effect" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { McpPaths } from "../../src/server/routes/instance/httpapi/groups/mcp" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { InstanceRuntime } from "../../src/project/instance-runtime" import { Server } from "../../src/server/server" import * as Log from "@opencode-ai/core/util/log" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" +import { TestInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" void Log.init({ print: false }) const context = Context.empty() as Context.Context -const it = testEffect(Layer.mergeAll(NodeFileSystem.layer, NodePath.layer)) +const testStateLayer = Layer.effectDiscard( + Effect.gen(function* () { + yield* Effect.promise(() => resetDatabase()) + yield* Effect.addFinalizer(() => Effect.promise(() => resetDatabase()).pipe(Effect.ignore)) + }), +) +const it = testEffect(testStateLayer) function app() { return Server.Default().app } type TestApp = ReturnType - -function request(route: string, directory: string, init?: RequestInit) { +type TestHandler = ReturnType + +const handlerScoped = Effect.acquireRelease( + Effect.sync(() => HttpApiApp.webHandler()), + (handler) => Effect.promise(() => handler.dispose()).pipe(Effect.ignore), +) + +const request = Effect.fnUntraced(function* ( + handler: TestHandler, + route: string, + directory: string, + init?: RequestInit, +) { const headers = new Headers(init?.headers) headers.set("x-opencode-directory", directory) - return ExperimentalHttpApiServer.webHandler().handler( - new Request(`http://localhost${route}`, { - ...init, - headers, - }), - context, + return yield* Effect.promise(() => + Promise.resolve( + handler.handler( + new Request(`http://localhost${route}`, { + ...init, + headers, + }), + context, + ), + ), ) -} - -function withMcpProject(self: (dir: string) => Effect.Effect) { - return Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path - const dir = yield* fs.makeTempDirectoryScoped({ prefix: "opencode-test-" }) +}) - yield* fs.writeFileString( - path.join(dir, "opencode.json"), - JSON.stringify({ - $schema: "https://opencode.ai/config.json", - formatter: false, - lsp: false, - mcp: { - demo: { - type: "local", - command: ["echo", "demo"], - enabled: false, - }, - }, - }), - ) - yield* Effect.addFinalizer(() => - Effect.promise(() => - WithInstance.provide({ directory: dir, fn: () => InstanceRuntime.disposeInstance(Instance.current) }), - ).pipe(Effect.ignore), - ) - - return yield* self(dir).pipe(provideInstance(dir)) - }) -} +const json = (response: Response) => Effect.promise(() => response.json() as Promise) const readResponse = Effect.fnUntraced(function* (input: { app: TestApp; path: string; headers: HeadersInit }) { const response = yield* Effect.promise(() => @@ -75,14 +63,19 @@ const readResponse = Effect.fnUntraced(function* (input: { app: TestApp; path: s } }) -afterEach(async () => { - await disposeAllInstances() - await resetDatabase() -}) - describe("mcp HttpApi", () => { - test("serves status endpoint", async () => { - await using tmp = await tmpdir({ + it.instance( + "serves status endpoint", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const handler = yield* handlerScoped + const response = yield* request(handler, McpPaths.status, tmp.directory) + + expect(response.status).toBe(200) + expect(yield* json(response)).toEqual({ demo: { status: "disabled" } }) + }), + { config: { mcp: { demo: { @@ -92,15 +85,39 @@ describe("mcp HttpApi", () => { }, }, }, - }) + }, + ) - const response = await request(McpPaths.status, tmp.path) - expect(response.status).toBe(200) - expect(await response.json()).toEqual({ demo: { status: "disabled" } }) - }) + it.instance( + "serves add, connect, and disconnect endpoints", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const handler = yield* handlerScoped + const added = yield* request(handler, McpPaths.status, tmp.directory, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ + name: "added", + config: { + type: "local", + command: ["echo", "added"], + enabled: false, + }, + }), + }) + expect(added.status).toBe(200) + expect(yield* json(added)).toMatchObject({ added: { status: "disabled" } }) - test("serves add, connect, and disconnect endpoints", async () => { - await using tmp = await tmpdir({ + const connected = yield* request(handler, "/mcp/demo/connect", tmp.directory, { method: "POST" }) + expect(connected.status).toBe(200) + expect(yield* json(connected)).toBe(true) + + const disconnected = yield* request(handler, "/mcp/demo/disconnect", tmp.directory, { method: "POST" }) + expect(disconnected.status).toBe(200) + expect(yield* json(disconnected)).toBe(true) + }), + { config: { mcp: { demo: { @@ -110,34 +127,26 @@ describe("mcp HttpApi", () => { }, }, }, - }) - - const added = await request(McpPaths.status, tmp.path, { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify({ - name: "added", - config: { - type: "local", - command: ["echo", "added"], - enabled: false, - }, - }), - }) - expect(added.status).toBe(200) - expect(await added.json()).toMatchObject({ added: { status: "disabled" } }) + }, + ) - const connected = await request("/mcp/demo/connect", tmp.path, { method: "POST" }) - expect(connected.status).toBe(200) - expect(await connected.json()).toBe(true) + it.instance( + "serves deterministic OAuth endpoints", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const handler = yield* handlerScoped + const start = yield* request(handler, "/mcp/demo/auth", tmp.directory, { method: "POST" }) + expect(start.status).toBe(400) - const disconnected = await request("/mcp/demo/disconnect", tmp.path, { method: "POST" }) - expect(disconnected.status).toBe(200) - expect(await disconnected.json()).toBe(true) - }) + const authenticate = yield* request(handler, "/mcp/demo/auth/authenticate", tmp.directory, { method: "POST" }) + expect(authenticate.status).toBe(400) - test("serves deterministic OAuth endpoints", async () => { - await using tmp = await tmpdir({ + const removed = yield* request(handler, "/mcp/demo/auth", tmp.directory, { method: "DELETE" }) + expect(removed.status).toBe(200) + expect(yield* json(removed)).toEqual({ success: true }) + }), + { config: { mcp: { demo: { @@ -147,23 +156,15 @@ describe("mcp HttpApi", () => { }, }, }, - }) - - const start = await request("/mcp/demo/auth", tmp.path, { method: "POST" }) - expect(start.status).toBe(400) - - const authenticate = await request("/mcp/demo/auth/authenticate", tmp.path, { method: "POST" }) - expect(authenticate.status).toBe(400) - - const removed = await request("/mcp/demo/auth", tmp.path, { method: "DELETE" }) - expect(removed.status).toBe(200) - expect(await removed.json()).toEqual({ success: true }) - }) + }, + ) - it.live( + it.instance( "returns unsupported OAuth error responses", - withMcpProject((dir) => + () => Effect.gen(function* () { + const tmp = yield* TestInstance + const dir = tmp.directory const headers = { "x-opencode-directory": dir } yield* Effect.forEach(["/mcp/demo/auth", "/mcp/demo/auth/authenticate"], (path) => @@ -177,6 +178,18 @@ describe("mcp HttpApi", () => { }), ) }), - ), + { + config: { + formatter: false, + lsp: false, + mcp: { + demo: { + type: "local", + command: ["echo", "demo"], + enabled: false, + }, + }, + }, + }, ) }) diff --git a/packages/opencode/test/server/httpapi-mdns.test.ts b/packages/opencode/test/server/httpapi-mdns.test.ts new file mode 100644 index 000000000000..6b88a1f10bf3 --- /dev/null +++ b/packages/opencode/test/server/httpapi-mdns.test.ts @@ -0,0 +1,82 @@ +import { afterEach, describe, expect, mock, test } from "bun:test" +import { Flag } from "@opencode-ai/core/flag/flag" +import * as Log from "@opencode-ai/core/util/log" +import { withTimeout } from "../../src/util/timeout" +import { resetDatabase } from "../fixture/db" +import { disposeAllInstances } from "../fixture/fixture" + +void Log.init({ print: false }) + +type Event = { kind: "publish"; port: number; name: string } | { kind: "unpublishAll" } | { kind: "destroy" } +const events: Event[] = [] + +void mock.module("bonjour-service", () => ({ + Bonjour: class { + publish(opts: { port: number; name: string }) { + events.push({ kind: "publish", port: opts.port, name: opts.name }) + return { on: () => {} } + } + unpublishAll() { + events.push({ kind: "unpublishAll" }) + } + destroy() { + events.push({ kind: "destroy" }) + } + }, +})) + +// Import Server AFTER the mock so the MDNS module picks up the stub. +const { Server } = await import("../../src/server/server") + +const original = { + OPENCODE_SERVER_PASSWORD: Flag.OPENCODE_SERVER_PASSWORD, + OPENCODE_SERVER_USERNAME: Flag.OPENCODE_SERVER_USERNAME, +} + +afterEach(async () => { + events.length = 0 + Flag.OPENCODE_SERVER_PASSWORD = original.OPENCODE_SERVER_PASSWORD + Flag.OPENCODE_SERVER_USERNAME = original.OPENCODE_SERVER_USERNAME + await disposeAllInstances() + await resetDatabase() +}) + +describe("HttpApi Server.listen mDNS", () => { + test("skips publish for loopback hostnames", async () => { + Flag.OPENCODE_SERVER_PASSWORD = "mdns-secret" + Flag.OPENCODE_SERVER_USERNAME = "opencode" + const listener = await Server.listen({ hostname: "127.0.0.1", port: 0, mdns: true }) + try { + expect(events.filter((e) => e.kind === "publish")).toEqual([]) + } finally { + await withTimeout(listener.stop(true), 10_000, "timed out stopping loopback mdns listener") + } + expect(events.filter((e) => e.kind === "publish")).toEqual([]) + }) + + test("publishes for non-loopback hostnames and unpublishes on stop", async () => { + Flag.OPENCODE_SERVER_PASSWORD = "mdns-secret" + Flag.OPENCODE_SERVER_USERNAME = "opencode" + const listener = await Server.listen({ hostname: "0.0.0.0", port: 0, mdns: true }) + try { + const published = events.filter((e) => e.kind === "publish") + expect(published.length).toBe(1) + expect(published[0]!.port).toBe(listener.port) + expect(published[0]!.name).toBe(`opencode-${listener.port}`) + } finally { + await withTimeout(listener.stop(true), 10_000, "timed out stopping mdns listener") + } + expect(events.some((e) => e.kind === "unpublishAll")).toBe(true) + expect(events.some((e) => e.kind === "destroy")).toBe(true) + }) + + test("scope finalizer unpublishes even if stop() is not called for force-close", async () => { + Flag.OPENCODE_SERVER_PASSWORD = "mdns-secret" + Flag.OPENCODE_SERVER_USERNAME = "opencode" + const listener = await Server.listen({ hostname: "0.0.0.0", port: 0, mdns: true }) + expect(events.filter((e) => e.kind === "publish").length).toBe(1) + // Plain (graceful) stop without close=true should still unpublish. + await withTimeout(listener.stop(), 10_000, "timed out stopping graceful mdns listener") + expect(events.some((e) => e.kind === "unpublishAll")).toBe(true) + }) +}) diff --git a/packages/opencode/test/server/httpapi-promptasync-context.test.ts b/packages/opencode/test/server/httpapi-promptasync-context.test.ts index a7a66ff4f609..84f3df5b8cdf 100644 --- a/packages/opencode/test/server/httpapi-promptasync-context.test.ts +++ b/packages/opencode/test/server/httpapi-promptasync-context.test.ts @@ -8,7 +8,6 @@ // Effect.provideService calls there are required, not defensive duplication. import { NodeHttpServer, NodeServices } from "@effect/platform-node" -import { Flag } from "@opencode-ai/core/flag/flag" import { describe, expect } from "bun:test" import { Deferred, Effect, Layer, Scope } from "effect" import * as Stream from "effect/Stream" @@ -19,24 +18,20 @@ import { registerAdapter } from "../../src/control-plane/adapters" import type { WorkspaceAdapter } from "../../src/control-plane/types" import { Workspace } from "../../src/control-plane/workspace" import { InstanceRef, WorkspaceRef } from "../../src/effect/instance-ref" -import { InstanceBootstrap } from "../../src/project/bootstrap" import { InstanceLayer } from "../../src/project/instance-layer" -import { InstanceStore } from "../../src/project/instance-store" import { Project } from "../../src/project/project" import { instanceRouterMiddleware } from "../../src/server/routes/instance/httpapi/middleware/instance-context" import { workspaceRouterMiddleware } from "../../src/server/routes/instance/httpapi/middleware/workspace-routing" import { resetDatabase } from "../fixture/db" import { disposeAllInstances, tmpdirScoped } from "../fixture/fixture" +import { workspaceLayerWithRuntimeFlags } from "../fixture/workspace" import { testEffect } from "../lib/effect" const testStateLayer = Layer.effectDiscard( Effect.gen(function* () { - const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES yield* Effect.promise(() => resetDatabase()) - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true yield* Effect.addFinalizer(() => Effect.promise(async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces await disposeAllInstances() await resetDatabase() }), @@ -44,10 +39,7 @@ const testStateLayer = Layer.effectDiscard( }), ) -const workspaceLayer = Workspace.defaultLayer.pipe( - Layer.provide(InstanceStore.defaultLayer), - Layer.provide(InstanceBootstrap.defaultLayer), -) +const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true }) const it = testEffect( Layer.mergeAll( diff --git a/packages/opencode/test/server/httpapi-provider.test.ts b/packages/opencode/test/server/httpapi-provider.test.ts index 68db6663d2cf..490b947fd9c7 100644 --- a/packages/opencode/test/server/httpapi-provider.test.ts +++ b/packages/opencode/test/server/httpapi-provider.test.ts @@ -1,18 +1,24 @@ -import { afterEach, describe, expect } from "bun:test" -import { Effect, FileSystem, Layer, Path } from "effect" -import { NodeFileSystem, NodePath } from "@effect/platform-node" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { InstanceRuntime } from "../../src/project/instance-runtime" +import { describe, expect } from "bun:test" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Effect, Layer } from "effect" +import path from "path" import { Server } from "../../src/server/server" import * as Log from "@opencode-ai/core/util/log" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, provideInstance } from "../fixture/fixture" +import { TestInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" void Log.init({ print: false }) -const it = testEffect(Layer.mergeAll(NodeFileSystem.layer, NodePath.layer)) +const testStateLayer = Layer.effectDiscard( + Effect.acquireRelease( + Effect.promise(() => resetDatabase()), + () => Effect.promise(() => resetDatabase()), + ), +) + +const it = testEffect(Layer.mergeAll(testStateLayer, AppFileSystem.defaultLayer)) +const projectOptions = { config: { formatter: false, lsp: false } } const providerID = "test-oauth-parity" const oauthURL = "https://example.com/oauth" const oauthInstructions = "Finish OAuth" @@ -74,12 +80,33 @@ function requestAuthorize(input: { providerID: string method: number headers: HeadersInit + inputs?: Record }) { return Effect.promise(async () => { const response = await input.app.request(`/provider/${input.providerID}/oauth/authorize`, { method: "POST", headers: input.headers, - body: JSON.stringify({ method: input.method }), + body: JSON.stringify({ method: input.method, ...(input.inputs ? { inputs: input.inputs } : {}) }), + }) + return { + status: response.status, + body: await response.text(), + } + }) +} + +function requestCallback(input: { + app: ReturnType + providerID: string + method: number + headers: HeadersInit + code?: string +}) { + return Effect.promise(async () => { + const response = await input.app.request(`/provider/${input.providerID}/oauth/callback`, { + method: "POST", + headers: input.headers, + body: JSON.stringify({ method: input.method, ...(input.code ? { code: input.code } : {}) }), }) return { status: response.status, @@ -90,11 +117,9 @@ function requestAuthorize(input: { function writeProviderAuthPlugin(dir: string) { return Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path + const fs = yield* AppFileSystem.Service - yield* fs.makeDirectory(path.join(dir, ".opencode", "plugin"), { recursive: true }) - yield* fs.writeFileString( + yield* fs.writeWithDirs( path.join(dir, ".opencode", "plugin", "provider-oauth-parity.ts"), [ "export default {", @@ -124,13 +149,52 @@ function writeProviderAuthPlugin(dir: string) { }) } +function writeProviderAuthValidationPlugin(dir: string) { + return Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + + yield* fs.writeWithDirs( + path.join(dir, ".opencode", "plugin", "provider-oauth-validation.ts"), + [ + "export default {", + ' id: "test.provider-oauth-validation",', + " server: async () => ({", + " auth: {", + ' provider: "test-oauth-validation",', + " methods: [", + " {", + ' type: "oauth",', + ' label: "OAuth",', + " prompts: [", + " {", + ' type: "text",', + ' key: "token",', + ' message: "Token",', + " validate: (value) => value === 'ok' ? undefined : 'Token must be ok',", + " },", + " ],", + " authorize: async () => ({", + ` url: "${oauthURL}",`, + ' method: "code",', + ` instructions: "${oauthInstructions}",`, + " callback: async () => ({ type: 'success', key: 'token' }),", + " }),", + " },", + " ],", + " },", + " }),", + "}", + "", + ].join("\n"), + ) + }) +} + function writeFunctionOptionsPlugin(dir: string) { return Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path + const fs = yield* AppFileSystem.Service - yield* fs.makeDirectory(path.join(dir, ".opencode", "plugin"), { recursive: true }) - yield* fs.writeFileString( + yield* fs.writeWithDirs( path.join(dir, ".opencode", "plugin", "provider-function-options.ts"), [ "export default {", @@ -159,11 +223,9 @@ function writeFunctionOptionsPlugin(dir: string) { function writeProviderModelsMutationPlugin(dir: string) { return Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path + const fs = yield* AppFileSystem.Service - yield* fs.makeDirectory(path.join(dir, ".opencode", "plugin"), { recursive: true }) - yield* fs.writeFileString( + yield* fs.writeWithDirs( path.join(dir, ".opencode", "plugin", "provider-models-mutation.ts"), [ "export default {", @@ -191,91 +253,114 @@ function writeProviderModelsMutationPlugin(dir: string) { }) } -function withProviderProject(self: (dir: string) => Effect.Effect) { - return Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path - const dir = yield* fs.makeTempDirectoryScoped({ prefix: "opencode-test-" }) - - yield* fs.writeFileString( - path.join(dir, "opencode.json"), - JSON.stringify({ $schema: "https://opencode.ai/config.json", formatter: false, lsp: false }), - ) - yield* writeProviderAuthPlugin(dir) - yield* Effect.addFinalizer(() => - Effect.promise(() => - WithInstance.provide({ directory: dir, fn: () => InstanceRuntime.disposeInstance(Instance.current) }), - ).pipe(Effect.ignore), - ) - - return yield* self(dir).pipe(provideInstance(dir)) - }) +function setEnvScoped(key: string, value: string) { + return Effect.acquireRelease( + Effect.sync(() => { + const previous = process.env[key] + process.env[key] = value + return previous + }), + (previous) => + Effect.sync(() => { + if (previous === undefined) delete process.env[key] + else process.env[key] = previous + }), + ) } -afterEach(async () => { - await disposeAllInstances() - await resetDatabase() -}) - describe("provider HttpApi", () => { - it.live( + it.instance( "serves OAuth authorize response shapes", - withProviderProject((dir) => - Effect.gen(function* () { - const headers = { "x-opencode-directory": dir, "content-type": "application/json" } - const server = app() - - const api = yield* requestAuthorize({ - app: server, - providerID, - method: 0, - headers, - }) - // method 0 (api-key style) — authorize() resolves with no further - // redirect; #26474 changed the wire format to JSON `null` so clients - // can `.json()` parse uniformly instead of getting an empty body - // that throws. - expect(api).toEqual({ status: 200, body: "null" }) - - const oauth = yield* requestAuthorize({ - app: server, - providerID, - method: 1, - headers, - }) - expect(JSON.parse(oauth.body)).toEqual({ - url: oauthURL, - method: "code", - instructions: oauthInstructions, - }) - }), - ), + Effect.gen(function* () { + const instance = yield* TestInstance + yield* writeProviderAuthPlugin(instance.directory) + const headers = { "x-opencode-directory": instance.directory, "content-type": "application/json" } + const server = app() + + const api = yield* requestAuthorize({ + app: server, + providerID, + method: 0, + headers, + }) + // method 0 (api-key style) — authorize() resolves with no further + // redirect; #26474 changed the wire format to JSON `null` so clients + // can `.json()` parse uniformly instead of getting an empty body + // that throws. + expect(api).toEqual({ status: 200, body: "null" }) + + const oauth = yield* requestAuthorize({ + app: server, + providerID, + method: 1, + headers, + }) + expect(JSON.parse(oauth.body)).toEqual({ + url: oauthURL, + method: "code", + instructions: oauthInstructions, + }) + }), + projectOptions, + 30000, ) - it.live("serves provider lists when auth loaders add runtime fetch options", () => + it.instance( + "returns declared provider auth validation errors", Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path - const dir = yield* fs.makeTempDirectoryScoped({ prefix: "opencode-test-" }) - const previous = process.env.OPENCODE_AUTH_CONTENT - - yield* fs.writeFileString( - path.join(dir, "opencode.json"), - JSON.stringify({ $schema: "https://opencode.ai/config.json", formatter: false, lsp: false }), - ) - yield* writeFunctionOptionsPlugin(dir) - yield* Effect.sync(() => { - process.env.OPENCODE_AUTH_CONTENT = JSON.stringify({ - google: { type: "oauth", refresh: "dummy", access: "dummy", expires: 9999999999999 }, - }) + const instance = yield* TestInstance + yield* writeProviderAuthValidationPlugin(instance.directory) + const response = yield* requestAuthorize({ + app: app(), + providerID: "test-oauth-validation", + method: 0, + inputs: { token: "nope" }, + headers: { "x-opencode-directory": instance.directory, "content-type": "application/json" }, + }) + + expect(response.status).toBe(400) + expect(JSON.parse(response.body)).toEqual({ + name: "ProviderAuthValidationFailed", + data: { field: "token", message: "Token must be ok" }, + }) + }), + projectOptions, + 30000, + ) + + it.instance( + "returns declared provider auth callback errors", + Effect.gen(function* () { + const instance = yield* TestInstance + const response = yield* requestCallback({ + app: app(), + providerID, + method: 0, + headers: { "x-opencode-directory": instance.directory, "content-type": "application/json" }, }) - yield* Effect.addFinalizer(() => - Effect.sync(() => { - if (previous === undefined) delete process.env.OPENCODE_AUTH_CONTENT - if (previous !== undefined) process.env.OPENCODE_AUTH_CONTENT = previous + + expect(response.status).toBe(400) + expect(JSON.parse(response.body)).toEqual({ + name: "ProviderAuthOauthMissing", + data: { providerID }, + }) + }), + projectOptions, + 30000, + ) + + it.instance( + "serves provider lists when auth loaders add runtime fetch options", + Effect.gen(function* () { + const instance = yield* TestInstance + yield* writeFunctionOptionsPlugin(instance.directory) + yield* setEnvScoped( + "OPENCODE_AUTH_CONTENT", + JSON.stringify({ + google: { type: "oauth", refresh: "dummy", access: "dummy", expires: 9999999999999 }, }), ) - const headers = { "x-opencode-directory": dir } + const headers = { "x-opencode-directory": instance.directory } const providerResponse = yield* Effect.promise(() => Promise.resolve(app().request("/provider", { headers }))) const configResponse = yield* Effect.promise(() => Promise.resolve(app().request("/config/providers", { headers })), @@ -291,21 +376,16 @@ describe("provider HttpApi", () => { expect(hasNonZeroModelCost(providerBody, "all", "google")).toBe(true) expect(hasNonZeroModelCost(configBody, "providers", "google")).toBe(true) }), + projectOptions, ) - it.live("keeps provider.models hook input mutations out of provider state", () => + it.instance( + "keeps provider.models hook input mutations out of provider state", Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path - const dir = yield* fs.makeTempDirectoryScoped({ prefix: "opencode-test-" }) - - yield* fs.writeFileString( - path.join(dir, "opencode.json"), - JSON.stringify({ $schema: "https://opencode.ai/config.json", formatter: false, lsp: false }), - ) - yield* writeProviderModelsMutationPlugin(dir) + const instance = yield* TestInstance + yield* writeProviderModelsMutationPlugin(instance.directory) - const headers = { "x-opencode-directory": dir } + const headers = { "x-opencode-directory": instance.directory } const providerResponse = yield* Effect.promise(() => Promise.resolve(app().request("/provider", { headers }))) const configResponse = yield* Effect.promise(() => Promise.resolve(app().request("/config/providers", { headers })), @@ -320,5 +400,6 @@ describe("provider HttpApi", () => { expect(hasProviderMutationMarker(configBody, "providers", "google")).toBe(false) expect(hasNonZeroModelCost(providerBody, "all", "google")).toBe(true) }), + projectOptions, ) }) diff --git a/packages/opencode/test/server/httpapi-pty-websocket.test.ts b/packages/opencode/test/server/httpapi-pty-websocket.test.ts index 81ee952d9689..19d97ef09c4d 100644 --- a/packages/opencode/test/server/httpapi-pty-websocket.test.ts +++ b/packages/opencode/test/server/httpapi-pty-websocket.test.ts @@ -1,16 +1,19 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import { Effect } from "effect" import { handlePtyInput } from "../../src/pty/input" +import { it } from "../lib/effect" describe("pty HttpApi websocket input", () => { - test("does not forward invalid binary frames to the PTY handler", async () => { - const messages: Array = [] - const handler = { onMessage: (message: string | ArrayBuffer) => messages.push(message) } + it.effect("does not forward invalid binary frames to the PTY handler", () => + Effect.gen(function* () { + const messages: Array = [] + const handler = { onMessage: (message: string | ArrayBuffer) => messages.push(message) } - await Effect.runPromise(handlePtyInput(handler, "ready")) - await Effect.runPromise(handlePtyInput(handler, new Uint8Array([0xff, 0xfe, 0xfd]))) - await Effect.runPromise(handlePtyInput(handler, new TextEncoder().encode("hello"))) + yield* handlePtyInput(handler, "ready") + yield* handlePtyInput(handler, new Uint8Array([0xff, 0xfe, 0xfd])) + yield* handlePtyInput(handler, new TextEncoder().encode("hello")) - expect(messages).toEqual(["ready", "hello"]) - }) + expect(messages).toEqual(["ready", "hello"]) + }), + ) }) diff --git a/packages/opencode/test/server/httpapi-pty.test.ts b/packages/opencode/test/server/httpapi-pty.test.ts index 987eba6b38f4..8bccbff86362 100644 --- a/packages/opencode/test/server/httpapi-pty.test.ts +++ b/packages/opencode/test/server/httpapi-pty.test.ts @@ -10,7 +10,7 @@ import { disposeAllInstances, tmpdir, tmpdirScoped } from "../fixture/fixture" import { Config, Effect, Layer, Queue, Schema } from "effect" import { HttpClient, HttpClientRequest, HttpRouter, HttpServer } from "effect/unstable/http" import * as Socket from "effect/unstable/socket/Socket" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { Pty } from "../../src/pty" import { testEffect } from "../lib/effect" @@ -30,7 +30,7 @@ const testStateLayer = Layer.effectDiscard( ) const servedRoutes: Layer.Layer = HttpRouter.serve( - ExperimentalHttpApiServer.routes, + HttpApiApp.routes, { disableListenLog: true, disableLogger: true }, ) diff --git a/packages/opencode/test/server/httpapi-raw-route-auth.test.ts b/packages/opencode/test/server/httpapi-raw-route-auth.test.ts index b1d4af76b810..adf6e18ee835 100644 --- a/packages/opencode/test/server/httpapi-raw-route-auth.test.ts +++ b/packages/opencode/test/server/httpapi-raw-route-auth.test.ts @@ -2,9 +2,9 @@ import { afterEach, describe, expect, test } from "bun:test" import { ConfigProvider, Layer } from "effect" import { HttpRouter } from "effect/unstable/http" import { Instance } from "../../src/project/instance" -import { EventPaths } from "../../src/server/routes/instance/httpapi/event" +import { EventPaths } from "../../src/server/routes/instance/httpapi/groups/event" import { PtyPaths } from "../../src/server/routes/instance/httpapi/groups/pty" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { PtyID } from "../../src/pty/schema" import { resetDatabase } from "../fixture/db" import { disposeAllInstances, tmpdir } from "../fixture/fixture" @@ -14,7 +14,7 @@ void Log.init({ print: false }) function app(input: { password?: string; username?: string }) { const handler = HttpRouter.toWebHandler( - ExperimentalHttpApiServer.routes.pipe( + HttpApiApp.routes.pipe( Layer.provide( ConfigProvider.layer( ConfigProvider.fromUnknown({ @@ -28,7 +28,7 @@ function app(input: { password?: string; username?: string }) { ).handler return { - fetch: (request: Request) => handler(request, ExperimentalHttpApiServer.context), + fetch: (request: Request) => handler(request, HttpApiApp.context), request(input: string | URL | Request, init?: RequestInit) { return this.fetch(input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init)) }, diff --git a/packages/opencode/test/server/httpapi-schema-error-body.test.ts b/packages/opencode/test/server/httpapi-schema-error-body.test.ts index fe6a1caad0b1..48ed7b6bfb68 100644 --- a/packages/opencode/test/server/httpapi-schema-error-body.test.ts +++ b/packages/opencode/test/server/httpapi-schema-error-body.test.ts @@ -3,7 +3,6 @@ import { Effect } from "effect" import { eq } from "drizzle-orm" import * as Database from "@/storage/db" import { ModelID, ProviderID } from "../../src/provider/schema" -import { WithInstance } from "../../src/project/with-instance" import { Server } from "../../src/server/server" import { Session } from "@/session/session" import { SessionPaths } from "../../src/server/routes/instance/httpapi/groups/session" @@ -11,80 +10,68 @@ import { SyncPaths } from "../../src/server/routes/instance/httpapi/groups/sync" import { MessageID, PartID } from "../../src/session/schema" import { PartTable } from "@/session/session.sql" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { it } from "../lib/effect" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" + +const it = testEffect(Session.defaultLayer) afterEach(async () => { await disposeAllInstances() await resetDatabase() }) -const withTmp = ( - options: Parameters[0], - fn: (tmp: Awaited>) => Effect.Effect, -) => - Effect.acquireRelease( - Effect.promise(() => tmpdir(options)), - (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()), - ).pipe(Effect.flatMap(fn)) - -async function seedCorruptStepFinishPart(directory: string) { - return WithInstance.provide({ - directory, - fn: () => - Effect.runPromise( - Effect.gen(function* () { - const session = yield* Session.Service - const info = yield* session.create({}) - const message = yield* session.updateMessage({ - id: MessageID.ascending(), - role: "user", - sessionID: info.id, - agent: "build", - model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, - time: { created: Date.now() }, - }) - const partID = PartID.ascending() - yield* session.updatePart({ - id: partID, - sessionID: info.id, - messageID: message.id, +const seedCorruptStepFinishPart = Effect.gen(function* () { + const session = yield* Session.Service + const info = yield* session.create({}) + const message = yield* session.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: info.id, + agent: "build", + model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, + time: { created: Date.now() }, + }) + const partID = PartID.ascending() + yield* session.updatePart({ + id: partID, + sessionID: info.id, + messageID: message.id, + type: "step-finish", + reason: "stop", + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + }) + // Schema.Finite still rejects NaN at encode: exact mirror of the corrupt row + // that broke the user's session in the OMO/Windows bug. + yield* Effect.sync(() => + Database.use((db) => + db + .update(PartTable) + .set({ + data: { type: "step-finish", reason: "stop", cost: 0, - tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, - }) - // Schema.Finite still rejects NaN at encode — exact mirror of the - // corrupt row that broke the user's session in the OMO/Windows bug. - Database.use((db) => - db - .update(PartTable) - .set({ - data: { - type: "step-finish", - reason: "stop", - cost: 0, - tokens: { input: 0, output: NaN, reasoning: 0, cache: { read: 0, write: 0 } }, - } as never, // drizzle's .set() can't narrow the discriminated union - }) - .where(eq(PartTable.id, partID)) - .run(), - ) - return info.id - }).pipe(Effect.provide(Session.defaultLayer)), - ), - }) -} + tokens: { input: 0, output: NaN, reasoning: 0, cache: { read: 0, write: 0 } }, + } as never, // drizzle's .set() can't narrow the discriminated union + }) + .where(eq(PartTable.id, partID)) + .run(), + ), + ) + return info.id +}) describe("schema-rejection wire shape", () => { - it.live( + it.instance( "Payload schema rejection returns NamedError-shaped JSON, not empty", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { + const test = yield* TestInstance const res = yield* Effect.promise(async () => Server.Default().app.request(SyncPaths.history, { method: "POST", - headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" }, + headers: { "x-opencode-directory": test.directory, "content-type": "application/json" }, body: JSON.stringify({ aggregate: -1 }), }), ) @@ -99,36 +86,38 @@ describe("schema-rejection wire shape", () => { expect(parsed.data.message).toEqual(expect.any(String)) expect(parsed.data.message.length).toBeGreaterThan(0) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "Query schema rejection returns NamedError-shaped JSON", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { + const test = yield* TestInstance // /find/file?limit=999999 violates the limit constraint check. - const url = `/find/file?query=foo&limit=999999&directory=${encodeURIComponent(tmp.path)}` + const url = `/find/file?query=foo&limit=999999&directory=${encodeURIComponent(test.directory)}` const res = yield* Effect.promise(async () => Server.Default().app.request(url)) const body = yield* Effect.promise(async () => res.text()) expect(res.status).toBe(400) const parsed = JSON.parse(body) expect(parsed).toMatchObject({ name: "BadRequest", data: { kind: "Query" } }) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "rejected request body never echoes back unbounded — message is capped", // Defense against DoS-amplification + secret-echo: Effect's Issue formatter // dumps the rejected `actual` verbatim. A multi-MB invalid array would // become a multi-MB 400 response and log line. Cap kicks in around 1KB. - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { + const test = yield* TestInstance const huge = "X".repeat(50_000) const res = yield* Effect.promise(async () => Server.Default().app.request(SyncPaths.history, { method: "POST", - headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" }, + headers: { "x-opencode-directory": test.directory, "content-type": "application/json" }, body: JSON.stringify({ aggregate: huge }), }), ) @@ -139,15 +128,16 @@ describe("schema-rejection wire shape", () => { const parsed = JSON.parse(body) expect(parsed.data.message).not.toContain(huge) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "response-encode failure: corrupted stored row returns NamedError-shaped JSON with field path", - withTmp({ config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const sessionID = yield* Effect.promise(() => seedCorruptStepFinishPart(tmp.path)) - const url = `${SessionPaths.messages.replace(":sessionID", sessionID)}?limit=80&directory=${encodeURIComponent(tmp.path)}` + const test = yield* TestInstance + const sessionID = yield* seedCorruptStepFinishPart + const url = `${SessionPaths.messages.replace(":sessionID", sessionID)}?limit=80&directory=${encodeURIComponent(test.directory)}` const res = yield* Effect.promise(async () => Server.Default().app.request(url)) const body = yield* Effect.promise(async () => res.text()) expect(res.status).toBe(400) @@ -157,6 +147,6 @@ describe("schema-rejection wire shape", () => { // Field path in data.message — what made this PR worth shipping. expect(parsed.data.message).toMatch(/output/) }), - ), + { config: { formatter: false, lsp: false } }, ) }) diff --git a/packages/opencode/test/server/httpapi-sdk.test.ts b/packages/opencode/test/server/httpapi-sdk.test.ts index 0201f98c25d4..4a11be61eca2 100644 --- a/packages/opencode/test/server/httpapi-sdk.test.ts +++ b/packages/opencode/test/server/httpapi-sdk.test.ts @@ -2,12 +2,15 @@ import { afterEach, describe, expect } from "bun:test" import { ConfigProvider, Effect, Layer } from "effect" import type * as Scope from "effect/Scope" import { HttpRouter } from "effect/unstable/http" +import { ChildProcessSpawner } from "effect/unstable/process" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { Flag } from "@opencode-ai/core/flag/flag" import { createOpencodeClient } from "@opencode-ai/sdk/v2" import { validateSession } from "../../src/cli/cmd/tui/validate-session" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { InstanceBootstrap } from "../../src/project/bootstrap-service" +import { InstanceStore } from "../../src/project/instance-store" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { Server } from "../../src/server/server" import { MessageID, PartID, SessionID } from "../../src/session/schema" import { MessageV2 } from "../../src/session/message-v2" @@ -18,8 +21,17 @@ import { errorMessage } from "../../src/util/error" import { TestLLMServer } from "../lib/llm-server" import path from "path" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { it } from "../lib/effect" +import { disposeAllInstances, TestInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" + +const noopBootstrap = Layer.succeed(InstanceBootstrap.Service, InstanceBootstrap.Service.of({ run: Effect.void })) +const it = testEffect( + Layer.mergeAll( + AppFileSystem.defaultLayer, + CrossSpawnSpawner.defaultLayer, + InstanceStore.defaultLayer.pipe(Layer.provide(noopBootstrap)), + ), +) const original = { OPENCODE_SERVER_PASSWORD: Flag.OPENCODE_SERVER_PASSWORD, @@ -32,6 +44,8 @@ type SdkResult = { response: Response; data?: unknown; error?: unknown } type Captured = { status: number; data?: unknown; error?: unknown } type ProjectFixture = { sdk: Sdk; directory: string } type LlmProjectFixture = ProjectFixture & { llm: TestLLMServer["Service"] } +type TestServices = AppFileSystem.Service | ChildProcessSpawner.ChildProcessSpawner | InstanceStore.Service +type TestScope = Scope.Scope | TestServices function app(serverPath: ServerPath, input?: { password?: string; username?: string }) { Flag.OPENCODE_SERVER_PASSWORD = input?.password @@ -39,7 +53,7 @@ function app(serverPath: ServerPath, input?: { password?: string; username?: str if (serverPath === "default") return Server.Default().app const handler = HttpRouter.toWebHandler( - ExperimentalHttpApiServer.routes.pipe( + HttpApiApp.routes.pipe( Layer.provide( ConfigProvider.layer( ConfigProvider.fromUnknown({ @@ -52,7 +66,7 @@ function app(serverPath: ServerPath, input?: { password?: string; username?: str { disableLogger: true }, ).handler return { - fetch: (request: Request) => handler(request, ExperimentalHttpApiServer.context), + fetch: (request: Request) => handler(request, HttpApiApp.context), request(input: string | URL | Request, init?: RequestInit) { return this.fetch(input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init)) }, @@ -149,12 +163,27 @@ function expectStatus(request: () => Promise<{ response: Response }>, status: nu ) } -function firstEvent(open: () => Promise<{ stream: AsyncIterator }>) { - return Effect.acquireRelease(call(open), (events) => - call(async () => void (await events.stream.return?.(undefined))).pipe(Effect.ignore), +function firstEvent(open: (signal: AbortSignal) => Promise<{ stream: AsyncIterator }>) { + return Effect.acquireRelease( + Effect.sync(() => new AbortController()), + (controller) => Effect.sync(() => controller.abort()), ).pipe( - Effect.flatMap((events) => call(() => events.stream.next())), - Effect.map((result) => result.value), + Effect.flatMap((controller) => + Effect.acquireRelease( + call(() => open(controller.signal)), + (events) => call(async () => void (await events.stream.return?.(undefined))).pipe(Effect.ignore), + ).pipe( + Effect.flatMap((events) => + call(() => events.stream.next()).pipe( + Effect.timeoutOrElse({ + duration: "1 second", + orElse: () => Effect.fail(new Error("timed out waiting for SDK event")), + }), + ), + ), + Effect.map((result) => result.value), + ), + ), ) } @@ -188,11 +217,32 @@ function resetState() { }) } -function httpapi(name: string, effect: Effect.Effect) { +function httpapi(name: string, effect: Effect.Effect) { it.live(name, effect) } -function serverPathParity(name: string, scenario: (serverPath: ServerPath) => Effect.Effect) { +function httpapiInstance( + name: string, + options: { + serverPath: ServerPath + git?: boolean + config?: Partial + setup?: (dir: string) => Effect.Effect + }, + run: (input: ProjectFixture) => Effect.Effect, +) { + it.instance( + name, + Effect.gen(function* () { + const instance = yield* TestInstance + yield* options.setup?.(instance.directory) ?? Effect.void + return yield* run({ sdk: client(options.serverPath, instance.directory), directory: instance.directory }) + }), + { git: options.git ?? true, config: { formatter: false, lsp: false, ...options.config } }, + ) +} + +function serverPathParity(name: string, scenario: (serverPath: ServerPath) => Effect.Effect) { it.live( name, Effect.gen(function* () { @@ -204,35 +254,43 @@ function serverPathParity(name: string, scenario: (serverPath: ServerPath) ) } -function withProject( +function withProject( serverPath: ServerPath, - options: { git?: boolean; config?: Partial; setup?: (dir: string) => Effect.Effect }, - run: (input: ProjectFixture) => Effect.Effect, + options: { + git?: boolean + config?: Partial + setup?: (dir: string) => Effect.Effect + }, + run: (input: ProjectFixture) => Effect.Effect, ) { - return Effect.acquireRelease( - call(() => tmpdir({ git: options.git ?? true, config: { formatter: false, lsp: false, ...options.config } })), - (tmp) => call(() => tmp[Symbol.asyncDispose]()).pipe(Effect.ignore), - ).pipe( - Effect.tap((tmp) => options.setup?.(tmp.path) ?? Effect.void), - Effect.flatMap((tmp) => run({ sdk: client(serverPath, tmp.path), directory: tmp.path })), - ) + return Effect.gen(function* () { + const directory = yield* tmpdirScoped({ + git: options.git ?? true, + config: { formatter: false, lsp: false, ...options.config }, + }) + yield* options.setup?.(directory) ?? Effect.void + return yield* run({ sdk: client(serverPath, directory), directory }) + }) } -function withStandardProject(serverPath: ServerPath, run: (input: ProjectFixture) => Effect.Effect) { +function withStandardProject( + serverPath: ServerPath, + run: (input: ProjectFixture) => Effect.Effect, +) { return withProject(serverPath, { setup: writeStandardFiles }, run) } -function withFakeLlm(serverPath: ServerPath, run: (input: LlmProjectFixture) => Effect.Effect) { +function withFakeLlm(serverPath: ServerPath, run: (input: LlmProjectFixture) => Effect.Effect) { return Effect.gen(function* () { const llm = yield* TestLLMServer return yield* withProject(serverPath, { config: providerConfig(llm.url) }, (input) => run({ ...input, llm })) }).pipe(Effect.provide(TestLLMServer.layer)) } -function withFakeLlmProject( +function withFakeLlmProject( serverPath: ServerPath, - options: { setup?: (dir: string) => Effect.Effect }, - run: (input: LlmProjectFixture) => Effect.Effect, + options: { setup?: (dir: string) => Effect.Effect }, + run: (input: LlmProjectFixture) => Effect.Effect, ) { return Effect.gen(function* () { const llm = yield* TestLLMServer @@ -248,15 +306,17 @@ function withFakeLlmProject( } function writeStandardFiles(dir: string) { - return Effect.all([ - call(() => Bun.write(path.join(dir, "hello.txt"), "hello")), - call(() => Bun.write(path.join(dir, "needle.ts"), "export const needle = 'sdk-parity'\n")), - ]).pipe(Effect.asVoid) + return AppFileSystem.Service.use((fs) => + Effect.all([ + fs.writeWithDirs(path.join(dir, "hello.txt"), "hello"), + fs.writeWithDirs(path.join(dir, "needle.ts"), "export const needle = 'sdk-parity'\n"), + ]).pipe(Effect.asVoid), + ) } function writeProjectSkill(dir: string) { - return call(() => - Bun.write( + return AppFileSystem.Service.use((fs) => + fs.writeWithDirs( path.join(dir, ".opencode", "skills", "project-rest-skill", "SKILL.md"), `--- name: project-rest-skill @@ -266,40 +326,36 @@ description: A project skill visible to REST API prompts. # Project REST Skill `, ), - ).pipe(Effect.asVoid) + ) } function seedMessage(directory: string, sessionID: string) { const id = SessionID.make(sessionID) - return call( - async () => - await WithInstance.provide({ - directory, - fn: () => - Effect.runPromise( - SessionNs.Service.use((svc) => - Effect.gen(function* () { - const message = yield* svc.updateMessage({ - id: MessageID.ascending(), - sessionID: id, - role: "user", - time: { created: Date.now() }, - agent: "test", - model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, - tools: {}, - } satisfies MessageV2.User) - const part = yield* svc.updatePart({ - id: PartID.ascending(), - sessionID: id, - messageID: message.id, - type: "text", - text: "seeded message", - }) - return { message, part } - }), - ).pipe(Effect.provide(SessionNs.defaultLayer)), - ), - }), + return InstanceStore.Service.use((store) => + store.provide( + { directory }, + SessionNs.Service.use((svc) => + Effect.gen(function* () { + const message = yield* svc.updateMessage({ + id: MessageID.ascending(), + sessionID: id, + role: "user", + time: { created: Date.now() }, + agent: "test", + model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, + tools: {}, + } satisfies MessageV2.User) + const part = yield* svc.updatePart({ + id: PartID.ascending(), + sessionID: id, + messageID: message.id, + type: "text", + text: "seeded message", + }) + return { message, part } + }), + ).pipe(Effect.provide(SessionNs.defaultLayer)), + ), ) } @@ -320,7 +376,7 @@ describe("HttpApi SDK", () => { expect(health.response.status).toBe(200) expect(health.data).toMatchObject({ healthy: true }) - expect(yield* firstEvent(() => sdk.global.event({ signal: AbortSignal.timeout(1_000) }))).toMatchObject({ + expect(yield* firstEvent((signal) => sdk.global.event({ signal }))).toMatchObject({ payload: { type: "server.connected" }, }) expect(log.response.status).toBe(200) @@ -329,9 +385,10 @@ describe("HttpApi SDK", () => { }), ) - httpapi( + httpapiInstance( "uses the generated SDK for safe instance routes", - withProject("raw", { git: false, setup: writeStandardFiles }, ({ sdk }) => + { serverPath: "raw", git: false, setup: writeStandardFiles }, + ({ sdk }) => Effect.gen(function* () { const file = yield* call(() => sdk.file.read({ path: "hello.txt" })) const session = yield* call(() => sdk.session.create({ title: "sdk" })) @@ -351,7 +408,6 @@ describe("HttpApi SDK", () => { expectStatus(() => sdk.find.files({ query: "hello", limit: 10 }), 200), ]) }), - ), ) serverPathParity("matches generated SDK global and control behavior", (serverPath) => @@ -370,14 +426,14 @@ describe("HttpApi SDK", () => { ) serverPathParity("matches generated SDK global event stream", (serverPath) => - firstEvent(() => client(serverPath).global.event({ signal: AbortSignal.timeout(1_000) })).pipe( + firstEvent((signal) => client(serverPath).global.event({ signal })).pipe( Effect.map((event) => ({ type: record(record(event).payload).type })), ), ) serverPathParity("matches generated SDK instance event stream", (serverPath) => withStandardProject(serverPath, ({ sdk }) => - firstEvent(() => sdk.event.subscribe(undefined, { signal: AbortSignal.timeout(1_000) })).pipe( + firstEvent((signal) => sdk.event.subscribe(undefined, { signal })).pipe( Effect.map((event) => ({ type: record(record(event).payload).type })), ), ), @@ -431,9 +487,10 @@ describe("HttpApi SDK", () => { ), ) - httpapi( + httpapiInstance( "uses generated SDK basic auth behavior", - withStandardProject("raw", ({ directory }) => + { serverPath: "raw", setup: writeStandardFiles }, + ({ directory }) => Effect.gen(function* () { const missing = yield* capture(() => client("raw", directory, { password: "secret" }).file.read({ path: "hello.txt" }), @@ -456,7 +513,6 @@ describe("HttpApi SDK", () => { content: record(good.data).content, } }), - ), ) serverPathParity("matches generated SDK instance read routes", (serverPath) => @@ -687,7 +743,7 @@ describe("HttpApi SDK", () => { ) httpapi( - "includes project skills in REST API async prompt context", + "includes project skills in REST API prompt context", withFakeLlmProject("default", { setup: writeProjectSkill }, ({ sdk, llm }) => Effect.gen(function* () { yield* llm.text("skill context ok", { usage: { input: 11, output: 7 } }) @@ -699,18 +755,17 @@ describe("HttpApi SDK", () => { ) const sessionID = String(record(session.data).id) const prompt = yield* capture(() => - sdk.session.promptAsync({ + sdk.session.prompt({ sessionID, agent: "build", model: { providerID: "test", modelID: "test-model" }, parts: [{ type: "text", text: "hello skill context" }], }), ) - yield* llm.wait(1) const inputs = yield* llm.inputs expect(session.status).toBe(200) - expect(prompt.status).toBe(204) + expect(prompt.status).toBe(200) expect(JSON.stringify(inputs[0])).toContain("project-rest-skill") }), ), diff --git a/packages/opencode/test/server/httpapi-session.test.ts b/packages/opencode/test/server/httpapi-session.test.ts index 210863e0c949..815b09a9d647 100644 --- a/packages/opencode/test/server/httpapi-session.test.ts +++ b/packages/opencode/test/server/httpapi-session.test.ts @@ -8,25 +8,27 @@ import type { WorkspaceAdapter } from "../../src/control-plane/types" import { Workspace } from "../../src/control-plane/workspace" import { PermissionID } from "../../src/permission/schema" import { ModelID, ProviderID } from "../../src/provider/schema" -import { WithInstance } from "../../src/project/with-instance" import { InstanceBootstrap } from "../../src/project/bootstrap" +import { InstanceBootstrap as InstanceBootstrapService } from "../../src/project/bootstrap-service" import { InstanceStore } from "../../src/project/instance-store" import { Project } from "../../src/project/project" import { Server } from "../../src/server/server" import { SessionPaths } from "../../src/server/routes/instance/httpapi/groups/session" +import { SessionGoal } from "@/session/goal" import { Session } from "@/session/session" import { MessageID, PartID, SessionID, type SessionID as SessionIDType } from "../../src/session/schema" import { MessageV2 } from "../../src/session/message-v2" import { Database } from "@/storage/db" import { SessionMessageTable, SessionTable } from "@/session/session.sql" -import { SessionMessage } from "../../src/v2/session-message" -import { Modelv2 } from "../../src/v2/model" +import { SessionMessage } from "@opencode-ai/core/session-message" +import { ModelV2 } from "@opencode-ai/core/model" +import { ProviderV2 } from "@opencode-ai/core/provider" import * as DateTime from "effect/DateTime" import * as Log from "@opencode-ai/core/util/log" import { eq } from "drizzle-orm" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { it } from "../lib/effect" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) @@ -35,58 +37,45 @@ const workspaceLayer = Workspace.defaultLayer.pipe( Layer.provide(InstanceStore.defaultLayer), Layer.provide(InstanceBootstrap.defaultLayer), ) +const instanceStoreLayer = InstanceStore.defaultLayer.pipe( + Layer.provide( + Layer.succeed(InstanceBootstrapService.Service, InstanceBootstrapService.Service.of({ run: Effect.void })), + ), +) +const it = testEffect(Layer.mergeAll(instanceStoreLayer, Project.defaultLayer, Session.defaultLayer, workspaceLayer)) function app() { return Server.Default().app } -function runSession(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(Session.defaultLayer))) -} - function pathFor(path: string, params: Record) { return Object.entries(params).reduce((result, [key, value]) => result.replace(`:${key}`, value), path) } -function createSession(directory: string, input?: Session.CreateInput) { - return Effect.promise( - async () => - await WithInstance.provide({ - directory, - fn: () => runSession(Session.Service.use((svc) => svc.create(input))), - }), - ) +function createSession(input?: Session.CreateInput) { + return Session.Service.use((svc) => svc.create(input)) } -function createTextMessage(directory: string, sessionID: SessionIDType, text: string) { - return Effect.promise( - async () => - await WithInstance.provide({ - directory, - fn: () => - runSession( - Effect.gen(function* () { - const svc = yield* Session.Service - const info = yield* svc.updateMessage({ - id: MessageID.ascending(), - role: "user", - sessionID, - agent: "build", - model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, - time: { created: Date.now() }, - }) - const part = yield* svc.updatePart({ - id: PartID.ascending(), - sessionID, - messageID: info.id, - type: "text", - text, - }) - return { info, part } - }), - ), - }), - ) +function createTextMessage(sessionID: SessionIDType, text: string) { + return Effect.gen(function* () { + const svc = yield* Session.Service + const info = yield* svc.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID, + agent: "build", + model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, + time: { created: Date.now() }, + }) + const part = yield* svc.updatePart({ + id: PartID.ascending(), + sessionID, + messageID: info.id, + type: "text", + text, + }) + return { info, part } + }) } const localAdapter = (directory: string): WorkspaceAdapter => ({ @@ -101,18 +90,88 @@ const localAdapter = (directory: string): WorkspaceAdapter => ({ }) const createLocalWorkspace = (input: { projectID: Project.Info["id"]; type: string; directory: string }) => - Effect.gen(function* () { - registerAdapter(input.projectID, input.type, localAdapter(input.directory)) - return yield* Workspace.Service.use((svc) => - svc.create({ - type: input.type, - branch: null, - extra: null, - projectID: input.projectID, - }), - ).pipe(Effect.provide(workspaceLayer)) + Effect.acquireRelease( + Effect.gen(function* () { + registerAdapter(input.projectID, input.type, localAdapter(input.directory)) + return yield* Workspace.Service.use((svc) => + svc.create({ + type: input.type, + branch: null, + extra: null, + projectID: input.projectID, + }), + ) + }), + (info) => Workspace.Service.use((svc) => svc.remove(info.id)).pipe(Effect.ignore), + ) + +const insertLegacyAssistantMessage = (sessionID: SessionIDType) => + Effect.sync(() => { + const message = new SessionMessage.Assistant({ + id: SessionMessage.ID.create(), + type: "assistant", + agent: "build", + model: { + id: ModelV2.ID.make("model"), + providerID: ProviderV2.ID.make("provider"), + variant: ModelV2.VariantID.make("default"), + }, + time: { created: DateTime.makeUnsafe(1) }, + content: [], + }) + Database.use((db) => + db + .insert(SessionMessageTable) + .values([ + { + id: message.id, + session_id: sessionID, + type: message.type, + time_created: 1, + data: { + time: { created: 1 }, + agent: message.agent, + model: message.model, + content: message.content, + } as NonNullable<(typeof SessionMessageTable.$inferInsert)["data"]>, + }, + ]) + .run(), + ) }) +const setLegacySummaryDiff = (sessionID: SessionIDType) => + Effect.sync(() => + Database.use((db) => + db + .update(SessionTable) + .set({ + summary_additions: 1, + summary_deletions: 0, + summary_files: 1, + summary_diffs: [{ additions: 1, deletions: 0 }], + }) + .where(eq(SessionTable.id, sessionID)) + .run(), + ), + ) + +const getWorkspaceID = (sessionID: SessionIDType) => + Effect.sync(() => + Database.use((db) => + db + .select({ workspaceID: SessionTable.workspace_id }) + .from(SessionTable) + .where(eq(SessionTable.id, sessionID)) + .get(), + ), + ) + +const clearSessionPath = (sessionID: SessionIDType) => + Effect.sync(() => + Database.use((db) => db.update(SessionTable).set({ path: null }).where(eq(SessionTable.id, sessionID)).run()), + ) + function request(path: string, init?: RequestInit) { return Effect.promise(async () => app().request(path, init)) } @@ -132,16 +191,6 @@ function requestJson(path: string, init?: RequestInit) { return request(path, init).pipe(Effect.flatMap(json)) } -function withTmp( - options: Parameters[0], - fn: (tmp: Awaited>) => Effect.Effect, -) { - return Effect.acquireRelease( - Effect.promise(() => tmpdir(options)), - (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()), - ).pipe(Effect.flatMap(fn)) -} - afterEach(async () => { Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces await disposeAllInstances() @@ -149,11 +198,12 @@ afterEach(async () => { }) describe("session HttpApi", () => { - it.live( + it.instance( "returns declared not found errors for read routes", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path } + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory } const missingSession = SessionID.descending() const missingSessionBody = { name: "NotFoundError", @@ -164,6 +214,14 @@ describe("session HttpApi", () => { expect(get.status).toBe(404) expect(yield* responseJson(get)).toEqual(missingSessionBody) + const children = yield* request(pathFor(SessionPaths.children, { sessionID: missingSession }), { headers }) + expect(children.status).toBe(404) + expect(yield* responseJson(children)).toEqual(missingSessionBody) + + const todo = yield* request(pathFor(SessionPaths.todo, { sessionID: missingSession }), { headers }) + expect(todo.status).toBe(404) + expect(yield* responseJson(todo)).toEqual(missingSessionBody) + const messages = yield* request(pathFor(SessionPaths.messages, { sessionID: missingSession }), { headers }) expect(messages.status).toBe(404) expect(yield* responseJson(messages)).toEqual(missingSessionBody) @@ -175,7 +233,22 @@ describe("session HttpApi", () => { expect(remove.status).toBe(404) expect(yield* responseJson(remove)).toEqual(missingSessionBody) - const session = yield* createSession(tmp.path, { title: "missing message" }) + const prompt = yield* request(pathFor(SessionPaths.prompt, { sessionID: missingSession }), { + headers: { ...headers, "content-type": "application/json" }, + method: "POST", + body: JSON.stringify({ agent: "build", noReply: true, parts: [{ type: "text", text: "hello" }] }), + }) + expect(prompt.status).toBe(404) + expect(yield* responseJson(prompt)).toEqual(missingSessionBody) + + const abort = yield* request(pathFor(SessionPaths.abort, { sessionID: missingSession }), { + headers, + method: "POST", + }) + expect(abort.status).toBe(200) + expect(yield* responseJson(abort)).toBe(true) + + const session = yield* createSession({ title: "missing message" }) const missingMessage = MessageID.ascending() const message = yield* request( pathFor(SessionPaths.message, { sessionID: session.id, messageID: missingMessage }), @@ -187,18 +260,19 @@ describe("session HttpApi", () => { data: { message: `Message not found: ${missingMessage}` }, }) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "serves read routes", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path } - const parent = yield* createSession(tmp.path, { title: "parent" }) - const child = yield* createSession(tmp.path, { title: "child", parentID: parent.id }) - const message = yield* createTextMessage(tmp.path, parent.id, "hello") - yield* createTextMessage(tmp.path, parent.id, "world") + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory } + const parent = yield* createSession({ title: "parent" }) + const child = yield* createSession({ title: "child", parentID: parent.id }) + const message = yield* createTextMessage(parent.id, "hello") + yield* createTextMessage(parent.id, "world") const listed = yield* requestJson(`${SessionPaths.list}?roots=true`, { headers }) expect(listed.map((item) => item.id)).toContain(parent.id) @@ -250,88 +324,132 @@ describe("session HttpApi", () => { ), ).toMatchObject({ info: { id: message.info.id } }) - yield* Effect.promise(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const message = new SessionMessage.Assistant({ - id: SessionMessage.ID.create(), - type: "assistant", - agent: "build", - model: { - id: Modelv2.ID.make("model"), - providerID: Modelv2.ProviderID.make("provider"), - variant: Modelv2.VariantID.make("default"), - }, - time: { created: DateTime.makeUnsafe(1) }, - content: [], - }) - Database.use((db) => - db - .insert(SessionMessageTable) - .values([ - { - id: message.id, - session_id: parent.id, - type: message.type, - time_created: 1, - data: { - time: { created: 1 }, - agent: message.agent, - model: message.model, - content: message.content, - } as NonNullable<(typeof SessionMessageTable.$inferInsert)["data"]>, - }, - ]) - .run(), - ) - }, - }), - ) + yield* insertLegacyAssistantMessage(parent.id) expect( (yield* requestJson<{ items: SessionMessage.Message[] }>(`/api/session/${parent.id}/message`, { headers })) .items, ).toMatchObject([{ type: "assistant" }]) }), - ), + { git: true, config: { formatter: false, lsp: false } }, + ) + + it.instance( + "serves session goal routes", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const headers = { "content-type": "application/json", "x-opencode-directory": test.directory } + const session = yield* createSession({ title: "goal routes" }) + const path = pathFor(SessionPaths.goal, { sessionID: session.id }) + + expect(yield* requestJson(path, { headers })).toBeNull() + + const created = yield* requestJson(path, { + headers, + method: "POST", + body: JSON.stringify({ objective: "finish api support", tokenBudget: 25 }), + }) + expect(created).toMatchObject({ + sessionID: session.id, + objective: "finish api support", + status: "active", + tokens: { used: 0, budget: 25 }, + }) + + const duplicate = yield* request(path, { + headers, + method: "POST", + body: JSON.stringify({ objective: "second" }), + }) + expect(duplicate.status).toBe(400) + + const paused = yield* requestJson(path, { + headers, + method: "PATCH", + body: JSON.stringify({ objective: "finish api support cleanly", status: "paused", tokenBudget: null }), + }) + expect(paused.objective).toBe("finish api support cleanly") + expect(paused.status).toBe("paused") + expect(paused.tokens.budget).toBeUndefined() + + const cleared = yield* requestJson(path, { headers, method: "DELETE" }) + expect(cleared).toBe(true) + expect(yield* requestJson(path, { headers })).toBeNull() + }), + { git: true, config: { formatter: false, lsp: false } }, + ) + + it.instance( + "titles a default session from native goal commands", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const headers = { "content-type": "application/json", "x-opencode-directory": test.directory } + const session = yield* createSession() + const path = pathFor(SessionPaths.goal, { sessionID: session.id }) + + expect(Session.isDefaultTitle(session.title)).toBe(true) + + yield* requestJson(path, { + headers, + method: "POST", + body: JSON.stringify({ objective: "refactor project title handling" }), + }) + expect( + yield* requestJson(pathFor(SessionPaths.get, { sessionID: session.id }), { headers }), + ).toMatchObject({ title: "refactor project title handling" }) + + yield* requestJson(path, { + headers, + method: "PATCH", + body: JSON.stringify({ objective: "verify edited goal titles" }), + }) + expect( + yield* requestJson(pathFor(SessionPaths.get, { sessionID: session.id }), { headers }), + ).toMatchObject({ title: "verify edited goal titles" }) + + yield* requestJson(pathFor(SessionPaths.update, { sessionID: session.id }), { + headers, + method: "PATCH", + body: JSON.stringify({ title: "manual title" }), + }) + yield* requestJson(path, { + headers, + method: "PATCH", + body: JSON.stringify({ objective: "do not override manual titles" }), + }) + expect( + yield* requestJson(pathFor(SessionPaths.get, { sessionID: session.id }), { headers }), + ).toMatchObject({ title: "manual title" }) + }), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "serves sessions with migrated summary diffs missing file details", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const session = yield* createSession(tmp.path, { title: "legacy diff" }) - yield* Effect.sync(() => - Database.use((db) => - db - .update(SessionTable) - .set({ - summary_additions: 1, - summary_deletions: 0, - summary_files: 1, - summary_diffs: [{ additions: 1, deletions: 0 }], - }) - .where(eq(SessionTable.id, session.id)) - .run(), - ), - ) + const test = yield* TestInstance + const session = yield* createSession({ title: "legacy diff" }) + yield* setLegacySummaryDiff(session.id) const response = yield* request(pathFor(SessionPaths.get, { sessionID: session.id }), { - headers: { "x-opencode-directory": tmp.path }, + headers: { "x-opencode-directory": test.directory }, }) expect(response.status).toBe(200) expect((yield* json(response)).summary?.diffs).toEqual([{ additions: 1, deletions: 0 }]) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "serves lifecycle mutation routes", - withTmp({ git: true, config: { formatter: false, lsp: false, share: "disabled" } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory, "content-type": "application/json" } const createdEmpty = yield* requestJson(SessionPaths.create, { method: "POST", @@ -373,56 +491,48 @@ describe("session HttpApi", () => { }), ).toBe(true) }), - ), + { git: true, config: { formatter: false, lsp: false, share: "disabled" } }, ) - it.live( + it.instance( "persists selected workspace id when creating a session", - withTmp({ git: true, config: { formatter: false, lsp: false, share: "disabled" } }, (tmp) => + () => Effect.gen(function* () { + const test = yield* TestInstance Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true - const project = yield* Project.use.fromDirectory(tmp.path).pipe(Effect.provide(Project.defaultLayer)) + const project = yield* Project.use.fromDirectory(test.directory) const workspace = yield* createLocalWorkspace({ projectID: project.project.id, type: "session-create-workspace", - directory: path.join(tmp.path, ".workspace-local"), + directory: path.join(test.directory, ".workspace-local"), }) const created = yield* requestJson(`${SessionPaths.create}?workspace=${workspace.id}`, { method: "POST", - headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" }, + headers: { "x-opencode-directory": test.directory, "content-type": "application/json" }, body: JSON.stringify({ title: "workspace session" }), }) const messages = yield* request( `${pathFor(SessionPaths.messages, { sessionID: created.id })}?workspace=${workspace.id}`, { - headers: { "x-opencode-directory": tmp.path }, + headers: { "x-opencode-directory": test.directory }, }, ) expect(created).toMatchObject({ id: created.id, workspaceID: workspace.id }) expect(messages.status).toBe(200) - expect( - yield* Effect.sync(() => - Database.use((db) => - db - .select({ workspaceID: SessionTable.workspace_id }) - .from(SessionTable) - .where(eq(SessionTable.id, created.id)) - .get(), - ), - ), - ).toEqual({ workspaceID: workspace.id }) + expect(yield* getWorkspaceID(created.id)).toEqual({ workspaceID: workspace.id }) }), - ), + { git: true, config: { formatter: false, lsp: false, share: "disabled" } }, ) - it.live( + it.instance( "validates archived timestamp values", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } - const session = yield* createSession(tmp.path, { title: "archived" }) + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory, "content-type": "application/json" } + const session = yield* createSession({ title: "archived" }) const body = JSON.stringify({ time: { archived: -1 } }) const response = yield* request(pathFor(SessionPaths.update, { sessionID: session.id }), { @@ -433,30 +543,35 @@ describe("session HttpApi", () => { expect(response.status).toBe(200) expect((yield* json(response)).time.archived).toBe(-1) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "uses project-scoped path and directory precedence", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const currentDir = path.join(tmp.path, "packages", "opencode", "src") + const test = yield* TestInstance + const currentDir = path.join(test.directory, "packages", "opencode", "src") yield* Effect.promise(() => mkdir(currentDir, { recursive: true })) - const pathSession = yield* createSession(currentDir) - const pathlessSession = yield* createSession(currentDir) - yield* Effect.sync(() => - Database.use((db) => - db.update(SessionTable).set({ path: null }).where(eq(SessionTable.id, pathlessSession.id)).run(), - ), + const store = yield* InstanceStore.Service + const { pathSession, pathlessSession } = yield* store.provide( + { directory: currentDir }, + Effect.gen(function* () { + return { + pathSession: yield* createSession(), + pathlessSession: yield* createSession(), + } + }).pipe(Effect.provideService(TestInstance, { directory: currentDir }), Effect.provide(Session.defaultLayer)), ) + yield* clearSessionPath(pathlessSession.id) const query = new URLSearchParams({ scope: "project", path: "packages/opencode/src", directory: currentDir, }) - const headers = { "x-opencode-directory": tmp.path } + const headers = { "x-opencode-directory": test.directory } const sessions = (yield* json( yield* request(`${SessionPaths.list}?${query}`, { headers }), )).map((item) => item.id) @@ -464,17 +579,18 @@ describe("session HttpApi", () => { expect(sessions).toContain(pathSession.id) expect(sessions).not.toContain(pathlessSession.id) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "serves paginated message link headers", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path } - const session = yield* createSession(tmp.path, { title: "messages" }) - yield* createTextMessage(tmp.path, session.id, "first") - yield* createTextMessage(tmp.path, session.id, "second") + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory } + const session = yield* createSession({ title: "messages" }) + yield* createTextMessage(session.id, "first") + yield* createTextMessage(session.id, "second") const route = `${pathFor(SessionPaths.messages, { sessionID: session.id })}?limit=1` const response = yield* request(route, { headers }) @@ -483,17 +599,18 @@ describe("session HttpApi", () => { expect(response.headers.get("link")).toContain("limit=1") expect(response.headers.get("access-control-expose-headers")?.toLowerCase()).toContain("x-next-cursor") }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( "serves message mutation routes", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } - const session = yield* createSession(tmp.path, { title: "messages" }) - const first = yield* createTextMessage(tmp.path, session.id, "first") - const second = yield* createTextMessage(tmp.path, session.id, "second") + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory, "content-type": "application/json" } + const session = yield* createSession({ title: "messages" }) + const first = yield* createTextMessage(session.id, "first") + const second = yield* createTextMessage(session.id, "second") const updated = yield* requestJson( pathFor(SessionPaths.updatePart, { @@ -527,15 +644,42 @@ describe("session HttpApi", () => { ), ).toBe(true) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) - it.live( + it.instance( + "rejects part updates whose path and body ids disagree", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory, "content-type": "application/json" } + const session = yield* createSession({ title: "part mismatch" }) + const message = yield* createTextMessage(session.id, "first") + const response = yield* request( + pathFor(SessionPaths.updatePart, { + sessionID: session.id, + messageID: message.info.id, + partID: message.part.id, + }), + { + method: "PATCH", + headers, + body: JSON.stringify({ ...message.part, id: PartID.ascending() }), + }, + ) + + expect(response.status).toBe(400) + }), + { git: true, config: { formatter: false, lsp: false } }, + ) + + it.instance( "serves remaining non-LLM session mutation routes", - withTmp({ git: true, config: { formatter: false, lsp: false } }, (tmp) => + () => Effect.gen(function* () { - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } - const session = yield* createSession(tmp.path, { title: "remaining" }) + const test = yield* TestInstance + const headers = { "x-opencode-directory": test.directory, "content-type": "application/json" } + const session = yield* createSession({ title: "remaining" }) expect( yield* requestJson(pathFor(SessionPaths.revert, { sessionID: session.id }), { @@ -566,6 +710,6 @@ describe("session HttpApi", () => { ), ).toBe(true) }), - ), + { git: true, config: { formatter: false, lsp: false } }, ) }) diff --git a/packages/opencode/test/server/httpapi-sync.test.ts b/packages/opencode/test/server/httpapi-sync.test.ts index cd626c28f4f4..b7fe0aa05850 100644 --- a/packages/opencode/test/server/httpapi-sync.test.ts +++ b/packages/opencode/test/server/httpapi-sync.test.ts @@ -1,29 +1,25 @@ -import { afterEach, describe, expect, mock, spyOn, test } from "bun:test" +import { afterEach, describe, expect, mock, spyOn } from "bun:test" import { Context, Effect } from "effect" import { Flag } from "@opencode-ai/core/flag/flag" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { Server } from "../../src/server/server" import { SyncPaths } from "../../src/server/routes/instance/httpapi/groups/sync" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { Session } from "@/session/session" import * as Log from "@opencode-ai/core/util/log" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES const context = Context.empty() as Context.Context +const it = testEffect(Session.defaultLayer) function app() { return Server.Default().app } -function runSession(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(Session.defaultLayer))) -} - afterEach(async () => { mock.restore() Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces @@ -32,111 +28,138 @@ afterEach(async () => { }) describe("sync HttpApi", () => { - test("serves sync routes", async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true - await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } - const info = spyOn(Log.create({ service: "server.sync" }), "info") - - const session = await WithInstance.provide({ - directory: tmp.path, - fn: async () => runSession(Session.Service.use((svc) => svc.create({ title: "sync" }))), - }) + it.instance( + "serves sync routes", + () => + Effect.gen(function* () { + Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true + const tmp = yield* TestInstance + const headers = { "x-opencode-directory": tmp.directory, "content-type": "application/json" } + const info = spyOn(Log.create({ service: "server.sync" }), "info") + const session = yield* Session.Service.use((svc) => svc.create({ title: "sync" })) - const started = await app().request(SyncPaths.start, { method: "POST", headers }) - expect(started.status).toBe(200) - expect(await started.json()).toBe(true) + const started = yield* Effect.promise(() => + Promise.resolve(app().request(SyncPaths.start, { method: "POST", headers })), + ) + expect(started.status).toBe(200) + expect(yield* Effect.promise(() => started.json())).toBe(true) - const history = await app().request(SyncPaths.history, { - method: "POST", - headers, - body: JSON.stringify({}), - }) - expect(history.status).toBe(200) - const rows = (await history.json()) as Array<{ - id: string - aggregate_id: string - seq: number - type: string - data: Record - }> - expect(rows.map((row) => row.aggregate_id)).toContain(session.id) + const history = yield* Effect.promise(() => + Promise.resolve( + app().request(SyncPaths.history, { + method: "POST", + headers, + body: JSON.stringify({}), + }), + ), + ) + expect(history.status).toBe(200) + const rows = (yield* Effect.promise(() => history.json())) as Array<{ + id: string + aggregate_id: string + seq: number + type: string + data: Record + }> + expect(rows.map((row) => row.aggregate_id)).toContain(session.id) - const replayed = await app().request(SyncPaths.replay, { - method: "POST", - headers, - body: JSON.stringify({ - directory: tmp.path, - events: rows - .filter((row) => row.aggregate_id === session.id) - .map((row) => ({ - id: row.id, - aggregateID: row.aggregate_id, - seq: row.seq, - type: row.type, - data: row.data, - })), + const replayed = yield* Effect.promise(() => + Promise.resolve( + app().request(SyncPaths.replay, { + method: "POST", + headers, + body: JSON.stringify({ + directory: tmp.directory, + events: rows + .filter((row) => row.aggregate_id === session.id) + .map((row) => ({ + id: row.id, + aggregateID: row.aggregate_id, + seq: row.seq, + type: row.type, + data: row.data, + })), + }), + }), + ), + ) + expect(replayed.status).toBe(200) + expect(yield* Effect.promise(() => replayed.json())).toEqual({ sessionID: session.id }) + expect(info.mock.calls.some(([message]) => message === "sync replay requested")).toBe(true) + expect(info.mock.calls.some(([message]) => message === "sync replay complete")).toBe(true) }), - }) - expect(replayed.status).toBe(200) - expect(await replayed.json()).toEqual({ sessionID: session.id }) - expect(info.mock.calls.some(([message]) => message === "sync replay requested")).toBe(true) - expect(info.mock.calls.some(([message]) => message === "sync replay complete")).toBe(true) - }) + { git: true, config: { formatter: false, lsp: false } }, + ) - test("validates seq values", async () => { - await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) - const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" } - const cases = [ - { - path: SyncPaths.history, - body: { aggregate: -1 }, - }, - { - path: SyncPaths.history, - body: { aggregate: 1.5 }, - }, - { - path: SyncPaths.replay, - body: { - directory: tmp.path, - events: [{ id: "event", aggregateID: "session", seq: -1, type: "session.created", data: {} }], - }, - }, - { - path: SyncPaths.replay, - body: { - directory: tmp.path, - events: [{ id: "event", aggregateID: "session", seq: 1.5, type: "session.created", data: {} }], - }, - }, - ] + it.instance( + "validates seq values", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const headers = { "x-opencode-directory": tmp.directory, "content-type": "application/json" } + const cases = [ + { + path: SyncPaths.history, + body: { aggregate: -1 }, + }, + { + path: SyncPaths.history, + body: { aggregate: 1.5 }, + }, + { + path: SyncPaths.replay, + body: { + directory: tmp.directory, + events: [{ id: "event", aggregateID: "session", seq: -1, type: "session.created", data: {} }], + }, + }, + { + path: SyncPaths.replay, + body: { + directory: tmp.directory, + events: [{ id: "event", aggregateID: "session", seq: 1.5, type: "session.created", data: {} }], + }, + }, + ] - for (const item of cases) { - const response = await app().request(item.path, { - method: "POST", - headers, - body: JSON.stringify(item.body), - }) - expect(response.status).toBe(400) - } - }) - - test.todo("returns structured validation errors", async () => { - await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false } }) - const response = await ExperimentalHttpApiServer.webHandler().handler( - new Request(`http://localhost${SyncPaths.history}`, { - method: "POST", - headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" }, - body: JSON.stringify({ aggregate: -1 }), + for (const item of cases) { + const response = yield* Effect.promise(() => + Promise.resolve( + app().request(item.path, { + method: "POST", + headers, + body: JSON.stringify(item.body), + }), + ), + ) + expect(response.status).toBe(400) + } }), - context, - ) + { git: true, config: { formatter: false, lsp: false } }, + ) + + it.instance.skip( + "returns structured validation errors", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const response = yield* Effect.promise(() => + HttpApiApp.webHandler().handler( + new Request(`http://localhost${SyncPaths.history}`, { + method: "POST", + headers: { "x-opencode-directory": tmp.directory, "content-type": "application/json" }, + body: JSON.stringify({ aggregate: -1 }), + }), + context, + ), + ) - expect(response.status).toBe(400) - expect(response.headers.get("content-type") ?? "").toContain("application/json") - const body = (await response.json()) as Record - expect(body.success).toBe(false) - expect(Array.isArray(body.error) || Array.isArray(body.errors)).toBe(true) - }) + expect(response.status).toBe(400) + expect(response.headers.get("content-type") ?? "").toContain("application/json") + const body = (yield* Effect.promise(() => response.json())) as Record + expect(body.success).toBe(false) + expect(Array.isArray(body.error) || Array.isArray(body.errors)).toBe(true) + }), + { git: true, config: { formatter: false, lsp: false } }, + ) }) diff --git a/packages/opencode/test/server/httpapi-ui.test.ts b/packages/opencode/test/server/httpapi-ui.test.ts index 256c4501939f..1ffa0d200502 100644 --- a/packages/opencode/test/server/httpapi-ui.test.ts +++ b/packages/opencode/test/server/httpapi-ui.test.ts @@ -1,5 +1,5 @@ import { createHash } from "node:crypto" -import { afterEach, describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import { Flag } from "@opencode-ai/core/flag/flag" import * as Log from "@opencode-ai/core/util/log" import { ConfigProvider, Effect, Layer } from "effect" @@ -13,29 +13,36 @@ import { HttpServerResponse, } from "effect/unstable/http" import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { RuntimeFlags } from "../../src/effect/runtime-flags" import { ServerAuth } from "../../src/server/auth" import { authorizationRouterMiddleware } from "../../src/server/routes/instance/httpapi/middleware/authorization" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { serveEmbeddedUIEffect, serveUIEffect } from "../../src/server/shared/ui" -import { Server } from "../../src/server/server" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) -const original = { - OPENCODE_DISABLE_EMBEDDED_WEB_UI: Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI, - OPENCODE_SERVER_PASSWORD: Flag.OPENCODE_SERVER_PASSWORD, - OPENCODE_SERVER_USERNAME: Flag.OPENCODE_SERVER_USERNAME, - envPassword: process.env.OPENCODE_SERVER_PASSWORD, - envUsername: process.env.OPENCODE_SERVER_USERNAME, -} +const testStateLayer = Layer.effectDiscard( + Effect.gen(function* () { + const original = { + OPENCODE_SERVER_PASSWORD: Flag.OPENCODE_SERVER_PASSWORD, + OPENCODE_SERVER_USERNAME: Flag.OPENCODE_SERVER_USERNAME, + envPassword: process.env.OPENCODE_SERVER_PASSWORD, + envUsername: process.env.OPENCODE_SERVER_USERNAME, + } -afterEach(() => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = original.OPENCODE_DISABLE_EMBEDDED_WEB_UI - Flag.OPENCODE_SERVER_PASSWORD = original.OPENCODE_SERVER_PASSWORD - Flag.OPENCODE_SERVER_USERNAME = original.OPENCODE_SERVER_USERNAME - restoreEnv("OPENCODE_SERVER_PASSWORD", original.envPassword) - restoreEnv("OPENCODE_SERVER_USERNAME", original.envUsername) -}) + yield* Effect.addFinalizer(() => + Effect.sync(() => { + Flag.OPENCODE_SERVER_PASSWORD = original.OPENCODE_SERVER_PASSWORD + Flag.OPENCODE_SERVER_USERNAME = original.OPENCODE_SERVER_USERNAME + restoreEnv("OPENCODE_SERVER_PASSWORD", original.envPassword) + restoreEnv("OPENCODE_SERVER_USERNAME", original.envUsername) + }), + ) + }), +) + +const it = testEffect(Layer.mergeAll(testStateLayer, AppFileSystem.defaultLayer, RuntimeFlags.layer())) function restoreEnv(key: string, value: string | undefined) { if (value === undefined) { @@ -47,7 +54,7 @@ function restoreEnv(key: string, value: string | undefined) { function app(input?: { password?: string; username?: string }) { const handler = HttpRouter.toWebHandler( - ExperimentalHttpApiServer.routes.pipe( + HttpApiApp.routes.pipe( Layer.provide( ConfigProvider.layer( ConfigProvider.fromUnknown({ @@ -61,27 +68,40 @@ function app(input?: { password?: string; username?: string }) { ).handler return { request(input: string | URL | Request, init?: RequestInit) { - return handler( - input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), - ExperimentalHttpApiServer.context, + return Effect.promise(() => + Promise.resolve( + handler( + input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), + HttpApiApp.context, + ), + ), ) }, } } -function uiApp(input?: { password?: string; username?: string; client?: Layer.Layer }) { +function uiApp(input?: { + password?: string + username?: string + client?: Layer.Layer + disableEmbeddedWebUi?: boolean +}) { const handler = HttpRouter.toWebHandler( HttpRouter.use((router) => Effect.gen(function* () { const fs = yield* AppFileSystem.Service const client = yield* HttpClient.HttpClient - yield* router.add("*", "/*", (request) => serveUIEffect(request, { fs, client })) + const flags = yield* RuntimeFlags.Service + yield* router.add("*", "/*", (request) => + serveUIEffect(request, { fs, client, disableEmbeddedWebUi: flags.disableEmbeddedWebUi }), + ) }), ).pipe( Layer.provide(authorizationRouterMiddleware.layer.pipe(Layer.provide(ServerAuth.Config.defaultLayer))), Layer.provide([ AppFileSystem.defaultLayer, input?.client ?? httpClient(new Response("ui")), + RuntimeFlags.layer({ disableEmbeddedWebUi: input?.disableEmbeddedWebUi ?? false }), HttpServer.layerServices, ConfigProvider.layer( ConfigProvider.fromUnknown({ @@ -95,9 +115,55 @@ function uiApp(input?: { password?: string; username?: string; client?: Layer.La ).handler return { request(input: string | URL | Request, init?: RequestInit) { - return handler( - input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), - ExperimentalHttpApiServer.context, + return Effect.promise(() => + Promise.resolve( + handler( + input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), + HttpApiApp.context, + ), + ), + ) + }, + } +} + +function routeOrderingApp() { + let proxiedUrl: string | undefined + const handler = HttpRouter.toWebHandler( + HttpRouter.use((router) => + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const client = yield* HttpClient.HttpClient + const flags = yield* RuntimeFlags.Service + yield* router.add("GET", "/session/:sessionID", () => + Effect.succeed(HttpServerResponse.jsonUnsafe({ error: "Not Found" }, { status: 404 })), + ) + yield* router.add("*", "/*", (request) => + serveUIEffect(request, { fs, client, disableEmbeddedWebUi: flags.disableEmbeddedWebUi }), + ) + }), + ).pipe( + Layer.provide([ + AppFileSystem.defaultLayer, + RuntimeFlags.layer({ disableEmbeddedWebUi: true }), + httpClient(new Response("ui"), (request) => { + proxiedUrl = request.url + }), + HttpServer.layerServices, + ]), + ), + { disableLogger: true }, + ).handler + return { + proxiedUrl: () => proxiedUrl, + request(input: string | URL | Request, init?: RequestInit) { + return Effect.promise(() => + Promise.resolve( + handler( + input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), + HttpApiApp.context, + ), + ), ) }, } @@ -113,42 +179,49 @@ function httpClient(response: Response, onRequest?: (request: HttpClientRequest. ) } +function responseText(response: Response) { + return Effect.promise(() => response.text()) +} + describe("HttpApi UI fallback", () => { - test("serves the web UI through the experimental backend", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true - let proxiedUrl: string | undefined - - const response = await uiApp({ - client: httpClient( - new Response("opencode", { headers: { "content-type": "text/html" } }), - (request) => { - proxiedUrl = request.url - }, - ), - }).request("/") + it.live("serves the web UI through the HTTP API app", () => + Effect.gen(function* () { + let proxiedUrl: string | undefined + + const response = yield* uiApp({ + disableEmbeddedWebUi: true, + client: httpClient( + new Response("opencode", { headers: { "content-type": "text/html" } }), + (request) => { + proxiedUrl = request.url + }, + ), + }).request("/") - expect(response.status).toBe(200) - expect(response.headers.get("content-type")).toContain("text/html") - expect(await response.text()).toBe("opencode") - expect(proxiedUrl).toBe("https://app.opencode.ai/") - }) + expect(response.status).toBe(200) + expect(response.headers.get("content-type")).toContain("text/html") + expect(yield* responseText(response)).toBe("opencode") + expect(proxiedUrl).toBe("https://app.opencode.ai/") + }), + ) - test("strips upstream transfer encoding headers from proxied assets", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true - let proxiedUrl: string | undefined + it.live("strips upstream transfer encoding headers from proxied assets", () => + Effect.gen(function* () { + let proxiedUrl: string | undefined - const response = await Effect.runPromise( - Effect.gen(function* () { + const response = yield* Effect.gen(function* () { const fs = yield* AppFileSystem.Service const client = yield* HttpClient.HttpClient + const flags = yield* RuntimeFlags.Service return yield* serveUIEffect(HttpServerRequest.fromWeb(new Request("http://localhost/assets/app.js")), { fs, client, + disableEmbeddedWebUi: flags.disableEmbeddedWebUi, }) }).pipe( Effect.provide( Layer.mergeAll( - AppFileSystem.defaultLayer, + RuntimeFlags.layer({ disableEmbeddedWebUi: true }), Layer.succeed( HttpClient.HttpClient, HttpClient.make((request) => { @@ -170,35 +243,35 @@ describe("HttpApi UI fallback", () => { ), ), Effect.map(HttpServerResponse.toWeb), - ), - ) + ) - expect(response.status).toBe(200) - expect(proxiedUrl).toBe("https://app.opencode.ai/assets/app.js") - expect(response.headers.get("content-encoding")).toBeNull() - expect(response.headers.get("content-length")).not.toBe("999") - expect(response.headers.get("content-type")).toContain("text/javascript") - expect(await response.text()).toBe("console.log('ok')") - }) + expect(response.status).toBe(200) + expect(proxiedUrl).toBe("https://app.opencode.ai/assets/app.js") + expect(response.headers.get("content-encoding")).toBeNull() + expect(response.headers.get("content-length")).not.toBe("999") + expect(response.headers.get("content-type")).toContain("text/javascript") + expect(yield* responseText(response)).toBe("console.log('ok')") + }), + ) // Regression for #25698 (Ope): upstream `transfer-encoding: chunked` was // forwarded through the proxy while the proxy itself re-frames the body, // causing browsers to fail with `ERR_INVALID_CHUNKED_ENCODING`. - test("strips upstream transfer-encoding header from proxied assets", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true - - const response = await Effect.runPromise( - Effect.gen(function* () { + it.live("strips upstream transfer-encoding header from proxied assets", () => + Effect.gen(function* () { + const response = yield* Effect.gen(function* () { const fs = yield* AppFileSystem.Service const client = yield* HttpClient.HttpClient + const flags = yield* RuntimeFlags.Service return yield* serveUIEffect(HttpServerRequest.fromWeb(new Request("http://localhost/")), { fs, client, + disableEmbeddedWebUi: flags.disableEmbeddedWebUi, }) }).pipe( Effect.provide( Layer.mergeAll( - AppFileSystem.defaultLayer, + RuntimeFlags.layer({ disableEmbeddedWebUi: true }), Layer.succeed( HttpClient.HttpClient, HttpClient.make((request) => @@ -218,140 +291,152 @@ describe("HttpApi UI fallback", () => { ), ), Effect.map(HttpServerResponse.toWeb), - ), - ) - - expect(response.status).toBe(200) - expect(response.headers.get("transfer-encoding")).toBeNull() - expect(await response.text()).toBe("opencode") - }) + ) - test("serves embedded UI assets when Bun can read them but access reports missing", async () => { - let readPath: string | undefined + expect(response.status).toBe(200) + expect(response.headers.get("transfer-encoding")).toBeNull() + expect(yield* responseText(response)).toBe("opencode") + }), + ) - const response = await Effect.runPromise( - Effect.gen(function* () { - const fs = yield* AppFileSystem.Service - return yield* serveEmbeddedUIEffect( - "/assets/app.js", - { - ...fs, - existsSafe: () => Effect.die("embedded UI should not rely on filesystem access checks"), - readFile: (path) => { - readPath = path - return path === "/$bunfs/root/assets/app.js" - ? Effect.succeed(new TextEncoder().encode("console.log('embedded')")) - : Effect.die(`unexpected embedded UI path: ${path}`) - }, + it.live("serves embedded UI assets when Bun can read them but access reports missing", () => + Effect.gen(function* () { + let readPath: string | undefined + + const fs = yield* AppFileSystem.Service + const response = yield* serveEmbeddedUIEffect( + "/assets/app.js", + { + ...fs, + existsSafe: () => Effect.die("embedded UI should not rely on filesystem access checks"), + readFile: (path) => { + readPath = path + return path === "/$bunfs/root/assets/app.js" + ? Effect.succeed(new TextEncoder().encode("console.log('embedded')")) + : Effect.die(`unexpected embedded UI path: ${path}`) }, - { "assets/app.js": "/$bunfs/root/assets/app.js" }, - ) - }).pipe(Effect.provide(AppFileSystem.defaultLayer), Effect.map(HttpServerResponse.toWeb)), - ) - - expect(response.status).toBe(200) - expect(readPath).toBe("/$bunfs/root/assets/app.js") - expect(response.headers.get("content-type")).toContain("text/javascript") - expect(await response.text()).toBe("console.log('embedded')") - }) + }, + { "assets/app.js": "/$bunfs/root/assets/app.js" }, + ).pipe(Effect.map(HttpServerResponse.toWeb)) - test("allows embedded UI terminal wasm and theme preload CSP", async () => { - const script = 'document.documentElement.dataset.theme = "dark"' + expect(response.status).toBe(200) + expect(readPath).toBe("/$bunfs/root/assets/app.js") + expect(response.headers.get("content-type")).toContain("text/javascript") + expect(yield* responseText(response)).toBe("console.log('embedded')") + }), + ) - const response = await Effect.runPromise( - Effect.gen(function* () { - const fs = yield* AppFileSystem.Service - return yield* serveEmbeddedUIEffect( - "/", - { - ...fs, - readFile: (path) => { - return path === "/$bunfs/root/index.html" - ? Effect.succeed( - new TextEncoder().encode( - ``, - ), - ) - : Effect.die(`unexpected embedded UI path: ${path}`) - }, + it.live("allows embedded UI terminal wasm and theme preload CSP", () => + Effect.gen(function* () { + const script = 'document.documentElement.dataset.theme = "dark"' + + const fs = yield* AppFileSystem.Service + const response = yield* serveEmbeddedUIEffect( + "/", + { + ...fs, + readFile: (path) => { + return path === "/$bunfs/root/index.html" + ? Effect.succeed( + new TextEncoder().encode( + ``, + ), + ) + : Effect.die(`unexpected embedded UI path: ${path}`) }, - { "index.html": "/$bunfs/root/index.html" }, - ) - }).pipe(Effect.provide(AppFileSystem.defaultLayer), Effect.map(HttpServerResponse.toWeb)), - ) - - const csp = response.headers.get("content-security-policy") ?? "" - expect(csp).toContain("script-src 'self' 'wasm-unsafe-eval'") - expect(csp).toContain(`'sha256-${createHash("sha256").update(script).digest("base64")}'`) - expect(csp).toContain("connect-src * data:") - }) - - test("keeps matched API routes ahead of the UI fallback", async () => { - const response = await Server.Default().app.request("/session/ses_nope") - - expect(response.status).toBe(404) - }) + }, + { "index.html": "/$bunfs/root/index.html" }, + ).pipe(Effect.map(HttpServerResponse.toWeb)) - test("requires server password for the web UI", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true + const csp = response.headers.get("content-security-policy") ?? "" + expect(csp).toContain("script-src 'self' 'wasm-unsafe-eval'") + expect(csp).toContain(`'sha256-${createHash("sha256").update(script).digest("base64")}'`) + expect(csp).toContain("connect-src * data:") + }), + ) - const response = await uiApp({ password: "secret", username: "opencode" }).request("/") + it.live("keeps matched API routes ahead of the UI fallback", () => + Effect.gen(function* () { + const server = routeOrderingApp() + const response = yield* server.request("/session/ses_nope") - expect(response.status).toBe(401) - expect(response.headers.get("www-authenticate")).toBe('Basic realm="Secure Area"') - }) + expect(response.status).toBe(404) + expect(server.proxiedUrl()).toBeUndefined() + }), + ) - test("accepts auth token for the web UI", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true + it.live("requires server password for the web UI", () => + Effect.gen(function* () { + const response = yield* uiApp({ + password: "secret", + username: "opencode", + disableEmbeddedWebUi: true, + }).request("/") - const response = await uiApp({ - password: "secret", - username: "opencode", - client: httpClient(new Response("opencode", { headers: { "content-type": "text/html" } })), - }).request(`/?auth_token=${btoa("opencode:secret")}`) + expect(response.status).toBe(401) + expect(response.headers.get("www-authenticate")).toBe('Basic realm="Secure Area"') + }), + ) - expect(response.status).toBe(200) - expect(await response.text()).toBe("opencode") - }) + it.live("accepts auth token for the web UI", () => + Effect.gen(function* () { + const response = yield* uiApp({ + password: "secret", + username: "opencode", + disableEmbeddedWebUi: true, + client: httpClient(new Response("opencode", { headers: { "content-type": "text/html" } })), + }).request(`/?auth_token=${btoa("opencode:secret")}`) - test("accepts basic auth for the web UI", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true + expect(response.status).toBe(200) + expect(yield* responseText(response)).toBe("opencode") + }), + ) - const response = await uiApp({ password: "secret", username: "opencode" }).request("/", { - headers: { authorization: `Basic ${btoa("opencode:secret")}` }, - }) + it.live("accepts basic auth for the web UI", () => + Effect.gen(function* () { + const response = yield* uiApp({ + password: "secret", + username: "opencode", + disableEmbeddedWebUi: true, + }).request("/", { + headers: { authorization: `Basic ${btoa("opencode:secret")}` }, + }) - expect(response.status).toBe(200) - }) + expect(response.status).toBe(200) + }), + ) // Regression for #25698 (Ope): the browser fetches the PWA manifest and // its icons via flows that don't carry app-managed credentials (the // `` request is not under page-auth control), so the // server returning 401 breaks PWA install. These specific public assets // should bypass auth. - test("serves the PWA manifest without auth even when a server password is set", async () => { - Flag.OPENCODE_DISABLE_EMBEDDED_WEB_UI = true + it.live("serves the PWA manifest without auth even when a server password is set", () => + Effect.gen(function* () { + for (const path of ["/site.webmanifest", "/web-app-manifest-192x192.png", "/web-app-manifest-512x512.png"]) { + const response = yield* uiApp({ + password: "secret", + username: "opencode", + disableEmbeddedWebUi: true, + client: httpClient(new Response("ok")), + }).request(path) + expect(response.status).not.toBe(401) + } + }), + ) - for (const path of ["/site.webmanifest", "/web-app-manifest-192x192.png", "/web-app-manifest-512x512.png"]) { - const response = await uiApp({ - password: "secret", - username: "opencode", - client: httpClient(new Response("ok")), - }).request(path) - expect(response.status).not.toBe(401) - } - }) - - test("allows web UI preflight without auth", async () => { - const response = await app({ password: "secret", username: "opencode" }).request("/", { - method: "OPTIONS", - headers: { - origin: "http://localhost:3000", - "access-control-request-method": "GET", - }, - }) - - expect(response.status).toBe(204) - expect(response.headers.get("access-control-allow-origin")).toBe("http://localhost:3000") - }) + it.live("allows web UI preflight without auth", () => + Effect.gen(function* () { + const response = yield* app({ password: "secret", username: "opencode" }).request("/", { + method: "OPTIONS", + headers: { + origin: "http://localhost:3000", + "access-control-request-method": "GET", + }, + }) + + expect(response.status).toBe(204) + expect(response.headers.get("access-control-allow-origin")).toBe("http://localhost:3000") + }), + ) }) diff --git a/packages/opencode/test/server/httpapi-workspace-routing.test.ts b/packages/opencode/test/server/httpapi-workspace-routing.test.ts index a62ca1db7437..9d6dc8c3e3ad 100644 --- a/packages/opencode/test/server/httpapi-workspace-routing.test.ts +++ b/packages/opencode/test/server/httpapi-workspace-routing.test.ts @@ -1,5 +1,4 @@ import { NodeHttpServer, NodeServices } from "@effect/platform-node" -import { Flag } from "@opencode-ai/core/flag/flag" import { describe, expect } from "bun:test" import { Context, Effect, Layer, Queue, Ref } from "effect" import { @@ -20,8 +19,6 @@ import { WorkspaceID } from "../../src/control-plane/schema" import type { WorkspaceAdapter } from "../../src/control-plane/types" import { Workspace } from "../../src/control-plane/workspace" import { WorkspaceTable } from "../../src/control-plane/workspace.sql" -import { InstanceBootstrap } from "../../src/project/bootstrap" -import { InstanceStore } from "../../src/project/instance-store" import { Project } from "../../src/project/project" import { WorkspacePaths } from "../../src/server/routes/instance/httpapi/groups/workspace" import { @@ -31,27 +28,22 @@ import { import { HEADER as FenceHeader } from "../../src/server/shared/fence" import { Database } from "../../src/storage/db" import { resetDatabase } from "../fixture/db" +import { workspaceLayerWithRuntimeFlags } from "../fixture/workspace" import { tmpdirScoped } from "../fixture/fixture" import { testEffect } from "../lib/effect" const testStateLayer = Layer.effectDiscard( Effect.gen(function* () { - const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES yield* Effect.promise(() => resetDatabase()) - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true yield* Effect.addFinalizer(() => Effect.promise(async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces await resetDatabase() }), ) }), ) -const workspaceLayer = Workspace.defaultLayer.pipe( - Layer.provide(InstanceStore.defaultLayer), - Layer.provide(InstanceBootstrap.defaultLayer), -) +const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true }) const it = testEffect( Layer.mergeAll( diff --git a/packages/opencode/test/server/negative-tokens-regression.test.ts b/packages/opencode/test/server/negative-tokens-regression.test.ts index 77ad1bc279af..290023ead756 100644 --- a/packages/opencode/test/server/negative-tokens-regression.test.ts +++ b/packages/opencode/test/server/negative-tokens-regression.test.ts @@ -5,11 +5,10 @@ // negative. The pre-fix `safe()` clamp only guarded against non-finite. The // strict `NonNegativeInt` schema then made every load of the message list // fail to encode, killing Desktop boot for every user with such a row. -import { afterEach, describe, expect } from "bun:test" +import { describe, expect } from "bun:test" import { Effect } from "effect" import { eq } from "drizzle-orm" import { ModelID, ProviderID } from "../../src/provider/schema" -import { WithInstance } from "../../src/project/with-instance" import { Server } from "../../src/server/server" import { SessionPaths } from "../../src/server/routes/instance/httpapi/groups/session" import { Session } from "@/session/session" @@ -17,81 +16,66 @@ import { MessageID, PartID } from "../../src/session/schema" import * as Database from "@/storage/db" import { PartTable } from "@/session/session.sql" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { it } from "../lib/effect" +import { TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" -afterEach(async () => { - await disposeAllInstances() - await resetDatabase() -}) +const it = testEffect(Session.defaultLayer) -function seedNegativeTokenSession(directory: string) { - return Effect.promise(async () => - WithInstance.provide({ - directory, - fn: () => - Effect.runPromise( - Effect.gen(function* () { - const session = yield* Session.Service - const info = yield* session.create({}) - const message = yield* session.updateMessage({ - id: MessageID.ascending(), - role: "user", - sessionID: info.id, - agent: "build", - model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, - time: { created: Date.now() }, - }) - const partID = PartID.ascending() - yield* session.updatePart({ - id: partID, - sessionID: info.id, - messageID: message.id, - type: "step-finish", - reason: "stop", - cost: 0, - tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, - }) +function seedNegativeTokenSession() { + return Effect.gen(function* () { + const session = yield* Session.Service + const info = yield* session.create({}) + const message = yield* session.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: info.id, + agent: "build", + model: { providerID: ProviderID.make("test"), modelID: ModelID.make("test") }, + time: { created: Date.now() }, + }) + const partID = PartID.ascending() + yield* session.updatePart({ + id: partID, + sessionID: info.id, + messageID: message.id, + type: "step-finish", + reason: "stop", + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + }) - // Bypass the schema with a direct SQL update to install the - // negative `output` value we want to test loading. - Database.use((db) => - db - .update(PartTable) - .set({ - data: { - type: "step-finish", - reason: "stop", - cost: 0, - tokens: { input: 0, output: -42, reasoning: 0, cache: { read: 0, write: 0 } }, - } as never, - }) - .where(eq(PartTable.id, partID)) - .run(), - ) + // Bypass the schema with a direct SQL update to install the + // negative `output` value we want to test loading. + Database.use((db) => + db + .update(PartTable) + .set({ + data: { + type: "step-finish", + reason: "stop", + cost: 0, + tokens: { input: 0, output: -42, reasoning: 0, cache: { read: 0, write: 0 } }, + } as never, + }) + .where(eq(PartTable.id, partID)) + .run(), + ) - return info.id - }).pipe(Effect.provide(Session.defaultLayer)), - ), - }), - ) + return info.id + }) } describe("messages endpoint tolerates legacy negative token counts", () => { - it.live( + it.instance( "returns 200 even when a step-finish part has tokens.output < 0", - Effect.acquireRelease( - Effect.promise(() => tmpdir({ config: { formatter: false, lsp: false } })), - (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()), - ).pipe( - Effect.flatMap((tmp) => - Effect.gen(function* () { - const sessionID = yield* seedNegativeTokenSession(tmp.path) - const url = `${SessionPaths.messages.replace(":sessionID", sessionID)}?limit=80&directory=${encodeURIComponent(tmp.path)}` - const res = yield* Effect.promise(async () => Server.Default().app.request(url)) - expect(res.status, "messages endpoint 400'd on legacy negative tokens").not.toBe(400) - }), - ), - ), + Effect.gen(function* () { + yield* Effect.addFinalizer(() => Effect.promise(() => resetDatabase())) + const test = yield* TestInstance + const sessionID = yield* seedNegativeTokenSession() + const url = `${SessionPaths.messages.replace(":sessionID", sessionID)}?limit=80&directory=${encodeURIComponent(test.directory)}` + const res = yield* Effect.promise(async () => Server.Default().app.request(url)) + expect(res.status, "messages endpoint 400'd on legacy negative tokens").not.toBe(400) + }), + { git: true, config: { formatter: false, lsp: false } }, ) }) diff --git a/packages/opencode/test/server/project-init-git.test.ts b/packages/opencode/test/server/project-init-git.test.ts index 48e28aa5acc2..c3e77fb2dd83 100644 --- a/packages/opencode/test/server/project-init-git.test.ts +++ b/packages/opencode/test/server/project-init-git.test.ts @@ -1,113 +1,120 @@ -import { afterEach, describe, expect, test } from "bun:test" -import { Effect } from "effect" +import { afterEach, describe, expect } from "bun:test" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Effect, Layer } from "effect" import path from "path" -import { GlobalBus } from "../../src/bus/global" +import { InstanceRef } from "../../src/effect/instance-ref" +import { InstanceBootstrap } from "../../src/project/bootstrap-service" +import { InstanceStore } from "../../src/project/instance-store" +import { GlobalBus, type GlobalEvent } from "../../src/bus/global" import { Snapshot } from "../../src/snapshot" import { Server } from "../../src/server/server" -import { Filesystem } from "@/util/filesystem" import * as Log from "@opencode-ai/core/util/log" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) afterEach(async () => { + await disposeAllInstances() await resetDatabase() }) -const disposedEvents = (seen: { directory?: string; payload: { type: string } }[], dir: string) => +const noopBootstrap = Layer.succeed(InstanceBootstrap.Service, InstanceBootstrap.Service.of({ run: Effect.void })) +const testInstanceStore = InstanceStore.defaultLayer.pipe(Layer.provide(noopBootstrap)) + +const it = testEffect(Layer.mergeAll(AppFileSystem.defaultLayer, Snapshot.defaultLayer, testInstanceStore)) + +function request(directory: string, url: string, init: RequestInit = {}) { + return Effect.promise(() => { + const headers = new Headers(init.headers) + headers.set("x-opencode-directory", directory) + return Promise.resolve(Server.Default().app.request(url, { ...init, headers })) + }) +} + +function json(response: Response) { + return Effect.promise(() => response.json() as Promise) +} + +function collectGlobalEvents() { + return Effect.acquireRelease( + Effect.sync(() => { + const seen: GlobalEvent[] = [] + const on = (event: GlobalEvent) => { + seen.push(event) + } + GlobalBus.on("event", on) + return { seen, on } + }), + ({ on }) => Effect.sync(() => GlobalBus.off("event", on)), + ) +} + +const disposedEvents = (seen: GlobalEvent[], dir: string) => seen.filter((evt) => evt.directory === dir && evt.payload.type === "server.instance.disposed").length describe("project.initGit endpoint", () => { - test("initializes git and reloads immediately", async () => { - await using tmp = await tmpdir() - const app = Server.Default().app - const seen: { directory?: string; payload: { type: string } }[] = [] - const fn = (evt: { directory?: string; payload: { type: string } }) => { - seen.push(evt) - } - GlobalBus.on("event", fn) + it.instance("initializes git and reloads immediately", () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const fs = yield* AppFileSystem.Service + const events = yield* collectGlobalEvents() - try { - const init = await app.request("/project/git/init", { + const init = yield* request(tmp.directory, "/project/git/init", { method: "POST", - headers: { - "x-opencode-directory": tmp.path, - }, }) - const body = await init.json() + const body = yield* json(init) expect(init.status).toBe(200) expect(body).toMatchObject({ id: "global", vcs: "git", - worktree: tmp.path, + worktree: tmp.directory, }) // Reload behavior: bus emits exactly one server.instance.disposed for the directory. - expect(disposedEvents(seen, tmp.path)).toBe(1) - expect(await Filesystem.exists(path.join(tmp.path, ".git", "opencode"))).toBe(false) + expect(disposedEvents(events.seen, tmp.directory)).toBe(1) + expect(yield* fs.exists(path.join(tmp.directory, ".git", "opencode"))).toBe(false) - const current = await app.request("/project/current", { - headers: { - "x-opencode-directory": tmp.path, - }, - }) + const current = yield* request(tmp.directory, "/project/current") expect(current.status).toBe(200) - expect(await current.json()).toMatchObject({ + expect(yield* json(current)).toMatchObject({ id: "global", vcs: "git", - worktree: tmp.path, + worktree: tmp.directory, }) - expect( - await Effect.runPromise( - Snapshot.Service.use((svc) => svc.track()).pipe( - provideInstance(tmp.path), - Effect.provide(Snapshot.defaultLayer), - ), - ), - ).toBeTruthy() - } finally { - await disposeAllInstances() - GlobalBus.off("event", fn) - } - }) + const ctx = yield* InstanceStore.Service.use((store) => store.reload({ directory: tmp.directory })) + const tracked = yield* Snapshot.Service.use((snapshot) => snapshot.track()).pipe( + Effect.provideService(InstanceRef, ctx), + ) + expect(tracked).toBeTruthy() + }), + ) - test("does not reload when the project is already git", async () => { - await using tmp = await tmpdir({ git: true }) - const app = Server.Default().app - const seen: { directory?: string; payload: { type: string } }[] = [] - const fn = (evt: { directory?: string; payload: { type: string } }) => { - seen.push(evt) - } - GlobalBus.on("event", fn) + it.instance( + "does not reload when the project is already git", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const events = yield* collectGlobalEvents() - try { - const init = await app.request("/project/git/init", { - method: "POST", - headers: { - "x-opencode-directory": tmp.path, - }, - }) - expect(init.status).toBe(200) - expect(await init.json()).toMatchObject({ - vcs: "git", - worktree: tmp.path, - }) - expect(disposedEvents(seen, tmp.path)).toBe(0) + const init = yield* request(tmp.directory, "/project/git/init", { + method: "POST", + }) + expect(init.status).toBe(200) + expect(yield* json(init)).toMatchObject({ + vcs: "git", + worktree: tmp.directory, + }) + expect(disposedEvents(events.seen, tmp.directory)).toBe(0) - const current = await app.request("/project/current", { - headers: { - "x-opencode-directory": tmp.path, - }, - }) - expect(current.status).toBe(200) - expect(await current.json()).toMatchObject({ - vcs: "git", - worktree: tmp.path, - }) - } finally { - await disposeAllInstances() - GlobalBus.off("event", fn) - } - }) + const current = yield* request(tmp.directory, "/project/current") + expect(current.status).toBe(200) + expect(yield* json(current)).toMatchObject({ + vcs: "git", + worktree: tmp.directory, + }) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/server/session-actions.test.ts b/packages/opencode/test/server/session-actions.test.ts index 1ccc9bc8e624..44e324b71279 100644 --- a/packages/opencode/test/server/session-actions.test.ts +++ b/packages/opencode/test/server/session-actions.test.ts @@ -1,28 +1,14 @@ -import { afterEach, describe, expect, mock, test } from "bun:test" +import { afterEach, describe, expect, mock } from "bun:test" import { Effect } from "effect" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { Server } from "../../src/server/server" import { Session as SessionNs } from "@/session/session" -import type { SessionID } from "../../src/session/schema" import * as Log from "@opencode-ai/core/util/log" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) -function run(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer))) -} - -const svc = { - ...SessionNs, - create(input?: SessionNs.CreateInput) { - return run(SessionNs.Service.use((svc) => svc.create(input))) - }, - remove(id: SessionID) { - return run(SessionNs.Service.use((svc) => svc.remove(id))) - }, -} +const it = testEffect(SessionNs.defaultLayer) afterEach(async () => { mock.restore() @@ -30,21 +16,28 @@ afterEach(async () => { }) describe("session action routes", () => { - test("abort route returns success", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await svc.create({}) - const app = Server.Default().app - - const res = await app.request(`/session/${session.id}/abort`, { method: "POST" }) + it.instance( + "abort route returns success", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const session = yield* Effect.acquireRelease( + SessionNs.Service.use((svc) => svc.create({})), + (created) => SessionNs.Service.use((svc) => svc.remove(created.id)).pipe(Effect.ignore), + ) + + const res = yield* Effect.promise(() => + Promise.resolve( + Server.Default().app.request(`/session/${session.id}/abort`, { + method: "POST", + headers: { "x-opencode-directory": test.directory }, + }), + ), + ) expect(res.status).toBe(200) - expect(await res.json()).toBe(true) - - await svc.remove(session.id) - }, - }) - }) + expect(yield* Effect.promise(() => res.json())).toBe(true) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/server/session-diff-missing-patch.test.ts b/packages/opencode/test/server/session-diff-missing-patch.test.ts index 5f27a4e2fde1..875c031d57a6 100644 --- a/packages/opencode/test/server/session-diff-missing-patch.test.ts +++ b/packages/opencode/test/server/session-diff-missing-patch.test.ts @@ -10,19 +10,20 @@ * asserts that GET /session//diff returns 200 with the row intact. */ import { afterEach, describe, expect } from "bun:test" -import { Effect } from "effect" +import { Effect, Layer } from "effect" import { Server } from "@/server/server" import { SessionPaths } from "@/server/routes/instance/httpapi/groups/session" import { Session } from "@/session/session" import { Storage } from "@/storage/storage" -import { WithInstance } from "@/project/with-instance" import { resetDatabase } from "../fixture/db" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { it } from "../lib/effect" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" import * as Log from "@opencode-ai/core/util/log" void Log.init({ print: false }) +const it = testEffect(Layer.mergeAll(Session.defaultLayer, Storage.defaultLayer)) + afterEach(async () => { await disposeAllInstances() await resetDatabase() @@ -32,50 +33,46 @@ function pathFor(template: string, params: Record) { return Object.entries(params).reduce((result, [key, value]) => result.replace(`:${key}`, value), template) } +const withSession = (input?: Parameters[0]) => + Effect.acquireRelease( + Session.Service.use((session) => session.create(input)), + (created) => Session.Service.use((session) => session.remove(created.id)).pipe(Effect.ignore), + ) + describe("session diff with missing patch (#26574)", () => { - it.live("GET /session//diff returns 200 when summary_diffs row has no patch", () => - Effect.gen(function* () { - const tmp = yield* Effect.acquireRelease( - Effect.promise(() => tmpdir({ git: true, config: { formatter: false, lsp: false } })), - (t) => Effect.promise(() => t[Symbol.asyncDispose]()), - ) + it.instance( + "GET /session//diff returns 200 when summary_diffs row has no patch", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const session = yield* withSession({ title: "missing-patch" }) - yield* Effect.promise(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await Effect.runPromise( - Effect.provide( - Session.Service.use((s) => s.create({ title: "missing-patch" })), - Session.defaultLayer, - ), - ) + // Mimic legacy/imported on-disk shape: a diff entry with no + // `patch` text. Pre-fix the typed response encoder rejects + // this and returns 400. + yield* Storage.Service.use((storage) => + storage.write(["session_diff", session.id], [{ file: "legacy.txt", additions: 1, deletions: 0 }]), + ) - // Mimic legacy/imported on-disk shape: a diff entry with no - // `patch` text. Pre-fix the typed response encoder rejects - // this and returns 400. - await Effect.runPromise( - Effect.provide( - Storage.Service.use((s) => - s.write(["session_diff", session.id], [{ file: "legacy.txt", additions: 1, deletions: 0 }]), - ), - Storage.defaultLayer, - ), - ) + const response = yield* Effect.promise(() => + Promise.resolve( + Server.Default().app.request(pathFor(SessionPaths.diff, { sessionID: session.id }), { + headers: { "x-opencode-directory": test.directory }, + }), + ), + ) - const headers = { "x-opencode-directory": tmp.path } - const response = await Server.Default().app.request(pathFor(SessionPaths.diff, { sessionID: session.id }), { - headers, - }) - expect(response.status).toBe(200) - const body = (await response.json()) as Array<{ file: string; patch?: string; additions: number }> - expect(body).toHaveLength(1) - expect(body[0]?.file).toBe("legacy.txt") - expect(body[0]?.additions).toBe(1) - expect(body[0]?.patch).toBeUndefined() - }, - }), - ) - }), + expect(response.status).toBe(200) + const body = (yield* Effect.promise(() => response.json())) as Array<{ + file: string + patch?: string + additions: number + }> + expect(body).toHaveLength(1) + expect(body[0]?.file).toBe("legacy.txt") + expect(body[0]?.additions).toBe(1) + expect(body[0]?.patch).toBeUndefined() + }), + { git: true, config: { formatter: false, lsp: false } }, ) }) diff --git a/packages/opencode/test/server/session-list.test.ts b/packages/opencode/test/server/session-list.test.ts index 20478dde844e..ff9e8ef51e30 100644 --- a/packages/opencode/test/server/session-list.test.ts +++ b/packages/opencode/test/server/session-list.test.ts @@ -1,239 +1,233 @@ -import { afterEach, describe, expect, test } from "bun:test" -import { Effect } from "effect" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" +import { afterEach, describe, expect } from "bun:test" +import { Effect, Layer } from "effect" import { Session as SessionNs } from "@/session/session" import * as Log from "@opencode-ai/core/util/log" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" -import { Flag } from "@opencode-ai/core/flag/flag" +import { disposeAllInstances, provideInstance, TestInstance } from "../fixture/fixture" import { mkdir } from "fs/promises" import path from "path" import { Database } from "@/storage/db" import { SessionTable } from "@/session/session.sql" import { eq } from "drizzle-orm" +import { testEffect } from "../lib/effect" +import { Bus } from "@/bus" +import { Storage } from "@/storage/storage" +import { SyncEvent } from "@/sync" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { BackgroundJob } from "@/background/job" +import { SessionGoal } from "@/session/goal" void Log.init({ print: false }) -const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES - -function run(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer))) -} - -const svc = { - ...SessionNs, - create(input?: SessionNs.CreateInput) { - return run(SessionNs.Service.use((svc) => svc.create(input))) - }, - list(input?: SessionNs.ListInput) { - return run(SessionNs.Service.use((svc) => svc.list(input))) - }, -} +const it = testEffect( + SessionNs.layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(Storage.defaultLayer), + Layer.provide(SessionGoal.defaultLayer), + Layer.provide(SyncEvent.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalWorkspaces: false })), + Layer.provide(BackgroundJob.defaultLayer), + ), +) + +const withSession = (input?: Parameters[0]) => + Effect.acquireRelease( + SessionNs.Service.use((session) => session.create(input)), + (created) => SessionNs.Service.use((session) => session.remove(created.id).pipe(Effect.ignore)), + ) afterEach(async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces await disposeAllInstances() }) describe("session.list", () => { - test("does not filter by directory when directory is omitted", async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = false - await using tmp = await tmpdir({ git: true }) - await mkdir(path.join(tmp.path, "packages", "opencode"), { recursive: true }) - await mkdir(path.join(tmp.path, "packages", "app"), { recursive: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const root = await svc.create({ title: "root" }) - - const parent = await WithInstance.provide({ - directory: path.join(tmp.path, "packages"), - fn: async () => svc.create({ title: "parent" }), - }) - const current = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "opencode"), - fn: async () => svc.create({ title: "current" }), - }) - const sibling = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "app"), - fn: async () => svc.create({ title: "sibling" }), - }) - - const ids = (await svc.list()).map((s) => s.id) + it.instance( + "does not filter by directory when directory is omitted", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => mkdir(path.join(test.directory, "packages", "opencode"), { recursive: true })) + yield* Effect.promise(() => mkdir(path.join(test.directory, "packages", "app"), { recursive: true })) + + const root = yield* withSession({ title: "root" }) + const parent = yield* withSession({ title: "parent" }).pipe( + provideInstance(path.join(test.directory, "packages")), + ) + const current = yield* withSession({ title: "current" }).pipe( + provideInstance(path.join(test.directory, "packages", "opencode")), + ) + const sibling = yield* withSession({ title: "sibling" }).pipe( + provideInstance(path.join(test.directory, "packages", "app")), + ) + + const ids = (yield* SessionNs.Service.use((session) => session.list())).map((session) => session.id) expect(ids).toContain(root.id) expect(ids).toContain(parent.id) expect(ids).toContain(current.id) expect(ids).toContain(sibling.id) - }, - }) - }) - - test("filters by directory when directory is provided", async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = false - await using tmp = await tmpdir({ git: true }) - await mkdir(path.join(tmp.path, "packages", "opencode"), { recursive: true }) - await mkdir(path.join(tmp.path, "packages", "app"), { recursive: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const root = await svc.create({ title: "root" }) - - const parent = await WithInstance.provide({ - directory: path.join(tmp.path, "packages"), - fn: async () => svc.create({ title: "parent" }), - }) - const current = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "opencode"), - fn: async () => svc.create({ title: "current" }), - }) - const sibling = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "app"), - fn: async () => svc.create({ title: "sibling" }), - }) - - const ids = (await svc.list({ directory: path.join(tmp.path, "packages", "opencode") })).map((s) => s.id) + }), + { git: true }, + ) + + it.instance( + "filters by directory when directory is provided", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => mkdir(path.join(test.directory, "packages", "opencode"), { recursive: true })) + yield* Effect.promise(() => mkdir(path.join(test.directory, "packages", "app"), { recursive: true })) + + const root = yield* withSession({ title: "root" }) + const parent = yield* withSession({ title: "parent" }).pipe( + provideInstance(path.join(test.directory, "packages")), + ) + const current = yield* withSession({ title: "current" }).pipe( + provideInstance(path.join(test.directory, "packages", "opencode")), + ) + const sibling = yield* withSession({ title: "sibling" }).pipe( + provideInstance(path.join(test.directory, "packages", "app")), + ) + + const ids = (yield* SessionNs.Service.use((session) => + session.list({ directory: path.join(test.directory, "packages", "opencode") }), + )).map((session) => session.id) expect(ids).not.toContain(root.id) expect(ids).not.toContain(parent.id) expect(ids).toContain(current.id) expect(ids).not.toContain(sibling.id) - }, - }) - }) - - test("filters by path and ignores directory when path is provided", async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = false - await using tmp = await tmpdir({ git: true }) - await mkdir(path.join(tmp.path, "packages", "opencode", "src", "deep"), { recursive: true }) - await mkdir(path.join(tmp.path, "packages", "app"), { recursive: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const parent = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "opencode"), - fn: async () => svc.create({ title: "parent" }), - }) - const current = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "opencode", "src"), - fn: async () => svc.create({ title: "current" }), - }) - const deeper = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "opencode", "src", "deep"), - fn: async () => svc.create({ title: "deeper" }), - }) - const sibling = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "app"), - fn: async () => svc.create({ title: "sibling" }), - }) - - const pathIDs = ( - await svc.list({ - directory: path.join(tmp.path, "packages", "app"), + }), + { git: true }, + ) + + it.instance( + "filters by path and ignores directory when path is provided", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + mkdir(path.join(test.directory, "packages", "opencode", "src", "deep"), { recursive: true }), + ) + yield* Effect.promise(() => mkdir(path.join(test.directory, "packages", "app"), { recursive: true })) + + const parent = yield* withSession({ title: "parent" }).pipe( + provideInstance(path.join(test.directory, "packages", "opencode")), + ) + const current = yield* withSession({ title: "current" }).pipe( + provideInstance(path.join(test.directory, "packages", "opencode", "src")), + ) + const deeper = yield* withSession({ title: "deeper" }).pipe( + provideInstance(path.join(test.directory, "packages", "opencode", "src", "deep")), + ) + const sibling = yield* withSession({ title: "sibling" }).pipe( + provideInstance(path.join(test.directory, "packages", "app")), + ) + + const pathIDs = (yield* SessionNs.Service.use((session) => + session.list({ + directory: path.join(test.directory, "packages", "app"), path: "packages/opencode/src", - }) - ).map((s) => s.id) + }), + )).map((session) => session.id) expect(pathIDs).not.toContain(parent.id) expect(pathIDs).toContain(current.id) expect(pathIDs).toContain(deeper.id) expect(pathIDs).not.toContain(sibling.id) - }, - }) - }) - - test("falls back to directory when filtering legacy sessions without path", async () => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = false - await using tmp = await tmpdir({ git: true }) - await mkdir(path.join(tmp.path, "packages", "opencode", "src"), { recursive: true }) - await mkdir(path.join(tmp.path, "packages", "app"), { recursive: true }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const current = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "opencode", "src"), - fn: async () => svc.create({ title: "legacy-current" }), - }) - const sibling = await WithInstance.provide({ - directory: path.join(tmp.path, "packages", "app"), - fn: async () => svc.create({ title: "legacy-sibling" }), - }) - - Database.use((db) => db.update(SessionTable).set({ path: null }).where(eq(SessionTable.id, current.id)).run()) - Database.use((db) => db.update(SessionTable).set({ path: null }).where(eq(SessionTable.id, sibling.id)).run()) - - const pathIDs = ( - await svc.list({ - directory: path.join(tmp.path, "packages", "opencode", "src"), + }), + { git: true }, + ) + + it.instance( + "falls back to directory when filtering legacy sessions without path", + () => + Effect.gen(function* () { + const test = yield* TestInstance + yield* Effect.promise(() => + mkdir(path.join(test.directory, "packages", "opencode", "src"), { recursive: true }), + ) + yield* Effect.promise(() => mkdir(path.join(test.directory, "packages", "app"), { recursive: true })) + + const current = yield* withSession({ title: "legacy-current" }).pipe( + provideInstance(path.join(test.directory, "packages", "opencode", "src")), + ) + const sibling = yield* withSession({ title: "legacy-sibling" }).pipe( + provideInstance(path.join(test.directory, "packages", "app")), + ) + + yield* Effect.sync(() => + Database.use((db) => + db.update(SessionTable).set({ path: null }).where(eq(SessionTable.id, current.id)).run(), + ), + ) + yield* Effect.sync(() => + Database.use((db) => + db.update(SessionTable).set({ path: null }).where(eq(SessionTable.id, sibling.id)).run(), + ), + ) + + const pathIDs = (yield* SessionNs.Service.use((session) => + session.list({ + directory: path.join(test.directory, "packages", "opencode", "src"), path: "packages/opencode/src", - }) - ).map((s) => s.id) + }), + )).map((session) => session.id) expect(pathIDs).toContain(current.id) expect(pathIDs).not.toContain(sibling.id) - }, - }) - }) + }), + { git: true }, + ) - test("filters root sessions", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const root = await svc.create({ title: "root-session" }) - const child = await svc.create({ title: "child-session", parentID: root.id }) + it.instance( + "filters root sessions", + () => + Effect.gen(function* () { + const root = yield* withSession({ title: "root-session" }) + const child = yield* withSession({ title: "child-session", parentID: root.id }) - const sessions = await svc.list({ roots: true }) - const ids = sessions.map((s) => s.id) + const sessions = yield* SessionNs.Service.use((session) => session.list({ roots: true })) + const ids = sessions.map((session) => session.id) expect(ids).toContain(root.id) expect(ids).not.toContain(child.id) - }, - }) - }) - - test("filters by start time", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await svc.create({ title: "new-session" }) - const futureStart = Date.now() + 86400000 - - const sessions = await svc.list({ start: futureStart }) + }), + { git: true }, + ) + + it.instance( + "filters by start time", + () => + Effect.gen(function* () { + yield* withSession({ title: "new-session" }) + const sessions = yield* SessionNs.Service.use((session) => session.list({ start: Date.now() + 86400000 })) expect(sessions.length).toBe(0) - }, - }) - }) + }), + { git: true }, + ) - test("filters by search term", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await svc.create({ title: "unique-search-term-abc" }) - await svc.create({ title: "other-session-xyz" }) + it.instance( + "filters by search term", + () => + Effect.gen(function* () { + yield* withSession({ title: "unique-search-term-abc" }) + yield* withSession({ title: "other-session-xyz" }) - const sessions = await svc.list({ search: "unique-search" }) - const titles = sessions.map((s) => s.title) + const sessions = yield* SessionNs.Service.use((session) => session.list({ search: "unique-search" })) + const titles = sessions.map((session) => session.title) expect(titles).toContain("unique-search-term-abc") expect(titles).not.toContain("other-session-xyz") - }, - }) - }) - - test("respects limit parameter", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await svc.create({ title: "session-1" }) - await svc.create({ title: "session-2" }) - await svc.create({ title: "session-3" }) - - const sessions = await svc.list({ limit: 2 }) + }), + { git: true }, + ) + + it.instance( + "respects limit parameter", + () => + Effect.gen(function* () { + yield* withSession({ title: "session-1" }) + yield* withSession({ title: "session-2" }) + yield* withSession({ title: "session-3" }) + + const sessions = yield* SessionNs.Service.use((session) => session.list({ limit: 2 })) expect(sessions.length).toBe(2) - }, - }) - }) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/server/session-messages.test.ts b/packages/opencode/test/server/session-messages.test.ts index f5ee5bdcb0ec..e603accbbecd 100644 --- a/packages/opencode/test/server/session-messages.test.ts +++ b/packages/opencode/test/server/session-messages.test.ts @@ -1,191 +1,179 @@ -import { afterEach, describe, expect, test } from "bun:test" +import { afterEach, describe, expect } from "bun:test" import { Effect } from "effect" -import { WithInstance } from "../../src/project/with-instance" import { Server } from "../../src/server/server" import { Session as SessionNs } from "@/session/session" import { MessageV2 } from "../../src/session/message-v2" +import { ModelID, ProviderID } from "../../src/provider/schema" import { MessageID, PartID, type SessionID } from "../../src/session/schema" import * as Log from "@opencode-ai/core/util/log" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) -function run(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer))) -} +const it = testEffect(SessionNs.defaultLayer) -const svc = { - ...SessionNs, - create(input?: SessionNs.CreateInput) { - return run(SessionNs.Service.use((svc) => svc.create(input))) - }, - remove(id: SessionID) { - return run(SessionNs.Service.use((svc) => svc.remove(id))) - }, - updateMessage(msg: T) { - return run(SessionNs.Service.use((svc) => svc.updateMessage(msg))) - }, - updatePart(part: T) { - return run(SessionNs.Service.use((svc) => svc.updatePart(part))) - }, +const model = { + providerID: ProviderID.make("test"), + modelID: ModelID.make("test"), } afterEach(async () => { await disposeAllInstances() }) -async function withoutWatcher(fn: () => Promise) { - if (process.platform !== "win32") return fn() - const prev = process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER - process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER = "true" - try { - return await fn() - } finally { - if (prev === undefined) delete process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER - else process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER = prev - } +const withoutWatcher = (effect: Effect.Effect) => { + if (process.platform !== "win32") return effect + return Effect.acquireUseRelease( + Effect.sync(() => { + const previous = process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER + process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER = "true" + return previous + }), + () => effect, + (previous) => + Effect.sync(() => { + if (previous === undefined) delete process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER + else process.env.OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER = previous + }), + ) +} + +const sessionScoped = Effect.acquireRelease( + SessionNs.Service.use((svc) => svc.create({})), + (session) => SessionNs.Service.use((svc) => svc.remove(session.id)).pipe(Effect.ignore), +) + +const fill = Effect.fn("SessionMessagesTest.fill")(function* ( + sessionID: SessionID, + count: number, + time = (i: number) => Date.now() + i, +) { + const session = yield* SessionNs.Service + return yield* Effect.forEach( + Array.from({ length: count }, (_, i) => i), + (i) => + Effect.gen(function* () { + const id = MessageID.ascending() + yield* session.updateMessage({ + id, + sessionID, + role: "user", + time: { created: time(i) }, + agent: "test", + model, + tools: {}, + } satisfies MessageV2.User) + yield* session.updatePart({ + id: PartID.ascending(), + sessionID, + messageID: id, + type: "text", + text: `m${i}`, + } satisfies MessageV2.TextPart) + return id + }), + ) +}) + +function request(path: string) { + return Effect.promise(() => Promise.resolve(Server.Default().app.request(path))) } -async function fill(sessionID: SessionID, count: number, time = (i: number) => Date.now() + i) { - const ids = [] as MessageID[] - for (let i = 0; i < count; i++) { - const id = MessageID.ascending() - ids.push(id) - await svc.updateMessage({ - id, - sessionID, - role: "user", - time: { created: time(i) }, - agent: "test", - model: { providerID: "test", modelID: "test" }, - tools: {}, - mode: "", - } as unknown as MessageV2.Info) - await svc.updatePart({ - id: PartID.ascending(), - sessionID, - messageID: id, - type: "text", - text: `m${i}`, - }) - } - return ids +function json(response: Response) { + return Effect.promise(() => response.json() as Promise) } describe("session messages endpoint", () => { - test("returns cursor headers for older pages", async () => { - await using tmp = await tmpdir({ git: true }) - await withoutWatcher(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 5) - const app = Server.Default().app - - const a = await app.request(`/session/${session.id}/message?limit=2`) - expect(a.status).toBe(200) - const aBody = (await a.json()) as MessageV2.WithParts[] - expect(aBody.map((item) => item.info.id)).toEqual(ids.slice(-2)) - const cursor = a.headers.get("x-next-cursor") - expect(cursor).toBeTruthy() - expect(a.headers.get("link")).toContain('rel="next"') - - const b = await app.request(`/session/${session.id}/message?limit=2&before=${encodeURIComponent(cursor!)}`) - expect(b.status).toBe(200) - const bBody = (await b.json()) as MessageV2.WithParts[] - expect(bBody.map((item) => item.info.id)).toEqual(ids.slice(-4, -2)) - - await svc.remove(session.id) - }, + it.instance( + "returns cursor headers for older pages", + withoutWatcher( + Effect.gen(function* () { + const session = yield* sessionScoped + const ids = yield* fill(session.id, 5) + + const a = yield* request(`/session/${session.id}/message?limit=2`) + expect(a.status).toBe(200) + const aBody = yield* json(a) + expect(aBody.map((item) => item.info.id)).toEqual(ids.slice(-2)) + const cursor = a.headers.get("x-next-cursor") + expect(cursor).toBeTruthy() + expect(a.headers.get("link")).toContain('rel="next"') + + const b = yield* request(`/session/${session.id}/message?limit=2&before=${encodeURIComponent(cursor!)}`) + expect(b.status).toBe(200) + const bBody = yield* json(b) + expect(bBody.map((item) => item.info.id)).toEqual(ids.slice(-4, -2)) }), - ) - }) - - test("keeps full-history responses when limit is omitted", async () => { - await using tmp = await tmpdir({ git: true }) - await withoutWatcher(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 3) - const app = Server.Default().app - - const res = await app.request(`/session/${session.id}/message`) - expect(res.status).toBe(200) - const body = (await res.json()) as MessageV2.WithParts[] - expect(body.map((item) => item.info.id)).toEqual(ids) - - await svc.remove(session.id) - }, + ), + { git: true }, + ) + + it.instance( + "keeps full-history responses when limit is omitted", + withoutWatcher( + Effect.gen(function* () { + const session = yield* sessionScoped + const ids = yield* fill(session.id, 3) + + const res = yield* request(`/session/${session.id}/message`) + expect(res.status).toBe(200) + const body = yield* json(res) + expect(body.map((item) => item.info.id)).toEqual(ids) }), - ) - }) - - test("rejects invalid cursors and missing sessions", async () => { - await using tmp = await tmpdir({ git: true }) - await withoutWatcher(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await svc.create({}) - const app = Server.Default().app - - const bad = await app.request(`/session/${session.id}/message?limit=2&before=bad`) - expect(bad.status).toBe(400) - - const miss = await app.request(`/session/ses_missing/message?limit=2`) - expect(miss.status).toBe(404) - - await svc.remove(session.id) - }, + ), + { git: true }, + ) + + it.instance( + "rejects invalid cursors and missing sessions", + withoutWatcher( + Effect.gen(function* () { + const session = yield* sessionScoped + + const bad = yield* request(`/session/${session.id}/message?limit=2&before=bad`) + expect(bad.status).toBe(400) + + const miss = yield* request(`/session/ses_missing/message?limit=2`) + expect(miss.status).toBe(404) }), - ) - }) - - test("does not truncate large legacy limit requests", async () => { - await using tmp = await tmpdir({ git: true }) - await withoutWatcher(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 520) - const app = Server.Default().app - - const res = await app.request(`/session/${session.id}/message?limit=510`) - expect(res.status).toBe(200) - const body = (await res.json()) as MessageV2.WithParts[] - expect(body).toHaveLength(510) - - await svc.remove(session.id) - }, + ), + { git: true }, + ) + + it.instance( + "does not truncate large legacy limit requests", + withoutWatcher( + Effect.gen(function* () { + const session = yield* sessionScoped + yield* fill(session.id, 520) + + const res = yield* request(`/session/${session.id}/message?limit=510`) + expect(res.status).toBe(200) + const body = yield* json(res) + expect(body).toHaveLength(510) }), - ) - }) - - test("accepts directory query used by workspace routing", async () => { - await using tmp = await tmpdir({ git: true }) - await withoutWatcher(() => - WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 1) - const app = Server.Default().app - - const res = await app.request( - `/session/${session.id}/message?limit=80&directory=${encodeURIComponent(tmp.path)}`, - ) - expect(res.status).toBe(200) - const body = await res.json() - expect(Array.isArray(body)).toBe(true) - expect(body).toHaveLength(1) - - await svc.remove(session.id) - }, + ), + { git: true }, + ) + + it.instance( + "accepts directory query used by workspace routing", + withoutWatcher( + Effect.gen(function* () { + const tmp = yield* TestInstance + const session = yield* sessionScoped + yield* fill(session.id, 1) + + const res = yield* request( + `/session/${session.id}/message?limit=80&directory=${encodeURIComponent(tmp.directory)}`, + ) + expect(res.status).toBe(200) + const body = yield* json(res) + expect(Array.isArray(body)).toBe(true) + expect(body).toHaveLength(1) }), - ) - }) + ), + { git: true }, + ) }) diff --git a/packages/opencode/test/server/session-select.test.ts b/packages/opencode/test/server/session-select.test.ts index 13edca14584e..9e24ed0ecc5b 100644 --- a/packages/opencode/test/server/session-select.test.ts +++ b/packages/opencode/test/server/session-select.test.ts @@ -1,101 +1,93 @@ -import { afterEach, describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import { Effect } from "effect" -import { Session as SessionNs } from "@/session/session" -import type { SessionID } from "../../src/session/schema" +import { Session } from "@/session/session" import * as Log from "@opencode-ai/core/util/log" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { Server } from "../../src/server/server" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { TestInstance } from "../fixture/fixture" +import { testEffect } from "../lib/effect" void Log.init({ print: false }) -function run(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer))) -} - -const svc = { - ...SessionNs, - create(input?: SessionNs.CreateInput) { - return run(SessionNs.Service.use((svc) => svc.create(input))) - }, - remove(id: SessionID) { - return run(SessionNs.Service.use((svc) => svc.remove(id))) - }, -} - -afterEach(async () => { - await disposeAllInstances() -}) +const it = testEffect(Session.defaultLayer) describe("tui.selectSession endpoint", () => { - test("should return 200 when called with valid session", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // #given - const session = await svc.create({}) + it.instance( + "should return 200 when called with valid session", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance + const session = yield* Session.Service.use((svc) => svc.create({})) - // #when const app = Server.Default().app - const response = await app.request("/tui/select-session", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ sessionID: session.id }), - }) + const response = yield* Effect.promise(() => + Promise.resolve( + app.request("/tui/select-session", { + method: "POST", + headers: { + "Content-Type": "application/json", + "x-opencode-directory": tmp.directory, + }, + body: JSON.stringify({ sessionID: session.id }), + }), + ), + ) - // #then expect(response.status).toBe(200) - const body = await response.json() + const body = yield* Effect.promise(() => response.json()) expect(body).toBe(true) + }), + { git: true }, + ) - await svc.remove(session.id) - }, - }) - }) - - test("should return 404 when session does not exist", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // #given + it.instance( + "should return 404 when session does not exist", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance const nonExistentSessionID = "ses_nonexistent123" - // #when const app = Server.Default().app - const response = await app.request("/tui/select-session", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ sessionID: nonExistentSessionID }), - }) + const response = yield* Effect.promise(() => + Promise.resolve( + app.request("/tui/select-session", { + method: "POST", + headers: { + "Content-Type": "application/json", + "x-opencode-directory": tmp.directory, + }, + body: JSON.stringify({ sessionID: nonExistentSessionID }), + }), + ), + ) - // #then expect(response.status).toBe(404) - }, - }) - }) + }), + { git: true }, + ) - test("should return 400 when session ID format is invalid", async () => { - await using tmp = await tmpdir({ git: true }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // #given + it.instance( + "should return 400 when session ID format is invalid", + () => + Effect.gen(function* () { + const tmp = yield* TestInstance const invalidSessionID = "invalid_session_id" - // #when const app = Server.Default().app - const response = await app.request("/tui/select-session", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ sessionID: invalidSessionID }), - }) + const response = yield* Effect.promise(() => + Promise.resolve( + app.request("/tui/select-session", { + method: "POST", + headers: { + "Content-Type": "application/json", + "x-opencode-directory": tmp.directory, + }, + body: JSON.stringify({ sessionID: invalidSessionID }), + }), + ), + ) - // #then expect(response.status).toBe(400) - }, - }) - }) + }), + { git: true }, + ) }) diff --git a/packages/opencode/test/server/worktree-endpoint-repro.test.ts b/packages/opencode/test/server/worktree-endpoint-repro.test.ts index e95d706d5468..747393bbd2eb 100644 --- a/packages/opencode/test/server/worktree-endpoint-repro.test.ts +++ b/packages/opencode/test/server/worktree-endpoint-repro.test.ts @@ -1,13 +1,14 @@ import { describe, expect } from "bun:test" -import { Effect, Layer } from "effect" +import { Effect, Layer, Queue } from "effect" import { HttpRouter } from "effect/unstable/http" import { Flag } from "@opencode-ai/core/flag/flag" -import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server" +import { GlobalBus, type GlobalEvent } from "@/bus/global" +import { Worktree } from "@/worktree" +import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server" import { ExperimentalPaths } from "../../src/server/routes/instance/httpapi/groups/experimental" import { WorkspacePaths } from "../../src/server/routes/instance/httpapi/groups/workspace" -import { withTimeout } from "../../src/util/timeout" import { resetDatabase } from "../fixture/db" -import { TestInstance } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" const stateLayer = Layer.effectDiscard( @@ -28,30 +29,127 @@ const stateLayer = Layer.effectDiscard( ) const it = testEffect(stateLayer) +const worktreeTest = process.platform === "win32" ? it.instance.skip : it.instance type TestServer = ReturnType +type CreatedWorktree = { directory: string } +type ScopedWorktree = { directory: string; body: CreatedWorktree; ready: Effect.Effect } function serverScoped() { return Effect.acquireRelease( - Effect.sync(() => HttpRouter.toWebHandler(ExperimentalHttpApiServer.routes, { disableLogger: true })), + Effect.sync(() => HttpRouter.toWebHandler(HttpApiApp.routes, { disableLogger: true })), (server) => Effect.promise(() => server.dispose()).pipe(Effect.ignore), ) } function request(server: TestServer, input: string, init?: RequestInit) { - return Effect.promise(() => - server.handler(new Request(new URL(input, "http://localhost"), init), ExperimentalHttpApiServer.context), - ) + return Effect.promise(() => server.handler(new Request(new URL(input, "http://localhost"), init), HttpApiApp.context)) } function withRequestTimeout(effect: Effect.Effect, label: string, ms = 5_000) { - return Effect.promise(() => withTimeout(Effect.runPromise(effect), ms, label)) + return effect.pipe( + Effect.timeoutOrElse({ + duration: `${ms} millis`, + orElse: () => Effect.fail(new Error(`${label} timed out after ${ms}ms`)), + }), + ) +} + +function json(response: Response) { + return Effect.promise(() => response.json() as Promise) +} + +function readyWatcher() { + return Effect.gen(function* () { + const events = yield* Queue.bounded(1) + const on = (event: GlobalEvent) => { + if (event.payload.type === Worktree.Event.Ready.type) Queue.offerUnsafe(events, event) + } + + GlobalBus.on("event", on) + yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on))) + + return (directory: string) => + Effect.gen(function* () { + while (true) { + const event = yield* Queue.take(events) + if (event.directory === directory) return + } + }).pipe( + Effect.timeoutOrElse({ + duration: "10 seconds", + orElse: () => Effect.fail(new Error(`timed out waiting for worktree.ready: ${directory}`)), + }), + ) + }) +} + +function removeCreatedWorktree(input: { + server: TestServer + rootDirectory: string + worktreeDirectory: string + ready: Effect.Effect +}) { + return Effect.gen(function* () { + yield* input.ready.pipe(Effect.timeout("1 second"), Effect.ignore) + yield* Effect.promise(() => disposeAllInstances()).pipe(Effect.ignore) + + const removed = yield* request( + input.server, + `${ExperimentalPaths.worktree}?directory=${encodeURIComponent(input.rootDirectory)}`, + { + method: "DELETE", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ directory: input.worktreeDirectory }), + }, + ) + if (removed.status !== 200) { + const message = yield* Effect.promise(() => removed.text()) + throw new Error(`failed to remove worktree: ${removed.status} ${message}`) + } + const ok = yield* json(removed) + if (!ok) throw new Error(`failed to remove worktree ${input.worktreeDirectory}`) + }) +} + +function createWorktreeScoped(input: { + server: TestServer + directory: string + path: string + init: RequestInit + timeoutLabel: string + timeoutMs?: number +}) { + return Effect.acquireRelease( + Effect.gen(function* () { + const waitReady = yield* readyWatcher() + const response = yield* withRequestTimeout( + request(input.server, input.path, input.init), + input.timeoutLabel, + input.timeoutMs, + ) + if (response.status !== 200) { + const message = yield* Effect.promise(() => response.text()) + throw new Error(`${input.timeoutLabel} failed: ${response.status} ${message}`) + } + expect(response.status).toBe(200) + const body = yield* json(response) + return { directory: body.directory, body, ready: waitReady(body.directory) } satisfies ScopedWorktree + }), + (created) => + removeCreatedWorktree({ + server: input.server, + rootDirectory: input.directory, + worktreeDirectory: created.directory, + ready: created.ready, + }).pipe(Effect.orDie), + ).pipe(Effect.map((created) => created.body)) } function setProjectStartCommand(input: { server: TestServer; directory: string; command: string }) { return Effect.gen(function* () { const current = yield* request(input.server, `/project/current?directory=${encodeURIComponent(input.directory)}`) expect(current.status).toBe(200) - const project = (yield* Effect.promise(() => current.json())) as { id: string } + const project = yield* json<{ id: string }>(current) const updated = yield* request( input.server, `/project/${project.id}?directory=${encodeURIComponent(input.directory)}`, @@ -66,47 +164,91 @@ function setProjectStartCommand(input: { server: TestServer; directory: string; } describe("worktree endpoint reproduction", () => { - it.instance( + worktreeTest( "direct HttpApi worktree create returns without waiting for boot", () => Effect.gen(function* () { const test = yield* TestInstance const server = yield* serverScoped() - const response = yield* withRequestTimeout( - request(server, `${ExperimentalPaths.worktree}?directory=${encodeURIComponent(test.directory)}`, { + const response = yield* createWorktreeScoped({ + server, + directory: test.directory, + path: `${ExperimentalPaths.worktree}?directory=${encodeURIComponent(test.directory)}`, + init: { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({}), - }), - "direct worktree create", - ) + }, + timeoutLabel: "direct worktree create", + }) - expect(response.status).toBe(200) - expect(yield* Effect.promise(() => response.json())).toMatchObject({ directory: expect.any(String) }) + expect(response).toMatchObject({ directory: expect.any(String) }) }), { git: true }, ) - it.instance( + worktreeTest( + "direct HttpApi worktree create accepts missing body", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const server = yield* serverScoped() + + const response = yield* createWorktreeScoped({ + server, + directory: test.directory, + path: `${ExperimentalPaths.worktree}?directory=${encodeURIComponent(test.directory)}`, + init: { method: "POST", headers: { "content-type": "application/json" } }, + timeoutLabel: "direct worktree create without body", + }) + + expect(response).toMatchObject({ directory: expect.any(String) }) + }), + { git: true }, + ) + + worktreeTest( + "direct HttpApi worktree create accepts missing content type and body", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const server = yield* serverScoped() + + const response = yield* createWorktreeScoped({ + server, + directory: test.directory, + path: `${ExperimentalPaths.worktree}?directory=${encodeURIComponent(test.directory)}`, + init: { method: "POST" }, + timeoutLabel: "direct worktree create without content type or body", + }) + + expect(response).toMatchObject({ directory: expect.any(String) }) + }), + { git: true }, + ) + + worktreeTest( "workspace worktree create does not hang", () => Effect.gen(function* () { const test = yield* TestInstance const server = yield* serverScoped() - const response = yield* withRequestTimeout( - request(server, `${WorkspacePaths.list}?directory=${encodeURIComponent(test.directory)}`, { + const response = yield* createWorktreeScoped({ + server, + directory: test.directory, + path: `${WorkspacePaths.list}?directory=${encodeURIComponent(test.directory)}`, + init: { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ type: "worktree", branch: null }), - }), - "workspace worktree create", - 8_000, - ) + }, + timeoutLabel: "workspace worktree create", + timeoutMs: 8_000, + }) - expect(response.status).toBe(200) - expect(yield* Effect.promise(() => response.json())).toMatchObject({ + expect(response).toMatchObject({ type: "worktree", directory: expect.any(String), }) @@ -114,7 +256,7 @@ describe("worktree endpoint reproduction", () => { { git: true }, ) - it.instance( + worktreeTest( "workspace worktree create returns without waiting for project start command", () => Effect.gen(function* () { @@ -127,17 +269,19 @@ describe("worktree endpoint reproduction", () => { }) const started = Date.now() - const response = yield* withRequestTimeout( - request(server, `${WorkspacePaths.list}?directory=${encodeURIComponent(test.directory)}`, { + yield* createWorktreeScoped({ + server, + directory: test.directory, + path: `${WorkspacePaths.list}?directory=${encodeURIComponent(test.directory)}`, + init: { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ type: "worktree", branch: null }), - }), - "workspace worktree create with project start command", - 6_000, - ) + }, + timeoutLabel: "workspace worktree create with project start command", + timeoutMs: 6_000, + }) - expect(response.status).toBe(200) expect(Date.now() - started).toBeLessThan(1_500) }), { git: true }, diff --git a/packages/opencode/test/session/compaction.test.ts b/packages/opencode/test/session/compaction.test.ts index c7f349d5cea0..2bc9b196216d 100644 --- a/packages/opencode/test/session/compaction.test.ts +++ b/packages/opencode/test/session/compaction.test.ts @@ -28,6 +28,8 @@ import { testEffect } from "../lib/effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { TestConfig } from "../fixture/config" import { SyncEvent } from "@/sync" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { EventV2Bridge } from "@/event-v2-bridge" void Log.init({ print: false }) @@ -225,6 +227,8 @@ const deps = Layer.mergeAll( Bus.layer, Config.defaultLayer, SyncEvent.defaultLayer, + RuntimeFlags.layer({ experimentalEventSystem: true }), + EventV2Bridge.defaultLayer, ) const env = Layer.mergeAll( @@ -257,6 +261,7 @@ function compactionProcessLayer(options?: CompactionProcessOptions) { ? SessionProcessorModule.SessionProcessor.layer.pipe( Layer.provide(summary), Layer.provide(Image.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), Layer.provide(status), ) : layer(options?.result ?? "continue") @@ -272,6 +277,8 @@ function compactionProcessLayer(options?: CompactionProcessOptions) { Layer.provide(bus), Layer.provide(options?.config ?? Config.defaultLayer), Layer.provide(SyncEvent.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), + Layer.provide(EventV2Bridge.defaultLayer), ) } @@ -926,12 +933,12 @@ describe("session.compaction.process", () => { ) itCompaction.instance( - "does not persist tail_start_id for serialized recent turns", + "persists tail_start_id for retained recent turns", Effect.gen(function* () { const ssn = yield* SessionNs.Service const session = yield* ssn.create({}) yield* createUserMessage(session.id, "first") - yield* createUserMessage(session.id, "second") + const keep = yield* createUserMessage(session.id, "second") yield* createUserMessage(session.id, "third") yield* createSummaryCompaction(session.id) @@ -947,18 +954,18 @@ describe("session.compaction.process", () => { const part = yield* readCompactionPart(session.id) expect(part?.type).toBe("compaction") - expect(part?.tail_start_id).toBeUndefined() + expect(part?.tail_start_id).toBe(keep.id) }).pipe(withCompaction({ config: cfg({ tail_turns: 2, preserve_recent_tokens: 10_000 }) })), ) itCompaction.instance( - "does not persist tail_start_id when shrinking serialized tail", + "shrinks retained tail to fit preserve token budget", Effect.gen(function* () { const ssn = yield* SessionNs.Service const session = yield* ssn.create({}) yield* createUserMessage(session.id, "first") yield* createUserMessage(session.id, "x".repeat(2_000)) - yield* createUserMessage(session.id, "tiny") + const keep = yield* createUserMessage(session.id, "tiny") yield* createSummaryCompaction(session.id) const msgs = yield* ssn.messages({ sessionID: session.id }) @@ -973,7 +980,7 @@ describe("session.compaction.process", () => { const part = yield* readCompactionPart(session.id) expect(part?.type).toBe("compaction") - expect(part?.tail_start_id).toBeUndefined() + expect(part?.tail_start_id).toBe(keep.id) }).pipe(withCompaction({ config: cfg({ tail_turns: 2, preserve_recent_tokens: 100 }) })), ) @@ -1005,7 +1012,7 @@ describe("session.compaction.process", () => { ) itCompaction.instance( - "serializes retained tail media as text in the summary input", + "falls back to full summary when retained tail media exceeds preserve token budget", () => { const stub = llm() let captured = "" @@ -1078,16 +1085,15 @@ describe("session.compaction.process", () => { const part = yield* readCompactionPart(session.id) expect(part?.type).toBe("compaction") - expect(part?.tail_start_id).toBeUndefined() + expect(part?.tail_start_id).toBe(keep.id) expect(captured).toContain("zzzz") - expect(captured).toContain("keep tail") + expect(captured).not.toContain("keep tail") const filtered = MessageV2.filterCompacted(MessageV2.stream(session.id)) - expect(filtered.map((msg) => msg.info.id)).toEqual([parent!, expect.any(String)]) + expect(filtered.map((msg) => msg.info.id).slice(0, 3)).toEqual([parent!, expect.any(String), keep.id]) expect(filtered[1]?.info.role).toBe("assistant") expect(filtered[1]?.info.role === "assistant" ? filtered[1].info.summary : false).toBe(true) expect(filtered.map((msg) => msg.info.id)).not.toContain(large.id) - expect(filtered.map((msg) => msg.info.id)).not.toContain(keep.id) }).pipe(withCompaction({ llm: stub.layer, config: cfg({ tail_turns: 1, preserve_recent_tokens: 100 }) })) }, { git: true }, @@ -1354,13 +1360,13 @@ describe("session.compaction.process", () => { ) itCompaction.instance( - "summarizes the head while serializing recent tail into summary input", + "summarizes only the head while keeping recent tail out of summary input", () => { const stub = llm() - let captured: LLM.StreamInput["messages"] = [] + let captured = "" stub.push( reply("summary", (input) => { - captured = input.messages + captured = JSON.stringify(input.messages) }), ) return Effect.gen(function* () { @@ -1381,15 +1387,10 @@ describe("session.compaction.process", () => { auto: false, }) - const head = JSON.stringify(captured.slice(0, -1)) - const prompt = JSON.stringify(captured.at(-1)) - expect(head).toContain("older context") - expect(head).not.toContain("keep this turn") - expect(head).not.toContain("and this one too") - expect(prompt).toContain("keep this turn") - expect(prompt).toContain("and this one too") - expect(prompt).toContain("recent-conversation-tail") - expect(prompt).not.toContain("What did we do so far?") + expect(captured).toContain("older context") + expect(captured).not.toContain("keep this turn") + expect(captured).not.toContain("and this one too") + expect(captured).not.toContain("What did we do so far?") }).pipe(withCompaction({ llm: stub.layer })) }, { git: true }, @@ -1437,7 +1438,7 @@ describe("session.compaction.process", () => { { git: true }, ) - itCompaction.instance("does not replay recent pre-compaction turns across repeated compactions", () => { + itCompaction.instance("keeps recent pre-compaction turns across repeated compactions", () => { const stub = llm() stub.push(reply("summary one")) stub.push(reply("summary two")) @@ -1468,8 +1469,8 @@ describe("session.compaction.process", () => { expect(ids).not.toContain(u1.id) expect(ids).not.toContain(u2.id) - expect(ids).not.toContain(u3.id) - expect(ids).not.toContain(u4.id) + expect(ids).toContain(u3.id) + expect(ids).toContain(u4.id) expect(filtered.some((msg) => msg.info.role === "assistant" && msg.info.summary)).toBe(true) expect( filtered.some((msg) => msg.info.role === "user" && msg.parts.some((part) => part.type === "compaction")), @@ -1478,7 +1479,7 @@ describe("session.compaction.process", () => { }) itCompaction.instance( - "ignores previous summaries when sizing the serialized tail", + "ignores previous summaries when sizing the retained tail", Effect.gen(function* () { const ssn = yield* SessionNs.Service const test = yield* TestInstance @@ -1517,7 +1518,7 @@ describe("session.compaction.process", () => { const part = yield* readCompactionPart(session.id) expect(part?.type).toBe("compaction") - expect(part?.tail_start_id).toBeUndefined() + expect(part?.tail_start_id).toBe(keep.id) }).pipe(withCompaction({ config: cfg({ tail_turns: 2, preserve_recent_tokens: 500 }) })), ) }) @@ -1764,6 +1765,101 @@ describe("SessionNs.getUsage", () => { expect(result.cost).toBe(3 + 1.5) }) + test("uses matching context cost tier before over-200k fallback", () => { + const model = createModel({ + context: 1_000_000, + output: 32_000, + cost: { + input: 1, + output: 2, + cache: { read: 0.1, write: 0.5 }, + tiers: [ + { + input: 3, + output: 4, + cache: { read: 0.3, write: 1.5 }, + tier: { type: "context", size: 200_000 }, + }, + { + input: 5, + output: 6, + cache: { read: 0.5, write: 2.5 }, + tier: { type: "context", size: 500_000 }, + }, + ], + experimentalOver200K: { + input: 100, + output: 100, + cache: { read: 100, write: 100 }, + }, + }, + }) + const result = SessionNs.getUsage({ + model, + usage: { + inputTokens: 650_000, + outputTokens: 100_000, + totalTokens: 750_000, + inputTokenDetails: { + noCacheTokens: undefined, + cacheReadTokens: 100_000, + cacheWriteTokens: undefined, + }, + outputTokenDetails: { + textTokens: undefined, + reasoningTokens: undefined, + }, + }, + }) + + expect(result.tokens.input).toBe(550_000) + expect(result.cost).toBe(2.75 + 0.6 + 0.05) + }) + + test("falls back to over-200k pricing when no cost tier matches", () => { + const model = createModel({ + context: 1_000_000, + output: 32_000, + cost: { + input: 1, + output: 2, + cache: { read: 0.1, write: 0.5 }, + tiers: [ + { + input: 5, + output: 6, + cache: { read: 0.5, write: 2.5 }, + tier: { type: "context", size: 500_000 }, + }, + ], + experimentalOver200K: { + input: 3, + output: 4, + cache: { read: 0.3, write: 1.5 }, + }, + }, + }) + const result = SessionNs.getUsage({ + model, + usage: { + inputTokens: 300_000, + outputTokens: 100_000, + totalTokens: 400_000, + inputTokenDetails: { + noCacheTokens: undefined, + cacheReadTokens: undefined, + cacheWriteTokens: undefined, + }, + outputTokenDetails: { + textTokens: undefined, + reasoningTokens: undefined, + }, + }, + }) + + expect(result.cost).toBe(0.9 + 0.4) + }) + test.each(["@ai-sdk/anthropic", "@ai-sdk/amazon-bedrock", "@ai-sdk/google-vertex/anthropic"])( "computes total from components for %s models", (npm) => { diff --git a/packages/opencode/test/session/goal.test.ts b/packages/opencode/test/session/goal.test.ts new file mode 100644 index 000000000000..d47f8d04f077 --- /dev/null +++ b/packages/opencode/test/session/goal.test.ts @@ -0,0 +1,688 @@ +import { describe, expect, test } from "bun:test" +import { AppRuntime } from "../../src/effect/app-runtime" +import { ProjectID } from "../../src/project/schema" +import { SessionGoal } from "../../src/session/goal" +import { MessageV2 } from "../../src/session/message-v2" +import { Session } from "../../src/session/session" +import { MessageID, PartID, SessionID } from "../../src/session/schema" +import { provideTestInstance, tmpdir } from "../fixture/fixture" +import { Effect } from "effect" + +function runIn(directory: string, fn: (directory: string) => A) { + return provideTestInstance({ directory, fn: () => fn(directory) }) +} + +async function run(fn: (directory: string) => A) { + await using tmp = await tmpdir({ git: true }) + return await runIn(tmp.path, fn) +} + +function effect(value: Effect.Effect) { + return AppRuntime.runPromise(value as never) as Promise +} + +async function expectRejects(fn: () => Promise, message: string) { + let error: unknown + try { + await fn() + } catch (e) { + error = e + } + expect(error).toBeTruthy() + expect(error instanceof Error ? error.message : String(error)).toContain(message) +} + +describe("SessionGoal", () => { + test("creates one persistent goal per session", async () => { + await using tmp = await tmpdir({ git: true }) + const goal = await runIn(tmp.path, async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-test" }))) + return effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "fix failing tests", + tokenBudget: 1000, + }), + ), + ) + }) + + expect(goal.id.startsWith("goal_")).toBe(true) + expect(goal.status).toBe("active") + expect(goal.objective).toBe("fix failing tests") + expect(goal.tokens.used).toBe(0) + expect(goal.tokens.budget).toBe(1000) + + const resumed = await runIn(tmp.path, () => effect(SessionGoal.Service.use((svc) => svc.get(goal.sessionID)))) + expect(resumed?.id).toBe(goal.id) + expect(resumed?.objective).toBe("fix failing tests") + + await expectRejects( + () => + runIn(tmp.path, () => + effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: goal.sessionID, + objective: "second goal", + }), + ), + ), + ), + "Goal already exists", + ) + }) + + test("validates objective and budget", async () => { + await expectRejects( + () => + run(() => + effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: SessionID.descending(), + objective: " ", + }), + ), + ), + ), + "Goal objective is required", + ) + + await expectRejects( + () => + run(() => + effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: SessionID.descending(), + objective: "x".repeat(4001), + }), + ), + ), + ), + "Goal objective is too long", + ) + + await expectRejects( + () => + run(() => + effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: SessionID.descending(), + objective: "valid", + tokenBudget: 0, + }), + ), + ), + ), + "Goal token budget must be positive", + ) + }) + + test("updates lifecycle, clears, and marks budget limited from accounting", async () => { + const result = await run(async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-accounting" }))) + const created = await effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "ship goal accounting", + tokenBudget: 10, + }), + ), + ) + const paused = await effect( + SessionGoal.Service.use((svc) => svc.update({ sessionID: session.id, status: "paused" })), + ) + const edited = await effect( + SessionGoal.Service.use((svc) => + svc.update({ + sessionID: session.id, + objective: "ship edited goal accounting", + status: "active", + }), + ), + ) + const limited = await effect( + SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, tokens: 11, seconds: 2 })), + ) + if (!limited) throw new Error("Expected goal accounting result") + const afterLimited = await effect( + SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, tokens: 5, seconds: 1 })), + ) + if (!afterLimited) throw new Error("Expected budget-limited goal") + await effect(SessionGoal.Service.use((svc) => svc.clear(session.id))) + return { + created, + paused, + edited, + limited, + afterLimited, + cleared: await effect(SessionGoal.Service.use((svc) => svc.get(session.id))), + } + }) + + expect(result.paused.status).toBe("paused") + expect(result.edited.objective).toBe("ship edited goal accounting") + expect(result.limited.status).toBe("budget_limited") + expect(result.limited.tokens.used).toBe(11) + expect(result.limited.time.used).toBe(2) + expect(result.afterLimited.tokens.used).toBe(11) + expect(result.afterLimited.time.used).toBe(2) + expect(result.cleared).toBeUndefined() + expect(result.created.id).toBe(result.limited.id) + }) + + test("persists cleared token budget", async () => { + const goal = await run(async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-budget-clear" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "clear the budget", + tokenBudget: 25, + }), + ), + ) + await effect(SessionGoal.Service.use((svc) => svc.update({ sessionID: session.id, tokenBudget: null }))) + return effect(SessionGoal.Service.use((svc) => svc.get(session.id))) + }) + + expect(goal?.tokens.budget).toBeUndefined() + }) + + test("marks active goals budget limited when lowering budget below usage", async () => { + const goal = await run(async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-budget-lower" }))) + await effect(SessionGoal.Service.use((svc) => svc.create({ sessionID: session.id, objective: "lower budget" }))) + await effect(SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, tokens: 8, seconds: 0 }))) + return effect(SessionGoal.Service.use((svc) => svc.update({ sessionID: session.id, tokenBudget: 8 }))) + }) + + expect(goal.status).toBe("budget_limited") + expect(goal.tokens.used).toBe(8) + expect(goal.tokens.budget).toBe(8) + }) + + test("recomputes budget-limited status when budget is raised or cleared", async () => { + const result = await run(async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-budget-recompute" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ sessionID: session.id, objective: "recover from budget limit", tokenBudget: 5 }), + ), + ) + await effect(SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, tokens: 5, seconds: 0 }))) + const raised = await effect(SessionGoal.Service.use((svc) => svc.update({ sessionID: session.id, tokenBudget: 6 }))) + const lowered = await effect( + SessionGoal.Service.use((svc) => svc.update({ sessionID: session.id, tokenBudget: 5 })), + ) + const cleared = await effect( + SessionGoal.Service.use((svc) => svc.update({ sessionID: session.id, tokenBudget: null })), + ) + return { raised, lowered, cleared } + }) + + expect(result.raised.status).toBe("active") + expect(result.raised.tokens.budget).toBe(6) + expect(result.lowered.status).toBe("budget_limited") + expect(result.cleared.status).toBe("active") + expect(result.cleared.tokens.budget).toBeUndefined() + }) + + test("accounts completion time after tokens exhaust the budget", async () => { + const result = await run(async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-budget-time" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ sessionID: session.id, objective: "count budget time", tokenBudget: 7 }), + ), + ) + const messageID = MessageID.ascending() + await effect( + SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, messageID, tokens: 7, seconds: 0 })), + ) + const afterCompletion = await effect( + SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, messageID, tokens: 0, seconds: 3 })), + ) + const afterLater = await effect( + SessionGoal.Service.use((svc) => + svc.account({ sessionID: session.id, messageID: MessageID.ascending(), tokens: 0, seconds: 5 }), + ), + ) + return { afterCompletion, afterLater } + }) + + expect(result.afterCompletion?.status).toBe("budget_limited") + expect(result.afterCompletion?.tokens.used).toBe(7) + expect(result.afterCompletion?.time.used).toBe(3) + expect(result.afterLater?.time.used).toBe(3) + }) + + test("accounts non-cached input and output tokens from step finish parts", async () => { + const goal = await run(async (directory) => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-step-finish" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "count tokens", + tokenBudget: 7, + }), + ), + ) + const messageID = MessageID.ascending() + await effect( + Session.Service.use((svc) => + svc.updateMessage({ + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "build", + path: { cwd: directory, root: directory }, + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created: Date.now() }, + } as MessageV2.Assistant), + ), + ) + await effect( + Session.Service.use((svc) => + svc.updatePart({ + id: PartID.ascending(), + messageID, + sessionID: session.id, + type: "step-finish", + reason: "stop", + cost: 0, + tokens: { input: 4, output: 3, reasoning: 3, cache: { read: 50, write: 50 } }, + }), + ), + ) + return effect(SessionGoal.Service.use((svc) => svc.get(session.id))) + }) + + expect(goal?.tokens.used).toBe(7) + expect(goal?.status).toBe("budget_limited") + }) + + test("does not count summary step finish parts against active goals", async () => { + const goal = await run(async (directory) => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-summary-step-finish" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "ignore summary tokens", + tokenBudget: 7, + }), + ), + ) + const messageID = MessageID.ascending() + await effect( + Session.Service.use((svc) => + svc.updateMessage({ + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "compaction", + agent: "compaction", + summary: true, + path: { cwd: directory, root: directory }, + parentID: MessageID.ascending(), + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created: Date.now() }, + } as MessageV2.Assistant), + ), + ) + await effect( + Session.Service.use((svc) => + svc.updatePart({ + id: PartID.ascending(), + messageID, + sessionID: session.id, + type: "step-finish", + reason: "stop", + cost: 0, + tokens: { input: 4, output: 3, reasoning: 0, cache: { read: 0, write: 0 } }, + }), + ), + ) + return effect(SessionGoal.Service.use((svc) => svc.get(session.id))) + }) + + expect(goal?.tokens.used).toBe(0) + expect(goal?.status).toBe("active") + }) + + test("does not double count repeated step finish part updates", async () => { + const goal = await run(async (directory) => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-step-finish-upsert" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "count tokens once", + tokenBudget: 100, + }), + ), + ) + const messageID = MessageID.ascending() + const partID = PartID.ascending() + await effect( + Session.Service.use((svc) => + svc.updateMessage({ + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "build", + agent: "build", + path: { cwd: directory, root: directory }, + parentID: MessageID.ascending(), + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created: Date.now() }, + } as MessageV2.Assistant), + ), + ) + const part = { + id: partID, + messageID, + sessionID: session.id, + type: "step-finish" as const, + reason: "stop", + cost: 0, + tokens: { input: 4, output: 3, reasoning: 0, cache: { read: 0, write: 0 } }, + } + await effect(Session.Service.use((svc) => svc.updatePart(part))) + await effect(Session.Service.use((svc) => svc.updatePart(part))) + return effect(SessionGoal.Service.use((svc) => svc.get(session.id))) + }) + + expect(goal?.tokens.used).toBe(7) + expect(goal?.status).toBe("active") + }) + + test("accounts wall-clock time once when assistant message completes", async () => { + const goal = await run(async (directory) => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-time" }))) + await effect(SessionGoal.Service.use((svc) => svc.create({ sessionID: session.id, objective: "count time" }))) + const messageID = MessageID.ascending() + const created = Date.now() - 2_100 + await effect( + Session.Service.use((svc) => + svc.updateMessage({ + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "build", + agent: "build", + path: { cwd: directory, root: directory }, + parentID: MessageID.ascending(), + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created }, + } as MessageV2.Assistant), + ), + ) + await effect( + Session.Service.use((svc) => + svc.updateMessage({ + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "build", + agent: "build", + path: { cwd: directory, root: directory }, + parentID: MessageID.ascending(), + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created, completed: created + 2_100 }, + } as MessageV2.Assistant), + ), + ) + await effect( + Session.Service.use((svc) => + svc.updateMessage({ + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "build", + agent: "build", + path: { cwd: directory, root: directory }, + parentID: MessageID.ascending(), + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created, completed: created + 2_100 }, + } as MessageV2.Assistant), + ), + ) + return effect(SessionGoal.Service.use((svc) => svc.get(session.id))) + }) + + expect(goal?.time.used).toBe(3) + }) + + test("model update can only mark a goal complete", async () => { + await run(async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-model" }))) + await effect(SessionGoal.Service.use((svc) => svc.create({ sessionID: session.id, objective: "finish it" }))) + const messageID = MessageID.ascending() + + await expectRejects( + () => + effect(SessionGoal.Service.use((svc) => svc.modelUpdate({ sessionID: session.id, status: "paused" }))), + "Models can only mark goals complete", + ) + + const complete = await effect( + SessionGoal.Service.use((svc) => svc.modelUpdate({ sessionID: session.id, messageID, status: "complete" })), + ) + expect(complete.status).toBe("complete") + const afterComplete = await effect( + SessionGoal.Service.use((svc) => svc.account({ sessionID: session.id, messageID, tokens: 5, seconds: 1 })), + ) + expect(afterComplete?.status).toBe("complete") + expect(afterComplete?.tokens.used).toBe(5) + expect(afterComplete?.time.used).toBe(1) + + const later = await effect( + SessionGoal.Service.use((svc) => + svc.account({ sessionID: session.id, messageID: MessageID.ascending(), tokens: 5, seconds: 1 }), + ), + ) + expect(later?.tokens.used).toBe(5) + expect(later?.time.used).toBe(1) + }) + }) + + test("counts the assistant turn that marks a goal complete", async () => { + const result = await run(async (directory) => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-complete-accounting" }))) + await effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "count the final turn", + tokenBudget: 3, + }), + ), + ) + + const messageID = MessageID.ascending() + const created = Date.now() - 1_100 + const assistant = { + id: messageID, + sessionID: session.id, + role: "assistant", + mode: "build", + agent: "build", + path: { cwd: directory, root: directory }, + parentID: MessageID.ascending(), + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: "test", + providerID: "test", + time: { created }, + } as MessageV2.Assistant + + await effect(Session.Service.use((svc) => svc.updateMessage(assistant))) + await effect( + SessionGoal.Service.use((svc) => svc.modelUpdate({ sessionID: session.id, messageID, status: "complete" })), + ) + await effect( + Session.Service.use((svc) => + svc.updatePart({ + id: PartID.ascending(), + messageID, + sessionID: session.id, + type: "step-finish", + reason: "tool-calls", + cost: 0, + tokens: { input: 2, output: 3, reasoning: 4, cache: { read: 50, write: 50 } }, + }), + ), + ) + await effect( + Session.Service.use((svc) => svc.updateMessage({ ...assistant, time: { created, completed: created + 1_100 } })), + ) + const afterComplete = await effect(SessionGoal.Service.use((svc) => svc.get(session.id))) + + const laterMessageID = MessageID.ascending() + const laterCreated = Date.now() - 1_000 + const laterAssistant = { + ...assistant, + id: laterMessageID, + parentID: messageID, + time: { created: laterCreated }, + } + await effect(Session.Service.use((svc) => svc.updateMessage(laterAssistant))) + await effect( + Session.Service.use((svc) => + svc.updatePart({ + id: PartID.ascending(), + messageID: laterMessageID, + sessionID: session.id, + type: "step-finish", + reason: "stop", + cost: 0, + tokens: { input: 10, output: 10, reasoning: 0, cache: { read: 0, write: 0 } }, + }), + ), + ) + await effect( + Session.Service.use((svc) => + svc.updateMessage({ ...laterAssistant, time: { created: laterCreated, completed: laterCreated + 1_000 } }), + ), + ) + + return { + afterComplete, + afterLater: await effect(SessionGoal.Service.use((svc) => svc.get(session.id))), + } + }) + + expect(result.afterComplete?.status).toBe("complete") + expect(result.afterComplete?.tokens.used).toBe(5) + expect(result.afterComplete?.time.used).toBe(2) + expect(result.afterLater?.status).toBe("complete") + expect(result.afterLater?.tokens.used).toBe(5) + expect(result.afterLater?.time.used).toBe(2) + }) + + test("persists goal after instance reload", async () => { + await using tmp = await tmpdir({ git: true }) + const created = await runIn(tmp.path, async () => { + const session = await effect(Session.Service.use((svc) => svc.create({ title: "goal-reload" }))) + return effect( + SessionGoal.Service.use((svc) => + svc.create({ + sessionID: session.id, + objective: "survive process restart", + tokenBudget: 100, + }), + ), + ) + }) + + const loaded = await runIn(tmp.path, () => effect(SessionGoal.Service.use((svc) => svc.get(created.sessionID)))) + expect(loaded?.id).toBe(created.id) + expect(loaded?.objective).toBe("survive process restart") + }) + + test("lists active goals for runtime startup scheduling", async () => { + await run(async () => { + const result = await effect( + Session.Service.use((sessions) => + SessionGoal.Service.use((goals) => + Effect.gen(function* () { + const activeSession = yield* sessions.create({ title: "active-goal" }) + const pausedSession = yield* sessions.create({ title: "paused-goal" }) + const completeSession = yield* sessions.create({ title: "complete-goal" }) + yield* goals.create({ sessionID: activeSession.id, objective: "keep going" }) + yield* goals.create({ sessionID: pausedSession.id, objective: "pause" }) + yield* goals.update({ sessionID: pausedSession.id, status: "paused" }) + yield* goals.create({ sessionID: completeSession.id, objective: "done" }) + yield* goals.modelUpdate({ sessionID: completeSession.id, status: "complete" }) + return { + activeSession, + pausedSession, + completeSession, + active: yield* goals.listActive(), + } + }), + ), + ), + ) + + expect(result.active.some((goal) => goal.sessionID === result.activeSession.id)).toBe(true) + expect(result.active.some((goal) => goal.sessionID === result.pausedSession.id)).toBe(false) + expect(result.active.some((goal) => goal.sessionID === result.completeSession.id)).toBe(false) + }) + }) + + test("lists active goals only for unarchived sessions in the requested project", async () => { + await run(async () => { + const result = await effect( + Session.Service.use((sessions) => + SessionGoal.Service.use((goals) => + Effect.gen(function* () { + const activeSession = yield* sessions.create({ title: "active-goal" }) + const archivedSession = yield* sessions.create({ title: "archived-goal" }) + yield* goals.create({ sessionID: activeSession.id, objective: "keep running" }) + yield* goals.create({ sessionID: archivedSession.id, objective: "do not resume" }) + yield* sessions.setArchived({ sessionID: archivedSession.id, time: Date.now() }) + return { + activeSession, + archivedSession, + active: yield* goals.listActive({ projectID: activeSession.projectID }), + wrongProject: yield* goals.listActive({ projectID: ProjectID.global }), + } + }), + ), + ), + ) + + expect(result.active.some((goal) => goal.sessionID === result.activeSession.id)).toBe(true) + expect(result.active.some((goal) => goal.sessionID === result.archivedSession.id)).toBe(false) + expect(result.wrongProject).toHaveLength(0) + }) + }) +}) diff --git a/packages/opencode/test/session/instruction.test.ts b/packages/opencode/test/session/instruction.test.ts index 5d40933954eb..0f9c340dd4c1 100644 --- a/packages/opencode/test/session/instruction.test.ts +++ b/packages/opencode/test/session/instruction.test.ts @@ -10,6 +10,7 @@ import { Instruction } from "../../src/session/instruction" import type { MessageV2 } from "../../src/session/message-v2" import { MessageID, PartID, SessionID } from "../../src/session/schema" import { Global } from "@opencode-ai/core/global" +import { RuntimeFlags } from "../../src/effect/runtime-flags" import { provideInstance, provideTmpdirInstance, tmpdirScoped } from "../fixture/fixture" import { testEffect } from "../lib/effect" import { TestConfig } from "../fixture/config" @@ -18,18 +19,19 @@ const it = testEffect(Layer.mergeAll(CrossSpawnSpawner.defaultLayer, NodeFileSys const configLayer = TestConfig.layer() -const instructionLayer = (global: Partial) => +const instructionLayer = (global: Partial, flags: Partial = {}) => Instruction.layer.pipe( Layer.provide(configLayer), Layer.provide(AppFileSystem.defaultLayer), Layer.provide(FetchHttpClient.layer), Layer.provide(Global.layerWith(global)), + Layer.provide(RuntimeFlags.layer(flags)), ) const provideInstruction = - (global: Partial) => + (global: Partial, flags?: Partial) => (self: Effect.Effect) => - self.pipe(Effect.provide(instructionLayer(global))) + self.pipe(Effect.provide(instructionLayer(global, flags))) const write = (filepath: string, content: string) => Effect.gen(function* () { @@ -215,6 +217,24 @@ describe("Instruction.system", () => { }).pipe(provideInstance(projectTmp), provideInstruction({ home: globalTmp, config: globalTmp })) }), ) + + it.live("skips project and global CLAUDE.md when Claude Code prompt is disabled", () => + Effect.gen(function* () { + const globalTmp = yield* tmpWithFiles({ ".claude/CLAUDE.md": "# Global Claude" }) + const projectTmp = yield* tmpWithFiles({ "CLAUDE.md": "# Project Claude" }) + + yield* Effect.gen(function* () { + const svc = yield* Instruction.Service + const paths = yield* svc.systemPaths() + expect(paths.has(path.join(globalTmp, ".claude", "CLAUDE.md"))).toBe(false) + expect(paths.has(path.join(projectTmp, "CLAUDE.md"))).toBe(false) + expect(yield* svc.system()).toEqual([]) + }).pipe( + provideInstance(projectTmp), + provideInstruction({ home: globalTmp, config: globalTmp }, { disableClaudeCodePrompt: true }), + ) + }), + ) }) describe("Instruction.systemPaths global config", () => { diff --git a/packages/opencode/test/session/llm.test.ts b/packages/opencode/test/session/llm.test.ts index 2879d0481249..3a949287e489 100644 --- a/packages/opencode/test/session/llm.test.ts +++ b/packages/opencode/test/session/llm.test.ts @@ -9,7 +9,7 @@ import { Instance } from "../../src/project/instance" import { WithInstance } from "../../src/project/with-instance" import { Provider } from "@/provider/provider" import { ProviderTransform } from "@/provider/transform" -import { ModelsDev } from "@/provider/models" +import { ModelsDev } from "@opencode-ai/core/models" import { ProviderID, ModelID } from "../../src/provider/schema" import { Filesystem } from "@/util/filesystem" import { tmpdir } from "../fixture/fixture" @@ -277,6 +277,25 @@ async function loadFixture(providerID: string, modelID: string) { return { provider, model } } +function configModel(model: ModelsDev.Model) { + return { + id: model.id, + name: model.name, + family: model.family, + release_date: model.release_date, + attachment: model.attachment, + reasoning: model.reasoning, + temperature: model.temperature, + tool_call: model.tool_call, + interleaved: model.interleaved, + cost: model.cost ? { ...model.cost, tiers: undefined } : undefined, + limit: model.limit, + modalities: model.modalities, + status: model.status, + provider: model.provider, + } +} + function createEventStream(chunks: unknown[], includeDone = false) { const lines = chunks.map((chunk) => `data: ${typeof chunk === "string" ? chunk : JSON.stringify(chunk)}`) if (includeDone) { @@ -617,7 +636,7 @@ describe("session.llm.stream", () => { npm: "@ai-sdk/openai", api: "https://api.openai.com/v1", models: { - [model.id]: model, + [model.id]: configModel(model), }, options: { apiKey: "test-openai-key", @@ -733,7 +752,7 @@ describe("session.llm.stream", () => { npm: "@ai-sdk/openai", api: "https://api.openai.com/v1", models: { - [model.id]: model, + [model.id]: configModel(model), }, options: { apiKey: "test-openai-key", @@ -970,7 +989,7 @@ describe("session.llm.stream", () => { npm: "@ai-sdk/anthropic", api: "https://api.anthropic.com/v1", models: { - [model.id]: model, + [model.id]: configModel(model), }, options: { apiKey: "test-anthropic-key", diff --git a/packages/opencode/test/session/message-v2.test.ts b/packages/opencode/test/session/message-v2.test.ts index f742b7afc8ef..82bed0e9cc6f 100644 --- a/packages/opencode/test/session/message-v2.test.ts +++ b/packages/opencode/test/session/message-v2.test.ts @@ -1547,3 +1547,110 @@ describe("session.message-v2.fromError", () => { expect(result.name).toBe("MessageAbortedError") }) }) + +describe("session.message-v2.latest", () => { + const TAIL_USER = MessageID.make("msg_001") + const OVERFLOW_ASSISTANT = MessageID.make("msg_002") + const COMPACTION_USER = MessageID.make("msg_003") + const SUMMARY_ASSISTANT = MessageID.make("msg_004") + const CONTINUE_USER = MessageID.make("msg_005") + const NEW_COMPACTION_USER = MessageID.make("msg_006") + + const tailUser: MessageV2.WithParts = { + info: userInfo(TAIL_USER), + parts: [{ ...basePart(TAIL_USER, "p1"), type: "text", text: "original prompt" }] as MessageV2.Part[], + } + + const overflowAssistant: MessageV2.WithParts = { + info: { + ...assistantInfo(OVERFLOW_ASSISTANT, TAIL_USER), + finish: "tool-calls", + tokens: { input: 280_000, output: 200, reasoning: 0, cache: { read: 0, write: 0 }, total: 280_200 }, + } as MessageV2.Assistant, + parts: [], + } + + const compactionUser: MessageV2.WithParts = { + info: userInfo(COMPACTION_USER), + parts: [ + { + ...basePart(COMPACTION_USER, "p1"), + type: "compaction", + auto: true, + tail_start_id: TAIL_USER, + }, + ] as MessageV2.Part[], + } + + const summaryAssistant: MessageV2.WithParts = { + info: { + ...assistantInfo(SUMMARY_ASSISTANT, COMPACTION_USER), + summary: true, + finish: "stop", + tokens: { input: 150_000, output: 1_500, reasoning: 0, cache: { read: 0, write: 0 }, total: 151_500 }, + } as MessageV2.Assistant, + parts: [], + } + + const continueUser: MessageV2.WithParts = { + info: userInfo(CONTINUE_USER), + parts: [ + { + ...basePart(CONTINUE_USER, "p1"), + type: "text", + text: "Continue if you have next steps...", + synthetic: true, + metadata: { compaction_continue: true }, + }, + ] as MessageV2.Part[], + } + + // Regression for double auto-compaction. The reorder in filterCompacted + // (#27145) returns [compaction-user, summary, ...tail..., continue-user], + // so picking lastFinished by array position landed on the pre-compaction + // overflow assistant and bypassed the `summary !== true` overflow guard + // in SessionPrompt.runLoop, firing a second compaction.create immediately. + test("finished is the chronologically-latest finished assistant, not the array-latest", () => { + const filtered = MessageV2.filterCompacted([ + continueUser, + summaryAssistant, + compactionUser, + overflowAssistant, + tailUser, + ]) + + const state = MessageV2.latest(filtered) + + expect(state.finished?.id).toBe(SUMMARY_ASSISTANT) + expect(state.finished?.summary).toBe(true) + expect(state.user?.id).toBe(CONTINUE_USER) + expect(state.tasks).toEqual([]) + }) + + test("a fresh compaction-user newer than the latest summary surfaces in tasks", () => { + const newCompactionUser: MessageV2.WithParts = { + info: userInfo(NEW_COMPACTION_USER), + parts: [ + { + ...basePart(NEW_COMPACTION_USER, "p1"), + type: "compaction", + auto: true, + }, + ] as MessageV2.Part[], + } + + const state = MessageV2.latest([ + tailUser, + overflowAssistant, + compactionUser, + summaryAssistant, + continueUser, + newCompactionUser, + ]) + + expect(state.finished?.id).toBe(SUMMARY_ASSISTANT) + expect(state.user?.id).toBe(NEW_COMPACTION_USER) + expect(state.tasks).toHaveLength(1) + expect(state.tasks[0]).toMatchObject({ type: "compaction", auto: true }) + }) +}) diff --git a/packages/opencode/test/session/messages-pagination.test.ts b/packages/opencode/test/session/messages-pagination.test.ts index 86e1d85d0df5..e558d07b500f 100644 --- a/packages/opencode/test/session/messages-pagination.test.ts +++ b/packages/opencode/test/session/messages-pagination.test.ts @@ -1,46 +1,42 @@ import { describe, expect, test } from "bun:test" -import { Effect } from "effect" -import path from "path" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" +import { Effect, Option } from "effect" import { Session as SessionNs } from "@/session/session" import { MessageV2 } from "../../src/session/message-v2" import { MessageID, PartID, type SessionID } from "../../src/session/schema" import { ModelID, ProviderID } from "../../src/provider/schema" +import { NotFoundError } from "@/storage/storage" import * as Log from "@opencode-ai/core/util/log" +import { testEffect } from "../lib/effect" -const root = path.join(__dirname, "../..") void Log.init({ print: false }) -function run(fx: Effect.Effect) { - return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer))) -} - -const svc = { - ...SessionNs, - create(input?: SessionNs.CreateInput) { - return run(SessionNs.Service.use((svc) => svc.create(input))) - }, - remove(id: SessionID) { - return run(SessionNs.Service.use((svc) => svc.remove(id))) - }, - updateMessage(msg: T) { - return run(SessionNs.Service.use((svc) => svc.updateMessage(msg))) - }, - updatePart(part: T) { - return run(SessionNs.Service.use((svc) => svc.updatePart(part))) - }, - fork(input: { sessionID: SessionID; messageID?: MessageID }) { - return run(SessionNs.Service.use((svc) => svc.fork(input))) - }, -} - -async function fill(sessionID: SessionID, count: number, time = (i: number) => Date.now() + i) { +const it = testEffect(SessionNs.defaultLayer) + +const withSession = ( + fn: (input: { session: SessionNs.Interface; sessionID: SessionID }) => Effect.Effect, +) => + Effect.acquireUseRelease( + Effect.gen(function* () { + const session = yield* SessionNs.Service + const created = yield* session.create({}) + return { session, sessionID: created.id } + }), + fn, + (input) => input.session.remove(input.sessionID).pipe(Effect.ignore), + ) + +// Helper functions using Effect.gen +const fill = Effect.fn("Test.fill")(function* ( + sessionID: SessionID, + count: number, + time = (i: number) => Date.now() + i, +) { + const session = yield* SessionNs.Service const ids = [] as MessageID[] for (let i = 0; i < count; i++) { const id = MessageID.ascending() ids.push(id) - await svc.updateMessage({ + yield* session.updateMessage({ id, sessionID, role: "user", @@ -50,7 +46,7 @@ async function fill(sessionID: SessionID, count: number, time = (i: number) => D tools: {}, mode: "", } as unknown as MessageV2.Info) - await svc.updatePart({ + yield* session.updatePart({ id: PartID.ascending(), sessionID, messageID: id, @@ -59,11 +55,12 @@ async function fill(sessionID: SessionID, count: number, time = (i: number) => D }) } return ids -} +}) -async function addUser(sessionID: SessionID, text?: string) { +const addUser = Effect.fn("Test.addUser")(function* (sessionID: SessionID, text?: string) { + const session = yield* SessionNs.Service const id = MessageID.ascending() - await svc.updateMessage({ + yield* session.updateMessage({ id, sessionID, role: "user", @@ -74,7 +71,7 @@ async function addUser(sessionID: SessionID, text?: string) { mode: "", } as unknown as MessageV2.Info) if (text) { - await svc.updatePart({ + yield* session.updatePart({ id: PartID.ascending(), sessionID, messageID: id, @@ -83,15 +80,16 @@ async function addUser(sessionID: SessionID, text?: string) { }) } return id -} +}) -async function addAssistant( +const addAssistant = Effect.fn("Test.addAssistant")(function* ( sessionID: SessionID, parentID: MessageID, opts?: { summary?: boolean; finish?: string; error?: MessageV2.Assistant["error"] }, ) { + const session = yield* SessionNs.Service const id = MessageID.ascending() - await svc.updateMessage({ + yield* session.updateMessage({ id, sessionID, role: "assistant", @@ -109,10 +107,15 @@ async function addAssistant( error: opts?.error, } as unknown as MessageV2.Info) return id -} +}) -async function addCompactionPart(sessionID: SessionID, messageID: MessageID, tailStartID?: MessageID) { - await svc.updatePart({ +const addCompactionPart = Effect.fn("Test.addCompactionPart")(function* ( + sessionID: SessionID, + messageID: MessageID, + tailStartID?: MessageID, +) { + const session = yield* SessionNs.Service + yield* session.updatePart({ id: PartID.ascending(), sessionID, messageID, @@ -120,382 +123,303 @@ async function addCompactionPart(sessionID: SessionID, messageID: MessageID, tai auto: true, tail_start_id: tailStartID, } as any) -} +}) describe("MessageV2.page", () => { - test("returns sync result", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 2) - - const result = MessageV2.page({ sessionID: session.id, limit: 10 }) + it.instance("returns page result", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + yield* fill(sessionID, 2) + + const result = yield* MessageV2.page({ sessionID, limit: 10 }) expect(result).toBeDefined() expect(result.items).toBeArray() + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("pages backward with opaque cursors", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 6) + it.instance("pages backward with opaque cursors", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 6) - const a = MessageV2.page({ sessionID: session.id, limit: 2 }) + const a = yield* MessageV2.page({ sessionID, limit: 2 }) expect(a.items.map((item) => item.info.id)).toEqual(ids.slice(-2)) expect(a.items.every((item) => item.parts.length === 1)).toBe(true) expect(a.more).toBe(true) expect(a.cursor).toBeTruthy() - const b = MessageV2.page({ sessionID: session.id, limit: 2, before: a.cursor! }) + const b = yield* MessageV2.page({ sessionID, limit: 2, before: a.cursor! }) expect(b.items.map((item) => item.info.id)).toEqual(ids.slice(-4, -2)) expect(b.more).toBe(true) expect(b.cursor).toBeTruthy() - const c = MessageV2.page({ sessionID: session.id, limit: 2, before: b.cursor! }) + const c = yield* MessageV2.page({ sessionID, limit: 2, before: b.cursor! }) expect(c.items.map((item) => item.info.id)).toEqual(ids.slice(0, 2)) expect(c.more).toBe(false) expect(c.cursor).toBeUndefined() + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) + it.instance("returns items in chronological order within a page", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 4) - test("returns items in chronological order within a page", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 4) - - const result = MessageV2.page({ sessionID: session.id, limit: 4 }) + const result = yield* MessageV2.page({ sessionID, limit: 4 }) expect(result.items.map((item) => item.info.id)).toEqual(ids) - - await svc.remove(session.id) - }, - }) - }) - - test("returns empty items for session with no messages", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const result = MessageV2.page({ sessionID: session.id, limit: 10 }) + }), + ), + ) + + it.instance("returns empty items for session with no messages", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const result = yield* MessageV2.page({ sessionID, limit: 10 }) expect(result.items).toEqual([]) expect(result.more).toBe(false) expect(result.cursor).toBeUndefined() - - await svc.remove(session.id) - }, - }) - }) - - test("throws NotFoundError for non-existent session", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const fake = "non-existent-session" as SessionID - expect(() => MessageV2.page({ sessionID: fake, limit: 10 })).toThrow("NotFoundError") - }, - }) - }) - - test("handles exact limit boundary", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 3) - - const result = MessageV2.page({ sessionID: session.id, limit: 3 }) + }), + ), + ) + + it.instance("fails with NotFoundError for non-existent session", () => + Effect.gen(function* () { + const fake = "non-existent-session" as SessionID + const error = yield* Effect.flip(MessageV2.page({ sessionID: fake, limit: 10 })) + expect(error).toBeInstanceOf(NotFoundError) + expect(error.message).toBe(`Session not found: ${fake}`) + }), + ) + + it.instance("handles exact limit boundary", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 3) + + const result = yield* MessageV2.page({ sessionID, limit: 3 }) expect(result.items.map((item) => item.info.id)).toEqual(ids) expect(result.more).toBe(false) expect(result.cursor).toBeUndefined() + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("limit of 1 returns single newest message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 5) + it.instance("limit of 1 returns single newest message", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 5) - const result = MessageV2.page({ sessionID: session.id, limit: 1 }) + const result = yield* MessageV2.page({ sessionID, limit: 1 }) expect(result.items).toHaveLength(1) expect(result.items[0].info.id).toBe(ids[ids.length - 1]) expect(result.more).toBe(true) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("hydrates multiple parts per message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) + it.instance("hydrates multiple parts per message", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) - await svc.updatePart({ + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: id, type: "text", text: "extra", }) - const result = MessageV2.page({ sessionID: session.id, limit: 10 }) + const result = yield* MessageV2.page({ sessionID, limit: 10 }) expect(result.items).toHaveLength(1) expect(result.items[0].parts).toHaveLength(2) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("accepts cursors from fractional timestamps", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 4, (i) => 1000.5 + i) + it.instance("accepts cursors from fractional timestamps", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 4, (i: number) => 1000.5 + i) - const a = MessageV2.page({ sessionID: session.id, limit: 2 }) - const b = MessageV2.page({ sessionID: session.id, limit: 2, before: a.cursor! }) + const a = yield* MessageV2.page({ sessionID, limit: 2 }) + const b = yield* MessageV2.page({ sessionID, limit: 2, before: a.cursor! }) expect(a.items.map((item) => item.info.id)).toEqual(ids.slice(-2)) expect(b.items.map((item) => item.info.id)).toEqual(ids.slice(0, 2)) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("messages with same timestamp are ordered by id", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 4, () => 1000) + it.instance("messages with same timestamp are ordered by id", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 4, () => 1000) - const a = MessageV2.page({ sessionID: session.id, limit: 2 }) + const a = yield* MessageV2.page({ sessionID, limit: 2 }) expect(a.items.map((item) => item.info.id)).toEqual(ids.slice(-2)) expect(a.more).toBe(true) - const b = MessageV2.page({ sessionID: session.id, limit: 2, before: a.cursor! }) + const b = yield* MessageV2.page({ sessionID, limit: 2, before: a.cursor! }) expect(b.items.map((item) => item.info.id)).toEqual(ids.slice(0, 2)) expect(b.more).toBe(false) - - await svc.remove(session.id) - }, - }) - }) - - test("does not return messages from other sessions", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const a = await svc.create({}) - const b = await svc.create({}) - await fill(a.id, 3) - await fill(b.id, 2) - - const resultA = MessageV2.page({ sessionID: a.id, limit: 10 }) - const resultB = MessageV2.page({ sessionID: b.id, limit: 10 }) - expect(resultA.items).toHaveLength(3) - expect(resultB.items).toHaveLength(2) - expect(resultA.items.every((item) => item.info.sessionID === a.id)).toBe(true) - expect(resultB.items.every((item) => item.info.sessionID === b.id)).toBe(true) - - await svc.remove(a.id) - await svc.remove(b.id) - }, - }) - }) - - test("large limit returns all messages without cursor", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 10) - - const result = MessageV2.page({ sessionID: session.id, limit: 100 }) + }), + ), + ) + + it.instance("does not return messages from other sessions", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const a = yield* session.create({}) + const b = yield* session.create({}) + yield* fill(a.id, 3) + yield* fill(b.id, 2) + + const resultA = yield* MessageV2.page({ sessionID: a.id, limit: 10 }) + const resultB = yield* MessageV2.page({ sessionID: b.id, limit: 10 }) + expect(resultA.items).toHaveLength(3) + expect(resultB.items).toHaveLength(2) + expect(resultA.items.every((item) => item.info.sessionID === a.id)).toBe(true) + expect(resultB.items.every((item) => item.info.sessionID === b.id)).toBe(true) + + yield* session.remove(a.id) + yield* session.remove(b.id) + }), + ) + + it.instance("large limit returns all messages without cursor", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 10) + + const result = yield* MessageV2.page({ sessionID, limit: 100 }) expect(result.items).toHaveLength(10) expect(result.items.map((item) => item.info.id)).toEqual(ids) expect(result.more).toBe(false) expect(result.cursor).toBeUndefined() - - await svc.remove(session.id) - }, - }) - }) + }), + ), + ) }) describe("MessageV2.stream", () => { - test("yields items newest first", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 5) - - const items = Array.from(MessageV2.stream(session.id)) - expect(items.map((item) => item.info.id)).toEqual(ids.slice().reverse()) - - await svc.remove(session.id) - }, - }) - }) - - test("yields nothing for empty session", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) + it.instance("yields items newest first", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 5) - const items = Array.from(MessageV2.stream(session.id)) + const items = Array.from(MessageV2.stream(sessionID)) + expect(items.map((item) => item.info.id)).toEqual(ids.slice().reverse()) + }), + ), + ) + + it.instance("yields nothing for empty session", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const items = Array.from(MessageV2.stream(sessionID)) expect(items).toHaveLength(0) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("yields single message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 1) + it.instance("yields single message", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 1) - const items = Array.from(MessageV2.stream(session.id)) + const items = Array.from(MessageV2.stream(sessionID)) expect(items).toHaveLength(1) expect(items[0].info.id).toBe(ids[0]) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) + it.instance("hydrates parts for each yielded message", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + yield* fill(sessionID, 3) - test("hydrates parts for each yielded message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 3) - - const items = Array.from(MessageV2.stream(session.id)) + const items = Array.from(MessageV2.stream(sessionID)) for (const item of items) { expect(item.parts).toHaveLength(1) expect(item.parts[0].type).toBe("text") } + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("handles sets exceeding internal page size", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 60) + it.instance("handles sets exceeding internal page size", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 60) - const items = Array.from(MessageV2.stream(session.id)) + const items = Array.from(MessageV2.stream(sessionID)) expect(items).toHaveLength(60) expect(items[0].info.id).toBe(ids[ids.length - 1]) expect(items[59].info.id).toBe(ids[0]) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) + it.instance("is a sync generator", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + yield* fill(sessionID, 1) - test("is a sync generator", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 1) - - const gen = MessageV2.stream(session.id) + const gen = MessageV2.stream(sessionID) const first = gen.next() // sync generator returns { value, done } directly, not a Promise expect(first).toHaveProperty("value") expect(first).toHaveProperty("done") expect(first.done).toBe(false) - - await svc.remove(session.id) - }, - }) - }) + }), + ), + ) }) describe("MessageV2.parts", () => { - test("returns parts for a message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) + it.instance("returns parts for a message", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) const result = MessageV2.parts(id) expect(result).toHaveLength(1) expect(result[0].type).toBe("text") expect((result[0] as MessageV2.TextPart).text).toBe("m0") + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("returns empty array for message with no parts", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const id = await addUser(session.id) + it.instance("returns empty array for message with no parts", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const id = yield* addUser(sessionID) const result = MessageV2.parts(id) expect(result).toEqual([]) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("returns multiple parts in order", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) + it.instance("returns multiple parts in order", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) - await svc.updatePart({ + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: id, type: "text", text: "second", }) - await svc.updatePart({ + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: id, type: "text", text: "third", @@ -506,547 +430,523 @@ describe("MessageV2.parts", () => { expect((result[0] as MessageV2.TextPart).text).toBe("m0") expect((result[1] as MessageV2.TextPart).text).toBe("second") expect((result[2] as MessageV2.TextPart).text).toBe("third") - - await svc.remove(session.id) - }, - }) - }) - - test("returns empty for non-existent message id", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - await svc.create({}) - const result = MessageV2.parts(MessageID.ascending()) - expect(result).toEqual([]) - }, - }) - }) - - test("parts contain sessionID and messageID", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) + }), + ), + ) + + it.instance("returns empty for non-existent message id", () => + Effect.gen(function* () { + yield* SessionNs.Service + const result = MessageV2.parts(MessageID.ascending()) + expect(result).toEqual([]) + }), + ) + + it.instance("parts contain sessionID and messageID", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) const result = MessageV2.parts(id) - expect(result[0].sessionID).toBe(session.id) + expect(result[0].sessionID).toBe(sessionID) expect(result[0].messageID).toBe(id) - - await svc.remove(session.id) - }, - }) - }) + }), + ), + ) }) describe("MessageV2.get", () => { - test("returns message with hydrated parts", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) - - const result = MessageV2.get({ sessionID: session.id, messageID: id }) + it.instance("returns message with hydrated parts", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) + + const result = yield* MessageV2.get({ sessionID, messageID: id }) expect(result.info.id).toBe(id) - expect(result.info.sessionID).toBe(session.id) + expect(result.info.sessionID).toBe(sessionID) expect(result.info.role).toBe("user") expect(result.parts).toHaveLength(1) expect((result.parts[0] as MessageV2.TextPart).text).toBe("m0") - - await svc.remove(session.id) - }, - }) - }) - - test("throws NotFoundError for non-existent message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - expect(() => MessageV2.get({ sessionID: session.id, messageID: MessageID.ascending() })).toThrow( - "NotFoundError", - ) - - await svc.remove(session.id) - }, - }) - }) - - test("scopes by session id", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const a = await svc.create({}) - const b = await svc.create({}) - const [id] = await fill(a.id, 1) - - expect(() => MessageV2.get({ sessionID: b.id, messageID: id })).toThrow("NotFoundError") - const result = MessageV2.get({ sessionID: a.id, messageID: id }) - expect(result.info.id).toBe(id) - - await svc.remove(a.id) - await svc.remove(b.id) - }, - }) - }) - - test("returns message with multiple parts", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) - - await svc.updatePart({ + }), + ), + ) + + it.instance("fails with NotFoundError for non-existent message", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const messageID = MessageID.ascending() + const error = yield* Effect.flip(MessageV2.get({ sessionID, messageID })) + expect(error).toBeInstanceOf(NotFoundError) + expect(error.message).toBe(`Message not found: ${messageID}`) + }), + ), + ) + + it.instance("scopes by session id", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const a = yield* session.create({}) + const b = yield* session.create({}) + const [id] = yield* fill(a.id, 1) + + const error = yield* Effect.flip(MessageV2.get({ sessionID: b.id, messageID: id })) + expect(error).toBeInstanceOf(NotFoundError) + expect(error.message).toBe(`Message not found: ${id}`) + const result = yield* MessageV2.get({ sessionID: a.id, messageID: id }) + expect(result.info.id).toBe(id) + + yield* session.remove(a.id) + yield* session.remove(b.id) + }), + ) + + it.instance("returns message with multiple parts", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) + + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: id, type: "text", text: "extra", }) - const result = MessageV2.get({ sessionID: session.id, messageID: id }) + const result = yield* MessageV2.get({ sessionID, messageID: id }) expect(result.parts).toHaveLength(2) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("returns assistant message with correct role", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const uid = await addUser(session.id, "hello") - const aid = await addAssistant(session.id, uid) + it.instance("returns assistant message with correct role", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const uid = yield* addUser(sessionID, "hello") + const aid = yield* addAssistant(sessionID, uid) - await svc.updatePart({ + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: aid, type: "text", text: "response", }) - const result = MessageV2.get({ sessionID: session.id, messageID: aid }) + const result = yield* MessageV2.get({ sessionID, messageID: aid }) expect(result.info.role).toBe("assistant") expect(result.parts).toHaveLength(1) expect((result.parts[0] as MessageV2.TextPart).text).toBe("response") + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("returns message with zero parts", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const id = await addUser(session.id) + it.instance("returns message with zero parts", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const id = yield* addUser(sessionID) - const result = MessageV2.get({ sessionID: session.id, messageID: id }) + const result = yield* MessageV2.get({ sessionID, messageID: id }) expect(result.info.id).toBe(id) expect(result.parts).toEqual([]) + }), + ), + ) +}) - await svc.remove(session.id) - }, - }) - }) +describe("Session.messages", () => { + it.instance("returns all messages in chronological order across pages", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 55) + const result = yield* session.messages({ sessionID }) + expect(result.map((item) => item.info.id)).toEqual(ids) + }), + ), + ) + + it.instance("fails with NotFoundError for non-existent session", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const fake = "non-existent-session" as SessionID + const error = yield* Effect.flip(session.messages({ sessionID: fake })) + expect(error).toBeInstanceOf(NotFoundError) + expect(error.message).toBe(`Session not found: ${fake}`) + }), + ) +}) + +describe("Session.findMessage", () => { + it.instance("searches newest-first", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 3) + const result = yield* session.findMessage(sessionID, () => true) + expect(Option.isSome(result) ? result.value.info.id : undefined).toBe(ids.at(-1)) + }), + ), + ) + + it.instance("fails with NotFoundError for non-existent session", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const fake = "non-existent-session" as SessionID + const error = yield* Effect.flip(session.findMessage(fake, () => true)) + expect(error).toBeInstanceOf(NotFoundError) + expect(error.message).toBe(`Session not found: ${fake}`) + }), + ) }) describe("MessageV2.filterCompacted", () => { - test("returns all messages when no compaction", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const ids = await fill(session.id, 5) - - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + it.instance("returns all messages when no compaction", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const ids = yield* fill(sessionID, 5) + + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) expect(result).toHaveLength(5) // reversed from newest-first to chronological expect(result.map((item) => item.info.id)).toEqual(ids) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("stops at compaction boundary and returns chronological order", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - + it.instance("stops at compaction boundary and returns chronological order", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { // Chronological: u1(+compaction part), a1(summary, parentID=u1), u2, a2 // Stream (newest first): a2, u2, a1(adds u1 to completed), u1(in completed + compaction) -> break - const u1 = await addUser(session.id, "first question") - const a1 = await addAssistant(session.id, u1, { summary: true, finish: "end_turn" }) - await svc.updatePart({ + const u1 = yield* addUser(sessionID, "first question") + const a1 = yield* addAssistant(sessionID, u1, { summary: true, finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a1, type: "text", text: "summary", }) - await addCompactionPart(session.id, u1) + yield* addCompactionPart(sessionID, u1) - const u2 = await addUser(session.id, "new question") - const a2 = await addAssistant(session.id, u2) - await svc.updatePart({ + const u2 = yield* addUser(sessionID, "new question") + const a2 = yield* addAssistant(sessionID, u2) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a2, type: "text", text: "new response", }) - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) // Includes compaction boundary: u1, a1, u2, a2 expect(result[0].info.id).toBe(u1) expect(result.length).toBe(4) - - await svc.remove(session.id) - }, - }) - }) - - test("handles empty iterable", () => { - const result = MessageV2.filterCompacted([]) - expect(result).toEqual([]) - }) - - test("does not break on compaction part without matching summary", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "hello") - await addCompactionPart(session.id, u1) - await addUser(session.id, "world") - - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + }), + ), + ) + + it.live("handles empty iterable", () => + Effect.sync(() => { + const result = MessageV2.filterCompacted([]) + expect(result).toEqual([]) + }), + ) + + it.instance("does not break on compaction part without matching summary", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const u1 = yield* addUser(sessionID, "hello") + yield* addCompactionPart(sessionID, u1) + yield* addUser(sessionID, "world") + + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) expect(result).toHaveLength(2) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("skips assistant with error even if marked as summary", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "hello") - await addCompactionPart(session.id, u1) + it.instance("skips assistant with error even if marked as summary", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const u1 = yield* addUser(sessionID, "hello") + yield* addCompactionPart(sessionID, u1) const error = new MessageV2.APIError({ message: "boom", isRetryable: true, }).toObject() as MessageV2.Assistant["error"] - await addAssistant(session.id, u1, { summary: true, finish: "end_turn", error }) - await addUser(session.id, "retry") + yield* addAssistant(sessionID, u1, { summary: true, finish: "end_turn", error }) + yield* addUser(sessionID, "retry") - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) // Error assistant doesn't add to completed, so compaction boundary never triggers expect(result).toHaveLength(3) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("skips assistant without finish even if marked as summary", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "hello") - await addCompactionPart(session.id, u1) + it.instance("skips assistant without finish even if marked as summary", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const u1 = yield* addUser(sessionID, "hello") + yield* addCompactionPart(sessionID, u1) // summary=true but no finish - await addAssistant(session.id, u1, { summary: true }) - await addUser(session.id, "next") + yield* addAssistant(sessionID, u1, { summary: true }) + yield* addUser(sessionID, "next") - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) expect(result).toHaveLength(3) - - await svc.remove(session.id) - }, - }) - }) - - test("ignores original tail when compaction stores tail_start_id", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "first") - const a1 = await addAssistant(session.id, u1, { finish: "end_turn" }) - await svc.updatePart({ + }), + ), + ) + + it.instance("retains original tail when compaction stores tail_start_id", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const u1 = yield* addUser(sessionID, "first") + const a1 = yield* addAssistant(sessionID, u1, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a1, type: "text", text: "first reply", }) - const u2 = await addUser(session.id, "second") - const a2 = await addAssistant(session.id, u2, { finish: "end_turn" }) - await svc.updatePart({ + const u2 = yield* addUser(sessionID, "second") + const a2 = yield* addAssistant(sessionID, u2, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a2, type: "text", text: "second reply", }) - const c1 = await addUser(session.id) - await addCompactionPart(session.id, c1, u2) - const s1 = await addAssistant(session.id, c1, { summary: true, finish: "end_turn" }) - await svc.updatePart({ + const c1 = yield* addUser(sessionID) + yield* addCompactionPart(sessionID, c1, u2) + const s1 = yield* addAssistant(sessionID, c1, { summary: true, finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: s1, type: "text", text: "summary", }) - const u3 = await addUser(session.id, "third") - const a3 = await addAssistant(session.id, u3, { finish: "end_turn" }) - await svc.updatePart({ + const u3 = yield* addUser(sessionID, "third") + const a3 = yield* addAssistant(sessionID, u3, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a3, type: "text", text: "third reply", }) - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) - - expect(result.map((item) => item.info.id)).toEqual([c1, s1, u3, a3]) - - await svc.remove(session.id) - }, - }) - }) - - test("fork keeps legacy tail_start_id without replaying the tail", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "first") - const a1 = await addAssistant(session.id, u1, { finish: "end_turn" }) - await svc.updatePart({ - id: PartID.ascending(), - sessionID: session.id, - messageID: a1, - type: "text", - text: "first reply", - }) - - const u2 = await addUser(session.id, "second") - const a2 = await addAssistant(session.id, u2, { finish: "end_turn" }) - await svc.updatePart({ - id: PartID.ascending(), - sessionID: session.id, - messageID: a2, - type: "text", - text: "second reply", - }) - - const c1 = await addUser(session.id) - await addCompactionPart(session.id, c1, u2) - const s1 = await addAssistant(session.id, c1, { summary: true, finish: "end_turn" }) - await svc.updatePart({ - id: PartID.ascending(), - sessionID: session.id, - messageID: s1, - type: "text", - text: "summary", - }) - - const u3 = await addUser(session.id, "third") - const a3 = await addAssistant(session.id, u3, { finish: "end_turn" }) - await svc.updatePart({ - id: PartID.ascending(), - sessionID: session.id, - messageID: a3, - type: "text", - text: "third reply", - }) - - const parentFiltered = MessageV2.filterCompacted(MessageV2.stream(session.id)) - expect(parentFiltered.map((item) => item.info.id)).toEqual([c1, s1, u3, a3]) - - const forked = await svc.fork({ sessionID: session.id }) - const childFiltered = MessageV2.filterCompacted(MessageV2.stream(forked.id)) - expect(childFiltered).toHaveLength(parentFiltered.length) - - const tailPart = childFiltered.flatMap((m) => m.parts).find((p) => p.type === "compaction") - expect(tailPart?.type).toBe("compaction") - if (!tailPart || tailPart.type !== "compaction") throw new Error("Expected forked compaction part") - expect(tailPart.tail_start_id).toBeDefined() - expect(childFiltered.some((m) => m.info.id === tailPart.tail_start_id)).toBe(false) - - await svc.remove(forked.id) - await svc.remove(session.id) - }, - }) - }) - - test("does not replay an assistant tail when compaction starts inside a turn", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "first") - const a1 = await addAssistant(session.id, u1, { finish: "end_turn" }) - await svc.updatePart({ + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) + + expect(result.map((item) => item.info.id)).toEqual([c1, s1, u2, a2, u3, a3]) + }), + ), + ) + + it.instance("fork remaps compaction tail_start_id for filterCompacted", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const created = yield* session.create({}) + + const u1 = yield* addUser(created.id, "first") + const a1 = yield* addAssistant(created.id, u1, { finish: "end_turn" }) + yield* session.updatePart({ + id: PartID.ascending(), + sessionID: created.id, + messageID: a1, + type: "text", + text: "first reply", + }) + + const u2 = yield* addUser(created.id, "second") + const a2 = yield* addAssistant(created.id, u2, { finish: "end_turn" }) + yield* session.updatePart({ + id: PartID.ascending(), + sessionID: created.id, + messageID: a2, + type: "text", + text: "second reply", + }) + + const c1 = yield* addUser(created.id) + yield* addCompactionPart(created.id, c1, u2) + const s1 = yield* addAssistant(created.id, c1, { summary: true, finish: "end_turn" }) + yield* session.updatePart({ + id: PartID.ascending(), + sessionID: created.id, + messageID: s1, + type: "text", + text: "summary", + }) + + const u3 = yield* addUser(created.id, "third") + const a3 = yield* addAssistant(created.id, u3, { finish: "end_turn" }) + yield* session.updatePart({ + id: PartID.ascending(), + sessionID: created.id, + messageID: a3, + type: "text", + text: "third reply", + }) + + const parentFiltered = MessageV2.filterCompacted(MessageV2.stream(created.id)) + expect(parentFiltered.map((item) => item.info.id)).toEqual([c1, s1, u2, a2, u3, a3]) + + const forked = yield* session.fork({ sessionID: created.id }) + const childFiltered = MessageV2.filterCompacted(MessageV2.stream(forked.id)) + expect(childFiltered).toHaveLength(parentFiltered.length) + + const tailPart = childFiltered.flatMap((m) => m.parts).find((p) => p.type === "compaction") + expect(tailPart?.type).toBe("compaction") + if (!tailPart || tailPart.type !== "compaction") throw new Error("Expected forked compaction part") + expect(tailPart.tail_start_id).toBeDefined() + expect(childFiltered.some((m) => m.info.id === tailPart.tail_start_id)).toBe(true) + + yield* session.remove(forked.id) + yield* session.remove(created.id) + }), + ) + + it.instance("retains an assistant tail when compaction starts inside a turn", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const u1 = yield* addUser(sessionID, "first") + const a1 = yield* addAssistant(sessionID, u1, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a1, type: "text", text: "first reply", }) - const u2 = await addUser(session.id, "second") - const a2 = await addAssistant(session.id, u2, { finish: "end_turn" }) - await svc.updatePart({ + const u2 = yield* addUser(sessionID, "second") + const a2 = yield* addAssistant(sessionID, u2, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a2, type: "text", text: "second reply", }) - const a3 = await addAssistant(session.id, u2, { finish: "end_turn" }) - await svc.updatePart({ + const a3 = yield* addAssistant(sessionID, u2, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a3, type: "text", text: "tail reply", }) - const c1 = await addUser(session.id) - await addCompactionPart(session.id, c1, a3) - const s1 = await addAssistant(session.id, c1, { summary: true, finish: "end_turn" }) - await svc.updatePart({ + const c1 = yield* addUser(sessionID) + yield* addCompactionPart(sessionID, c1, a3) + const s1 = yield* addAssistant(sessionID, c1, { summary: true, finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: s1, type: "text", text: "summary", }) - const u3 = await addUser(session.id, "third") - const a4 = await addAssistant(session.id, u3, { finish: "end_turn" }) - await svc.updatePart({ + const u3 = yield* addUser(sessionID, "third") + const a4 = yield* addAssistant(sessionID, u3, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a4, type: "text", text: "third reply", }) - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) - expect(result.map((item) => item.info.id)).toEqual([c1, s1, u3, a4]) - - await svc.remove(session.id) - }, - }) - }) + expect(result.map((item) => item.info.id)).toEqual([c1, s1, a3, u3, a4]) + }), + ), + ) - test("prefers latest compaction boundary when repeated compactions exist", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - - const u1 = await addUser(session.id, "first") - const a1 = await addAssistant(session.id, u1, { finish: "end_turn" }) - await svc.updatePart({ + it.instance("prefers latest compaction boundary when repeated compactions exist", () => + withSession(({ session, sessionID }) => + Effect.gen(function* () { + const u1 = yield* addUser(sessionID, "first") + const a1 = yield* addAssistant(sessionID, u1, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a1, type: "text", text: "first reply", }) - const u2 = await addUser(session.id, "second") - const a2 = await addAssistant(session.id, u2, { finish: "end_turn" }) - await svc.updatePart({ + const u2 = yield* addUser(sessionID, "second") + const a2 = yield* addAssistant(sessionID, u2, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a2, type: "text", text: "second reply", }) - const c1 = await addUser(session.id) - await addCompactionPart(session.id, c1, u2) - const s1 = await addAssistant(session.id, c1, { summary: true, finish: "end_turn" }) - await svc.updatePart({ + const c1 = yield* addUser(sessionID) + yield* addCompactionPart(sessionID, c1, u2) + const s1 = yield* addAssistant(sessionID, c1, { summary: true, finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: s1, type: "text", text: "summary one", }) - const u3 = await addUser(session.id, "third") - const a3 = await addAssistant(session.id, u3, { finish: "end_turn" }) - await svc.updatePart({ + const u3 = yield* addUser(sessionID, "third") + const a3 = yield* addAssistant(sessionID, u3, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a3, type: "text", text: "third reply", }) - const c2 = await addUser(session.id) - await addCompactionPart(session.id, c2, u3) - const s2 = await addAssistant(session.id, c2, { summary: true, finish: "end_turn" }) - await svc.updatePart({ + const c2 = yield* addUser(sessionID) + yield* addCompactionPart(sessionID, c2, u3) + const s2 = yield* addAssistant(sessionID, c2, { summary: true, finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: s2, type: "text", text: "summary two", }) - const u4 = await addUser(session.id, "fourth") - const a4 = await addAssistant(session.id, u4, { finish: "end_turn" }) - await svc.updatePart({ + const u4 = yield* addUser(sessionID, "fourth") + const a4 = yield* addAssistant(sessionID, u4, { finish: "end_turn" }) + yield* session.updatePart({ id: PartID.ascending(), - sessionID: session.id, + sessionID, messageID: a4, type: "text", text: "fourth reply", }) - const result = MessageV2.filterCompacted(MessageV2.stream(session.id)) + const result = MessageV2.filterCompacted(MessageV2.stream(sessionID)) - expect(result.map((item) => item.info.id)).toEqual([c2, s2, u4, a4]) - - await svc.remove(session.id) - }, - }) - }) + expect(result.map((item) => item.info.id)).toEqual([c2, s2, u3, a3, u4, a4]) + }), + ), + ) test("works with array input", () => { // filterCompacted accepts any Iterable, not just generators @@ -1093,54 +993,44 @@ describe("MessageV2.cursor", () => { }) describe("MessageV2 consistency", () => { - test("page hydration matches get for each message", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 3) - - const paged = MessageV2.page({ sessionID: session.id, limit: 10 }) + it.instance("page hydration matches get for each message", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + yield* fill(sessionID, 3) + + const paged = yield* MessageV2.page({ sessionID, limit: 10 }) for (const item of paged.items) { - const got = MessageV2.get({ sessionID: session.id, messageID: item.info.id as MessageID }) + const got = yield* MessageV2.get({ sessionID, messageID: item.info.id as MessageID }) expect(got.info).toEqual(item.info) expect(got.parts).toEqual(item.parts) } + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("parts from get match standalone parts call", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - const [id] = await fill(session.id, 1) + it.instance("parts from get match standalone parts call", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + const [id] = yield* fill(sessionID, 1) - const got = MessageV2.get({ sessionID: session.id, messageID: id }) + const got = yield* MessageV2.get({ sessionID, messageID: id }) const standalone = MessageV2.parts(id) expect(got.parts).toEqual(standalone) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) - - test("stream collects same messages as exhaustive page iteration", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 7) + it.instance("stream collects same messages as exhaustive page iteration", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + yield* fill(sessionID, 7) - const streamed = Array.from(MessageV2.stream(session.id)) + const streamed = Array.from(MessageV2.stream(sessionID)) const paged = [] as MessageV2.WithParts[] let cursor: string | undefined while (true) { - const result = MessageV2.page({ sessionID: session.id, limit: 3, before: cursor }) + const result = yield* MessageV2.page({ sessionID, limit: 3, before: cursor }) for (let i = result.items.length - 1; i >= 0; i--) { paged.push(result.items[i]) } @@ -1149,26 +1039,20 @@ describe("MessageV2 consistency", () => { } expect(streamed.map((m) => m.info.id)).toEqual(paged.map((m) => m.info.id)) + }), + ), + ) - await svc.remove(session.id) - }, - }) - }) + it.instance("filterCompacted of full stream returns same as Array.from when no compaction", () => + withSession(({ sessionID }) => + Effect.gen(function* () { + yield* fill(sessionID, 4) - test("filterCompacted of full stream returns same as Array.from when no compaction", async () => { - await WithInstance.provide({ - directory: root, - fn: async () => { - const session = await svc.create({}) - await fill(session.id, 4) - - const filtered = MessageV2.filterCompacted(MessageV2.stream(session.id)) - const all = Array.from(MessageV2.stream(session.id)).reverse() + const filtered = MessageV2.filterCompacted(MessageV2.stream(sessionID)) + const all = Array.from(MessageV2.stream(sessionID)).reverse() expect(filtered.map((m) => m.info.id)).toEqual(all.map((m) => m.info.id)) - - await svc.remove(session.id) - }, - }) - }) + }), + ), + ) }) diff --git a/packages/opencode/test/session/processor-effect.test.ts b/packages/opencode/test/session/processor-effect.test.ts index 56ff10243065..78c7e4c64228 100644 --- a/packages/opencode/test/session/processor-effect.test.ts +++ b/packages/opencode/test/session/processor-effect.test.ts @@ -25,6 +25,8 @@ import { provideTmpdirServer } from "../fixture/fixture" import { testEffect } from "../lib/effect" import { raw, reply, TestLLMServer } from "../lib/llm-server" import { SyncEvent } from "@/sync" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { EventV2Bridge } from "@/event-v2-bridge" void Log.init({ print: false }) @@ -104,6 +106,17 @@ function defer() { return { promise, resolve } } +const waitFor = (check: Effect.Effect, message: string) => + Effect.gen(function* () { + const stop = Date.now() + 500 + while (Date.now() < stop) { + const value = yield* check + if (value !== undefined) return value + yield* Effect.sleep("10 millis") + } + return yield* Effect.fail(new Error(message)) + }) + const user = Effect.fn("TestSession.user")(function* (sessionID: SessionID, text: string) { const session = yield* Session.Service const msg = yield* session.updateMessage({ @@ -168,10 +181,16 @@ const deps = Layer.mergeAll( Provider.defaultLayer, status, SyncEvent.defaultLayer, + EventV2Bridge.defaultLayer, ).pipe(Layer.provideMerge(infra)) const env = Layer.mergeAll( TestLLMServer.layer, - SessionProcessor.layer.pipe(Layer.provide(summary), Layer.provide(Image.defaultLayer), Layer.provideMerge(deps)), + SessionProcessor.layer.pipe( + Layer.provide(summary), + Layer.provide(Image.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), + Layer.provideMerge(deps), + ), ) const it = testEffect(env) @@ -295,15 +314,10 @@ it.live("session.processor effect tests preserve text start time", () => }) .pipe(Effect.forkChild) - yield* Effect.promise(async () => { - const stop = Date.now() + 500 - while (Date.now() < stop) { - const text = MessageV2.parts(msg.id).find((part): part is MessageV2.TextPart => part.type === "text") - if (text?.time?.start) return - await Bun.sleep(10) - } - throw new Error("timed out waiting for text part") - }) + yield* waitFor( + Effect.sync(() => MessageV2.parts(msg.id).find((part): part is MessageV2.TextPart => part.type === "text")), + "timed out waiting for text part", + ) yield* Effect.sleep("20 millis") gate.resolve() @@ -685,14 +699,10 @@ it.live("session.processor effect tests mark pending tools as aborted on cleanup .pipe(Effect.forkChild) yield* llm.wait(1) - yield* Effect.promise(async () => { - const end = Date.now() + 500 - while (Date.now() < end) { - const parts = await MessageV2.parts(msg.id) - if (parts.some((part) => part.type === "tool")) return - await Bun.sleep(10) - } - }) + yield* waitFor( + Effect.sync(() => MessageV2.parts(msg.id).find((part): part is MessageV2.ToolPart => part.type === "tool")), + "timed out waiting for tool part", + ) yield* Fiber.interrupt(run) const exit = yield* Fiber.await(run) @@ -767,7 +777,7 @@ it.live("session.processor effect tests record aborted errors and idle state", ( const exit = yield* Fiber.await(run) yield* Effect.promise(() => seen.promise) - const stored = MessageV2.get({ sessionID: chat.id, messageID: msg.id }) + const stored = yield* MessageV2.get({ sessionID: chat.id, messageID: msg.id }) const state = yield* sts.get(chat.id) off() @@ -829,7 +839,7 @@ it.live("session.processor effect tests mark interruptions aborted without manua yield* Fiber.interrupt(run) const exit = yield* Fiber.await(run) - const stored = MessageV2.get({ sessionID: chat.id, messageID: msg.id }) + const stored = yield* MessageV2.get({ sessionID: chat.id, messageID: msg.id }) const state = yield* sts.get(chat.id) expect(Exit.isFailure(exit)).toBe(true) diff --git a/packages/opencode/test/session/prompt.test.ts b/packages/opencode/test/session/prompt.test.ts index 3821954945f5..6dc0899bb68b 100644 --- a/packages/opencode/test/session/prompt.test.ts +++ b/packages/opencode/test/session/prompt.test.ts @@ -1,12 +1,12 @@ import { NodeFileSystem } from "@effect/platform-node" import { FetchHttpClient } from "effect/unstable/http" import { expect } from "bun:test" -import { Cause, Effect, Exit, Fiber, Layer } from "effect" -import fs from "fs/promises" +import { Cause, Deferred, Duration, Effect, Exit, Fiber, Layer } from "effect" import path from "path" import { fileURLToPath, pathToFileURL } from "url" import { NamedError } from "@opencode-ai/core/util/error" import { Agent as AgentSvc } from "../../src/agent/agent" +import { BackgroundJob } from "@/background/job" import { Bus } from "../../src/bus" import { Command } from "../../src/command" import { Config } from "@/config/config" @@ -21,6 +21,7 @@ import { Image } from "../../src/image/image" import { ModelID, ProviderID } from "../../src/provider/schema" import { Question } from "../../src/question" import { Todo } from "../../src/session/todo" +import { SessionGoal } from "@/session/goal" import { Session } from "@/session/session" import { SessionMessageTable } from "../../src/session/session.sql" import { LLM } from "../../src/session/llm" @@ -48,10 +49,12 @@ import * as Database from "../../src/storage/db" import { Ripgrep } from "../../src/file/ripgrep" import { Format } from "../../src/format" import { Reference } from "../../src/reference/reference" -import { provideTmpdirInstance, provideTmpdirServer } from "../fixture/fixture" -import { testEffect } from "../lib/effect" +import { TestInstance } from "../fixture/fixture" +import { awaitWithTimeout, pollWithTimeout, testEffect } from "../lib/effect" import { reply, TestLLMServer } from "../lib/llm-server" import { SyncEvent } from "@/sync" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { EventV2Bridge } from "@/event-v2-bridge" void Log.init({ print: false }) @@ -69,14 +72,6 @@ const ref = { modelID: ModelID.make("test-model"), } -function defer() { - let resolve!: (value: T | PromiseLike) => void - const promise = new Promise((done) => { - resolve = done - }) - return { promise, resolve } -} - function withSh(fx: () => Effect.Effect) { return Effect.acquireUseRelease( Effect.sync(() => { @@ -114,6 +109,16 @@ function errorTool(parts: MessageV2.Part[]) { return part?.state.status === "error" ? (part as ErrorToolPart) : undefined } +function requestToolNames(body: Record) { + const tools = Array.isArray(body.tools) ? body.tools : [] + return tools.flatMap((item) => { + if (!item || typeof item !== "object") return [] + const tool = item as { name?: unknown; function?: { name?: unknown } } + const name = typeof tool.name === "string" ? tool.name : tool.function?.name + return typeof name === "string" ? [name] : [] + }) +} + const mcp = Layer.succeed( MCP.Service, MCP.Service.of({ @@ -160,9 +165,19 @@ const lsp = Layer.succeed( const status = SessionStatus.layer.pipe(Layer.provideMerge(Bus.layer)) const run = SessionRunState.layer.pipe(Layer.provide(status)) const infra = Layer.mergeAll(NodeFileSystem.layer, CrossSpawnSpawner.defaultLayer) -function makeHttp() { + +const processorCreateStarted: Array<() => void> = [] +const blockingProcessor = Layer.succeed( + SessionProcessor.Service, + SessionProcessor.Service.of({ + create: () => Effect.sync(() => processorCreateStarted.shift()?.()).pipe(Effect.andThen(Effect.never)), + }), +) + +function makeHttp(input?: { processor?: "blocking" }) { const deps = Layer.mergeAll( Session.defaultLayer, + SessionGoal.defaultLayer, Snapshot.defaultLayer, LLM.defaultLayer, Env.defaultLayer, @@ -175,8 +190,10 @@ function makeHttp() { lsp, mcp, AppFileSystem.defaultLayer, + BackgroundJob.defaultLayer, status, SyncEvent.defaultLayer, + EventV2Bridge.defaultLayer, ).pipe(Layer.provideMerge(infra)) const question = Question.layer.pipe(Layer.provideMerge(deps)) const todo = Todo.layer.pipe(Layer.provideMerge(deps)) @@ -188,17 +205,26 @@ function makeHttp() { Layer.provide(Reference.defaultLayer), Layer.provide(Ripgrep.defaultLayer), Layer.provide(Format.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), Layer.provideMerge(todo), Layer.provideMerge(question), Layer.provideMerge(deps), ) const trunc = Truncate.layer.pipe(Layer.provideMerge(deps)) - const proc = SessionProcessor.layer.pipe( - Layer.provide(summary), - Layer.provide(Image.defaultLayer), + const proc = + input?.processor === "blocking" + ? blockingProcessor + : SessionProcessor.layer.pipe( + Layer.provide(summary), + Layer.provide(Image.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), + Layer.provideMerge(deps), + ) + const compact = SessionCompaction.layer.pipe( + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), + Layer.provideMerge(proc), Layer.provideMerge(deps), ) - const compact = SessionCompaction.layer.pipe(Layer.provideMerge(proc), Layer.provideMerge(deps)) return Layer.mergeAll( TestLLMServer.layer, SessionPrompt.layer.pipe( @@ -213,13 +239,15 @@ function makeHttp() { Layer.provideMerge(trunc), Layer.provide(Instruction.defaultLayer), Layer.provide(SystemPrompt.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), Layer.provideMerge(deps), ), ).pipe(Layer.provide(summary)) } const it = testEffect(makeHttp()) -const unix = process.platform !== "win32" ? it.live : it.live.skip +const race = testEffect(makeHttp({ processor: "blocking" })) +const unix = process.platform !== "win32" ? it.instance : it.instance.skip // Config that registers a custom "test" provider with a "test-model" model // so provider model lookup succeeds inside the loop. @@ -268,6 +296,77 @@ function providerCfg(url: string) { } } +const writeText = Effect.fn("test.writeText")(function* (file: string, text: string) { + const fs = yield* AppFileSystem.Service + yield* fs.writeWithDirs(file, text) +}) + +const ensureDir = Effect.fn("test.ensureDir")(function* (dir: string) { + const fs = yield* AppFileSystem.Service + yield* fs.ensureDir(dir) +}) + +const writeConfig = Effect.fn("test.writeConfig")(function* (dir: string, config: Partial) { + yield* writeText( + path.join(dir, "opencode.json"), + JSON.stringify({ $schema: "https://opencode.ai/config.json", ...config }), + ) +}) + +const useServerConfig = Effect.fn("test.useServerConfig")(function* (config: (url: string) => Partial) { + const { directory: dir } = yield* TestInstance + const llm = yield* TestLLMServer + yield* writeConfig(dir, config(llm.url)) + return { dir, llm } +}) + +// Wait for a session's runner to enter a busy state. SessionStatus is flipped to +// "busy" inside Runner.startShell's modifyEffect at the same moment the runner +// is registered, so this is a deterministic readiness signal — cancel can't +// no-op once we observe it. +const waitForBusy = (sessionID: SessionID, duration: Duration.Input = "2 seconds") => + pollWithTimeout( + Effect.gen(function* () { + const status = yield* SessionStatus.Service + const s = yield* status.get(sessionID) + return s.type === "busy" ? (true as const) : undefined + }), + `session ${sessionID} never became busy`, + duration, + ) + +const hasBash = Effect.sync(() => Bun.which("bash") !== null) + +const deferredAsPromise = (deferred: Deferred.Deferred): PromiseLike => ({ + then: (onfulfilled, onrejected) => { + Effect.runFork( + Deferred.await(deferred).pipe( + Effect.match({ + onFailure: (error) => { + onrejected?.(error) + }, + onSuccess: (value) => { + onfulfilled?.(value) + }, + }), + ), + ) + return deferredAsPromise(deferred) as PromiseLike + }, +}) + +function defer() { + let resolve!: (value: T | PromiseLike) => void + const promise = new Promise((done) => { + resolve = done + }) + return { promise, resolve } +} + +const succeedVoid = (deferred: Deferred.Deferred) => { + Effect.runSync(Deferred.succeed(deferred, void 0).pipe(Effect.ignore)) +} + const user = Effect.fn("test.user")(function* (sessionID: SessionID, text: string) { const session = yield* Session.Service const msg = yield* session.updateMessage({ @@ -344,9 +443,11 @@ const boot = Effect.fn("test.boot")(function* (input?: { title?: string }) { // Loop semantics -it.live("loop exits immediately when last assistant has stop finish", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "loop exits immediately when last assistant has stop finish", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service const sessions = yield* Session.Service const chat = yield* sessions.create({ title: "Pinned" }) @@ -357,13 +458,14 @@ it.live("loop exits immediately when last assistant has stop finish", () => if (result.info.role === "assistant") expect(result.info.finish).toBe("stop") expect(yield* llm.calls).toBe(0) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("loop calls LLM and returns assistant message", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "loop calls LLM and returns assistant message", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service const sessions = yield* Session.Service const chat = yield* sessions.create({ @@ -384,13 +486,14 @@ it.live("loop calls LLM and returns assistant message", () => expect(parts.some((p) => p.type === "text" && p.text === "world")).toBe(true) expect(yield* llm.hits).toHaveLength(1) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("prompt emits v2 prompted and synthetic events", () => - provideTmpdirServer( - Effect.fnUntraced(function* () { +it.instance( + "prompt emits v2 prompted and synthetic events", + () => + Effect.gen(function* () { + yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service const sessions = yield* Session.Service const chat = yield* sessions.create({ title: "Pinned" }) @@ -425,13 +528,14 @@ it.live("prompt emits v2 prompted and synthetic events", () => ]), ) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("static loop returns assistant text through local provider", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "static loop returns assistant text through local provider", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service const sessions = yield* Session.Service const session = yield* sessions.create({ @@ -454,13 +558,14 @@ it.live("static loop returns assistant text through local provider", () => expect(yield* llm.hits).toHaveLength(1) expect(yield* llm.pending).toBe(0) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("static loop consumes queued replies across turns", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "static loop consumes queued replies across turns", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service const sessions = yield* Session.Service const session = yield* sessions.create({ @@ -497,892 +602,1496 @@ it.live("static loop consumes queued replies across turns", () => expect(yield* llm.hits).toHaveLength(2) expect(yield* llm.pending).toBe(0) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("loop continues when finish is tool-calls", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "goal continuation waits while user input is unanswered", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service const sessions = yield* Session.Service const session = yield* sessions.create({ - title: "Pinned", + title: "Goal continuation waits", permission: [{ permission: "*", pattern: "*", action: "allow" }], }) + yield* goals.create({ sessionID: session.id, objective: "continue only when idle" }) yield* prompt.prompt({ sessionID: session.id, agent: "build", noReply: true, - parts: [{ type: "text", text: "hello" }], + parts: [{ type: "text", text: "unanswered user work" }], }) - yield* llm.tool("first", { value: "first" }) - yield* llm.text("second") - const result = yield* prompt.loop({ sessionID: session.id }) - expect(yield* llm.calls).toBe(2) - expect(result.info.role).toBe("assistant") - if (result.info.role === "assistant") { - expect(result.parts.some((part) => part.type === "text" && part.text === "second")).toBe(true) - expect(result.info.finish).toBe("stop") - } + yield* prompt.continueGoal(session.id) + + expect(yield* llm.calls).toBe(0) + expect(yield* goals.get(session.id)).toMatchObject({ status: "active" }) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("glob tool keeps instance context during prompt runs", () => - provideTmpdirServer( - ({ dir, llm }) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({ - title: "Glob context", - permission: [{ permission: "*", pattern: "*", action: "allow" }], - }) - const file = path.join(dir, "probe.txt") - yield* Effect.promise(() => Bun.write(file, "probe")) +it.instance( + "goal continuation treats equal-time newer user input as unanswered", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal continuation same-time user", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "wait for same-time user" }) + const created = Date.now() + const initial = yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: session.id, + agent: "build", + model: ref, + time: { created: created - 1 }, + }) + const assistant = yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "assistant", + parentID: initial.id, + sessionID: session.id, + mode: "build", + agent: "build", + cost: 0, + path: { cwd: "/tmp", root: "/tmp" }, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: ref.modelID, + providerID: ref.providerID, + time: { created, completed: created }, + finish: "stop", + }) + yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: session.id, + agent: "build", + model: ref, + time: { created }, + }) - yield* prompt.prompt({ - sessionID: session.id, - agent: "build", - noReply: true, - parts: [{ type: "text", text: "find text files" }], - }) - yield* llm.tool("glob", { pattern: "**/*.txt" }) - yield* llm.text("done") + yield* prompt.continueGoal(session.id) - const result = yield* prompt.loop({ sessionID: session.id }) - expect(result.info.role).toBe("assistant") + expect(assistant.time.created).toBe(created) + expect(yield* llm.calls).toBe(0) + expect(yield* goals.get(session.id)).toMatchObject({ status: "active" }) + }), + { git: true }, +) - const msgs = yield* MessageV2.filterCompactedEffect(session.id) - const tool = msgs - .flatMap((msg) => msg.parts) - .find( - (part): part is CompletedToolPart => - part.type === "tool" && part.tool === "glob" && part.state.status === "completed", - ) - if (!tool) return +it.instance( + "goal continuation subscribes to idle when invoked while busy", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const sessionStatus = yield* SessionStatus.Service + const session = yield* sessions.create({ + title: "Goal continuation busy", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "continue after busy", tokenBudget: 2 }) + yield* seed(session.id, { finish: "stop" }) + yield* sessionStatus.set(session.id, { type: "busy" }) - expect(tool.state.output).toContain(file) - expect(tool.state.output).not.toContain("No context found for instance") - expect(result.parts.some((part) => part.type === "text" && part.text === "done")).toBe(true) - }), - { git: true, config: providerCfg }, - ), + yield* prompt.continueGoal(session.id) + expect(yield* llm.calls).toBe(0) + yield* Effect.yieldNow + + yield* llm.text("continued", { usage: { input: 1, output: 1 } }) + yield* sessionStatus.set(session.id, { type: "idle" }) + yield* awaitWithTimeout(llm.wait(1), "timed out waiting for goal continuation", "10 seconds") + const goal = yield* pollWithTimeout( + goals.get(session.id).pipe(Effect.map((next) => (next?.status === "budget_limited" ? next : undefined))), + "timed out waiting for goal accounting", + ) + + expect(yield* llm.calls).toBeGreaterThan(0) + expect(goal).toMatchObject({ status: "budget_limited", tokens: { used: 2 } }) + }), + { git: true }, ) -it.live("loop continues when finish is stop but assistant has tool parts", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "goal continuation lets queued user input win during the idle grace period", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service const sessions = yield* Session.Service + const sessionStatus = yield* SessionStatus.Service const session = yield* sessions.create({ - title: "Pinned", + title: "Goal continuation queued input", permission: [{ permission: "*", pattern: "*", action: "allow" }], }) + yield* goals.create({ sessionID: session.id, objective: "continue unless user queues work" }) + yield* seed(session.id, { finish: "stop" }) + yield* sessionStatus.set(session.id, { type: "busy" }) + yield* llm.text("should not be used", { usage: { input: 1, output: 1 } }) + + yield* prompt.continueGoal(session.id) + yield* sessionStatus.set(session.id, { type: "idle" }) + yield* Effect.sleep("50 millis") yield* prompt.prompt({ sessionID: session.id, agent: "build", noReply: true, - parts: [{ type: "text", text: "hello" }], + parts: [{ type: "text", text: "user follow-up should run next" }], }) - yield* llm.push(reply().tool("first", { value: "first" }).stop()) - yield* llm.text("second") + yield* Effect.sleep("250 millis") - const result = yield* prompt.loop({ sessionID: session.id }) - expect(yield* llm.calls).toBe(2) - expect(result.info.role).toBe("assistant") - if (result.info.role === "assistant") { - expect(result.parts.some((part) => part.type === "text" && part.text === "second")).toBe(true) - expect(result.info.finish).toBe("stop") - } + expect(yield* llm.calls).toBe(0) + expect(yield* goals.get(session.id)).toMatchObject({ status: "active" }) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live("failed subtask preserves metadata on error tool state", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "goal continuation coalesces duplicate idle resumes", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.tool("task", { - description: "inspect bug", - prompt: "look into the cache key path", - subagent_type: "general", + const session = yield* sessions.create({ + title: "Goal continuation duplicate resume", + permission: [{ permission: "*", pattern: "*", action: "allow" }], }) - yield* llm.text("done") - const msg = yield* user(chat.id, "hello") - yield* addSubtask(chat.id, msg.id) + yield* goals.create({ sessionID: session.id, objective: "continue once" }) + yield* seed(session.id, { finish: "stop" }) + yield* llm.text("continued once", { usage: { input: 1, output: 1 } }) - const result = yield* prompt.loop({ sessionID: chat.id }) - expect(result.info.role).toBe("assistant") - expect(yield* llm.calls).toBe(2) - - const msgs = yield* MessageV2.filterCompactedEffect(chat.id) - const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") - expect(taskMsg?.info.role).toBe("assistant") - if (!taskMsg || taskMsg.info.role !== "assistant") return + const first = yield* prompt.continueGoal(session.id).pipe(Effect.forkChild) + const second = yield* prompt.continueGoal(session.id).pipe(Effect.forkChild) + yield* Fiber.await(first) + yield* Fiber.await(second) - const tool = errorTool(taskMsg.parts) - if (!tool) return + expect(yield* llm.calls).toBe(1) + }), + { git: true }, +) - expect(tool.state.error).toContain("Tool execution failed") - expect(tool.state.metadata).toBeDefined() - expect(tool.state.metadata?.sessionId).toBeDefined() - expect(tool.state.metadata?.model).toEqual({ - providerID: ProviderID.make("test"), - modelID: ModelID.make("missing-model"), +it.instance( + "goal continuation enqueues a synthetic turn after completed work", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal continuation runs", + permission: [{ permission: "*", pattern: "*", action: "allow" }], }) + yield* goals.create({ sessionID: session.id, objective: "continue after idle", tokenBudget: 2 }) + yield* seed(session.id, { finish: "stop" }) + yield* llm.text("continued", { usage: { input: 1, output: 1 } }) + + yield* prompt.continueGoal(session.id) + const result = yield* sessions.messages({ sessionID: session.id }) + const synthetic = result + .flatMap((message) => message.parts) + .find((part) => part.type === "text" && part.synthetic && part.text.includes("Continue working toward")) + + expect(yield* llm.calls).toBeGreaterThan(0) + expect(synthetic).toBeDefined() + expect(synthetic?.type === "text" ? synthetic.text : "").toContain('Goal objective: "continue after idle"') + expect(synthetic?.type === "text" ? synthetic.metadata : undefined).toMatchObject({ goalContinuation: true }) + expect(yield* goals.get(session.id)).toMatchObject({ status: "budget_limited", tokens: { used: 2 } }) }), - { - git: true, - config: (url) => ({ - ...providerCfg(url), - agent: { - general: { - model: "test/missing-model", - }, - }, - }), - }, - ), + { git: true }, ) -it.live( - "running subtask preserves metadata after tool-call transition", +it.instance( + "goal continuation pauses after a synthetic turn makes no progress", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.hang - const msg = yield* user(chat.id, "hello") - yield* addSubtask(chat.id, msg.id) - - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - - const tool = yield* Effect.promise(async () => { - const end = Date.now() + 5_000 - while (Date.now() < end) { - const msgs = await Effect.runPromise(MessageV2.filterCompactedEffect(chat.id)) - const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") - const tool = taskMsg?.parts.find((part): part is MessageV2.ToolPart => part.type === "tool") - if (tool?.state.status === "running" && tool.state.metadata?.sessionId) return tool - await new Promise((done) => setTimeout(done, 20)) - } - throw new Error("timed out waiting for running subtask metadata") - }) + Effect.gen(function* () { + yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const llm = yield* TestLLMServer + const session = yield* sessions.create({ + title: "Goal continuation no progress", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "do not ask for direction forever" }) + const created = Date.now() + const synthetic = yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: session.id, + agent: "build", + model: ref, + time: { created }, + }) + yield* sessions.updatePart({ + id: PartID.ascending(), + messageID: synthetic.id, + sessionID: session.id, + type: "text", + synthetic: true, + text: "\nContinue working toward the active session goal.\n", + }) + const assistant = yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "assistant", + parentID: synthetic.id, + sessionID: session.id, + mode: "build", + agent: "build", + cost: 0, + path: { cwd: "/tmp", root: "/tmp" }, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: ref.modelID, + providerID: ref.providerID, + time: { created: created + 1, completed: created + 2 }, + finish: "stop", + }) + yield* sessions.updatePart({ + id: PartID.ascending(), + messageID: assistant.id, + sessionID: session.id, + type: "text", + text: "What task would you like me to work on?", + }) - if (tool.state.status !== "running") return - expect(typeof tool.state.metadata?.sessionId).toBe("string") - expect(tool.state.title).toBeDefined() - expect(tool.state.metadata?.model).toBeDefined() + yield* prompt.continueGoal(session.id) - yield* prompt.cancel(chat.id) - yield* Fiber.await(fiber) - }), - { git: true, config: providerCfg }, - ), - 5_000, + expect(yield* llm.calls).toBe(0) + expect(yield* goals.get(session.id)).toMatchObject({ status: "paused" }) + }), + { git: true }, ) -it.live( - "running task tool preserves metadata after tool-call transition", +it.instance( + "goal continuation stops after errored assistant work", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ - title: "Pinned", - permission: [{ permission: "*", pattern: "*", action: "allow" }], - }) - yield* llm.tool("task", { - description: "inspect bug", - prompt: "look into the cache key path", - subagent_type: "general", - }) - yield* llm.hang - yield* user(chat.id, "hello") - - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - - const tool = yield* Effect.promise(async () => { - const end = Date.now() + 5_000 - while (Date.now() < end) { - const msgs = await Effect.runPromise(MessageV2.filterCompactedEffect(chat.id)) - const assistant = msgs.findLast((item) => item.info.role === "assistant" && item.info.agent === "build") - const tool = assistant?.parts.find( - (part): part is MessageV2.ToolPart => part.type === "tool" && part.tool === "task", - ) - if (tool?.state.status === "running" && tool.state.metadata?.sessionId) return tool - await new Promise((done) => setTimeout(done, 20)) - } - throw new Error("timed out waiting for running task metadata") - }) + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal continuation error", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "do not loop on failure" }) + const created = Date.now() + const user = yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: session.id, + agent: "build", + model: ref, + time: { created }, + }) + yield* sessions.updatePart({ + id: PartID.ascending(), + messageID: user.id, + sessionID: session.id, + type: "text", + text: "start failure-prone work", + }) + yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "assistant", + parentID: user.id, + sessionID: session.id, + mode: "build", + agent: "build", + cost: 0, + path: { cwd: "/tmp", root: "/tmp" }, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: ref.modelID, + providerID: ref.providerID, + time: { created: created + 1, completed: created + 2 }, + error: new NamedError.Unknown({ message: "provider failed" }).toObject(), + }) - if (tool.state.status !== "running") return - expect(typeof tool.state.metadata?.sessionId).toBe("string") - expect(tool.state.title).toBe("inspect bug") - expect(tool.state.metadata?.model).toBeDefined() + yield* prompt.continueGoal(session.id) + const messages = yield* sessions.messages({ sessionID: session.id }) + const synthetic = messages.some( + (message) => + message.info.role === "user" && + message.parts.some( + (part) => part.type === "text" && part.synthetic && part.text.includes("Continue working toward"), + ), + ) - yield* prompt.cancel(chat.id) - yield* Fiber.await(fiber) - }), - { git: true, config: providerCfg }, - ), - 10_000, + expect(yield* llm.calls).toBe(0) + expect(synthetic).toBe(false) + expect(yield* goals.get(session.id)).toMatchObject({ status: "active" }) + }), + { git: true }, ) -it.live( - "loop sets status to busy then idle", +it.instance( + "goal continuation preserves the last user agent and model", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const status = yield* SessionStatus.Service - - yield* llm.hang - - const chat = yield* sessions.create({}) - yield* user(chat.id, "hi") + Effect.gen(function* () { + const { llm } = yield* useServerConfig((url) => ({ + ...providerCfg(url), + agent: { + reviewer: { + model: "test/test-model", + }, + }, + })) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal continuation agent", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "continue with reviewer", tokenBudget: 2 }) + const user = yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "user", + sessionID: session.id, + agent: "reviewer", + model: ref, + time: { created: Date.now() }, + }) + yield* sessions.updatePart({ + id: PartID.ascending(), + messageID: user.id, + sessionID: session.id, + type: "text", + text: "start reviewer work", + }) + yield* sessions.updateMessage({ + id: MessageID.ascending(), + role: "assistant", + parentID: user.id, + sessionID: session.id, + mode: "reviewer", + agent: "reviewer", + cost: 0, + path: { cwd: "/tmp", root: "/tmp" }, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: ref.modelID, + providerID: ref.providerID, + time: { created: Date.now() }, + }) + yield* llm.text("continued", { usage: { input: 1, output: 1 } }) + + yield* prompt.continueGoal(session.id) + const result = yield* sessions.messages({ sessionID: session.id }) + const synthetic = result.find( + (message) => + message.info.role === "user" && + message.parts.some( + (part) => part.type === "text" && part.synthetic && part.text.includes("Continue working toward"), + ), + ) - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) - expect((yield* status.get(chat.id)).type).toBe("busy") - yield* prompt.cancel(chat.id) - yield* Fiber.await(fiber) - expect((yield* status.get(chat.id)).type).toBe("idle") - }), - { git: true, config: providerCfg }, - ), - 3_000, + expect(synthetic?.info).toMatchObject({ + role: "user", + agent: "reviewer", + model: ref, + }) + }), + { git: true }, ) -// Cancel semantics - -it.live( - "cancel interrupts loop and resolves with an assistant message", +it.instance( + "goal tools return normal persisted tool output", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* seed(chat.id) + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal tools", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "verify native goal tools" }) + yield* goals.update({ sessionID: session.id, status: "paused" }) + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "what is the current goal?" }], + }) + yield* llm.tool("get_goal", {}) + yield* llm.text("goal checked") - yield* llm.hang + const result = yield* prompt.loop({ sessionID: session.id }) + const messages = yield* sessions.messages({ sessionID: session.id }) + const tool = messages + .flatMap((message) => message.parts) + .find((part): part is MessageV2.ToolPart => part.type === "tool" && part.tool === "get_goal") - yield* user(chat.id, "more") + expect(yield* llm.calls).toBe(2) + expect(result.info.role).toBe("assistant") + expect(tool?.state.status).toBe("completed") + if (tool?.state.status === "completed") { + expect(tool.state.title).toBe("Current goal") + expect(tool.state.output).toContain("verify native goal tools") + expect(tool.state.metadata.goal?.status).toBe("paused") + } + }), + { git: true }, +) - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) - yield* prompt.cancel(chat.id) - const exit = yield* Fiber.await(fiber) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - expect(exit.value.info.role).toBe("assistant") - } - }), - { git: true, config: providerCfg }, - ), +it.instance( + "goal tools hide create_goal unless the latest user explicitly asks", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal create hidden", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "what tools are available?" }], + }) + yield* llm.text("checked") + + yield* prompt.loop({ sessionID: session.id }) + const [body] = yield* llm.inputs + expect(requestToolNames(body)).toContain("get_goal") + expect(requestToolNames(body)).not.toContain("create_goal") + }), + { git: true }, +) + +it.instance( + "goal tools allow create_goal for explicit user request", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal create explicit", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "Create a goal to finish the migration" }], + }) + yield* llm.tool("create_goal", { objective: "finish the migration" }) + yield* llm.text("goal created") + + yield* prompt.loop({ sessionID: session.id }) + const [body] = yield* llm.inputs + const goal = yield* goals.get(session.id) + expect(requestToolNames(body)).toContain("create_goal") + expect(goal?.objective).toBe("finish the migration") + expect(goal?.status).toBe("active") + }), + { git: true }, +) + +it.instance( + "goal tools reject create_goal when a goal already exists", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const goals = yield* SessionGoal.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Goal change explicit", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* goals.create({ sessionID: session.id, objective: "finish the old migration" }) + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "Change the goal to finish the new migration" }], + }) + yield* llm.tool("create_goal", { objective: "finish the new migration" }) + yield* llm.text("goal updated") + + yield* prompt.loop({ sessionID: session.id }) + const [body] = yield* llm.inputs + const messages = yield* sessions.messages({ sessionID: session.id }) + const tool = messages + .flatMap((message) => message.parts) + .find((part): part is MessageV2.ToolPart => part.type === "tool" && part.tool === "create_goal") + const goal = yield* goals.get(session.id) + expect(requestToolNames(body)).toContain("create_goal") + expect(tool?.state.status).toBe("error") + if (tool?.state.status === "error") { + expect(tool.state.error).toContain("already exists") + } + expect(goal?.objective).toBe("finish the old migration") + expect(goal?.status).toBe("active") + }), + { git: true }, +) + +it.instance( + "loop continues when finish is tool-calls", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Pinned", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "hello" }], + }) + yield* llm.tool("first", { value: "first" }) + yield* llm.text("second") + + const result = yield* prompt.loop({ sessionID: session.id }) + expect(yield* llm.calls).toBe(2) + expect(result.info.role).toBe("assistant") + if (result.info.role === "assistant") { + expect(result.parts.some((part) => part.type === "text" && part.text === "second")).toBe(true) + expect(result.info.finish).toBe("stop") + } + }), + { git: true }, +) + +it.instance( + "glob tool keeps instance context during prompt runs", + () => + Effect.gen(function* () { + const { dir, llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Glob context", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + const file = path.join(dir, "probe.txt") + yield* writeText(file, "probe") + + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "find text files" }], + }) + yield* llm.tool("glob", { pattern: "**/*.txt" }) + yield* llm.text("done") + + const result = yield* prompt.loop({ sessionID: session.id }) + expect(result.info.role).toBe("assistant") + + const msgs = yield* MessageV2.filterCompactedEffect(session.id) + const tool = msgs + .flatMap((msg) => msg.parts) + .find( + (part): part is CompletedToolPart => + part.type === "tool" && part.tool === "glob" && part.state.status === "completed", + ) + if (!tool) return + + expect(tool.state.output).toContain(file) + expect(tool.state.output).not.toContain("No context found for instance") + expect(result.parts.some((part) => part.type === "text" && part.text === "done")).toBe(true) + }), + { git: true }, +) + +it.instance( + "loop continues when finish is stop but assistant has tool parts", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ + title: "Pinned", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "hello" }], + }) + yield* llm.push(reply().tool("first", { value: "first" }).stop()) + yield* llm.text("second") + + const result = yield* prompt.loop({ sessionID: session.id }) + expect(yield* llm.calls).toBe(2) + expect(result.info.role).toBe("assistant") + if (result.info.role === "assistant") { + expect(result.parts.some((part) => part.type === "text" && part.text === "second")).toBe(true) + expect(result.info.finish).toBe("stop") + } + }), + { git: true }, +) + +it.instance( + "failed subtask preserves metadata on error tool state", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig((url) => ({ + ...providerCfg(url), + agent: { + general: { + model: "test/missing-model", + }, + }, + })) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* llm.tool("task", { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + }) + yield* llm.text("done") + const msg = yield* user(chat.id, "hello") + yield* addSubtask(chat.id, msg.id) + + const result = yield* prompt.loop({ sessionID: chat.id }) + expect(result.info.role).toBe("assistant") + expect(yield* llm.calls).toBe(2) + + const msgs = yield* MessageV2.filterCompactedEffect(chat.id) + const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") + expect(taskMsg?.info.role).toBe("assistant") + if (!taskMsg || taskMsg.info.role !== "assistant") return + + const tool = errorTool(taskMsg.parts) + if (!tool) return + + expect(tool.state.error).toContain("Tool execution failed") + expect(tool.state.metadata).toBeDefined() + expect(tool.state.metadata?.sessionId).toBeDefined() + expect(tool.state.metadata?.model).toEqual({ + providerID: ProviderID.make("test"), + modelID: ModelID.make("missing-model"), + }) + }), + { git: true }, +) + +it.instance( + "running subtask preserves metadata after tool-call transition", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* llm.hang + const msg = yield* user(chat.id, "hello") + yield* addSubtask(chat.id, msg.id) + + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + + const tool = yield* pollWithTimeout( + Effect.gen(function* () { + const msgs = yield* MessageV2.filterCompactedEffect(chat.id) + const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") + const tool = taskMsg?.parts.find((part): part is MessageV2.ToolPart => part.type === "tool") + if (tool?.state.status === "running" && tool.state.metadata?.sessionId) return tool + }), + "timed out waiting for running subtask metadata", + ) + + if (tool.state.status !== "running") return + expect(typeof tool.state.metadata?.sessionId).toBe("string") + expect(tool.state.title).toBeDefined() + expect(tool.state.metadata?.model).toBeDefined() + + yield* prompt.cancel(chat.id) + yield* Fiber.await(fiber) + }), + { git: true }, + 5_000, +) + +it.instance( + "running task tool preserves metadata after tool-call transition", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ + title: "Pinned", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* llm.tool("task", { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + }) + yield* llm.hang + yield* user(chat.id, "hello") + + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + + const tool = yield* pollWithTimeout( + Effect.gen(function* () { + const msgs = yield* MessageV2.filterCompactedEffect(chat.id) + const assistant = msgs.findLast((item) => item.info.role === "assistant" && item.info.agent === "build") + const tool = assistant?.parts.find( + (part): part is MessageV2.ToolPart => part.type === "tool" && part.tool === "task", + ) + if (tool?.state.status === "running" && tool.state.metadata?.sessionId) return tool + }), + "timed out waiting for running task metadata", + ) + + if (tool.state.status !== "running") return + expect(typeof tool.state.metadata?.sessionId).toBe("string") + expect(tool.state.title).toBe("inspect bug") + expect(tool.state.metadata?.model).toBeDefined() + + yield* prompt.cancel(chat.id) + yield* Fiber.await(fiber) + }), + { git: true }, + 10_000, +) + +it.instance( + "loop sets status to busy then idle", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const status = yield* SessionStatus.Service + + yield* llm.hang + + const chat = yield* sessions.create({}) + yield* user(chat.id, "hi") + + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) + expect((yield* status.get(chat.id)).type).toBe("busy") + yield* prompt.cancel(chat.id) + yield* Fiber.await(fiber) + expect((yield* status.get(chat.id)).type).toBe("idle") + }), + { git: true }, 3_000, ) -it.live( - "cancel records MessageAbortedError on interrupted process", +// Cancel semantics + +it.instance( + "cancel interrupts loop and resolves with an assistant message", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.hang - yield* user(chat.id, "hello") + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* seed(chat.id) - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) - yield* prompt.cancel(chat.id) - const exit = yield* Fiber.await(fiber) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - const info = exit.value.info - if (info.role === "assistant") { - expect(info.error?.name).toBe("MessageAbortedError") - } + yield* llm.hang + + yield* user(chat.id, "more") + + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) + yield* prompt.cancel(chat.id) + const exit = yield* Fiber.await(fiber) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + expect(exit.value.info.role).toBe("assistant") + } + }), + { git: true }, + 3_000, +) + +it.instance( + "cancel records MessageAbortedError on interrupted process", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* llm.hang + yield* user(chat.id, "hello") + + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) + yield* prompt.cancel(chat.id) + const exit = yield* Fiber.await(fiber) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + const info = exit.value.info + if (info.role === "assistant") { + expect(info.error?.name).toBe("MessageAbortedError") } - }), - { git: true, config: providerCfg }, - ), + } + }), + { git: true }, 3_000, ) -it.live( +race.instance( + "finalizes assistant when cancelled before processor creation completes", + () => + Effect.gen(function* () { + yield* useServerConfig(providerCfg) + processorCreateStarted.length = 0 + yield* Effect.addFinalizer(() => + Effect.sync(() => { + processorCreateStarted.length = 0 + }), + ) + + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Processor creation race" }) + + yield* prompt.prompt({ + sessionID: chat.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "first" }], + }) + + const firstCreate = defer() + processorCreateStarted.push(firstCreate.resolve) + const first = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* Effect.promise(() => firstCreate.promise) + + yield* prompt.cancel(chat.id) + const firstExit = yield* Fiber.await(first) + expect(Exit.isSuccess(firstExit)).toBe(true) + + let messages = yield* sessions.messages({ sessionID: chat.id }) + const firstInterrupted = messages.at(-1) + expect(firstInterrupted?.info.role).toBe("assistant") + expect(firstInterrupted?.parts).toHaveLength(0) + if (firstInterrupted?.info.role === "assistant") { + expect(firstInterrupted.info.finish).toBeUndefined() + expect(firstInterrupted.info.time.completed).toBeNumber() + expect(firstInterrupted.info.error?.name).toBe("MessageAbortedError") + } + + yield* prompt.prompt({ + sessionID: chat.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "second" }], + }) + + const secondCreate = defer() + processorCreateStarted.push(secondCreate.resolve) + const second = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* Effect.promise(() => secondCreate.promise) + + yield* prompt.cancel(chat.id) + const secondExit = yield* Fiber.await(second) + expect(Exit.isSuccess(secondExit)).toBe(true) + + messages = yield* sessions.messages({ sessionID: chat.id }) + const poisonMessages = messages.filter( + (message) => + message.info.role === "assistant" && + message.parts.length === 0 && + !message.info.finish && + !message.info.time.completed && + !message.info.error, + ) + expect(poisonMessages).toHaveLength(0) + + const interruptedMessages = messages.filter( + (message) => + message.info.role === "assistant" && + message.parts.length === 0 && + message.info.time.completed && + message.info.error?.name === "MessageAbortedError", + ) + expect(interruptedMessages).toHaveLength(2) + + const lastUser = messages.at(-2) + const lastAssistant = messages.at(-1) + expect(lastUser?.info.role).toBe("user") + expect(lastAssistant?.info.role).toBe("assistant") + if (lastUser?.info.role === "user" && lastAssistant?.info.role === "assistant") { + expect(lastAssistant.info.parentID).toBe(lastUser?.info.id) + } + }), + { git: true }, + 3_000, +) + +it.instance( "cancel finalizes subtask tool state", () => - provideTmpdirInstance( - () => - Effect.gen(function* () { - const ready = defer() - const aborted = defer() - const registry = yield* ToolRegistry.Service - const { task } = yield* registry.named() - const original = task.execute - task.execute = (_args, ctx) => - Effect.callback((_resume) => { - ready.resolve() - ctx.abort.addEventListener("abort", () => aborted.resolve(), { once: true }) - return Effect.sync(() => aborted.resolve()) - }) - yield* Effect.addFinalizer(() => Effect.sync(() => void (task.execute = original))) - - const { prompt, chat } = yield* boot() - const msg = yield* user(chat.id, "hello") - yield* addSubtask(chat.id, msg.id) - - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* Effect.promise(() => ready.promise) - yield* prompt.cancel(chat.id) - yield* Effect.promise(() => aborted.promise) - - const exit = yield* Fiber.await(fiber) - expect(Exit.isSuccess(exit)).toBe(true) + Effect.gen(function* () { + const ready = yield* Deferred.make() + const aborted = yield* Deferred.make() + const registry = yield* ToolRegistry.Service + const { task } = yield* registry.named() + const original = task.execute + task.execute = (_args, ctx) => + Effect.callback((_resume) => { + ctx.abort.addEventListener("abort", () => succeedVoid(aborted), { once: true }) + if (ctx.abort.aborted) succeedVoid(aborted) + succeedVoid(ready) + return Effect.sync(() => succeedVoid(aborted)) + }) + yield* Effect.addFinalizer(() => Effect.sync(() => void (task.execute = original))) - const msgs = yield* MessageV2.filterCompactedEffect(chat.id) - const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") - expect(taskMsg?.info.role).toBe("assistant") - if (!taskMsg || taskMsg.info.role !== "assistant") return + const { prompt, chat } = yield* boot() + const msg = yield* user(chat.id, "hello") + yield* addSubtask(chat.id, msg.id) - const tool = toolPart(taskMsg.parts) - expect(tool?.type).toBe("tool") - if (!tool) return + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* awaitWithTimeout(Deferred.await(ready), "timed out waiting for task tool to start", "10 seconds") + yield* prompt.cancel(chat.id) - expect(tool.state.status).not.toBe("running") - expect(taskMsg.info.time.completed).toBeDefined() - expect(taskMsg.info.finish).toBeDefined() - }), - { git: true, config: cfg }, - ), + const exit = yield* Fiber.await(fiber) + expect(Exit.isSuccess(exit)).toBe(true) + yield* awaitWithTimeout(Deferred.await(aborted), "timed out waiting for task tool abort", "10 seconds") + + const msgs = yield* MessageV2.filterCompactedEffect(chat.id) + const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") + expect(taskMsg?.info.role).toBe("assistant") + if (!taskMsg || taskMsg.info.role !== "assistant") return + + const tool = toolPart(taskMsg.parts) + expect(tool?.type).toBe("tool") + if (!tool) return + + expect(tool.state.status).not.toBe("running") + expect(taskMsg.info.time.completed).toBeDefined() + expect(taskMsg.info.finish).toBeDefined() + }), + { git: true, config: cfg }, 30_000, ) -it.live( +it.instance( "cancel propagates from slash command subtask to child session", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const status = yield* SessionStatus.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.hang - const msg = yield* user(chat.id, "hello") - yield* addSubtask(chat.id, msg.id) - - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) - - const msgs = yield* MessageV2.filterCompactedEffect(chat.id) - const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") - const tool = taskMsg ? toolPart(taskMsg.parts) : undefined - const sessionID = tool?.state.status === "running" ? tool.state.metadata?.sessionId : undefined - expect(typeof sessionID).toBe("string") - if (typeof sessionID !== "string") throw new Error("missing child session id") - const childID = SessionID.make(sessionID) - expect((yield* status.get(childID)).type).toBe("busy") + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const status = yield* SessionStatus.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* llm.hang + const msg = yield* user(chat.id, "hello") + yield* addSubtask(chat.id, msg.id) - yield* prompt.cancel(chat.id) - const exit = yield* Fiber.await(fiber) - expect(Exit.isSuccess(exit)).toBe(true) + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) - expect((yield* status.get(chat.id)).type).toBe("idle") - expect((yield* status.get(childID)).type).toBe("idle") - }), - { git: true, config: providerCfg }, - ), + const msgs = yield* MessageV2.filterCompactedEffect(chat.id) + const taskMsg = msgs.find((item) => item.info.role === "assistant" && item.info.agent === "general") + const tool = taskMsg ? toolPart(taskMsg.parts) : undefined + const sessionID = tool?.state.status === "running" ? tool.state.metadata?.sessionId : undefined + expect(typeof sessionID).toBe("string") + if (typeof sessionID !== "string") throw new Error("missing child session id") + const childID = SessionID.make(sessionID) + expect((yield* status.get(childID)).type).toBe("busy") + + yield* prompt.cancel(chat.id) + const exit = yield* Fiber.await(fiber) + expect(Exit.isSuccess(exit)).toBe(true) + + expect((yield* status.get(chat.id)).type).toBe("idle") + expect((yield* status.get(childID)).type).toBe("idle") + }), + { git: true }, 10_000, ) -it.live( +it.instance( "cancel with queued callers resolves all cleanly", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.hang - yield* user(chat.id, "hello") - - const a = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) - const b = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* Effect.sleep(50) - - yield* prompt.cancel(chat.id) - const [exitA, exitB] = yield* Effect.all([Fiber.await(a), Fiber.await(b)]) - expect(Exit.isSuccess(exitA)).toBe(true) - expect(Exit.isSuccess(exitB)).toBe(true) - if (Exit.isSuccess(exitA) && Exit.isSuccess(exitB)) { - expect(exitA.value.info.id).toBe(exitB.value.info.id) - } - }), - { git: true, config: providerCfg }, - ), + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* llm.hang + yield* user(chat.id, "hello") + + const a = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) + const b = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* Effect.sleep(50) + + yield* prompt.cancel(chat.id) + const [exitA, exitB] = yield* Effect.all([Fiber.await(a), Fiber.await(b)]) + expect(Exit.isSuccess(exitA)).toBe(true) + expect(Exit.isSuccess(exitB)).toBe(true) + if (Exit.isSuccess(exitA) && Exit.isSuccess(exitB)) { + expect(exitA.value.info.id).toBe(exitB.value.info.id) + } + }), + { git: true }, 3_000, ) // Queue semantics -it.live("concurrent loop callers get same result", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - yield* seed(chat.id, { finish: "stop" }) +it.instance( + "concurrent loop callers get same result", + () => + Effect.gen(function* () { + const { prompt, run, chat } = yield* boot() + yield* seed(chat.id, { finish: "stop" }) - const [a, b] = yield* Effect.all([prompt.loop({ sessionID: chat.id }), prompt.loop({ sessionID: chat.id })], { - concurrency: "unbounded", - }) + const [a, b] = yield* Effect.all([prompt.loop({ sessionID: chat.id }), prompt.loop({ sessionID: chat.id })], { + concurrency: "unbounded", + }) - expect(a.info.id).toBe(b.info.id) - expect(a.info.role).toBe("assistant") - yield* run.assertNotBusy(chat.id) - }), - { git: true }, - ), + expect(a.info.id).toBe(b.info.id) + expect(a.info.role).toBe("assistant") + yield* run.assertNotBusy(chat.id) + }), + { git: true }, ) -it.live( +it.instance( "concurrent loop callers all receive same error result", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.fail("boom") - yield* user(chat.id, "hello") + yield* llm.fail("boom") + yield* user(chat.id, "hello") - const [a, b] = yield* Effect.all([prompt.loop({ sessionID: chat.id }), prompt.loop({ sessionID: chat.id })], { - concurrency: "unbounded", - }) - expect(a.info.id).toBe(b.info.id) - expect(a.info.role).toBe("assistant") - }), - { git: true, config: providerCfg }, - ), + const [a, b] = yield* Effect.all([prompt.loop({ sessionID: chat.id }), prompt.loop({ sessionID: chat.id })], { + concurrency: "unbounded", + }) + expect(a.info.id).toBe(b.info.id) + expect(a.info.role).toBe("assistant") + }), + { git: true }, 3_000, ) -it.live( +it.instance( "prompt submitted during an active run is included in the next LLM input", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const gate = defer() - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - - yield* llm.hold("first", gate.promise) - yield* llm.text("second") + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const gate = yield* Deferred.make() + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) - const a = yield* prompt - .prompt({ - sessionID: chat.id, - agent: "build", - model: ref, - parts: [{ type: "text", text: "first" }], - }) - .pipe(Effect.forkChild) + yield* llm.hold("first", deferredAsPromise(gate)) + yield* llm.text("second") - yield* llm.wait(1) + const a = yield* prompt + .prompt({ + sessionID: chat.id, + agent: "build", + model: ref, + parts: [{ type: "text", text: "first" }], + }) + .pipe(Effect.forkChild) - const id = MessageID.ascending() - const b = yield* prompt - .prompt({ - sessionID: chat.id, - messageID: id, - agent: "build", - model: ref, - parts: [{ type: "text", text: "second" }], - }) - .pipe(Effect.forkChild) + yield* llm.wait(1) - yield* Effect.promise(async () => { - const end = Date.now() + 5000 - while (Date.now() < end) { - const msgs = await Effect.runPromise(sessions.messages({ sessionID: chat.id })) - if (msgs.some((msg) => msg.info.role === "user" && msg.info.id === id)) return - await new Promise((done) => setTimeout(done, 20)) - } - throw new Error("timed out waiting for second prompt to save") + const id = MessageID.ascending() + const b = yield* prompt + .prompt({ + sessionID: chat.id, + messageID: id, + agent: "build", + model: ref, + parts: [{ type: "text", text: "second" }], }) + .pipe(Effect.forkChild) + + yield* pollWithTimeout( + sessions + .messages({ sessionID: chat.id }) + .pipe( + Effect.map((msgs) => + msgs.some((msg) => msg.info.role === "user" && msg.info.id === id) ? true : undefined, + ), + ), + "timed out waiting for second prompt to save", + ) - gate.resolve() - - const [ea, eb] = yield* Effect.all([Fiber.await(a), Fiber.await(b)]) - expect(Exit.isSuccess(ea)).toBe(true) - expect(Exit.isSuccess(eb)).toBe(true) - expect(yield* llm.calls).toBe(2) + yield* Deferred.succeed(gate, void 0) - const msgs = yield* sessions.messages({ sessionID: chat.id }) - const assistants = msgs.filter((msg) => msg.info.role === "assistant") - expect(assistants).toHaveLength(2) - const last = assistants.at(-1) - if (!last || last.info.role !== "assistant") throw new Error("expected second assistant") - expect(last.info.parentID).toBe(id) - expect(last.parts.some((part) => part.type === "text" && part.text === "second")).toBe(true) + const [ea, eb] = yield* Effect.all([Fiber.await(a), Fiber.await(b)]) + expect(Exit.isSuccess(ea)).toBe(true) + expect(Exit.isSuccess(eb)).toBe(true) + expect(yield* llm.calls).toBe(2) - const inputs = yield* llm.inputs - expect(inputs).toHaveLength(2) - expect(JSON.stringify(inputs.at(-1)?.messages)).toContain("second") - }), - { git: true, config: providerCfg }, - ), + const msgs = yield* sessions.messages({ sessionID: chat.id }) + const assistants = msgs.filter((msg) => msg.info.role === "assistant") + expect(assistants).toHaveLength(2) + const last = assistants.at(-1) + if (!last || last.info.role !== "assistant") throw new Error("expected second assistant") + expect(last.info.parentID).toBe(id) + expect(last.parts.some((part) => part.type === "text" && part.text === "second")).toBe(true) + + const inputs = yield* llm.inputs + expect(inputs).toHaveLength(2) + expect(JSON.stringify(inputs.at(-1)?.messages)).toContain("second") + }), + { git: true }, 3_000, ) -it.live( - "assertNotBusy throws BusyError when loop running", +it.instance( + "assertNotBusy fails with BusyError when loop running", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const run = yield* SessionRunState.Service - const sessions = yield* Session.Service - yield* llm.hang + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const run = yield* SessionRunState.Service + const sessions = yield* Session.Service + yield* llm.hang - const chat = yield* sessions.create({}) - yield* user(chat.id, "hi") + const chat = yield* sessions.create({}) + yield* user(chat.id, "hi") - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) - const exit = yield* run.assertNotBusy(chat.id).pipe(Effect.exit) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) { - expect(Cause.squash(exit.cause)).toBeInstanceOf(Session.BusyError) - } + const exit = yield* run.assertNotBusy(chat.id).pipe(Effect.exit) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + expect(Cause.squash(exit.cause)).toBeInstanceOf(Session.BusyError) + expect(Cause.squash(exit.cause)).toMatchObject({ _tag: "SessionBusyError", sessionID: chat.id }) + } - yield* prompt.cancel(chat.id) - yield* Fiber.await(fiber) - }), - { git: true, config: providerCfg }, - ), + yield* prompt.cancel(chat.id) + yield* Fiber.await(fiber) + }), + { git: true }, 3_000, ) -it.live("assertNotBusy succeeds when idle", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const run = yield* SessionRunState.Service - const sessions = yield* Session.Service +it.instance( + "assertNotBusy succeeds when idle", + () => + Effect.gen(function* () { + const run = yield* SessionRunState.Service + const sessions = yield* Session.Service - const chat = yield* sessions.create({}) - const exit = yield* run.assertNotBusy(chat.id).pipe(Effect.exit) - expect(Exit.isSuccess(exit)).toBe(true) - }), - { git: true }, - ), + const chat = yield* sessions.create({}) + const exit = yield* run.assertNotBusy(chat.id).pipe(Effect.exit) + expect(Exit.isSuccess(exit)).toBe(true) + }), + { git: true }, ) // Shell semantics -it.live( +it.instance( "shell rejects with BusyError when loop running", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Pinned" }) - yield* llm.hang - yield* user(chat.id, "hi") + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Pinned" }) + yield* llm.hang + yield* user(chat.id, "hi") - const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) + const fiber = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) - const exit = yield* prompt.shell({ sessionID: chat.id, agent: "build", command: "echo hi" }).pipe(Effect.exit) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) { - expect(Cause.squash(exit.cause)).toBeInstanceOf(Session.BusyError) - } + const exit = yield* prompt.shell({ sessionID: chat.id, agent: "build", command: "echo hi" }).pipe(Effect.exit) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + expect(Cause.squash(exit.cause)).toBeInstanceOf(Session.BusyError) + expect(Cause.squash(exit.cause)).toMatchObject({ _tag: "SessionBusyError", sessionID: chat.id }) + } - yield* prompt.cancel(chat.id) - yield* Fiber.await(fiber) - }), - { git: true, config: providerCfg }, - ), + yield* prompt.cancel(chat.id) + yield* Fiber.await(fiber) + }), + { git: true }, 3_000, ) -unix("shell captures stdout and stderr in completed tool output", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - const result = yield* prompt.shell({ - sessionID: chat.id, - agent: "build", - command: "printf out && printf err >&2", - }) +unix( + "shell captures stdout and stderr in completed tool output", + () => + Effect.gen(function* () { + const { prompt, run, chat } = yield* boot() + const result = yield* prompt.shell({ + sessionID: chat.id, + agent: "build", + command: "printf out && printf err >&2", + }) - expect(result.info.role).toBe("assistant") - const tool = completedTool(result.parts) - if (!tool) return + expect(result.info.role).toBe("assistant") + const tool = completedTool(result.parts) + if (!tool) return - expect(tool.state.output).toContain("out") - expect(tool.state.output).toContain("err") - expect(tool.state.metadata.output).toContain("out") - expect(tool.state.metadata.output).toContain("err") - yield* run.assertNotBusy(chat.id) - }), - { git: true, config: cfg }, - ), + expect(tool.state.output).toContain("out") + expect(tool.state.output).toContain("err") + expect(tool.state.metadata.output).toContain("out") + expect(tool.state.metadata.output).toContain("err") + yield* run.assertNotBusy(chat.id) + }), + { git: true, config: cfg }, ) -unix("shell completes a fast command on the preferred shell", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - const result = yield* prompt.shell({ - sessionID: chat.id, - agent: "build", - command: "pwd", - }) +unix( + "shell completes a fast command on the preferred shell", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const { prompt, run, chat } = yield* boot() + const result = yield* prompt.shell({ + sessionID: chat.id, + agent: "build", + command: "pwd", + }) - expect(result.info.role).toBe("assistant") - const tool = completedTool(result.parts) - if (!tool) return + expect(result.info.role).toBe("assistant") + const tool = completedTool(result.parts) + if (!tool) return - expect(tool.state.input.command).toBe("pwd") - expect(tool.state.output).toContain(dir) - expect(tool.state.metadata.output).toContain(dir) - yield* run.assertNotBusy(chat.id) - }), - { git: true, config: cfg }, - ), + expect(tool.state.input.command).toBe("pwd") + expect(tool.state.output).toContain(dir) + expect(tool.state.metadata.output).toContain(dir) + yield* run.assertNotBusy(chat.id) + }), + { git: true, config: cfg }, ) unix( "shell uses configured shell over env shell", () => withSh(() => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - if (!Bun.which("bash")) return - - const { prompt, chat } = yield* boot() - const result = yield* prompt.shell({ - sessionID: chat.id, - agent: "build", - command: "[[ 1 -eq 1 ]] && printf configured", - }) - - const tool = completedTool(result.parts) - if (!tool) return - expect(tool.state.output).toContain("configured") - }), - { git: true, config: { ...cfg, shell: "bash" } }, - ), - ), - 30_000, -) - -unix("shell commands can change directory after startup", () => - provideTmpdirInstance( - (dir) => Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - const parent = path.dirname(dir) + if (!(yield* hasBash)) return + + const { prompt, chat } = yield* boot() const result = yield* prompt.shell({ sessionID: chat.id, agent: "build", - command: "cd .. && pwd", + command: "[[ 1 -eq 1 ]] && printf configured", }) - expect(result.info.role).toBe("assistant") const tool = completedTool(result.parts) if (!tool) return - - expect(tool.state.output).toContain(parent) - expect(tool.state.metadata.output).toContain(parent) - yield* run.assertNotBusy(chat.id) + expect(tool.state.output).toContain("configured") }), - { git: true, config: cfg }, - ), + ), + { git: true, config: { ...cfg, shell: "bash" } }, + 30_000, ) -unix("shell lists files from the project directory", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - yield* Effect.promise(() => Bun.write(path.join(dir, "README.md"), "# e2e\n")) +unix( + "shell commands can change directory after startup", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const { prompt, run, chat } = yield* boot() + const parent = path.dirname(dir) + const result = yield* prompt.shell({ + sessionID: chat.id, + agent: "build", + command: "cd .. && pwd", + }) - const result = yield* prompt.shell({ - sessionID: chat.id, - agent: "build", - command: "command ls", - }) + expect(result.info.role).toBe("assistant") + const tool = completedTool(result.parts) + if (!tool) return - expect(result.info.role).toBe("assistant") - const tool = completedTool(result.parts) - if (!tool) return + expect(tool.state.output).toContain(parent) + expect(tool.state.metadata.output).toContain(parent) + yield* run.assertNotBusy(chat.id) + }), + { git: true, config: cfg }, +) - expect(tool.state.input.command).toBe("command ls") - expect(tool.state.output).toContain("README.md") - expect(tool.state.metadata.output).toContain("README.md") - yield* run.assertNotBusy(chat.id) - }), - { git: true, config: cfg }, - ), +unix( + "shell lists files from the project directory", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const { prompt, run, chat } = yield* boot() + yield* writeText(path.join(dir, "README.md"), "# e2e\n") + + const result = yield* prompt.shell({ + sessionID: chat.id, + agent: "build", + command: "command ls", + }) + + expect(result.info.role).toBe("assistant") + const tool = completedTool(result.parts) + if (!tool) return + + expect(tool.state.input.command).toBe("command ls") + expect(tool.state.output).toContain("README.md") + expect(tool.state.metadata.output).toContain("README.md") + yield* run.assertNotBusy(chat.id) + }), + { git: true, config: cfg }, ) -unix("shell captures stderr from a failing command", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - const result = yield* prompt.shell({ - sessionID: chat.id, - agent: "build", - command: "command -v __nonexistent_cmd_e2e__ || echo 'not found' >&2; exit 1", - }) +unix( + "shell captures stderr from a failing command", + () => + Effect.gen(function* () { + const { prompt, run, chat } = yield* boot() + const result = yield* prompt.shell({ + sessionID: chat.id, + agent: "build", + command: "command -v __nonexistent_cmd_e2e__ || echo 'not found' >&2; exit 1", + }) - expect(result.info.role).toBe("assistant") - const tool = completedTool(result.parts) - if (!tool) return + expect(result.info.role).toBe("assistant") + const tool = completedTool(result.parts) + if (!tool) return - expect(tool.state.output).toContain("not found") - expect(tool.state.metadata.output).toContain("not found") - yield* run.assertNotBusy(chat.id) - }), - { git: true, config: cfg }, - ), + expect(tool.state.output).toContain("not found") + expect(tool.state.metadata.output).toContain("not found") + yield* run.assertNotBusy(chat.id) + }), + { git: true, config: cfg }, ) unix( "shell updates running metadata before process exit", () => withSh(() => - provideTmpdirInstance( - (_dir) => + Effect.gen(function* () { + const { prompt, chat } = yield* boot() + + const fiber = yield* prompt + .shell({ sessionID: chat.id, agent: "build", command: "printf first && sleep 0.2 && printf second" }) + .pipe(Effect.forkChild) + + yield* pollWithTimeout( Effect.gen(function* () { - const { prompt, chat } = yield* boot() - - const fiber = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "printf first && sleep 0.2 && printf second" }) - .pipe(Effect.forkChild) - - yield* Effect.promise(async () => { - const start = Date.now() - while (Date.now() - start < 5000) { - const msgs = await MessageV2.filterCompacted(MessageV2.stream(chat.id)) - const taskMsg = msgs.find((item) => item.info.role === "assistant") - const tool = taskMsg ? toolPart(taskMsg.parts) : undefined - if (tool?.state.status === "running" && tool.state.metadata?.output.includes("first")) return - await new Promise((done) => setTimeout(done, 20)) - } - throw new Error("timed out waiting for running shell metadata") - }) - - const exit = yield* Fiber.await(fiber) - expect(Exit.isSuccess(exit)).toBe(true) + const msgs = yield* MessageV2.filterCompactedEffect(chat.id) + const taskMsg = msgs.find((item) => item.info.role === "assistant") + const tool = taskMsg ? toolPart(taskMsg.parts) : undefined + if (tool?.state.status === "running" && tool.state.metadata?.output.includes("first")) return true }), - { git: true, config: cfg }, - ), + "timed out waiting for running shell metadata", + ) + + const exit = yield* Fiber.await(fiber) + expect(Exit.isSuccess(exit)).toBe(true) + }), ), + { git: true, config: cfg }, 30_000, ) -it.live( +it.instance( "loop waits while shell runs and starts after shell exits", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ - title: "Pinned", - permission: [{ permission: "*", pattern: "*", action: "allow" }], - }) - yield* llm.text("after-shell") + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ + title: "Pinned", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* llm.text("after-shell") - const sh = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "sleep 0.2" }) - .pipe(Effect.forkChild) - yield* Effect.sleep(50) + const sh = yield* prompt + .shell({ sessionID: chat.id, agent: "build", command: "sleep 0.2" }) + .pipe(Effect.forkChild) + yield* waitForBusy(chat.id) - const loop = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* Effect.sleep(50) + const loop = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* Effect.sleep(50) - expect(yield* llm.calls).toBe(0) + expect(yield* llm.calls).toBe(0) - yield* Fiber.await(sh) - const exit = yield* Fiber.await(loop) + yield* Fiber.await(sh) + const exit = yield* Fiber.await(loop) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - expect(exit.value.info.role).toBe("assistant") - expect(exit.value.parts.some((part) => part.type === "text" && part.text === "after-shell")).toBe(true) - } - expect(yield* llm.calls).toBe(1) - }), - { git: true, config: providerCfg }, - ), + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + expect(exit.value.info.role).toBe("assistant") + expect(exit.value.parts.some((part) => part.type === "text" && part.text === "after-shell")).toBe(true) + } + expect(yield* llm.calls).toBe(1) + }), + { git: true }, 3_000, ) -it.live( +it.instance( "shell completion resumes queued loop callers", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ - title: "Pinned", - permission: [{ permission: "*", pattern: "*", action: "allow" }], - }) - yield* llm.text("done") + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ + title: "Pinned", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) + yield* llm.text("done") - const sh = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "sleep 0.2" }) - .pipe(Effect.forkChild) - yield* Effect.sleep(50) + const sh = yield* prompt + .shell({ sessionID: chat.id, agent: "build", command: "sleep 0.2" }) + .pipe(Effect.forkChild) + yield* waitForBusy(chat.id) - const a = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - const b = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* Effect.sleep(50) + const a = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + const b = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* Effect.sleep(50) - expect(yield* llm.calls).toBe(0) + expect(yield* llm.calls).toBe(0) - yield* Fiber.await(sh) - const [ea, eb] = yield* Effect.all([Fiber.await(a), Fiber.await(b)]) + yield* Fiber.await(sh) + const [ea, eb] = yield* Effect.all([Fiber.await(a), Fiber.await(b)]) - expect(Exit.isSuccess(ea)).toBe(true) - expect(Exit.isSuccess(eb)).toBe(true) - if (Exit.isSuccess(ea) && Exit.isSuccess(eb)) { - expect(ea.value.info.id).toBe(eb.value.info.id) - expect(ea.value.info.role).toBe("assistant") - } - expect(yield* llm.calls).toBe(1) - }), - { git: true, config: providerCfg }, - ), + expect(Exit.isSuccess(ea)).toBe(true) + expect(Exit.isSuccess(eb)).toBe(true) + if (Exit.isSuccess(ea) && Exit.isSuccess(eb)) { + expect(ea.value.info.id).toBe(eb.value.info.id) + expect(ea.value.info.role).toBe("assistant") + } + expect(yield* llm.calls).toBe(1) + }), + { git: true }, 3_000, ) @@ -1390,38 +2099,33 @@ unix( "command ! expansion uses configured shell over env shell", () => withSh(() => - provideTmpdirServer( - ({ llm }) => - Effect.gen(function* () { - if (!Bun.which("bash")) return + Effect.gen(function* () { + if (!(yield* hasBash)) return + const { llm } = yield* useServerConfig((url) => ({ + ...providerCfg(url), + shell: "bash", + command: { + probe: { + template: "Probe: !`[[ 1 -eq 1 ]] && printf configured`", + }, + }, + })) - const { prompt, chat } = yield* boot() - yield* llm.text("done") + const { prompt, chat } = yield* boot() + yield* llm.text("done") - const result = yield* prompt.command({ - sessionID: chat.id, - command: "probe", - arguments: "", - }) + const result = yield* prompt.command({ + sessionID: chat.id, + command: "probe", + arguments: "", + }) - expect(result.info.role).toBe("assistant") - const inputs = yield* llm.inputs - expect(JSON.stringify(inputs.at(-1)?.messages)).toContain("configured") - }), - { - git: true, - config: (url) => ({ - ...providerCfg(url), - shell: "bash", - command: { - probe: { - template: "Probe: !`[[ 1 -eq 1 ]] && printf configured`", - }, - }, - }), - }, - ), + expect(result.info.role).toBe("assistant") + const inputs = yield* llm.inputs + expect(JSON.stringify(inputs.at(-1)?.messages)).toContain("configured") + }), ), + { git: true }, 30_000, ) @@ -1429,36 +2133,33 @@ unix( "cancel interrupts shell and resolves cleanly", () => withSh(() => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, run, chat } = yield* boot() - - const sh = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "sleep 30" }) - .pipe(Effect.forkChild) - yield* Effect.sleep(50) - - yield* prompt.cancel(chat.id) - - const status = yield* SessionStatus.Service - expect((yield* status.get(chat.id)).type).toBe("idle") - const busy = yield* run.assertNotBusy(chat.id).pipe(Effect.exit) - expect(Exit.isSuccess(busy)).toBe(true) - - const exit = yield* Fiber.await(sh) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - expect(exit.value.info.role).toBe("assistant") - const tool = completedTool(exit.value.parts) - if (tool) { - expect(tool.state.output).toContain("User aborted the command") - } - } - }), - { git: true, config: cfg }, - ), + Effect.gen(function* () { + const { prompt, run, chat } = yield* boot() + + const sh = yield* prompt + .shell({ sessionID: chat.id, agent: "build", command: "sleep 30" }) + .pipe(Effect.forkChild) + yield* waitForBusy(chat.id) + + yield* prompt.cancel(chat.id) + + const status = yield* SessionStatus.Service + expect((yield* status.get(chat.id)).type).toBe("idle") + const busy = yield* run.assertNotBusy(chat.id).pipe(Effect.exit) + expect(Exit.isSuccess(busy)).toBe(true) + + const exit = yield* Fiber.await(sh) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + expect(exit.value.info.role).toBe("assistant") + const tool = completedTool(exit.value.parts) + if (tool) { + expect(tool.state.output).toContain("User aborted the command") + } + } + }), ), + { git: true, config: cfg }, 30_000, ) @@ -1466,114 +2167,119 @@ unix( "cancel persists aborted shell result when shell ignores TERM", () => withSh(() => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, chat } = yield* boot() - - const sh = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "trap '' TERM; sleep 30" }) - .pipe(Effect.forkChild) - yield* Effect.sleep(50) - - yield* prompt.cancel(chat.id) - - const exit = yield* Fiber.await(sh) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - expect(exit.value.info.role).toBe("assistant") - const tool = completedTool(exit.value.parts) - if (tool) { - expect(tool.state.output).toContain("User aborted the command") - } - } - }), - { git: true, config: cfg }, - ), + Effect.gen(function* () { + const { prompt, chat } = yield* boot() + const { directory: dir } = yield* TestInstance + const afs = yield* AppFileSystem.Service + const ready = path.join(dir, ".trap-ready") + + const sh = yield* prompt + .shell({ + sessionID: chat.id, + agent: "build", + // Touch marker AFTER trap installs so the test waits for the actual + // ignore-TERM state before cancelling; otherwise SIGTERM can arrive + // before `trap` runs and the escalation path is never exercised. + command: `trap '' TERM; touch "${ready}"; sleep 30`, + }) + .pipe(Effect.forkChild) + + yield* Effect.gen(function* () { + while (!(yield* afs.existsSafe(ready))) { + yield* Effect.sleep(Duration.millis(10)) + } + }).pipe(Effect.timeout(Duration.seconds(5))) + + yield* prompt.cancel(chat.id) + + const exit = yield* Fiber.await(sh) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + expect(exit.value.info.role).toBe("assistant") + const tool = completedTool(exit.value.parts) + if (tool) { + expect(tool.state.output).toContain("User aborted the command") + } + } + }), ), + { git: true, config: cfg }, 30_000, ) unix( "cancel finalizes interrupted bash tool output through normal truncation", () => - provideTmpdirServer( - ({ dir, llm }) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ - title: "Interrupted bash truncation", - permission: [{ permission: "*", pattern: "*", action: "allow" }], - }) + Effect.gen(function* () { + const { dir, llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ + title: "Interrupted bash truncation", + permission: [{ permission: "*", pattern: "*", action: "allow" }], + }) - yield* prompt.prompt({ - sessionID: chat.id, - agent: "build", - noReply: true, - parts: [{ type: "text", text: "run bash" }], - }) + yield* prompt.prompt({ + sessionID: chat.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "run bash" }], + }) - yield* llm.tool("bash", { - command: - 'i=0; while [ "$i" -lt 4000 ]; do printf "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx %05d\\n" "$i"; i=$((i + 1)); done; sleep 30', - description: "Print many lines", - timeout: 30_000, - workdir: path.resolve(dir), - }) + yield* llm.tool("bash", { + command: + 'i=0; while [ "$i" -lt 4000 ]; do printf "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx %05d\\n" "$i"; i=$((i + 1)); done; sleep 30', + description: "Print many lines", + timeout: 30_000, + workdir: path.resolve(dir), + }) - const run = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* llm.wait(1) - yield* Effect.sleep(150) - yield* prompt.cancel(chat.id) + const run = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* llm.wait(1) + yield* Effect.sleep(150) + yield* prompt.cancel(chat.id) - const exit = yield* Fiber.await(run) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isFailure(exit)) return + const exit = yield* Fiber.await(run) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isFailure(exit)) return - const tool = completedTool(exit.value.parts) - if (!tool) return + const tool = completedTool(exit.value.parts) + if (!tool) return - expect(tool.state.metadata.truncated).toBe(true) - expect(typeof tool.state.metadata.outputPath).toBe("string") - expect(tool.state.output).toMatch(/\.\.\.output truncated\.\.\./) - expect(tool.state.output).toMatch(/Full output saved to:\s+\S+/) - expect(tool.state.output).not.toContain("Tool execution aborted") - }), - { git: true, config: providerCfg }, - ), + expect(tool.state.metadata.truncated).toBe(true) + expect(typeof tool.state.metadata.outputPath).toBe("string") + expect(tool.state.output).toMatch(/\.\.\.output truncated\.\.\./) + expect(tool.state.output).toMatch(/Full output saved to:\s+\S+/) + expect(tool.state.output).not.toContain("Tool execution aborted") + }), + { git: true }, 30_000, ) unix( "cancel interrupts loop queued behind shell", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, chat } = yield* boot() + Effect.gen(function* () { + const { prompt, chat } = yield* boot() - const sh = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "sleep 30" }) - .pipe(Effect.forkChild) - yield* Effect.sleep(50) + const sh = yield* prompt.shell({ sessionID: chat.id, agent: "build", command: "sleep 30" }).pipe(Effect.forkChild) + yield* waitForBusy(chat.id) - const loop = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) - yield* Effect.sleep(50) + const loop = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild) + yield* Effect.sleep(50) - yield* prompt.cancel(chat.id) + yield* prompt.cancel(chat.id) - const exit = yield* Fiber.await(loop) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - const tool = completedTool(exit.value.parts) - expect(tool?.state.output).toContain("User aborted the command") - } + const exit = yield* Fiber.await(loop) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + const tool = completedTool(exit.value.parts) + expect(tool?.state.output).toContain("User aborted the command") + } - yield* Fiber.await(sh) - }), - { git: true, config: cfg }, - ), + yield* Fiber.await(sh) + }), + { git: true, config: cfg }, 30_000, ) @@ -1581,422 +2287,405 @@ unix( "shell rejects when another shell is already running", () => withSh(() => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const { prompt, chat } = yield* boot() - - const a = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "sleep 30" }) - .pipe(Effect.forkChild) - yield* Effect.sleep(50) - - const exit = yield* prompt - .shell({ sessionID: chat.id, agent: "build", command: "echo hi" }) - .pipe(Effect.exit) - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) { - expect(Cause.squash(exit.cause)).toBeInstanceOf(Session.BusyError) - } - - yield* prompt.cancel(chat.id) - yield* Fiber.await(a) - }), - { git: true, config: cfg }, - ), + Effect.gen(function* () { + const { prompt, chat } = yield* boot() + + const a = yield* prompt + .shell({ sessionID: chat.id, agent: "build", command: "sleep 30" }) + .pipe(Effect.forkChild) + yield* waitForBusy(chat.id) + + const exit = yield* prompt.shell({ sessionID: chat.id, agent: "build", command: "echo hi" }).pipe(Effect.exit) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + expect(Cause.squash(exit.cause)).toBeInstanceOf(Session.BusyError) + } + + yield* prompt.cancel(chat.id) + yield* Fiber.await(a) + }), ), + { git: true, config: cfg }, 30_000, ) // Abort signal propagation tests for inline tool execution -/** Override a tool's execute to hang until aborted. Returns ready/aborted defers and a finalizer. */ function hangUntilAborted(tool: { execute: (...args: any[]) => any }) { - const ready = defer() - const aborted = defer() - const original = tool.execute - tool.execute = (_args: any, ctx: any) => { - ready.resolve() - ctx.abort.addEventListener("abort", () => aborted.resolve(), { once: true }) - return Effect.callback(() => {}) - } - const restore = Effect.addFinalizer(() => Effect.sync(() => void (tool.execute = original))) - return { ready, aborted, restore } + return Effect.gen(function* () { + const ready = yield* Deferred.make() + const aborted = yield* Deferred.make() + const original = tool.execute + tool.execute = (_args: any, ctx: any) => { + ctx.abort.addEventListener("abort", () => succeedVoid(aborted), { once: true }) + if (ctx.abort.aborted) succeedVoid(aborted) + succeedVoid(ready) + return Effect.callback(() => Effect.sync(() => succeedVoid(aborted))) + } + const restore = Effect.addFinalizer(() => Effect.sync(() => void (tool.execute = original))) + return { ready, aborted, restore } + }) } -it.live( - "interrupt propagates abort signal to read tool via file part (text/plain)", - () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const registry = yield* ToolRegistry.Service - const { read } = yield* registry.named() - const { ready, aborted, restore } = hangUntilAborted(read) - yield* restore - - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Abort Test" }) - - const testFile = path.join(dir, "test.txt") - yield* Effect.promise(() => Bun.write(testFile, "hello world")) - - const fiber = yield* prompt - .prompt({ - sessionID: chat.id, - agent: "build", - parts: [ - { type: "text", text: "read this" }, - { type: "file", url: `file://${testFile}`, filename: "test.txt", mime: "text/plain" }, - ], - }) - .pipe(Effect.forkChild) - - yield* Effect.promise(() => ready.promise) - yield* Fiber.interrupt(fiber) - - yield* Effect.promise(() => - Promise.race([ - aborted.promise, - new Promise((_, reject) => - setTimeout(() => reject(new Error("abort signal not propagated within 2s")), 2_000), - ), - ]), - ) - }), - { git: true, config: cfg }, - ), +it.instance( + "interrupt propagates abort signal to read tool via file part (text/plain)", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const registry = yield* ToolRegistry.Service + const { read } = yield* registry.named() + const { ready, restore } = yield* hangUntilAborted(read) + yield* restore + + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Abort Test" }) + + const testFile = path.join(dir, "test.txt") + yield* writeText(testFile, "hello world") + + const fiber = yield* prompt + .prompt({ + sessionID: chat.id, + agent: "build", + parts: [ + { type: "text", text: "read this" }, + { type: "file", url: `file://${testFile}`, filename: "test.txt", mime: "text/plain" }, + ], + }) + .pipe(Effect.forkChild) + + yield* awaitWithTimeout(Deferred.await(ready), "timed out waiting for read tool to start", "10 seconds") + yield* prompt.cancel(chat.id) + yield* Fiber.interrupt(fiber) + const exit = yield* Fiber.await(fiber) + expect(Exit.isFailure(exit)).toBe(true) + }), + { git: true, config: cfg }, 30_000, ) -it.live( +it.instance( "interrupt propagates abort signal to read tool via file part (directory)", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const registry = yield* ToolRegistry.Service - const { read } = yield* registry.named() - const { ready, aborted, restore } = hangUntilAborted(read) - yield* restore - - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const chat = yield* sessions.create({ title: "Abort Test" }) - - const fiber = yield* prompt - .prompt({ - sessionID: chat.id, - agent: "build", - parts: [ - { type: "text", text: "read this" }, - { type: "file", url: `file://${dir}`, filename: "dir", mime: "application/x-directory" }, - ], - }) - .pipe(Effect.forkChild) - - yield* Effect.promise(() => ready.promise) - yield* Fiber.interrupt(fiber) - - yield* Effect.promise(() => - Promise.race([ - aborted.promise, - new Promise((_, reject) => - setTimeout(() => reject(new Error("abort signal not propagated within 2s")), 2_000), - ), - ]), - ) - }), - { git: true, config: cfg }, - ), - 30_000, -) - -// Missing file handling + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const registry = yield* ToolRegistry.Service + const { read } = yield* registry.named() + const { ready, restore } = yield* hangUntilAborted(read) + yield* restore -it.live("does not fail the prompt when a file part is missing", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const chat = yield* sessions.create({ title: "Abort Test" }) - const missing = path.join(dir, "does-not-exist.ts") - const msg = yield* prompt.prompt({ - sessionID: session.id, + const fiber = yield* prompt + .prompt({ + sessionID: chat.id, agent: "build", - noReply: true, parts: [ - { type: "text", text: "please review @does-not-exist.ts" }, - { - type: "file", - mime: "text/plain", - url: `file://${missing}`, - filename: "does-not-exist.ts", - }, + { type: "text", text: "read this" }, + { type: "file", url: `file://${dir}`, filename: "dir", mime: "application/x-directory" }, ], }) + .pipe(Effect.forkChild) - if (msg.info.role !== "user") throw new Error("expected user message") - const hasFailure = msg.parts.some( - (part) => part.type === "text" && part.synthetic && part.text.includes("Read tool failed to read"), - ) - expect(hasFailure).toBe(true) + yield* awaitWithTimeout(Deferred.await(ready), "timed out waiting for read tool to start", "10 seconds") + yield* prompt.cancel(chat.id) + yield* Fiber.interrupt(fiber) + const exit = yield* Fiber.await(fiber) + expect(Exit.isFailure(exit)).toBe(true) + }), + { git: true, config: cfg }, + 30_000, +) - yield* sessions.remove(session.id) - }), - { git: true, config: cfg }, - ), +// Missing file handling + +it.instance( + "does not fail the prompt when a file part is missing", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + + const missing = path.join(dir, "does-not-exist.ts") + const msg = yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [ + { type: "text", text: "please review @does-not-exist.ts" }, + { + type: "file", + mime: "text/plain", + url: `file://${missing}`, + filename: "does-not-exist.ts", + }, + ], + }) + + if (msg.info.role !== "user") throw new Error("expected user message") + const hasFailure = msg.parts.some( + (part) => part.type === "text" && part.synthetic && part.text.includes("Read tool failed to read"), + ) + expect(hasFailure).toBe(true) + + yield* sessions.remove(session.id) + }), + { git: true, config: cfg }, ) -it.live("keeps stored part order stable when file resolution is async", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) +it.instance( + "keeps stored part order stable when file resolution is async", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) - const missing = path.join(dir, "still-missing.ts") - const msg = yield* prompt.prompt({ - sessionID: session.id, - agent: "build", - noReply: true, - parts: [ - { - type: "file", - mime: "text/plain", - url: `file://${missing}`, - filename: "still-missing.ts", - }, - { type: "text", text: "after-file" }, - ], - }) + const missing = path.join(dir, "still-missing.ts") + const msg = yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [ + { + type: "file", + mime: "text/plain", + url: `file://${missing}`, + filename: "still-missing.ts", + }, + { type: "text", text: "after-file" }, + ], + }) - if (msg.info.role !== "user") throw new Error("expected user message") + if (msg.info.role !== "user") throw new Error("expected user message") - const stored = MessageV2.get({ - sessionID: session.id, - messageID: msg.info.id, - }) - const text = stored.parts.filter((part) => part.type === "text").map((part) => part.text) + const stored = yield* MessageV2.get({ + sessionID: session.id, + messageID: msg.info.id, + }) + const text = stored.parts.filter((part) => part.type === "text").map((part) => part.text) - expect(text[0]?.startsWith("Called the Read tool with the following input:")).toBe(true) - expect(text[1]?.includes("Read tool failed to read")).toBe(true) - expect(text[2]).toBe("after-file") + expect(text[0]?.startsWith("Called the Read tool with the following input:")).toBe(true) + expect(text[1]?.includes("Read tool failed to read")).toBe(true) + expect(text[2]).toBe("after-file") - yield* sessions.remove(session.id) - }), - { git: true, config: cfg }, - ), + yield* sessions.remove(session.id) + }), + { git: true, config: cfg }, ) -it.live("resolves configured reference mentions before workspace paths and agents", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const docs = path.join(dir, "external-docs") - yield* Effect.promise(() => fs.mkdir(path.join(docs, "guide"), { recursive: true })) - yield* Effect.promise(() => fs.mkdir(path.join(dir, "docs"), { recursive: true })) - yield* Effect.promise(() => Bun.write(path.join(docs, "README.md"), "reference readme")) - yield* Effect.promise(() => Bun.write(path.join(docs, "guide", "intro.md"), "reference intro")) - yield* Effect.promise(() => Bun.write(path.join(dir, "docs", "README.md"), "workspace readme")) - - const prompt = yield* SessionPrompt.Service - const parts = yield* prompt.resolvePromptParts( - "Use @docs and @docs/README.md and @docs/guide and @docs/missing.md and @docs/README.md and @build", - ) - const references = parts.filter( - (part): part is MessageV2.TextPartInput => - part.type === "text" && part.synthetic === true && part.text.startsWith("Referenced configured reference "), - ) - const files = parts.filter((part): part is MessageV2.FilePartInput => part.type === "file") - const agents = parts.filter((part): part is MessageV2.AgentPartInput => part.type === "agent") - const bare = references.find((part) => part.text.includes("@docs.")) - const missing = references.find((part) => part.text.includes("@docs/missing.md")) - const guide = files.find((part) => part.filename === "docs/guide") - - expect(references.length).toBe(2) - expect(bare?.metadata?.reference).toMatchObject({ - name: "docs", - kind: "local", - path: docs, - }) - expect(missing?.text).toContain("Path does not exist inside configured reference @docs") - expect(missing?.metadata?.reference).toMatchObject({ - target: "missing.md", - targetPath: path.join(docs, "missing.md"), - }) +it.instance( + "resolves configured reference mentions before workspace paths and agents", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const docs = path.join(dir, "external-docs") + yield* ensureDir(path.join(docs, "guide")) + yield* ensureDir(path.join(dir, "docs")) + yield* writeText(path.join(docs, "README.md"), "reference readme") + yield* writeText(path.join(docs, "guide", "intro.md"), "reference intro") + yield* writeText(path.join(dir, "docs", "README.md"), "workspace readme") - expect(files.length).toBe(2) - expect(files.map((file) => fileURLToPath(file.url)).sort()).toEqual( - [path.join(docs, "README.md"), path.join(docs, "guide")].sort(), - ) - expect(guide?.mime).toBe("application/x-directory") - expect(agents.map((agent) => agent.name)).toEqual(["build"]) - }), - { - git: true, - config: { - ...cfg, - reference: { - docs: "./external-docs", - }, + const prompt = yield* SessionPrompt.Service + const parts = yield* prompt.resolvePromptParts( + "Use @docs and @docs/README.md and @docs/guide and @docs/missing.md and @docs/README.md and @build", + ) + const references = parts.filter( + (part): part is MessageV2.TextPartInput => + part.type === "text" && part.synthetic === true && part.text.startsWith("Referenced configured reference "), + ) + const files = parts.filter((part): part is MessageV2.FilePartInput => part.type === "file") + const agents = parts.filter((part): part is MessageV2.AgentPartInput => part.type === "agent") + const bare = references.find((part) => part.text.includes("@docs.")) + const missing = references.find((part) => part.text.includes("@docs/missing.md")) + const guide = files.find((part) => part.filename === "docs/guide") + + expect(references.length).toBe(2) + expect(bare?.metadata?.reference).toMatchObject({ + name: "docs", + kind: "local", + path: docs, + }) + expect(missing?.text).toContain("Path does not exist inside configured reference @docs") + expect(missing?.metadata?.reference).toMatchObject({ + target: "missing.md", + targetPath: path.join(docs, "missing.md"), + }) + + expect(files.length).toBe(2) + expect(files.map((file) => fileURLToPath(file.url)).sort()).toEqual( + [path.join(docs, "README.md"), path.join(docs, "guide")].sort(), + ) + expect(guide?.mime).toBe("application/x-directory") + expect(agents.map((agent) => agent.name)).toEqual(["build"]) + }), + { + git: true, + config: { + ...cfg, + reference: { + docs: "./external-docs", }, }, - ), + }, ) -it.live("injects metadata for bare configured reference mentions", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const docs = path.join(dir, "external-docs") - yield* Effect.promise(() => fs.mkdir(docs, { recursive: true })) +it.instance( + "injects metadata for bare configured reference mentions", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const docs = path.join(dir, "external-docs") + yield* ensureDir(docs) - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) - const message = yield* prompt.prompt({ - sessionID: session.id, - noReply: true, - parts: yield* prompt.resolvePromptParts("Use @docs for context"), - }) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + const message = yield* prompt.prompt({ + sessionID: session.id, + noReply: true, + parts: yield* prompt.resolvePromptParts("Use @docs for context"), + }) - const stored = MessageV2.get({ sessionID: session.id, messageID: message.info.id }) - const synthetic = stored.parts.filter( - (part): part is MessageV2.TextPart => part.type === "text" && part.synthetic === true, - ) - const reference = synthetic.find((part) => part.text.startsWith("Referenced configured reference @docs.")) + const stored = yield* MessageV2.get({ sessionID: session.id, messageID: message.info.id }) + const synthetic = stored.parts.filter( + (part): part is MessageV2.TextPart => part.type === "text" && part.synthetic === true, + ) + const reference = synthetic.find((part) => part.text.startsWith("Referenced configured reference @docs.")) - expect(reference?.metadata?.reference).toMatchObject({ name: "docs", kind: "local", path: docs }) - expect(synthetic.some((part) => part.text.includes(`Reference root: ${docs}`))).toBe(true) - expect(synthetic.some((part) => part.text.includes("subagent scout"))).toBe(true) + expect(reference?.metadata?.reference).toMatchObject({ name: "docs", kind: "local", path: docs }) + expect(synthetic.some((part) => part.text.includes(`Reference root: ${docs}`))).toBe(true) + expect(synthetic.some((part) => part.text.includes("subagent scout"))).toBe(true) - yield* sessions.remove(session.id) - }), - { - git: true, - config: { - ...cfg, - reference: { - docs: "./external-docs", - }, + yield* sessions.remove(session.id) + }), + { + git: true, + config: { + ...cfg, + reference: { + docs: "./external-docs", }, }, - ), + }, ) -it.live("injects metadata for configured reference file attachments", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - const docs = path.join(dir, "external-docs") - const readme = path.join(docs, "README.md") - yield* Effect.promise(() => fs.mkdir(docs, { recursive: true })) - yield* Effect.promise(() => Bun.write(readme, "reference readme")) - - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) - const message = yield* prompt.prompt({ - sessionID: session.id, - agent: "build", - noReply: true, - parts: [ - { type: "text", text: "Read @docs/README.md" }, - { +it.instance( + "injects metadata for configured reference file attachments", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + const docs = path.join(dir, "external-docs") + const readme = path.join(docs, "README.md") + yield* ensureDir(docs) + yield* writeText(readme, "reference readme") + + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + const message = yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [ + { type: "text", text: "Read @docs/README.md" }, + { + type: "file", + mime: "text/plain", + filename: "docs/README.md", + url: pathToFileURL(readme).href, + source: { type: "file", - mime: "text/plain", - filename: "docs/README.md", - url: pathToFileURL(readme).href, - source: { - type: "file", - path: "docs/README.md", - text: { value: "@docs/README.md", start: 5, end: 20 }, - }, + path: "docs/README.md", + text: { value: "@docs/README.md", start: 5, end: 20 }, }, - ], - }) + }, + ], + }) - const stored = MessageV2.get({ sessionID: session.id, messageID: message.info.id }) - const synthetic = stored.parts.filter( - (part): part is MessageV2.TextPart => part.type === "text" && part.synthetic === true, - ) - const reference = synthetic.find((part) => - part.text.startsWith("Referenced configured reference @docs/README.md."), - ) + const stored = yield* MessageV2.get({ sessionID: session.id, messageID: message.info.id }) + const synthetic = stored.parts.filter( + (part): part is MessageV2.TextPart => part.type === "text" && part.synthetic === true, + ) + const reference = synthetic.find((part) => + part.text.startsWith("Referenced configured reference @docs/README.md."), + ) - expect(reference?.metadata?.reference).toMatchObject({ - name: "docs", - kind: "local", - path: docs, - target: "README.md", - targetPath: readme, - source: { value: "@docs/README.md", start: 5, end: 20 }, - }) - expect(synthetic.findIndex((part) => part === reference)).toBeLessThan( - synthetic.findIndex((part) => part.text.startsWith("Called the Read tool with the following input:")), - ) + expect(reference?.metadata?.reference).toMatchObject({ + name: "docs", + kind: "local", + path: docs, + target: "README.md", + targetPath: readme, + source: { value: "@docs/README.md", start: 5, end: 20 }, + }) + expect(synthetic.findIndex((part) => part === reference)).toBeLessThan( + synthetic.findIndex((part) => part.text.startsWith("Called the Read tool with the following input:")), + ) - yield* sessions.remove(session.id) - }), - { - git: true, - config: { - ...cfg, - reference: { - docs: "./external-docs", - }, + yield* sessions.remove(session.id) + }), + { + git: true, + config: { + ...cfg, + reference: { + docs: "./external-docs", }, }, - ), + }, ) // Special characters in filenames -it.live("handles filenames with # character", () => - provideTmpdirInstance( - (dir) => - Effect.gen(function* () { - yield* Effect.promise(() => Bun.write(path.join(dir, "file#name.txt"), "special content\n")) +it.instance( + "handles filenames with # character", + () => + Effect.gen(function* () { + const { directory: dir } = yield* TestInstance + yield* writeText(path.join(dir, "file#name.txt"), "special content\n") - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) - const parts = yield* prompt.resolvePromptParts("Read @file#name.txt") - const fileParts = parts.filter((part) => part.type === "file") + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + const parts = yield* prompt.resolvePromptParts("Read @file#name.txt") + const fileParts = parts.filter((part) => part.type === "file") - expect(fileParts.length).toBe(1) - expect(fileParts[0].filename).toBe("file#name.txt") - expect(fileParts[0].url).toContain("%23") + expect(fileParts.length).toBe(1) + expect(fileParts[0].filename).toBe("file#name.txt") + expect(fileParts[0].url).toContain("%23") - const decodedPath = fileURLToPath(fileParts[0].url) - expect(decodedPath).toBe(path.join(dir, "file#name.txt")) + const decodedPath = fileURLToPath(fileParts[0].url) + expect(decodedPath).toBe(path.join(dir, "file#name.txt")) - const message = yield* prompt.prompt({ - sessionID: session.id, - parts, - noReply: true, - }) - const stored = MessageV2.get({ sessionID: session.id, messageID: message.info.id }) - const textParts = stored.parts.filter((part) => part.type === "text") - const hasContent = textParts.some((part) => part.text.includes("special content")) - expect(hasContent).toBe(true) + const message = yield* prompt.prompt({ + sessionID: session.id, + parts, + noReply: true, + }) + const stored = yield* MessageV2.get({ sessionID: session.id, messageID: message.info.id }) + const textParts = stored.parts.filter((part) => part.type === "text") + const hasContent = textParts.some((part) => part.text.includes("special content")) + expect(hasContent).toBe(true) - yield* sessions.remove(session.id) - }), - { git: true, config: cfg }, - ), + yield* sessions.remove(session.id) + }), + { git: true, config: cfg }, ) // Regression: empty assistant turn loop -it.live("does not loop empty assistant turns for a simple reply", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { +it.instance( + "does not loop empty assistant turns for a simple reply", + () => + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) const prompt = yield* SessionPrompt.Service const sessions = yield* Session.Service const session = yield* sessions.create({ title: "Prompt regression" }) @@ -2016,222 +2705,210 @@ it.live("does not loop empty assistant turns for a simple reply", () => expect(msgs.filter((msg) => msg.info.role === "assistant")).toHaveLength(1) expect(yield* llm.calls).toBe(1) }), - { git: true, config: providerCfg }, - ), + { git: true }, ) -it.live( +it.instance( "records aborted errors when prompt is cancelled mid-stream", () => - provideTmpdirServer( - Effect.fnUntraced(function* ({ llm }) { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({ title: "Prompt cancel regression" }) + Effect.gen(function* () { + const { llm } = yield* useServerConfig(providerCfg) + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ title: "Prompt cancel regression" }) - yield* llm.hang + yield* llm.hang - const fiber = yield* prompt - .prompt({ - sessionID: session.id, - agent: "build", - parts: [{ type: "text", text: "Cancel me" }], - }) - .pipe(Effect.forkChild) + const fiber = yield* prompt + .prompt({ + sessionID: session.id, + agent: "build", + parts: [{ type: "text", text: "Cancel me" }], + }) + .pipe(Effect.forkChild) - yield* llm.wait(1) - yield* prompt.cancel(session.id) + yield* llm.wait(1) + yield* prompt.cancel(session.id) - const exit = yield* Fiber.await(fiber) - expect(Exit.isSuccess(exit)).toBe(true) - if (Exit.isSuccess(exit)) { - expect(exit.value.info.role).toBe("assistant") - if (exit.value.info.role === "assistant") { - expect(exit.value.info.error?.name).toBe("MessageAbortedError") - } + const exit = yield* Fiber.await(fiber) + expect(Exit.isSuccess(exit)).toBe(true) + if (Exit.isSuccess(exit)) { + expect(exit.value.info.role).toBe("assistant") + if (exit.value.info.role === "assistant") { + expect(exit.value.info.error?.name).toBe("MessageAbortedError") } + } - const msgs = yield* sessions.messages({ sessionID: session.id }) - const last = msgs.findLast((msg) => msg.info.role === "assistant") - expect(last?.info.role).toBe("assistant") - if (last?.info.role === "assistant") { - expect(last.info.error?.name).toBe("MessageAbortedError") - } - }), - { git: true, config: providerCfg }, - ), + const msgs = yield* sessions.messages({ sessionID: session.id }) + const last = msgs.findLast((msg) => msg.info.role === "assistant") + expect(last?.info.role).toBe("assistant") + if (last?.info.role === "assistant") { + expect(last.info.error?.name).toBe("MessageAbortedError") + } + }), + { git: true }, 3_000, ) // Agent variant -it.live("applies agent variant only when using agent model", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) +it.instance( + "applies agent variant only when using agent model", + () => + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) - const other = yield* prompt.prompt({ - sessionID: session.id, - agent: "build", - model: { providerID: ProviderID.make("opencode"), modelID: ModelID.make("kimi-k2.5-free") }, - noReply: true, - parts: [{ type: "text", text: "hello" }], - }) - if (other.info.role !== "user") throw new Error("expected user message") - expect(other.info.model.variant).toBeUndefined() + const other = yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + model: { providerID: ProviderID.make("opencode"), modelID: ModelID.make("kimi-k2.5-free") }, + noReply: true, + parts: [{ type: "text", text: "hello" }], + }) + if (other.info.role !== "user") throw new Error("expected user message") + expect(other.info.model.variant).toBeUndefined() - const match = yield* prompt.prompt({ - sessionID: session.id, - agent: "build", - noReply: true, - parts: [{ type: "text", text: "hello again" }], - }) - if (match.info.role !== "user") throw new Error("expected user message") - expect(match.info.model).toEqual({ - providerID: ProviderID.make("test"), - modelID: ModelID.make("test-model"), - variant: "xhigh", - }) - expect(match.info.model.variant).toBe("xhigh") + const match = yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + parts: [{ type: "text", text: "hello again" }], + }) + if (match.info.role !== "user") throw new Error("expected user message") + expect(match.info.model).toEqual({ + providerID: ProviderID.make("test"), + modelID: ModelID.make("test-model"), + variant: "xhigh", + }) + expect(match.info.model.variant).toBe("xhigh") - const override = yield* prompt.prompt({ - sessionID: session.id, - agent: "build", - noReply: true, - variant: "high", - parts: [{ type: "text", text: "hello third" }], - }) - if (override.info.role !== "user") throw new Error("expected user message") - expect(override.info.model.variant).toBe("high") + const override = yield* prompt.prompt({ + sessionID: session.id, + agent: "build", + noReply: true, + variant: "high", + parts: [{ type: "text", text: "hello third" }], + }) + if (override.info.role !== "user") throw new Error("expected user message") + expect(override.info.model.variant).toBe("high") - yield* sessions.remove(session.id) - }), - { - git: true, - config: { - ...cfg, - provider: { - ...cfg.provider, - test: { - ...cfg.provider.test, - models: { - "test-model": { - ...cfg.provider.test.models["test-model"], - variants: { xhigh: {}, high: {} }, - }, + yield* sessions.remove(session.id) + }), + { + git: true, + config: { + ...cfg, + provider: { + ...cfg.provider, + test: { + ...cfg.provider.test, + models: { + "test-model": { + ...cfg.provider.test.models["test-model"], + variants: { xhigh: {}, high: {} }, }, }, }, - agent: { - build: { - model: "test/test-model", - variant: "xhigh", - }, + }, + agent: { + build: { + model: "test/test-model", + variant: "xhigh", }, }, }, - ), + }, ) // Agent / command resolution errors -it.live( +it.instance( "unknown agent throws typed error", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) - const exit = yield* prompt - .prompt({ - sessionID: session.id, - agent: "nonexistent-agent-xyz", - noReply: true, - parts: [{ type: "text", text: "hello" }], - }) - .pipe(Effect.exit) - - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) { - const err = Cause.squash(exit.cause) - expect(err).not.toBeInstanceOf(TypeError) - expect(NamedError.Unknown.isInstance(err)).toBe(true) - if (NamedError.Unknown.isInstance(err)) { - expect(err.data.message).toContain('Agent not found: "nonexistent-agent-xyz"') - } - } - }), - { git: true }, - ), + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + const exit = yield* prompt + .prompt({ + sessionID: session.id, + agent: "nonexistent-agent-xyz", + noReply: true, + parts: [{ type: "text", text: "hello" }], + }) + .pipe(Effect.exit) + + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const err = Cause.squash(exit.cause) + expect(err).not.toBeInstanceOf(TypeError) + expect(NamedError.Unknown.isInstance(err)).toBe(true) + if (NamedError.Unknown.isInstance(err)) { + expect(err.data.message).toContain('Agent not found: "nonexistent-agent-xyz"') + } + } + }), + { git: true }, 30_000, ) -it.live( +it.instance( "unknown agent error includes available agent names", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) - const exit = yield* prompt - .prompt({ - sessionID: session.id, - agent: "nonexistent-agent-xyz", - noReply: true, - parts: [{ type: "text", text: "hello" }], - }) - .pipe(Effect.exit) - - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) { - const err = Cause.squash(exit.cause) - expect(NamedError.Unknown.isInstance(err)).toBe(true) - if (NamedError.Unknown.isInstance(err)) { - expect(err.data.message).toContain("build") - } - } - }), - { git: true }, - ), + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + const exit = yield* prompt + .prompt({ + sessionID: session.id, + agent: "nonexistent-agent-xyz", + noReply: true, + parts: [{ type: "text", text: "hello" }], + }) + .pipe(Effect.exit) + + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const err = Cause.squash(exit.cause) + expect(NamedError.Unknown.isInstance(err)).toBe(true) + if (NamedError.Unknown.isInstance(err)) { + expect(err.data.message).toContain("build") + } + } + }), + { git: true }, 30_000, ) -it.live( +it.instance( "unknown command throws typed error with available names", () => - provideTmpdirInstance( - (_dir) => - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({}) - const exit = yield* prompt - .command({ - sessionID: session.id, - command: "nonexistent-command-xyz", - arguments: "", - }) - .pipe(Effect.exit) - - expect(Exit.isFailure(exit)).toBe(true) - if (Exit.isFailure(exit)) { - const err = Cause.squash(exit.cause) - expect(err).not.toBeInstanceOf(TypeError) - expect(NamedError.Unknown.isInstance(err)).toBe(true) - if (NamedError.Unknown.isInstance(err)) { - expect(err.data.message).toContain('Command not found: "nonexistent-command-xyz"') - expect(err.data.message).toContain("init") - } - } - }), - { git: true }, - ), + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({}) + const exit = yield* prompt + .command({ + sessionID: session.id, + command: "nonexistent-command-xyz", + arguments: "", + }) + .pipe(Effect.exit) + + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit)) { + const err = Cause.squash(exit.cause) + expect(err).not.toBeInstanceOf(TypeError) + expect(NamedError.Unknown.isInstance(err)).toBe(true) + if (NamedError.Unknown.isInstance(err)) { + expect(err.data.message).toContain('Command not found: "nonexistent-command-xyz"') + expect(err.data.message).toContain("init") + } + } + }), + { git: true }, 30_000, ) diff --git a/packages/opencode/test/session/retry.test.ts b/packages/opencode/test/session/retry.test.ts index 9da45c9112a2..22ff6cde811d 100644 --- a/packages/opencode/test/session/retry.test.ts +++ b/packages/opencode/test/session/retry.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test" import type { NamedError } from "@opencode-ai/core/util/error" import { APICallError } from "ai" import { setTimeout as sleep } from "node:timers/promises" -import { Effect, Layer, Schedule } from "effect" +import { Effect, Layer, Schedule, Schema } from "effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { SessionRetry } from "../../src/session/retry" import { MessageV2 } from "../../src/session/message-v2" @@ -17,7 +17,7 @@ const retryProvider = "test" const it = testEffect(Layer.mergeAll(SessionStatus.defaultLayer, CrossSpawnSpawner.defaultLayer)) function apiError(headers?: Record): MessageV2.APIError { - return MessageV2.APIError.Schema.parse( + return Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "boom", isRetryable: true, @@ -94,7 +94,7 @@ describe("session.retry.delay", () => { const step = yield* Schedule.toStepWithMetadata( SessionRetry.policy({ provider: "test", - parse: (err) => MessageV2.APIError.Schema.parse(err), + parse: Schema.decodeUnknownSync(MessageV2.APIError.Schema), set: (info) => status.set(sessionID, { type: "retry", @@ -173,7 +173,7 @@ describe("session.retry.retryable", () => { }) test("retries 500 errors even when isRetryable is false", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Internal server error", isRetryable: false, @@ -186,7 +186,7 @@ describe("session.retry.retryable", () => { }) test("retries 502 bad gateway errors", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Bad gateway", isRetryable: false, @@ -198,7 +198,7 @@ describe("session.retry.retryable", () => { }) test("retries 503 service unavailable errors", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Service unavailable", isRetryable: false, @@ -210,7 +210,7 @@ describe("session.retry.retryable", () => { }) test("does not retry 4xx errors when isRetryable is false", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Bad request", isRetryable: false, @@ -222,7 +222,7 @@ describe("session.retry.retryable", () => { }) test("retries ZlibError decompression failures", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Response decompression failed", isRetryable: true, @@ -236,7 +236,7 @@ describe("session.retry.retryable", () => { }) test("maps free limits to Go upsell action", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Free usage exceeded", isRetryable: true, @@ -262,7 +262,7 @@ describe("session.retry.retryable", () => { }) test("maps Go subscription limits to workspace PAYG upsell", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Subscription quota exceeded. You can continue using free models.", isRetryable: true, @@ -300,7 +300,7 @@ describe("session.retry.retryable", () => { }) test("maps Go subscription limits without limit metadata", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Subscription quota exceeded. You can continue using free models.", isRetryable: true, @@ -366,7 +366,7 @@ describe("session.message-v2.fromError", () => { ) test("ECONNRESET socket error is retryable", () => { - const error = MessageV2.APIError.Schema.parse( + const error = Schema.decodeUnknownSync(MessageV2.APIError.Schema)( new MessageV2.APIError({ message: "Connection reset by server", isRetryable: true, diff --git a/packages/opencode/test/session/session-schema.test.ts b/packages/opencode/test/session/session-schema.test.ts index 38531d15b49a..906414fdbe52 100644 --- a/packages/opencode/test/session/session-schema.test.ts +++ b/packages/opencode/test/session/session-schema.test.ts @@ -12,6 +12,8 @@ const info = { directory: "/tmp/opencode", parentID: undefined, summary: undefined, + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, share: undefined, title: "Test session", version: "1.0.0", diff --git a/packages/opencode/test/session/session.test.ts b/packages/opencode/test/session/session.test.ts index bb69e459bc05..b20203bad1a1 100644 --- a/packages/opencode/test/session/session.test.ts +++ b/packages/opencode/test/session/session.test.ts @@ -1,186 +1,189 @@ -import { describe, expect, test } from "bun:test" -import path from "path" +import { describe, expect } from "bun:test" +import { Deferred, Effect, Exit, Layer } from "effect" import { Session as SessionNs } from "@/session/session" -import { Bus } from "../../src/bus" +import { GlobalBus, type GlobalEvent } from "../../src/bus/global" import * as Log from "@opencode-ai/core/util/log" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { MessageV2 } from "../../src/session/message-v2" import { MessageID, PartID, type SessionID } from "../../src/session/schema" -import { AppRuntime } from "../../src/effect/app-runtime" -import { tmpdir } from "../fixture/fixture" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { provideInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" +import { Bus } from "@/bus" +import { Storage } from "@/storage/storage" +import { SyncEvent } from "@/sync" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { BackgroundJob } from "@/background/job" +import { SessionGoal } from "@/session/goal" -const projectRoot = path.join(__dirname, "../..") void Log.init({ print: false }) -function create(input?: SessionNs.CreateInput) { - return AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create(input))) -} +const it = testEffect( + Layer.mergeAll( + SessionNs.layer.pipe( + Layer.provide(Bus.layer), + Layer.provide(Storage.defaultLayer), + Layer.provide(SessionGoal.defaultLayer), + Layer.provide(SyncEvent.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalWorkspaces: false })), + Layer.provide(BackgroundJob.defaultLayer), + ), + CrossSpawnSpawner.defaultLayer, + ), +) + +const awaitDeferred = (deferred: Deferred.Deferred, message: string) => + Effect.race( + Deferred.await(deferred), + Effect.sleep("2 seconds").pipe(Effect.flatMap(() => Effect.fail(new Error(message)))), + ) -function get(id: SessionID) { - return AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.get(id))) -} +const remove = (id: SessionID) => SessionNs.Service.use((svc) => svc.remove(id)) -function remove(id: SessionID) { - return AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.remove(id))) +const subscribeGlobal = (type: string, callback: (event: NonNullable) => void) => { + const listener = (event: GlobalEvent) => { + if (event.payload?.type === type) callback(event.payload) + } + GlobalBus.on("event", listener) + return () => GlobalBus.off("event", listener) } -function updateMessage(msg: T) { - return AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.updateMessage(msg))) -} +describe("session.created event", () => { + it.instance("should emit session.created event when session is created", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const received = yield* Deferred.make() -function updatePart(part: T) { - return AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.updatePart(part))) -} + const unsub = subscribeGlobal(SessionNs.Event.Created.type, (event) => { + Deferred.doneUnsafe(received, Effect.succeed(event.properties.info as SessionNs.Info)) + }) + yield* Effect.addFinalizer(() => Effect.sync(unsub)) -describe("session.created event", () => { - test("should emit session.created event when session is created", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - let eventReceived = false - let receivedInfo: SessionNs.Info | undefined - - const unsub = Bus.subscribe(SessionNs.Event.Created, (event) => { - eventReceived = true - receivedInfo = event.properties.info as SessionNs.Info - }) + const info = yield* session.create({}) + const receivedInfo = yield* awaitDeferred(received, "timed out waiting for session.created") - const info = await create({}) - await new Promise((resolve) => setTimeout(resolve, 100)) - unsub() - - expect(eventReceived).toBe(true) - expect(receivedInfo).toBeDefined() - expect(receivedInfo?.id).toBe(info.id) - expect(receivedInfo?.projectID).toBe(info.projectID) - expect(receivedInfo?.directory).toBe(info.directory) - expect(receivedInfo?.path).toBe(info.path) - expect(receivedInfo?.title).toBe(info.title) - - await remove(info.id) - }, - }) - }) - - test("session.created event should be emitted before session.updated", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const events: string[] = [] - - const unsubCreated = Bus.subscribe(SessionNs.Event.Created, () => { - events.push("created") - }) + expect(receivedInfo.id).toBe(info.id) + expect(receivedInfo.projectID).toBe(info.projectID) + expect(receivedInfo.directory).toBe(info.directory) + expect(receivedInfo.path).toBe(info.path) + expect(receivedInfo.title).toBe(info.title) - const unsubUpdated = Bus.subscribe(SessionNs.Event.Updated, () => { - events.push("updated") - }) + yield* session.remove(info.id) + }), + ) - const info = await create({}) - await new Promise((resolve) => setTimeout(resolve, 100)) - unsubCreated() - unsubUpdated() + it.instance("session.created event should be emitted before session.updated", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const events: string[] = [] + const received = yield* Deferred.make() + const push = (event: string) => { + events.push(event) + if (events.includes("created") && events.includes("updated")) { + Deferred.doneUnsafe(received, Effect.succeed(events)) + } + } + + const unsubCreated = subscribeGlobal(SessionNs.Event.Created.type, () => { + push("created") + }) + yield* Effect.addFinalizer(() => Effect.sync(unsubCreated)) + + const unsubUpdated = subscribeGlobal(SessionNs.Event.Updated.type, () => { + push("updated") + }) + yield* Effect.addFinalizer(() => Effect.sync(unsubUpdated)) - expect(events).toContain("created") - expect(events).toContain("updated") - expect(events.indexOf("created")).toBeLessThan(events.indexOf("updated")) + const info = yield* session.create({}) + const receivedEvents = yield* awaitDeferred(received, "timed out waiting for session created/updated events") - await remove(info.id) - }, - }) - }) + expect(receivedEvents).toContain("created") + expect(receivedEvents).toContain("updated") + expect(receivedEvents.indexOf("created")).toBeLessThan(receivedEvents.indexOf("updated")) + + yield* session.remove(info.id) + }), + ) }) describe("step-finish token propagation via Bus event", () => { - test( + it.instance( "non-zero tokens propagate through PartUpdated event", - async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const info = await create({}) - - const messageID = MessageID.ascending() - await updateMessage({ - id: messageID, - sessionID: info.id, - role: "user", - time: { created: Date.now() }, - agent: "user", - model: { providerID: "test", modelID: "test" }, - tools: {}, - mode: "", - } as unknown as MessageV2.Info) - - // Bus subscribers receive readonly Schema.Type payloads; `MessageV2.Part` - // is the mutable domain type. Cast bridges the two — safe because the - // test only reads the value afterwards. - let received: MessageV2.Part | undefined - const unsub = Bus.subscribe(MessageV2.Event.PartUpdated, (event) => { - received = event.properties.part as MessageV2.Part - }) - - const tokens = { - total: 1500, - input: 500, - output: 800, - reasoning: 200, - cache: { read: 100, write: 50 }, - } - - const partInput = { - id: PartID.ascending(), - messageID, - sessionID: info.id, - type: "step-finish" as const, - reason: "stop", - cost: 0.005, - tokens, - } - - await updatePart(partInput) - await new Promise((resolve) => setTimeout(resolve, 100)) - - expect(received).toBeDefined() - expect(received!.type).toBe("step-finish") - const finish = received as MessageV2.StepFinishPart - expect(finish.tokens.input).toBe(500) - expect(finish.tokens.output).toBe(800) - expect(finish.tokens.reasoning).toBe(200) - expect(finish.tokens.total).toBe(1500) - expect(finish.tokens.cache.read).toBe(100) - expect(finish.tokens.cache.write).toBe(50) - expect(finish.cost).toBe(0.005) - expect(received).not.toBe(partInput) - - unsub() - await remove(info.id) - }, - }) - }, + () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const info = yield* session.create({}) + + const messageID = MessageID.ascending() + yield* session.updateMessage({ + id: messageID, + sessionID: info.id, + role: "user", + time: { created: Date.now() }, + agent: "user", + model: { providerID: "test", modelID: "test" }, + tools: {}, + mode: "", + } as unknown as MessageV2.Info) + + // Bus subscribers receive readonly Schema.Type payloads; `MessageV2.Part` + // is the mutable domain type. Cast bridges the two — safe because the + // test only reads the value afterwards. + const received = yield* Deferred.make() + const unsub = subscribeGlobal(MessageV2.Event.PartUpdated.type, (event) => { + Deferred.doneUnsafe(received, Effect.succeed(event.properties.part as MessageV2.Part)) + }) + yield* Effect.addFinalizer(() => Effect.sync(unsub)) + + const tokens = { + total: 1500, + input: 500, + output: 800, + reasoning: 200, + cache: { read: 100, write: 50 }, + } + + const partInput = { + id: PartID.ascending(), + messageID, + sessionID: info.id, + type: "step-finish" as const, + reason: "stop", + cost: 0.005, + tokens, + } + + yield* session.updatePart(partInput) + const receivedPart = yield* awaitDeferred(received, "timed out waiting for message.part.updated") + + expect(receivedPart.type).toBe("step-finish") + const finish = receivedPart as MessageV2.StepFinishPart + expect(finish.tokens.input).toBe(500) + expect(finish.tokens.output).toBe(800) + expect(finish.tokens.reasoning).toBe(200) + expect(finish.tokens.total).toBe(1500) + expect(finish.tokens.cache.read).toBe(100) + expect(finish.tokens.cache.write).toBe(50) + expect(finish.cost).toBe(0.005) + expect(receivedPart).not.toBe(partInput) + + yield* session.remove(info.id) + }), { timeout: 30000 }, ) }) describe("Session", () => { - test("remove works without an instance", async () => { - await using tmp = await tmpdir({ git: true }) - - const info = await WithInstance.provide({ - directory: tmp.path, - fn: () => create({ title: "remove-without-instance" }), - }) - - await expect(async () => { - await remove(info.id) - }).not.toThrow() - - let missing = false - await get(info.id).catch(() => { - missing = true - }) - - expect(missing).toBe(true) - }) + it.live("remove works without an instance", () => + Effect.gen(function* () { + const session = yield* SessionNs.Service + const dir = yield* tmpdirScoped({ git: true }) + const info = yield* provideInstance(dir)(session.create({ title: "remove-without-instance" })) + + const removeExit = yield* remove(info.id).pipe(Effect.exit) + expect(Exit.isSuccess(removeExit)).toBe(true) + + const getExit = yield* session.get(info.id).pipe(Effect.exit) + expect(Exit.isFailure(getExit)).toBe(true) + }), + ) }) diff --git a/packages/opencode/test/session/snapshot-tool-race.test.ts b/packages/opencode/test/session/snapshot-tool-race.test.ts index 8640612e9825..b53f54ed354c 100644 --- a/packages/opencode/test/session/snapshot-tool-race.test.ts +++ b/packages/opencode/test/session/snapshot-tool-race.test.ts @@ -30,6 +30,7 @@ import { TestLLMServer } from "../lib/llm-server" // Same layer setup as prompt-effect.test.ts import { NodeFileSystem } from "@effect/platform-node" import { Agent as AgentSvc } from "../../src/agent/agent" +import { BackgroundJob } from "@/background/job" import { Git } from "../../src/git" import { Bus } from "../../src/bus" import { Command } from "../../src/command" @@ -50,6 +51,7 @@ import { Instruction } from "../../src/session/instruction" import { SessionProcessor } from "../../src/session/processor" import { SessionRunState } from "../../src/session/run-state" import { SessionStatus } from "../../src/session/status" +import { SessionGoal } from "../../src/session/goal" import { Snapshot } from "../../src/snapshot" import { ToolRegistry } from "@/tool/registry" import { Truncate } from "@/tool/truncate" @@ -59,6 +61,8 @@ import { Ripgrep } from "../../src/file/ripgrep" import { Format } from "../../src/format" import { Reference } from "../../src/reference/reference" import { SyncEvent } from "@/sync" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { EventV2Bridge } from "@/event-v2-bridge" void Log.init({ print: false }) @@ -112,6 +116,7 @@ const infra = Layer.mergeAll(NodeFileSystem.layer, CrossSpawnSpawner.defaultLaye function makeHttp() { const deps = Layer.mergeAll( Session.defaultLayer, + SessionGoal.defaultLayer, Snapshot.defaultLayer, LLM.defaultLayer, Env.defaultLayer, @@ -124,8 +129,10 @@ function makeHttp() { lsp, mcp, AppFileSystem.defaultLayer, + BackgroundJob.defaultLayer, status, SyncEvent.defaultLayer, + EventV2Bridge.defaultLayer, ).pipe(Layer.provideMerge(infra)) const question = Question.layer.pipe(Layer.provideMerge(deps)) const todo = Todo.layer.pipe(Layer.provideMerge(deps)) @@ -137,6 +144,7 @@ function makeHttp() { Layer.provide(Reference.defaultLayer), Layer.provide(Ripgrep.defaultLayer), Layer.provide(Format.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), Layer.provideMerge(todo), Layer.provideMerge(question), Layer.provideMerge(deps), @@ -145,9 +153,14 @@ function makeHttp() { const proc = SessionProcessor.layer.pipe( Layer.provide(SessionSummary.defaultLayer), Layer.provide(Image.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), + Layer.provideMerge(deps), + ) + const compact = SessionCompaction.layer.pipe( + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), + Layer.provideMerge(proc), Layer.provideMerge(deps), ) - const compact = SessionCompaction.layer.pipe(Layer.provideMerge(proc), Layer.provideMerge(deps)) return Layer.mergeAll( TestLLMServer.layer, SessionSummary.defaultLayer, @@ -163,6 +176,7 @@ function makeHttp() { Layer.provideMerge(trunc), Layer.provide(Instruction.defaultLayer), Layer.provide(SystemPrompt.defaultLayer), + Layer.provide(RuntimeFlags.layer({ experimentalEventSystem: true })), Layer.provideMerge(deps), ), ) diff --git a/packages/opencode/test/session/structured-output-integration.test.ts b/packages/opencode/test/session/structured-output-integration.test.ts index da2ffb79373c..125c63c0f9d3 100644 --- a/packages/opencode/test/session/structured-output-integration.test.ts +++ b/packages/opencode/test/session/structured-output-integration.test.ts @@ -1,250 +1,219 @@ import { describe, expect, test } from "bun:test" -import path from "path" import { Effect, Layer } from "effect" import { Session } from "@/session/session" import { SessionPrompt } from "../../src/session/prompt" import * as Log from "@opencode-ai/core/util/log" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { MessageV2 } from "../../src/session/message-v2" +import { testEffect } from "../lib/effect" -const projectRoot = path.join(__dirname, "../..") void Log.init({ print: false }) // Skip tests if no API key is available const hasApiKey = !!process.env.ANTHROPIC_API_KEY - -// Helper to run test within Instance context -async function withInstance(fn: () => Promise): Promise { - return WithInstance.provide({ - directory: projectRoot, - fn, - }) -} - -function run(fx: Effect.Effect) { - return Effect.runPromise( - fx.pipe(Effect.scoped, Effect.provide(Layer.mergeAll(SessionPrompt.defaultLayer, Session.defaultLayer))), - ) -} +const it = testEffect(Layer.mergeAll(SessionPrompt.defaultLayer, Session.defaultLayer)) +const live = hasApiKey ? it.instance : it.instance.skip describe("StructuredOutput Integration", () => { - test.skipIf(!hasApiKey)( + live( "produces structured output with simple schema", - async () => { - await withInstance(() => - run( - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({ title: "Structured Output Test" }) - - const result = yield* prompt.prompt({ - sessionID: session.id, - parts: [ - { - type: "text", - text: "What is 2 + 2? Provide a simple answer.", - }, - ], - format: { - type: "json_schema", - schema: { - type: "object", - properties: { - answer: { type: "number", description: "The numerical answer" }, - explanation: { type: "string", description: "Brief explanation" }, - }, - required: ["answer"], - }, - retryCount: 0, + () => + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ title: "Structured Output Test" }) + + const result = yield* prompt.prompt({ + sessionID: session.id, + parts: [ + { + type: "text", + text: "What is 2 + 2? Provide a simple answer.", + }, + ], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + answer: { type: "number", description: "The numerical answer" }, + explanation: { type: "string", description: "Brief explanation" }, }, - }) - - // Verify structured output was captured (only on assistant messages) - expect(result.info.role).toBe("assistant") - if (result.info.role === "assistant") { - expect(result.info.structured).toBeDefined() - expect(typeof result.info.structured).toBe("object") - - const output = result.info.structured as any - expect(output.answer).toBe(4) - - // Verify no error was set - expect(result.info.error).toBeUndefined() - } - - // Clean up - // Note: Not removing session to avoid race with background SessionSummary.summarize - }), - ), - ) - }, + required: ["answer"], + }, + retryCount: 0, + }, + }) + + // Verify structured output was captured (only on assistant messages) + expect(result.info.role).toBe("assistant") + if (result.info.role === "assistant") { + expect(result.info.structured).toBeDefined() + expect(typeof result.info.structured).toBe("object") + + const output = result.info.structured as any + expect(output.answer).toBe(4) + + // Verify no error was set + expect(result.info.error).toBeUndefined() + } + + // Clean up + // Note: Not removing session to avoid race with background SessionSummary.summarize + }), + { git: true }, 60000, ) - test.skipIf(!hasApiKey)( + live( "produces structured output with nested objects", - async () => { - await withInstance(() => - run( - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({ title: "Nested Schema Test" }) - - const result = yield* prompt.prompt({ - sessionID: session.id, - parts: [ - { - type: "text", - text: "Tell me about Anthropic company in a structured format.", - }, - ], - format: { - type: "json_schema", - schema: { + () => + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ title: "Nested Schema Test" }) + + const result = yield* prompt.prompt({ + sessionID: session.id, + parts: [ + { + type: "text", + text: "Tell me about Anthropic company in a structured format.", + }, + ], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "object", properties: { - company: { - type: "object", - properties: { - name: { type: "string" }, - founded: { type: "number" }, - }, - required: ["name", "founded"], - }, - products: { - type: "array", - items: { type: "string" }, - }, + name: { type: "string" }, + founded: { type: "number" }, }, - required: ["company"], + required: ["name", "founded"], + }, + products: { + type: "array", + items: { type: "string" }, }, - retryCount: 0, }, - }) - - // Verify structured output was captured (only on assistant messages) - expect(result.info.role).toBe("assistant") - if (result.info.role === "assistant") { - expect(result.info.structured).toBeDefined() - const output = result.info.structured as any - - expect(output.company).toBeDefined() - expect(output.company.name).toBe("Anthropic") - expect(typeof output.company.founded).toBe("number") - - if (output.products) { - expect(Array.isArray(output.products)).toBe(true) - } - - // Verify no error was set - expect(result.info.error).toBeUndefined() - } - - // Clean up - // Note: Not removing session to avoid race with background SessionSummary.summarize - }), - ), - ) - }, + required: ["company"], + }, + retryCount: 0, + }, + }) + + // Verify structured output was captured (only on assistant messages) + expect(result.info.role).toBe("assistant") + if (result.info.role === "assistant") { + expect(result.info.structured).toBeDefined() + const output = result.info.structured as any + + expect(output.company).toBeDefined() + expect(output.company.name).toBe("Anthropic") + expect(typeof output.company.founded).toBe("number") + + if (output.products) { + expect(Array.isArray(output.products)).toBe(true) + } + + // Verify no error was set + expect(result.info.error).toBeUndefined() + } + + // Clean up + // Note: Not removing session to avoid race with background SessionSummary.summarize + }), + { git: true }, 60000, ) - test.skipIf(!hasApiKey)( + live( "works with text outputFormat (default)", - async () => { - await withInstance(() => - run( - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({ title: "Text Output Test" }) - - const result = yield* prompt.prompt({ - sessionID: session.id, - parts: [ - { - type: "text", - text: "Say hello.", - }, - ], - format: { - type: "text", - }, - }) - - // Verify no structured output (text mode) and no error - expect(result.info.role).toBe("assistant") - if (result.info.role === "assistant") { - expect(result.info.structured).toBeUndefined() - expect(result.info.error).toBeUndefined() - } - - // Verify we got a response with parts - expect(result.parts.length).toBeGreaterThan(0) - - // Clean up - // Note: Not removing session to avoid race with background SessionSummary.summarize - }), - ), - ) - }, + () => + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ title: "Text Output Test" }) + + const result = yield* prompt.prompt({ + sessionID: session.id, + parts: [ + { + type: "text", + text: "Say hello.", + }, + ], + format: { + type: "text", + }, + }) + + // Verify no structured output (text mode) and no error + expect(result.info.role).toBe("assistant") + if (result.info.role === "assistant") { + expect(result.info.structured).toBeUndefined() + expect(result.info.error).toBeUndefined() + } + + // Verify we got a response with parts + expect(result.parts.length).toBeGreaterThan(0) + + // Clean up + // Note: Not removing session to avoid race with background SessionSummary.summarize + }), + { git: true }, 60000, ) - test.skipIf(!hasApiKey)( + live( "stores outputFormat on user message", - async () => { - await withInstance(() => - run( - Effect.gen(function* () { - const prompt = yield* SessionPrompt.Service - const sessions = yield* Session.Service - const session = yield* sessions.create({ title: "OutputFormat Storage Test" }) - - yield* prompt.prompt({ - sessionID: session.id, - parts: [ - { - type: "text", - text: "What is 1 + 1?", - }, - ], - format: { - type: "json_schema", - schema: { - type: "object", - properties: { - result: { type: "number" }, - }, - required: ["result"], - }, - retryCount: 3, + () => + Effect.gen(function* () { + const prompt = yield* SessionPrompt.Service + const sessions = yield* Session.Service + const session = yield* sessions.create({ title: "OutputFormat Storage Test" }) + + yield* prompt.prompt({ + sessionID: session.id, + parts: [ + { + type: "text", + text: "What is 1 + 1?", + }, + ], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + result: { type: "number" }, }, - }) - - // Get all messages from session - const messages = yield* sessions.messages({ sessionID: session.id }) - const userMessage = messages.find((m) => m.info.role === "user") - - // Verify outputFormat was stored on user message - expect(userMessage).toBeDefined() - if (userMessage?.info.role === "user") { - expect(userMessage.info.format).toBeDefined() - expect(userMessage.info.format?.type).toBe("json_schema") - if (userMessage.info.format?.type === "json_schema") { - expect(userMessage.info.format.retryCount).toBe(3) - } - } - - // Clean up - // Note: Not removing session to avoid race with background SessionSummary.summarize - }), - ), - ) - }, + required: ["result"], + }, + retryCount: 3, + }, + }) + + // Get all messages from session + const messages = yield* sessions.messages({ sessionID: session.id }) + const userMessage = messages.find((m) => m.info.role === "user") + + // Verify outputFormat was stored on user message + expect(userMessage).toBeDefined() + if (userMessage?.info.role === "user") { + expect(userMessage.info.format).toBeDefined() + expect(userMessage.info.format?.type).toBe("json_schema") + if (userMessage.info.format?.type === "json_schema") { + expect(userMessage.info.format.retryCount).toBe(3) + } + } + + // Clean up + // Note: Not removing session to avoid race with background SessionSummary.summarize + }), + { git: true }, 60000, ) diff --git a/packages/opencode/test/skill/discovery.test.ts b/packages/opencode/test/skill/discovery.test.ts index f4a17f25ce99..074992c56cd3 100644 --- a/packages/opencode/test/skill/discovery.test.ts +++ b/packages/opencode/test/skill/discovery.test.ts @@ -1,10 +1,12 @@ -import { describe, test, expect, beforeAll, afterAll } from "bun:test" -import { Effect } from "effect" +import { describe, expect, beforeAll, afterAll } from "bun:test" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Effect, Layer } from "effect" import { Discovery } from "../../src/skill/discovery" import { Global } from "@opencode-ai/core/global" import { Filesystem } from "@/util/filesystem" import { rm } from "fs/promises" import path from "path" +import { testEffect } from "../lib/effect" let CLOUDFLARE_SKILLS_URL: string let server: ReturnType @@ -12,6 +14,7 @@ let downloadCount = 0 const fixturePath = path.join(import.meta.dir, "../fixture/skills") const cacheDir = path.join(Global.Path.cache, "skills") +const it = testEffect(Layer.mergeAll(Discovery.defaultLayer, AppFileSystem.defaultLayer)) beforeAll(async () => { await rm(cacheDir, { recursive: true, force: true }) @@ -47,70 +50,90 @@ afterAll(async () => { }) describe("Discovery.pull", () => { - const pull = (url: string) => - Effect.runPromise(Discovery.Service.use((s) => s.pull(url)).pipe(Effect.provide(Discovery.defaultLayer))) - - test("downloads skills from cloudflare url", async () => { - const dirs = await pull(CLOUDFLARE_SKILLS_URL) - expect(dirs.length).toBeGreaterThan(0) - for (const dir of dirs) { - expect(dir).toStartWith(cacheDir) - const md = path.join(dir, "SKILL.md") - expect(await Filesystem.exists(md)).toBe(true) - } - }) - - test("url without trailing slash works", async () => { - const dirs = await pull(CLOUDFLARE_SKILLS_URL.replace(/\/$/, "")) - expect(dirs.length).toBeGreaterThan(0) - for (const dir of dirs) { - const md = path.join(dir, "SKILL.md") - expect(await Filesystem.exists(md)).toBe(true) - } - }) - - test("returns empty array for invalid url", async () => { - const dirs = await pull(`http://localhost:${server.port}/invalid-url/`) - expect(dirs).toEqual([]) - }) - - test("returns empty array for non-json response", async () => { - // any url not explicitly handled in server returns 404 text "Not Found" - const dirs = await pull(`http://localhost:${server.port}/some-other-path/`) - expect(dirs).toEqual([]) - }) - - test("downloads reference files alongside SKILL.md", async () => { - const dirs = await pull(CLOUDFLARE_SKILLS_URL) - // find a skill dir that should have reference files (e.g. agents-sdk) - const agentsSdk = dirs.find((d) => d.endsWith(path.sep + "agents-sdk")) - expect(agentsSdk).toBeDefined() - if (agentsSdk) { - const refs = path.join(agentsSdk, "references") - expect(await Filesystem.exists(path.join(agentsSdk, "SKILL.md"))).toBe(true) - // agents-sdk has reference files per the index - const refDir = await Array.fromAsync(new Bun.Glob("**/*.md").scan({ cwd: refs, onlyFiles: true })) - expect(refDir.length).toBeGreaterThan(0) - } - }) - - test("caches downloaded files on second pull", async () => { - // clear dir and downloadCount - await rm(cacheDir, { recursive: true, force: true }) - downloadCount = 0 - - // first pull to populate cache - const first = await pull(CLOUDFLARE_SKILLS_URL) - expect(first.length).toBeGreaterThan(0) - const firstCount = downloadCount - expect(firstCount).toBeGreaterThan(0) - - // second pull should return same results from cache - const second = await pull(CLOUDFLARE_SKILLS_URL) - expect(second.length).toBe(first.length) - expect(second.sort()).toEqual(first.sort()) - - // second pull should NOT increment download count - expect(downloadCount).toBe(firstCount) - }) + it.live("downloads skills from cloudflare url", () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const discovery = yield* Discovery.Service + const dirs = yield* discovery.pull(CLOUDFLARE_SKILLS_URL) + expect(dirs.length).toBeGreaterThan(0) + for (const dir of dirs) { + expect(dir).toStartWith(cacheDir) + const md = path.join(dir, "SKILL.md") + expect(yield* fsys.existsSafe(md)).toBe(true) + } + }), + ) + + it.live("url without trailing slash works", () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const discovery = yield* Discovery.Service + const dirs = yield* discovery.pull(CLOUDFLARE_SKILLS_URL.replace(/\/$/, "")) + expect(dirs.length).toBeGreaterThan(0) + for (const dir of dirs) { + const md = path.join(dir, "SKILL.md") + expect(yield* fsys.existsSafe(md)).toBe(true) + } + }), + ) + + it.live("returns empty array for invalid url", () => + Effect.gen(function* () { + const discovery = yield* Discovery.Service + const dirs = yield* discovery.pull(`http://localhost:${server.port}/invalid-url/`) + expect(dirs).toEqual([]) + }), + ) + + it.live("returns empty array for non-json response", () => + Effect.gen(function* () { + // any url not explicitly handled in server returns 404 text "Not Found" + const discovery = yield* Discovery.Service + const dirs = yield* discovery.pull(`http://localhost:${server.port}/some-other-path/`) + expect(dirs).toEqual([]) + }), + ) + + it.live("downloads reference files alongside SKILL.md", () => + Effect.gen(function* () { + const fsys = yield* AppFileSystem.Service + const discovery = yield* Discovery.Service + const dirs = yield* discovery.pull(CLOUDFLARE_SKILLS_URL) + // find a skill dir that should have reference files (e.g. agents-sdk) + const agentsSdk = dirs.find((d) => d.endsWith(path.sep + "agents-sdk")) + expect(agentsSdk).toBeDefined() + if (agentsSdk) { + const refs = path.join(agentsSdk, "references") + expect(yield* fsys.existsSafe(path.join(agentsSdk, "SKILL.md"))).toBe(true) + // agents-sdk has reference files per the index + const refDir = yield* Effect.promise(() => + Array.fromAsync(new Bun.Glob("**/*.md").scan({ cwd: refs, onlyFiles: true })), + ) + expect(refDir.length).toBeGreaterThan(0) + } + }), + ) + + it.live("caches downloaded files on second pull", () => + Effect.gen(function* () { + // clear dir and downloadCount + yield* Effect.promise(() => rm(cacheDir, { recursive: true, force: true })) + downloadCount = 0 + const discovery = yield* Discovery.Service + + // first pull to populate cache + const first = yield* discovery.pull(CLOUDFLARE_SKILLS_URL) + expect(first.length).toBeGreaterThan(0) + const firstCount = downloadCount + expect(firstCount).toBeGreaterThan(0) + + // second pull should return same results from cache + const second = yield* discovery.pull(CLOUDFLARE_SKILLS_URL) + expect(second.length).toBe(first.length) + expect(second.sort()).toEqual(first.sort()) + + // second pull should NOT increment download count + expect(downloadCount).toBe(firstCount) + }), + ) }) diff --git a/packages/opencode/test/skill/skill.test.ts b/packages/opencode/test/skill/skill.test.ts index 969014e6b384..149cad1f2db3 100644 --- a/packages/opencode/test/skill/skill.test.ts +++ b/packages/opencode/test/skill/skill.test.ts @@ -1,7 +1,13 @@ import { describe, expect } from "bun:test" import { Effect, Layer } from "effect" import { Skill } from "../../src/skill" +import { Discovery } from "../../src/skill/discovery" +import { RuntimeFlags } from "../../src/effect/runtime-flags" +import { Bus } from "../../src/bus" +import { Config } from "../../src/config/config" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppFileSystem } from "@opencode-ai/core/filesystem" +import { Global } from "@opencode-ai/core/global" import { provideInstance, provideTmpdirInstance, tmpdir } from "../fixture/fixture" import { testEffect } from "../lib/effect" import path from "path" @@ -10,6 +16,32 @@ import fs from "fs/promises" const node = CrossSpawnSpawner.defaultLayer const it = testEffect(Layer.mergeAll(Skill.defaultLayer, node)) +const itWithoutClaudeCodeSkills = testEffect( + Layer.mergeAll( + Skill.layer.pipe( + Layer.provide(Discovery.defaultLayer), + Layer.provide(Config.defaultLayer), + Layer.provide(Bus.layer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Global.layer), + Layer.provide(RuntimeFlags.layer({ disableClaudeCodeSkills: true })), + ), + node, + ), +) +const itWithoutExternalSkills = testEffect( + Layer.mergeAll( + Skill.layer.pipe( + Layer.provide(Discovery.defaultLayer), + Layer.provide(Config.defaultLayer), + Layer.provide(Bus.layer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Global.layer), + Layer.provide(RuntimeFlags.layer({ disableExternalSkills: true })), + ), + node, + ), +) async function createGlobalSkill(homeDir: string) { const skillDir = path.join(homeDir, ".claude", "skills", "global-test-skill") @@ -364,6 +396,90 @@ description: A skill in the .agents/skills directory. ), ) + itWithoutClaudeCodeSkills.live("skips Claude Code skills when disabled", () => + provideTmpdirInstance( + (dir) => + Effect.gen(function* () { + yield* Effect.promise(() => + Promise.all([ + Bun.write( + path.join(dir, ".claude", "skills", "claude-skill", "SKILL.md"), + `--- +name: claude-skill +description: A skill in the .claude/skills directory. +--- + +# Claude Skill +`, + ), + Bun.write( + path.join(dir, ".agents", "skills", "agent-skill", "SKILL.md"), + `--- +name: agent-skill +description: A skill in the .agents/skills directory. +--- + +# Agent Skill +`, + ), + ]), + ) + + const skill = yield* Skill.Service + const list = (yield* skill.all()).filter((s) => s.location !== "") + expect(list.map((s) => s.name)).toEqual(["agent-skill"]) + }), + { git: true }, + ), + ) + + itWithoutExternalSkills.live("skips external skill directories when disabled", () => + provideTmpdirInstance( + (dir) => + Effect.gen(function* () { + yield* Effect.promise(() => + Promise.all([ + Bun.write( + path.join(dir, ".claude", "skills", "claude-skill", "SKILL.md"), + `--- +name: claude-skill +description: A skill in the .claude/skills directory. +--- + +# Claude Skill +`, + ), + Bun.write( + path.join(dir, ".agents", "skills", "agent-skill", "SKILL.md"), + `--- +name: agent-skill +description: A skill in the .agents/skills directory. +--- + +# Agent Skill +`, + ), + Bun.write( + path.join(dir, ".opencode", "skill", "opencode-skill", "SKILL.md"), + `--- +name: opencode-skill +description: A skill in the .opencode/skill directory. +--- + +# OpenCode Skill +`, + ), + ]), + ) + + const skill = yield* Skill.Service + const list = (yield* skill.all()).filter((s) => s.location !== "") + expect(list.map((s) => s.name)).toEqual(["opencode-skill"]) + }), + { git: true }, + ), + ) + it.live("properly resolves directories that skills live in", () => provideTmpdirInstance( (dir) => diff --git a/packages/opencode/test/snapshot/snapshot.test.ts b/packages/opencode/test/snapshot/snapshot.test.ts index 99ddfe72d456..de60d58b2df2 100644 --- a/packages/opencode/test/snapshot/snapshot.test.ts +++ b/packages/opencode/test/snapshot/snapshot.test.ts @@ -1,13 +1,15 @@ -import { afterEach, test, expect } from "bun:test" +import { afterEach, expect } from "bun:test" import { $ } from "bun" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import fs from "fs/promises" import path from "path" -import { Effect } from "effect" +import { Effect, Fiber, Layer } from "effect" import { Snapshot } from "../../src/snapshot" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { Filesystem } from "@/util/filesystem" -import { disposeAllInstances, provideInstance, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, provideInstance, TestInstance, tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" + +const it = testEffect(Layer.mergeAll(Snapshot.defaultLayer, AppFileSystem.defaultLayer)) // Git always outputs /-separated paths internally. Snapshot.patch() joins them // with path.join (which produces \ on Windows) then normalizes back to /. @@ -18,1515 +20,1095 @@ afterEach(async () => { await disposeAllInstances() }) -async function bootstrap() { - return tmpdir({ - git: true, - init: async (dir) => { - const unique = Math.random().toString(36).slice(2) - const aContent = `A${unique}` - const bContent = `B${unique}` - await Filesystem.write(`${dir}/a.txt`, aContent) - await Filesystem.write(`${dir}/b.txt`, bContent) - await $`git add .`.cwd(dir).quiet() - await $`git commit -m init`.cwd(dir).quiet() - return { - aContent, - bContent, - } - }, +const exec = (cwd: string, command: string[]) => + Effect.promise(async () => { + const proc = Bun.spawn(command, { cwd, stdout: "ignore", stderr: "pipe" }) + const code = await proc.exited + if (code !== 0) throw new Error(`${command.join(" ")} failed: ${await new Response(proc.stderr).text()}`) }) -} - -function run(dir: string, body: (snapshot: Snapshot.Interface) => Effect.Effect) { - return Effect.runPromise( - Effect.gen(function* () { - const snapshot = yield* Snapshot.Service - return yield* body(snapshot) - }).pipe(provideInstance(dir), Effect.provide(Snapshot.defaultLayer)), - ) -} - -test("tracks deleted files correctly", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`rm ${tmp.path}/a.txt`.quiet() - expect((await run(tmp.path, (snapshot) => snapshot.patch(before!))).files).toContain(fwd(tmp.path, "a.txt")) - }, - }) +const write = (file: string, content: string | Uint8Array) => + AppFileSystem.Service.use((fs) => fs.writeWithDirs(file, content)) +const readText = (file: string) => AppFileSystem.Service.use((fs) => fs.readFileString(file)) +const exists = (file: string) => AppFileSystem.Service.use((fs) => fs.existsSafe(file)) +const mkdirp = (dir: string) => AppFileSystem.Service.use((fs) => fs.ensureDir(dir)) +const rm = (file: string) => + AppFileSystem.Service.use((fs) => fs.remove(file, { recursive: true, force: true }).pipe(Effect.ignore)) + +const initialize = Effect.fn("SnapshotTest.initialize")(function* (dir: string) { + const unique = Math.random().toString(36).slice(2) + const aContent = `A${unique}` + const bContent = `B${unique}` + yield* write(`${dir}/a.txt`, aContent) + yield* write(`${dir}/b.txt`, bContent) + yield* exec(dir, ["git", "add", "."]) + yield* exec(dir, ["git", "commit", "-m", "init"]) + return { aContent, bContent } }) -test("revert should remove new files", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/new.txt`, "NEW") +type Bootstrapped = { path: string; extra: { aContent: string; bContent: string } } - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect( - await fs - .access(`${tmp.path}/new.txt`) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) +const bootstrap = Effect.fn("SnapshotTest.bootstrap")(function* () { + const tmp = yield* TestInstance + return { path: tmp.directory, extra: yield* initialize(tmp.directory) } }) -test("revert in subdirectory", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`mkdir -p ${tmp.path}/sub`.quiet() - await Filesystem.write(`${tmp.path}/sub/file.txt`, "SUB") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect( - await fs - .access(`${tmp.path}/sub/file.txt`) - .then(() => true) - .catch(() => false), - ).toBe(false) - // Note: revert currently only removes files, not directories - // The empty subdirectory will remain - }, +const withTrackedSnapshot = ( + fn: (input: { tmp: Bootstrapped; snapshot: Snapshot.Interface; before: string }) => Effect.Effect, +) => + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + const before = yield* snapshot.track() + expect(before).toBeTruthy() + return yield* fn({ tmp, snapshot, before: before! }) }) -}) -test("multiple file operations", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`rm ${tmp.path}/a.txt`.quiet() - await Filesystem.write(`${tmp.path}/c.txt`, "C") - await $`mkdir -p ${tmp.path}/dir`.quiet() - await Filesystem.write(`${tmp.path}/dir/d.txt`, "D") - await Filesystem.write(`${tmp.path}/b.txt`, "MODIFIED") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect(await fs.readFile(`${tmp.path}/a.txt`, "utf-8")).toBe(tmp.extra.aContent) - expect( - await fs - .access(`${tmp.path}/c.txt`) - .then(() => true) - .catch(() => false), - ).toBe(false) - // Note: revert currently only removes files, not directories - // The empty directory will remain - expect(await fs.readFile(`${tmp.path}/b.txt`, "utf-8")).toBe(tmp.extra.bContent) - }, - }) +const bootstrapScoped = Effect.fn("SnapshotTest.bootstrapScoped")(function* () { + const dir = yield* tmpdirScoped({ git: true }).pipe(Effect.provide(CrossSpawnSpawner.defaultLayer)) + return { path: dir, extra: yield* initialize(dir) } }) -test("empty directory handling", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`mkdir ${tmp.path}/empty`.quiet() +const scopedGitTmpdir = () => tmpdirScoped({ git: true }).pipe(Effect.provide(CrossSpawnSpawner.defaultLayer)) - expect((await run(tmp.path, (snapshot) => snapshot.patch(before!))).files.length).toBe(0) - }, +const cleanupWorktree = (repo: string, worktree: string, files: string[] = []) => + Effect.promise(async () => { + await $`git worktree remove --force ${worktree}`.cwd(repo).quiet().nothrow() + await fs.rm(worktree, { recursive: true, force: true }).catch(() => undefined) + await Promise.all(files.map((file) => fs.rm(file, { recursive: true, force: true }).catch(() => undefined))) }) -}) - -test("binary file handling", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - await Filesystem.write(`${tmp.path}/image.png`, new Uint8Array([0x89, 0x50, 0x4e, 0x47])) +const withGitConfigGlobal = (config: string, self: Effect.Effect) => + Effect.acquireUseRelease( + Effect.sync(() => { + const previous = process.env.GIT_CONFIG_GLOBAL + process.env.GIT_CONFIG_GLOBAL = config + return previous + }), + () => self, + (previous) => + Effect.sync(() => { + if (previous) process.env.GIT_CONFIG_GLOBAL = previous + else delete process.env.GIT_CONFIG_GLOBAL + }), + ) - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) +it.instance( + "tracks deleted files correctly", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* rm(`${tmp.path}/a.txt`) + expect((yield* snapshot.patch(before)).files).toContain(fwd(tmp.path, "a.txt")) + }), + ), + { git: true }, +) + +it.instance( + "revert should remove new files", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/new.txt`, "NEW") + const patch = yield* snapshot.patch(before) + yield* snapshot.revert([patch]) + expect(yield* exists(`${tmp.path}/new.txt`)).toBe(false) + }), + ), + { git: true }, +) + +it.instance( + "revert in subdirectory", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* mkdirp(`${tmp.path}/sub`) + yield* write(`${tmp.path}/sub/file.txt`, "SUB") + const patch = yield* snapshot.patch(before) + yield* snapshot.revert([patch]) + expect(yield* exists(`${tmp.path}/sub/file.txt`)).toBe(false) + }), + ), + { git: true }, +) + +it.instance( + "multiple file operations", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* rm(`${tmp.path}/a.txt`) + yield* write(`${tmp.path}/c.txt`, "C") + yield* mkdirp(`${tmp.path}/dir`) + yield* write(`${tmp.path}/dir/d.txt`, "D") + yield* write(`${tmp.path}/b.txt`, "MODIFIED") + const patch = yield* snapshot.patch(before) + yield* snapshot.revert([patch]) + expect(yield* readText(`${tmp.path}/a.txt`)).toBe(tmp.extra.aContent) + expect(yield* exists(`${tmp.path}/c.txt`)).toBe(false) + expect(yield* readText(`${tmp.path}/b.txt`)).toBe(tmp.extra.bContent) + }), + ), + { git: true }, +) + +it.instance( + "empty directory handling", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* mkdirp(`${tmp.path}/empty`) + expect((yield* snapshot.patch(before)).files.length).toBe(0) + }), + ), + { git: true }, +) + +it.instance( + "binary file handling", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/image.png`, new Uint8Array([0x89, 0x50, 0x4e, 0x47])) + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(fwd(tmp.path, "image.png")) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - expect( - await fs - .access(`${tmp.path}/image.png`) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) -}) - -test("symlink handling", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await fs.symlink(`${tmp.path}/a.txt`, `${tmp.path}/link.txt`, "file") - - expect((await run(tmp.path, (snapshot) => snapshot.patch(before!))).files).toContain(fwd(tmp.path, "link.txt")) - }, - }) -}) - -test("file under size limit handling", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/large.txt`, "x".repeat(1024 * 1024)) - - expect((await run(tmp.path, (snapshot) => snapshot.patch(before!))).files).toContain(fwd(tmp.path, "large.txt")) - }, - }) -}) - -test("large added files are skipped", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/huge.txt`, new Uint8Array(2 * 1024 * 1024 + 1)) - - expect((await run(tmp.path, (snapshot) => snapshot.patch(before!))).files).toEqual([]) - expect(await run(tmp.path, (snapshot) => snapshot.diff(before!))).toBe("") - expect(await run(tmp.path, (snapshot) => snapshot.track())).toBe(before) - }, - }) -}) - -test("nested directory revert", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`mkdir -p ${tmp.path}/level1/level2/level3`.quiet() - await Filesystem.write(`${tmp.path}/level1/level2/level3/deep.txt`, "DEEP") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect( - await fs - .access(`${tmp.path}/level1/level2/level3/deep.txt`) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) -}) - -test("special characters in filenames", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/file with spaces.txt`, "SPACES") - await Filesystem.write(`${tmp.path}/file-with-dashes.txt`, "DASHES") - await Filesystem.write(`${tmp.path}/file_with_underscores.txt`, "UNDERSCORES") - - const files = (await run(tmp.path, (snapshot) => snapshot.patch(before!))).files + yield* snapshot.revert([patch]) + expect(yield* exists(`${tmp.path}/image.png`)).toBe(false) + }), + ), + { git: true }, +) + +it.instance( + "symlink handling", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* Effect.promise(() => fs.symlink(`${tmp.path}/a.txt`, `${tmp.path}/link.txt`, "file")) + expect((yield* snapshot.patch(before)).files).toContain(fwd(tmp.path, "link.txt")) + }), + ), + { git: true }, +) + +it.instance( + "file under size limit handling", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/large.txt`, "x".repeat(1024 * 1024)) + expect((yield* snapshot.patch(before)).files).toContain(fwd(tmp.path, "large.txt")) + }), + ), + { git: true }, +) + +it.instance( + "large added files are skipped", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/huge.txt`, new Uint8Array(2 * 1024 * 1024 + 1)) + expect((yield* snapshot.patch(before)).files).toEqual([]) + expect(yield* snapshot.diff(before)).toBe("") + expect(yield* snapshot.track()).toBe(before) + }), + ), + { git: true }, +) + +it.instance( + "nested directory revert", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* mkdirp(`${tmp.path}/level1/level2/level3`) + yield* write(`${tmp.path}/level1/level2/level3/deep.txt`, "DEEP") + const patch = yield* snapshot.patch(before) + yield* snapshot.revert([patch]) + expect(yield* exists(`${tmp.path}/level1/level2/level3/deep.txt`)).toBe(false) + }), + ), + { git: true }, +) + +it.instance( + "special characters in filenames", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/file with spaces.txt`, "SPACES") + yield* write(`${tmp.path}/file-with-dashes.txt`, "DASHES") + yield* write(`${tmp.path}/file_with_underscores.txt`, "UNDERSCORES") + const files = (yield* snapshot.patch(before)).files expect(files).toContain(fwd(tmp.path, "file with spaces.txt")) expect(files).toContain(fwd(tmp.path, "file-with-dashes.txt")) expect(files).toContain(fwd(tmp.path, "file_with_underscores.txt")) - }, - }) -}) - -test("revert with empty patches", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // Should not crash with empty patches - expect(run(tmp.path, (snapshot) => snapshot.revert([]))).resolves.toBeUndefined() - - // Should not crash with patches that have empty file lists - expect(run(tmp.path, (snapshot) => snapshot.revert([{ hash: "dummy", files: [] }]))).resolves.toBeUndefined() - }, - }) -}) - -test("patch with invalid hash", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Create a change - await Filesystem.write(`${tmp.path}/test.txt`, "TEST") - - // Try to patch with invalid hash - should handle gracefully - const patch = await run(tmp.path, (snapshot) => snapshot.patch("invalid-hash-12345")) + }), + ), + { git: true }, +) + +it.instance( + "revert with empty patches", + Effect.gen(function* () { + yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* snapshot.revert([]) + yield* snapshot.revert([{ hash: "dummy", files: [] }]) + }), + { git: true }, +) + +it.instance( + "patch with invalid hash", + withTrackedSnapshot(({ tmp, snapshot }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/test.txt`, "TEST") + const patch = yield* snapshot.patch("invalid-hash-12345") expect(patch.files).toEqual([]) expect(patch.hash).toBe("invalid-hash-12345") - }, - }) -}) - -test("revert non-existent file", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Try to revert a file that doesn't exist in the snapshot - // This should not crash - expect( - run(tmp.path, (snapshot) => - snapshot.revert([ - { - hash: before!, - files: [`${tmp.path}/nonexistent.txt`], - }, - ]), - ), - ).resolves.toBeUndefined() - }, - }) -}) - -test("unicode filenames", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - + }), + ), + { git: true }, +) + +it.instance( + "revert non-existent file", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* snapshot.revert([{ hash: before, files: [`${tmp.path}/nonexistent.txt`] }]) + }), + ), + { git: true }, +) + +it.instance( + "unicode filenames", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { const unicodeFiles = [ { path: fwd(tmp.path, "文件.txt"), content: "chinese content" }, { path: fwd(tmp.path, "🚀rocket.txt"), content: "emoji content" }, { path: fwd(tmp.path, "café.txt"), content: "accented content" }, { path: fwd(tmp.path, "файл.txt"), content: "cyrillic content" }, ] - - for (const file of unicodeFiles) { - await Filesystem.write(file.path, file.content) - } - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + yield* Effect.all( + unicodeFiles.map((file) => write(file.path, file.content)), + { concurrency: "unbounded" }, + ) + const patch = yield* snapshot.patch(before) expect(patch.files.length).toBe(4) - - for (const file of unicodeFiles) { - expect(patch.files).toContain(file.path) - } - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - for (const file of unicodeFiles) { - expect( - await fs - .access(file.path) - .then(() => true) - .catch(() => false), - ).toBe(false) - } - }, - }) -}) - -test.skip("unicode filenames modification and restore", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const chineseFile = fwd(tmp.path, "文件.txt") - const cyrillicFile = fwd(tmp.path, "файл.txt") - - await Filesystem.write(chineseFile, "original chinese") - await Filesystem.write(cyrillicFile, "original cyrillic") - - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(chineseFile, "modified chinese") - await Filesystem.write(cyrillicFile, "modified cyrillic") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - expect(patch.files).toContain(chineseFile) - expect(patch.files).toContain(cyrillicFile) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect(await fs.readFile(chineseFile, "utf-8")).toBe("original chinese") - expect(await fs.readFile(cyrillicFile, "utf-8")).toBe("original cyrillic") - }, - }) -}) - -test("unicode filenames in subdirectories", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`mkdir -p "${tmp.path}/目录/подкаталог"`.quiet() + for (const file of unicodeFiles) expect(patch.files).toContain(file.path) + yield* snapshot.revert([patch]) + for (const file of unicodeFiles) expect(yield* exists(file.path)).toBe(false) + }), + ), + { git: true }, +) + +it.instance.skip( + "unicode filenames modification and restore", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + const chineseFile = fwd(tmp.path, "文件.txt") + const cyrillicFile = fwd(tmp.path, "файл.txt") + yield* write(chineseFile, "original chinese") + yield* write(cyrillicFile, "original cyrillic") + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* write(chineseFile, "modified chinese") + yield* write(cyrillicFile, "modified cyrillic") + const patch = yield* snapshot.patch(before!) + expect(patch.files).toContain(chineseFile) + expect(patch.files).toContain(cyrillicFile) + yield* snapshot.revert([patch]) + expect(yield* readText(chineseFile)).toBe("original chinese") + expect(yield* readText(cyrillicFile)).toBe("original cyrillic") + }), + { git: true }, +) + +it.instance( + "unicode filenames in subdirectories", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* mkdirp(`${tmp.path}/目录/подкаталог`) const deepFile = fwd(tmp.path, "目录", "подкаталог", "文件.txt") - await Filesystem.write(deepFile, "deep unicode content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + yield* write(deepFile, "deep unicode content") + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(deepFile) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - expect( - await fs - .access(deepFile) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) -}) - -test("very long filenames", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - const longName = "a".repeat(200) + ".txt" - const longFile = fwd(tmp.path, longName) - - await Filesystem.write(longFile, "long filename content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + yield* snapshot.revert([patch]) + expect(yield* exists(deepFile)).toBe(false) + }), + ), + { git: true }, +) + +it.instance( + "very long filenames", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + const longFile = fwd(tmp.path, `${"a".repeat(200)}.txt`) + yield* write(longFile, "long filename content") + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(longFile) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - expect( - await fs - .access(longFile) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) -}) - -test("hidden files", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/.hidden`, "hidden content") - await Filesystem.write(`${tmp.path}/.gitignore`, "*.log") - await Filesystem.write(`${tmp.path}/.config`, "config content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + yield* snapshot.revert([patch]) + expect(yield* exists(longFile)).toBe(false) + }), + ), + { git: true }, +) + +it.instance( + "hidden files", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/.hidden`, "hidden content") + yield* write(`${tmp.path}/.gitignore`, "*.log") + yield* write(`${tmp.path}/.config`, "config content") + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(fwd(tmp.path, ".hidden")) expect(patch.files).toContain(fwd(tmp.path, ".gitignore")) expect(patch.files).toContain(fwd(tmp.path, ".config")) - }, - }) -}) - -test("nested symlinks", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`mkdir -p ${tmp.path}/sub/dir`.quiet() - await Filesystem.write(`${tmp.path}/sub/dir/target.txt`, "target content") - await fs.symlink(`${tmp.path}/sub/dir/target.txt`, `${tmp.path}/sub/dir/link.txt`, "file") - await fs.symlink(`${tmp.path}/sub`, `${tmp.path}/sub-link`, "dir") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + }), + ), + { git: true }, +) + +it.instance( + "nested symlinks", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* mkdirp(`${tmp.path}/sub/dir`) + yield* write(`${tmp.path}/sub/dir/target.txt`, "target content") + yield* Effect.promise(() => fs.symlink(`${tmp.path}/sub/dir/target.txt`, `${tmp.path}/sub/dir/link.txt`, "file")) + yield* Effect.promise(() => fs.symlink(`${tmp.path}/sub`, `${tmp.path}/sub-link`, "dir")) + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(fwd(tmp.path, "sub", "dir", "link.txt")) expect(patch.files).toContain(fwd(tmp.path, "sub-link")) - }, - }) -}) - -test("file permissions and ownership changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Change permissions multiple times - await $`chmod 600 ${tmp.path}/a.txt`.quiet() - await $`chmod 755 ${tmp.path}/a.txt`.quiet() - await $`chmod 644 ${tmp.path}/a.txt`.quiet() - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - // Note: git doesn't track permission changes on existing files by default - // Only tracks executable bit when files are first added - expect(patch.files.length).toBe(0) - }, - }) -}) - -test("circular symlinks", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Create circular symlink - await fs.symlink(`${tmp.path}/circular`, `${tmp.path}/circular`, "dir").catch(() => {}) - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - expect(patch.files.length).toBeGreaterThanOrEqual(0) // Should not crash - }, - }) -}) - -test("source project gitignore is respected - ignored files are not snapshotted", async () => { - await using tmp = await tmpdir({ - git: true, - init: async (dir) => { - // Create gitignore BEFORE any tracking - await Filesystem.write(`${dir}/.gitignore`, "*.ignored\nbuild/\nnode_modules/\n") - await Filesystem.write(`${dir}/tracked.txt`, "tracked content") - await Filesystem.write(`${dir}/ignored.ignored`, "ignored content") - await $`mkdir -p ${dir}/build`.quiet() - await Filesystem.write(`${dir}/build/output.js`, "build output") - await Filesystem.write(`${dir}/normal.js`, "normal js") - await $`git add .`.cwd(dir).quiet() - await $`git commit -m init`.cwd(dir).quiet() - }, - }) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Modify tracked files and create new ones - some ignored, some not - await Filesystem.write(`${tmp.path}/tracked.txt`, "modified tracked") - await Filesystem.write(`${tmp.path}/new.ignored`, "new ignored") - await Filesystem.write(`${tmp.path}/new-tracked.txt`, "new tracked") - await Filesystem.write(`${tmp.path}/build/new-build.js`, "new build file") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - // Modified and new tracked files should be in snapshot - expect(patch.files).toContain(fwd(tmp.path, "new-tracked.txt")) - expect(patch.files).toContain(fwd(tmp.path, "tracked.txt")) - - // Ignored files should NOT be in snapshot - expect(patch.files).not.toContain(fwd(tmp.path, "new.ignored")) - expect(patch.files).not.toContain(fwd(tmp.path, "ignored.ignored")) - expect(patch.files).not.toContain(fwd(tmp.path, "build/output.js")) - expect(patch.files).not.toContain(fwd(tmp.path, "build/new-build.js")) - }, - }) -}) - -test("gitignore changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) + }), + ), + { git: true }, +) + +it.instance( + "file permissions and ownership changes", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* Effect.promise(() => fs.chmod(`${tmp.path}/a.txt`, 0o600)) + yield* Effect.promise(() => fs.chmod(`${tmp.path}/a.txt`, 0o755)) + yield* Effect.promise(() => fs.chmod(`${tmp.path}/a.txt`, 0o644)) + expect((yield* snapshot.patch(before)).files.length).toBe(0) + }), + ), + { git: true }, +) + +it.instance( + "circular symlinks", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* Effect.promise(() => + fs.symlink(`${tmp.path}/circular`, `${tmp.path}/circular`, "dir").catch(() => undefined), + ) + expect((yield* snapshot.patch(before)).files.length).toBeGreaterThanOrEqual(0) + }), + ), + { git: true }, +) + +it.live( + "source project gitignore is respected - ignored files are not snapshotted", + Effect.gen(function* () { + const dir = yield* scopedGitTmpdir() + yield* write(`${dir}/.gitignore`, "*.ignored\nbuild/\nnode_modules/\n") + yield* write(`${dir}/tracked.txt`, "tracked content") + yield* write(`${dir}/ignored.ignored`, "ignored content") + yield* mkdirp(`${dir}/build`) + yield* write(`${dir}/build/output.js`, "build output") + yield* write(`${dir}/normal.js`, "normal js") + yield* exec(dir, ["git", "add", "."]) + yield* exec(dir, ["git", "commit", "-m", "init"]) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before = yield* snapshot.track() expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/.gitignore`, "*.ignored") - await Filesystem.write(`${tmp.path}/test.ignored`, "ignored content") - await Filesystem.write(`${tmp.path}/normal.txt`, "normal content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - // Should track gitignore itself + yield* write(`${dir}/tracked.txt`, "modified tracked") + yield* write(`${dir}/new.ignored`, "new ignored") + yield* write(`${dir}/new-tracked.txt`, "new tracked") + yield* write(`${dir}/build/new-build.js`, "new build file") + const patch = yield* snapshot.patch(before!) + expect(patch.files).toContain(fwd(dir, "new-tracked.txt")) + expect(patch.files).toContain(fwd(dir, "tracked.txt")) + expect(patch.files).not.toContain(fwd(dir, "new.ignored")) + expect(patch.files).not.toContain(fwd(dir, "ignored.ignored")) + expect(patch.files).not.toContain(fwd(dir, "build/output.js")) + expect(patch.files).not.toContain(fwd(dir, "build/new-build.js")) + }).pipe(provideInstance(dir)) + }), +) + +it.instance( + "gitignore changes", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/.gitignore`, "*.ignored") + yield* write(`${tmp.path}/test.ignored`, "ignored content") + yield* write(`${tmp.path}/normal.txt`, "normal content") + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(fwd(tmp.path, ".gitignore")) - // Should track normal files expect(patch.files).toContain(fwd(tmp.path, "normal.txt")) - // Should not track ignored files (git won't see them) expect(patch.files).not.toContain(fwd(tmp.path, "test.ignored")) - }, - }) -}) - -test("files tracked in snapshot but now gitignored are filtered out", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // First, create a file and snapshot it - await Filesystem.write(`${tmp.path}/later-ignored.txt`, "initial content") - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Modify the file (so it appears in diff-files) - await Filesystem.write(`${tmp.path}/later-ignored.txt`, "modified content") - - // Now add gitignore that would exclude this file - await Filesystem.write(`${tmp.path}/.gitignore`, "later-ignored.txt\n") - - // Also create another tracked file - await Filesystem.write(`${tmp.path}/still-tracked.txt`, "new tracked file") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) - - // The file that is now gitignored should NOT appear, even though it was - // previously tracked and modified - expect(patch.files).not.toContain(fwd(tmp.path, "later-ignored.txt")) - - // The gitignore file itself should appear - expect(patch.files).toContain(fwd(tmp.path, ".gitignore")) - - // Other tracked files should appear - expect(patch.files).toContain(fwd(tmp.path, "still-tracked.txt")) - }, - }) -}) - -test("gitignore updated between track calls filters from diff", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // a.txt is already committed from bootstrap - track it in snapshot - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Modify a.txt (so it appears in diff-files) - await Filesystem.write(`${tmp.path}/a.txt`, "modified content") - - // Now add gitignore that would exclude a.txt - await Filesystem.write(`${tmp.path}/.gitignore`, "a.txt\n") - - // Also modify b.txt which is not gitignored - await Filesystem.write(`${tmp.path}/b.txt`, "also modified") - - // Second track - should not include a.txt even though it changed - const after = await run(tmp.path, (snapshot) => snapshot.track()) + }), + ), + { git: true }, +) + +it.instance( + "files tracked in snapshot but now gitignored are filtered out", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* write(`${tmp.path}/later-ignored.txt`, "initial content") + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* write(`${tmp.path}/later-ignored.txt`, "modified content") + yield* write(`${tmp.path}/.gitignore`, "later-ignored.txt\n") + yield* write(`${tmp.path}/still-tracked.txt`, "new tracked file") + const patch = yield* snapshot.patch(before!) + expect(patch.files).not.toContain(fwd(tmp.path, "later-ignored.txt")) + expect(patch.files).toContain(fwd(tmp.path, ".gitignore")) + expect(patch.files).toContain(fwd(tmp.path, "still-tracked.txt")) + }), + { git: true }, +) + +it.instance( + "gitignore updated between track calls filters from diff", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/a.txt`, "modified content") + yield* write(`${tmp.path}/.gitignore`, "a.txt\n") + yield* write(`${tmp.path}/b.txt`, "also modified") + const after = yield* snapshot.track() expect(after).toBeTruthy() - - // Verify a.txt is NOT in the diff between snapshots - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.some((x) => x.file === "a.txt")).toBe(false) - - // But .gitignore should be in the diff expect(diffs.some((x) => x.file === ".gitignore")).toBe(true) - - // b.txt should be in the diff (not gitignored) expect(diffs.some((x) => x.file === "b.txt")).toBe(true) - }, - }) -}) - -test("git info exclude changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - + }), + ), + { git: true }, +) + +it.instance( + "git info exclude changes", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { const file = `${tmp.path}/.git/info/exclude` - const text = await Bun.file(file).text() - await Bun.write(file, `${text.trimEnd()}\nignored.txt\n`) - await Bun.write(`${tmp.path}/ignored.txt`, "ignored content") - await Bun.write(`${tmp.path}/normal.txt`, "normal content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + yield* write(file, `${(yield* Effect.promise(() => Bun.file(file).text())).trimEnd()}\nignored.txt\n`) + yield* write(`${tmp.path}/ignored.txt`, "ignored content") + yield* write(`${tmp.path}/normal.txt`, "normal content") + const patch = yield* snapshot.patch(before) expect(patch.files).toContain(fwd(tmp.path, "normal.txt")) expect(patch.files).not.toContain(fwd(tmp.path, "ignored.txt")) - - const after = await run(tmp.path, (snapshot) => snapshot.track()) - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const after = yield* snapshot.track() + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.some((x) => x.file === "normal.txt")).toBe(true) expect(diffs.some((x) => x.file === "ignored.txt")).toBe(false) - }, - }) -}) - -test("git info exclude keeps global excludes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const global = `${tmp.path}/global.ignore` - const config = `${tmp.path}/global.gitconfig` - await Bun.write(global, "global.tmp\n") - await Bun.write(config, `[core]\n\texcludesFile = ${global.replaceAll("\\", "/")}\n`) - - const prev = process.env.GIT_CONFIG_GLOBAL - process.env.GIT_CONFIG_GLOBAL = config - try { - const before = await run(tmp.path, (snapshot) => snapshot.track()) + }), + ), + { git: true }, +) + +it.instance( + "git info exclude keeps global excludes", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const global = `${tmp.path}/global.ignore` + const config = `${tmp.path}/global.gitconfig` + yield* write(global, "global.tmp\n") + yield* write(config, `[core]\n\texcludesFile = ${global.replaceAll("\\", "/")}\n`) + yield* withGitConfigGlobal( + config, + Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before = yield* snapshot.track() expect(before).toBeTruthy() - const file = `${tmp.path}/.git/info/exclude` - const text = await Bun.file(file).text() - await Bun.write(file, `${text.trimEnd()}\ninfo.tmp\n`) - - await Bun.write(`${tmp.path}/global.tmp`, "global content") - await Bun.write(`${tmp.path}/info.tmp`, "info content") - await Bun.write(`${tmp.path}/normal.txt`, "normal content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(before!)) + yield* write(file, `${(yield* Effect.promise(() => Bun.file(file).text())).trimEnd()}\ninfo.tmp\n`) + yield* write(`${tmp.path}/global.tmp`, "global content") + yield* write(`${tmp.path}/info.tmp`, "info content") + yield* write(`${tmp.path}/normal.txt`, "normal content") + const patch = yield* snapshot.patch(before!) expect(patch.files).toContain(fwd(tmp.path, "normal.txt")) expect(patch.files).not.toContain(fwd(tmp.path, "global.tmp")) expect(patch.files).not.toContain(fwd(tmp.path, "info.tmp")) - } finally { - if (prev) process.env.GIT_CONFIG_GLOBAL = prev - else delete process.env.GIT_CONFIG_GLOBAL - } - }, - }) -}) - -test("concurrent file operations during patch", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Start creating files - const createPromise = (async () => { + }), + ) + }), + { git: true }, +) + +it.instance( + "concurrent file operations during patch", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + const fiber = yield* Effect.gen(function* () { for (let i = 0; i < 10; i++) { - await Filesystem.write(`${tmp.path}/concurrent${i}.txt`, `concurrent${i}`) - // Small delay to simulate concurrent operations - await new Promise((resolve) => setTimeout(resolve, 1)) + yield* write(`${tmp.path}/concurrent${i}.txt`, `concurrent${i}`) + yield* Effect.sleep("1 millis") } - })() - - // Get patch while files are being created - const patchPromise = run(tmp.path, (snapshot) => snapshot.patch(before!)) - - await createPromise - const patch = await patchPromise - - // Should capture some or all of the concurrent files + }).pipe(Effect.forkScoped) + const patch = yield* snapshot.patch(before) + yield* Fiber.join(fiber) expect(patch.files.length).toBeGreaterThanOrEqual(0) - }, - }) -}) - -test("snapshot state isolation between projects", async () => { - // Test that different projects don't interfere with each other - await using tmp1 = await bootstrap() - await using tmp2 = await bootstrap() - - await WithInstance.provide({ - directory: tmp1.path, - fn: async () => { - const before1 = await run(tmp1.path, (snapshot) => snapshot.track()) - await Filesystem.write(`${tmp1.path}/project1.txt`, "project1 content") - const patch1 = await run(tmp1.path, (snapshot) => snapshot.patch(before1!)) + }), + ), + { git: true }, +) + +it.live( + "snapshot state isolation between projects", + Effect.gen(function* () { + const tmp1 = yield* bootstrapScoped() + const tmp2 = yield* bootstrapScoped() + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before1 = yield* snapshot.track() + yield* write(`${tmp1.path}/project1.txt`, "project1 content") + const patch1 = yield* snapshot.patch(before1!) expect(patch1.files).toContain(fwd(tmp1.path, "project1.txt")) - }, - }) - - await WithInstance.provide({ - directory: tmp2.path, - fn: async () => { - const before2 = await run(tmp2.path, (snapshot) => snapshot.track()) - await Filesystem.write(`${tmp2.path}/project2.txt`, "project2 content") - const patch2 = await run(tmp2.path, (snapshot) => snapshot.patch(before2!)) + }).pipe(provideInstance(tmp1.path)) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before2 = yield* snapshot.track() + yield* write(`${tmp2.path}/project2.txt`, "project2 content") + const patch2 = yield* snapshot.patch(before2!) expect(patch2.files).toContain(fwd(tmp2.path, "project2.txt")) - - // Ensure project1 files don't appear in project2 - expect(patch2.files).not.toContain(fwd(tmp1?.path ?? "", "project1.txt")) - }, - }) -}) - -test("patch detects changes in secondary worktree", async () => { - await using tmp = await bootstrap() - const worktreePath = `${tmp.path}-worktree` - await $`git worktree add ${worktreePath} HEAD`.cwd(tmp.path).quiet() - - try { - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - expect(await run(tmp.path, (snapshot) => snapshot.track())).toBeTruthy() - }, - }) - - await WithInstance.provide({ - directory: worktreePath, - fn: async () => { - const before = await run(worktreePath, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - const worktreeFile = fwd(worktreePath, "worktree.txt") - await Filesystem.write(worktreeFile, "worktree content") - - const patch = await run(worktreePath, (snapshot) => snapshot.patch(before!)) - expect(patch.files).toContain(worktreeFile) - }, - }) - } finally { - await $`git worktree remove --force ${worktreePath}`.cwd(tmp.path).quiet().nothrow() - await $`rm -rf ${worktreePath}`.quiet() - } -}) - -test("revert only removes files in invoking worktree", async () => { - await using tmp = await bootstrap() - const worktreePath = `${tmp.path}-worktree` - await $`git worktree add ${worktreePath} HEAD`.cwd(tmp.path).quiet() - - try { - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - expect(await run(tmp.path, (snapshot) => snapshot.track())).toBeTruthy() - }, - }) + expect(patch2.files).not.toContain(fwd(tmp1.path, "project1.txt")) + }).pipe(provideInstance(tmp2.path)) + }), +) + +it.live( + "patch detects changes in secondary worktree", + Effect.gen(function* () { + const tmp = yield* bootstrapScoped() + const worktreePath = `${tmp.path}-worktree` + yield* exec(tmp.path, ["git", "worktree", "add", worktreePath, "HEAD"]) + yield* Effect.addFinalizer(() => cleanupWorktree(tmp.path, worktreePath)) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + expect(yield* snapshot.track()).toBeTruthy() + }).pipe(provideInstance(tmp.path)) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before = yield* snapshot.track() + expect(before).toBeTruthy() + const worktreeFile = fwd(worktreePath, "worktree.txt") + yield* write(worktreeFile, "worktree content") + expect((yield* snapshot.patch(before!)).files).toContain(worktreeFile) + }).pipe(provideInstance(worktreePath)) + }), +) + +it.live( + "revert only removes files in invoking worktree", + Effect.gen(function* () { + const tmp = yield* bootstrapScoped() + const worktreePath = `${tmp.path}-worktree` const primaryFile = `${tmp.path}/worktree.txt` - await Filesystem.write(primaryFile, "primary content") - - await WithInstance.provide({ - directory: worktreePath, - fn: async () => { - const before = await run(worktreePath, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - const worktreeFile = fwd(worktreePath, "worktree.txt") - await Filesystem.write(worktreeFile, "worktree content") - - const patch = await run(worktreePath, (snapshot) => snapshot.patch(before!)) - await run(worktreePath, (snapshot) => snapshot.revert([patch])) - - expect( - await fs - .access(worktreeFile) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) - - expect(await fs.readFile(primaryFile, "utf-8")).toBe("primary content") - } finally { - await $`git worktree remove --force ${worktreePath}`.cwd(tmp.path).quiet().nothrow() - await $`rm -rf ${worktreePath}`.quiet() - await $`rm -f ${tmp.path}/worktree.txt`.quiet() - } -}) - -test("diff reports worktree-only/shared edits and ignores primary-only", async () => { - await using tmp = await bootstrap() - const worktreePath = `${tmp.path}-worktree` - await $`git worktree add ${worktreePath} HEAD`.cwd(tmp.path).quiet() - - try { - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - expect(await run(tmp.path, (snapshot) => snapshot.track())).toBeTruthy() - }, - }) - - await WithInstance.provide({ - directory: worktreePath, - fn: async () => { - const before = await run(worktreePath, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${worktreePath}/worktree-only.txt`, "worktree diff content") - await Filesystem.write(`${worktreePath}/shared.txt`, "worktree edit") - await Filesystem.write(`${tmp.path}/shared.txt`, "primary edit") - await Filesystem.write(`${tmp.path}/primary-only.txt`, "primary change") - - const diff = await run(worktreePath, (snapshot) => snapshot.diff(before!)) - expect(diff).toContain("worktree-only.txt") - expect(diff).toContain("shared.txt") - expect(diff).not.toContain("primary-only.txt") - }, - }) - } finally { - await $`git worktree remove --force ${worktreePath}`.cwd(tmp.path).quiet().nothrow() - await $`rm -rf ${worktreePath}`.quiet() - await $`rm -f ${tmp.path}/shared.txt`.quiet() - await $`rm -f ${tmp.path}/primary-only.txt`.quiet() - } -}) - -test("track with no changes returns same hash", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const hash1 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(hash1).toBeTruthy() - - // Track again with no changes - const hash2 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(hash2).toBe(hash1!) - - // Track again - const hash3 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(hash3).toBe(hash1!) - }, - }) -}) - -test("diff function with various changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) + yield* exec(tmp.path, ["git", "worktree", "add", worktreePath, "HEAD"]) + yield* Effect.addFinalizer(() => cleanupWorktree(tmp.path, worktreePath, [primaryFile])) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + expect(yield* snapshot.track()).toBeTruthy() + }).pipe(provideInstance(tmp.path)) + yield* write(primaryFile, "primary content") + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before = yield* snapshot.track() expect(before).toBeTruthy() - - // Make various changes - await $`rm ${tmp.path}/a.txt`.quiet() - await Filesystem.write(`${tmp.path}/new.txt`, "new content") - await Filesystem.write(`${tmp.path}/b.txt`, "modified content") - - const diff = await run(tmp.path, (snapshot) => snapshot.diff(before!)) + const worktreeFile = fwd(worktreePath, "worktree.txt") + yield* write(worktreeFile, "worktree content") + const patch = yield* snapshot.patch(before!) + yield* snapshot.revert([patch]) + expect(yield* exists(worktreeFile)).toBe(false) + }).pipe(provideInstance(worktreePath)) + expect(yield* readText(primaryFile)).toBe("primary content") + }), +) + +it.live( + "diff reports worktree-only/shared edits and ignores primary-only", + Effect.gen(function* () { + const tmp = yield* bootstrapScoped() + const worktreePath = `${tmp.path}-worktree` + yield* exec(tmp.path, ["git", "worktree", "add", worktreePath, "HEAD"]) + yield* Effect.addFinalizer(() => + cleanupWorktree(tmp.path, worktreePath, [`${tmp.path}/shared.txt`, `${tmp.path}/primary-only.txt`]), + ) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + expect(yield* snapshot.track()).toBeTruthy() + }).pipe(provideInstance(tmp.path)) + yield* Effect.gen(function* () { + const snapshot = yield* Snapshot.Service + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* write(`${worktreePath}/worktree-only.txt`, "worktree diff content") + yield* write(`${worktreePath}/shared.txt`, "worktree edit") + yield* write(`${tmp.path}/shared.txt`, "primary edit") + yield* write(`${tmp.path}/primary-only.txt`, "primary change") + const diff = yield* snapshot.diff(before!) + expect(diff).toContain("worktree-only.txt") + expect(diff).toContain("shared.txt") + expect(diff).not.toContain("primary-only.txt") + }).pipe(provideInstance(worktreePath)) + }), +) + +it.instance( + "track with no changes returns same hash", + withTrackedSnapshot(({ snapshot, before }) => + Effect.gen(function* () { + expect(yield* snapshot.track()).toBe(before) + expect(yield* snapshot.track()).toBe(before) + }), + ), + { git: true }, +) + +it.instance( + "diff function with various changes", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* rm(`${tmp.path}/a.txt`) + yield* write(`${tmp.path}/new.txt`, "new content") + yield* write(`${tmp.path}/b.txt`, "modified content") + const diff = yield* snapshot.diff(before) expect(diff).toContain("a.txt") expect(diff).toContain("b.txt") expect(diff).toContain("new.txt") - }, - }) -}) - -test("restore function", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - // Make changes - await $`rm ${tmp.path}/a.txt`.quiet() - await Filesystem.write(`${tmp.path}/new.txt`, "new content") - await Filesystem.write(`${tmp.path}/b.txt`, "modified") - - // Restore to original state - await run(tmp.path, (snapshot) => snapshot.restore(before!)) - - expect( - await fs - .access(`${tmp.path}/a.txt`) - .then(() => true) - .catch(() => false), - ).toBe(true) - expect(await fs.readFile(`${tmp.path}/a.txt`, "utf-8")).toBe(tmp.extra.aContent) - expect( - await fs - .access(`${tmp.path}/new.txt`) - .then(() => true) - .catch(() => false), - ).toBe(true) // New files should remain - expect(await fs.readFile(`${tmp.path}/b.txt`, "utf-8")).toBe(tmp.extra.bContent) - }, - }) -}) - -test("revert should not delete files that existed but were deleted in snapshot", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const snapshot1 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snapshot1).toBeTruthy() - - await $`rm ${tmp.path}/a.txt`.quiet() - - const snapshot2 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snapshot2).toBeTruthy() - - await Filesystem.write(`${tmp.path}/a.txt`, "recreated content") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(snapshot2!)) - expect(patch.files).toContain(fwd(tmp.path, "a.txt")) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect( - await fs - .access(`${tmp.path}/a.txt`) - .then(() => true) - .catch(() => false), - ).toBe(false) - }, - }) -}) - -test("revert preserves file that existed in snapshot when deleted then recreated", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await Filesystem.write(`${tmp.path}/existing.txt`, "original content") - - const hash = await run(tmp.path, (snapshot) => snapshot.track()) - expect(hash).toBeTruthy() - - await $`rm ${tmp.path}/existing.txt`.quiet() - await Filesystem.write(`${tmp.path}/existing.txt`, "recreated") - await Filesystem.write(`${tmp.path}/newfile.txt`, "new") - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(hash!)) - expect(patch.files).toContain(fwd(tmp.path, "existing.txt")) - expect(patch.files).toContain(fwd(tmp.path, "newfile.txt")) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - expect( - await fs - .access(`${tmp.path}/newfile.txt`) - .then(() => true) - .catch(() => false), - ).toBe(false) - expect( - await fs - .access(`${tmp.path}/existing.txt`) - .then(() => true) - .catch(() => false), - ).toBe(true) - expect(await fs.readFile(`${tmp.path}/existing.txt`, "utf-8")).toBe("original content") - }, - }) -}) - -test("diffFull sets status based on git change type", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await Filesystem.write(`${tmp.path}/grow.txt`, "one\n") - await Filesystem.write(`${tmp.path}/trim.txt`, "line1\nline2\n") - await Filesystem.write(`${tmp.path}/delete.txt`, "gone") - - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/grow.txt`, "one\ntwo\n") - await Filesystem.write(`${tmp.path}/trim.txt`, "line1\n") - await $`rm ${tmp.path}/delete.txt`.quiet() - await Filesystem.write(`${tmp.path}/added.txt`, "new") - - const after = await run(tmp.path, (snapshot) => snapshot.track()) - expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) - expect(diffs.length).toBe(4) - - const added = diffs.find((d) => d.file === "added.txt") - expect(added).toBeDefined() - expect(added!.status).toBe("added") - - const deleted = diffs.find((d) => d.file === "delete.txt") - expect(deleted).toBeDefined() - expect(deleted!.status).toBe("deleted") - - const grow = diffs.find((d) => d.file === "grow.txt") - expect(grow).toBeDefined() - expect(grow!.status).toBe("modified") - expect(grow!.additions).toBeGreaterThan(0) - expect(grow!.deletions).toBe(0) - - const trim = diffs.find((d) => d.file === "trim.txt") - expect(trim).toBeDefined() - expect(trim!.status).toBe("modified") - expect(trim!.additions).toBe(0) - expect(trim!.deletions).toBeGreaterThan(0) - }, - }) -}) - -test("diffFull with new file additions", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/new.txt`, "new content") - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + }), + ), + { git: true }, +) + +it.instance( + "restore function", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* rm(`${tmp.path}/a.txt`) + yield* write(`${tmp.path}/new.txt`, "new content") + yield* write(`${tmp.path}/b.txt`, "modified") + yield* snapshot.restore(before) + expect(yield* exists(`${tmp.path}/a.txt`)).toBe(true) + expect(yield* readText(`${tmp.path}/a.txt`)).toBe(tmp.extra.aContent) + expect(yield* exists(`${tmp.path}/new.txt`)).toBe(true) + expect(yield* readText(`${tmp.path}/b.txt`)).toBe(tmp.extra.bContent) + }), + ), + { git: true }, +) + +it.instance( + "revert should not delete files that existed but were deleted in snapshot", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + const snapshot1 = yield* snapshot.track() + expect(snapshot1).toBeTruthy() + yield* rm(`${tmp.path}/a.txt`) + const snapshot2 = yield* snapshot.track() + expect(snapshot2).toBeTruthy() + yield* write(`${tmp.path}/a.txt`, "recreated content") + const patch = yield* snapshot.patch(snapshot2!) + expect(patch.files).toContain(fwd(tmp.path, "a.txt")) + yield* snapshot.revert([patch]) + expect(yield* exists(`${tmp.path}/a.txt`)).toBe(false) + }), + { git: true }, +) + +it.instance( + "revert preserves file that existed in snapshot when deleted then recreated", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* write(`${tmp.path}/existing.txt`, "original content") + const hash = yield* snapshot.track() + expect(hash).toBeTruthy() + yield* rm(`${tmp.path}/existing.txt`) + yield* write(`${tmp.path}/existing.txt`, "recreated") + yield* write(`${tmp.path}/newfile.txt`, "new") + const patch = yield* snapshot.patch(hash!) + expect(patch.files).toContain(fwd(tmp.path, "existing.txt")) + expect(patch.files).toContain(fwd(tmp.path, "newfile.txt")) + yield* snapshot.revert([patch]) + expect(yield* exists(`${tmp.path}/newfile.txt`)).toBe(false) + expect(yield* exists(`${tmp.path}/existing.txt`)).toBe(true) + expect(yield* readText(`${tmp.path}/existing.txt`)).toBe("original content") + }), + { git: true }, +) + +it.instance( + "diffFull sets status based on git change type", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* write(`${tmp.path}/grow.txt`, "one\n") + yield* write(`${tmp.path}/trim.txt`, "line1\nline2\n") + yield* write(`${tmp.path}/delete.txt`, "gone") + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* write(`${tmp.path}/grow.txt`, "one\ntwo\n") + yield* write(`${tmp.path}/trim.txt`, "line1\n") + yield* rm(`${tmp.path}/delete.txt`) + yield* write(`${tmp.path}/added.txt`, "new") + const after = yield* snapshot.track() + expect(after).toBeTruthy() + const diffs = yield* snapshot.diffFull(before!, after!) + expect(diffs.length).toBe(4) + expect(diffs.find((d) => d.file === "added.txt")!.status).toBe("added") + expect(diffs.find((d) => d.file === "delete.txt")!.status).toBe("deleted") + const grow = diffs.find((d) => d.file === "grow.txt")! + expect(grow.status).toBe("modified") + expect(grow.additions).toBeGreaterThan(0) + expect(grow.deletions).toBe(0) + const trim = diffs.find((d) => d.file === "trim.txt")! + expect(trim.status).toBe("modified") + expect(trim.additions).toBe(0) + expect(trim.deletions).toBeGreaterThan(0) + }), + { git: true }, +) + +it.instance( + "diffFull with new file additions", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/new.txt`, "new content") + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(1) - - const newFileDiff = diffs[0] - expect(newFileDiff.file).toBe("new.txt") - expect(newFileDiff.patch).toContain("+new content") - expect(newFileDiff.additions).toBe(1) - expect(newFileDiff.deletions).toBe(0) - }, - }) -}) - -test("diffFull with a large interleaved mixed diff", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const ids = Array.from({ length: 60 }, (_, i) => i.toString().padStart(3, "0")) - const mod = ids.map((id) => fwd(tmp.path, "mix", `${id}-mod.txt`)) - const del = ids.map((id) => fwd(tmp.path, "mix", `${id}-del.txt`)) - const add = ids.map((id) => fwd(tmp.path, "mix", `${id}-add.txt`)) - const bin = ids.map((id) => fwd(tmp.path, "mix", `${id}-bin.bin`)) - - await $`mkdir -p ${tmp.path}/mix`.quiet() - await Promise.all([ - ...mod.map((file, i) => Filesystem.write(file, `before-${ids[i]}-é\n🙂\nline`)), - ...del.map((file, i) => Filesystem.write(file, `gone-${ids[i]}\n你好`)), - ...bin.map((file, i) => Filesystem.write(file, new Uint8Array([0, i, 255, i % 251]))), - ]) - - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Promise.all([ - ...mod.map((file, i) => Filesystem.write(file, `after-${ids[i]}-é\n🚀\nline`)), - ...add.map((file, i) => Filesystem.write(file, `new-${ids[i]}\nこんにちは`)), - ...bin.map((file, i) => Filesystem.write(file, new Uint8Array([9, i, 8, i % 251]))), - ...del.map((file) => fs.rm(file)), - ]) - - const after = await run(tmp.path, (snapshot) => snapshot.track()) - expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) - expect(diffs).toHaveLength(ids.length * 4) - - const map = new Map(diffs.map((item) => [item.file, item])) - for (let i = 0; i < ids.length; i++) { - const m = map.get(fwd("mix", `${ids[i]}-mod.txt`)) - expect(m).toBeDefined() - expect(m!.patch).toContain(`-before-${ids[i]}-é`) - expect(m!.patch).toContain(`+after-${ids[i]}-é`) - expect(m!.status).toBe("modified") - - const d = map.get(fwd("mix", `${ids[i]}-del.txt`)) - expect(d).toBeDefined() - expect(d!.patch).toContain(`-gone-${ids[i]}`) - expect(d!.status).toBe("deleted") - - const a = map.get(fwd("mix", `${ids[i]}-add.txt`)) - expect(a).toBeDefined() - expect(a!.patch).toContain(`+new-${ids[i]}`) - expect(a!.status).toBe("added") - - const b = map.get(fwd("mix", `${ids[i]}-bin.bin`)) - expect(b).toBeDefined() - expect(b!.patch).toBe("") - expect(b!.additions).toBe(0) - expect(b!.deletions).toBe(0) - expect(b!.status).toBe("modified") - } - }, - }) -}) - -test("diffFull preserves git diff order across batch boundaries", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const ids = Array.from({ length: 140 }, (_, i) => i.toString().padStart(3, "0")) - - await $`mkdir -p ${tmp.path}/order`.quiet() - await Promise.all(ids.map((id) => Filesystem.write(`${tmp.path}/order/${id}.txt`, `before-${id}`))) - - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Promise.all(ids.map((id) => Filesystem.write(`${tmp.path}/order/${id}.txt`, `after-${id}`))) - - const after = await run(tmp.path, (snapshot) => snapshot.track()) - expect(after).toBeTruthy() - - const expected = ids.map((id) => `order/${id}.txt`) - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) - expect(diffs.map((item) => item.file)).toEqual(expected) - }, - }) -}) - -test("diffFull with file modifications", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/b.txt`, "modified content") - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + expect(diffs[0].file).toBe("new.txt") + expect(diffs[0].patch).toContain("+new content") + expect(diffs[0].additions).toBe(1) + expect(diffs[0].deletions).toBe(0) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with a large interleaved mixed diff", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + const ids = Array.from({ length: 60 }, (_, i) => i.toString().padStart(3, "0")) + const mod = ids.map((id) => fwd(tmp.path, "mix", `${id}-mod.txt`)) + const del = ids.map((id) => fwd(tmp.path, "mix", `${id}-del.txt`)) + const add = ids.map((id) => fwd(tmp.path, "mix", `${id}-add.txt`)) + const bin = ids.map((id) => fwd(tmp.path, "mix", `${id}-bin.bin`)) + yield* mkdirp(`${tmp.path}/mix`) + yield* Effect.all( + [ + ...mod.map((file, i) => write(file, `before-${ids[i]}-é\n🙂\nline`)), + ...del.map((file, i) => write(file, `gone-${ids[i]}\n你好`)), + ...bin.map((file, i) => write(file, new Uint8Array([0, i, 255, i % 251]))), + ], + { concurrency: "unbounded" }, + ) + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* Effect.all( + [ + ...mod.map((file, i) => write(file, `after-${ids[i]}-é\n🚀\nline`)), + ...add.map((file, i) => write(file, `new-${ids[i]}\nこんにちは`)), + ...bin.map((file, i) => write(file, new Uint8Array([9, i, 8, i % 251]))), + ...del.map((file) => rm(file)), + ], + { concurrency: "unbounded" }, + ) + const after = yield* snapshot.track() + expect(after).toBeTruthy() + const diffs = yield* snapshot.diffFull(before!, after!) + expect(diffs).toHaveLength(ids.length * 4) + const map = new Map(diffs.map((item) => [item.file, item])) + for (let i = 0; i < ids.length; i++) { + const m = map.get(fwd("mix", `${ids[i]}-mod.txt`)) + expect(m).toBeDefined() + expect(m!.patch).toContain(`-before-${ids[i]}-é`) + expect(m!.patch).toContain(`+after-${ids[i]}-é`) + expect(m!.status).toBe("modified") + const d = map.get(fwd("mix", `${ids[i]}-del.txt`)) + expect(d).toBeDefined() + expect(d!.patch).toContain(`-gone-${ids[i]}`) + expect(d!.status).toBe("deleted") + const a = map.get(fwd("mix", `${ids[i]}-add.txt`)) + expect(a).toBeDefined() + expect(a!.patch).toContain(`+new-${ids[i]}`) + expect(a!.status).toBe("added") + const b = map.get(fwd("mix", `${ids[i]}-bin.bin`)) + expect(b).toBeDefined() + expect(b!.patch).toBe("") + expect(b!.additions).toBe(0) + expect(b!.deletions).toBe(0) + expect(b!.status).toBe("modified") + } + }), + { git: true }, +) + +it.instance( + "diffFull preserves git diff order across batch boundaries", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + const ids = Array.from({ length: 140 }, (_, i) => i.toString().padStart(3, "0")) + yield* mkdirp(`${tmp.path}/order`) + yield* Effect.all( + ids.map((id) => write(`${tmp.path}/order/${id}.txt`, `before-${id}`)), + { concurrency: "unbounded" }, + ) + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* Effect.all( + ids.map((id) => write(`${tmp.path}/order/${id}.txt`, `after-${id}`)), + { concurrency: "unbounded" }, + ) + const after = yield* snapshot.track() + expect(after).toBeTruthy() + expect((yield* snapshot.diffFull(before!, after!)).map((item) => item.file)).toEqual( + ids.map((id) => `order/${id}.txt`), + ) + }), + { git: true }, +) + +it.instance( + "diffFull with file modifications", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/b.txt`, "modified content") + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(1) - - const modifiedFileDiff = diffs[0] - expect(modifiedFileDiff.file).toBe("b.txt") - expect(modifiedFileDiff.patch).toContain(`-${tmp.extra.bContent}`) - expect(modifiedFileDiff.patch).toContain("+modified content") - expect(modifiedFileDiff.additions).toBeGreaterThan(0) - expect(modifiedFileDiff.deletions).toBeGreaterThan(0) - }, - }) -}) - -test("diffFull with file deletions", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await $`rm ${tmp.path}/a.txt`.quiet() - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + expect(diffs[0].file).toBe("b.txt") + expect(diffs[0].patch).toContain(`-${tmp.extra.bContent}`) + expect(diffs[0].patch).toContain("+modified content") + expect(diffs[0].additions).toBeGreaterThan(0) + expect(diffs[0].deletions).toBeGreaterThan(0) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with file deletions", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* rm(`${tmp.path}/a.txt`) + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(1) - - const removedFileDiff = diffs[0] - expect(removedFileDiff.file).toBe("a.txt") - expect(removedFileDiff.patch).toContain(`-${tmp.extra.aContent}`) - expect(removedFileDiff.additions).toBe(0) - expect(removedFileDiff.deletions).toBe(1) - }, - }) -}) - -test("diffFull with multiple line additions", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/multi.txt`, "line1\nline2\nline3") - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + expect(diffs[0].file).toBe("a.txt") + expect(diffs[0].patch).toContain(`-${tmp.extra.aContent}`) + expect(diffs[0].additions).toBe(0) + expect(diffs[0].deletions).toBe(1) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with multiple line additions", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/multi.txt`, "line1\nline2\nline3") + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(1) - - const multiDiff = diffs[0] - expect(multiDiff.file).toBe("multi.txt") - expect(multiDiff.patch).toContain("+line1") - expect(multiDiff.patch).toContain("+line3") - expect(multiDiff.additions).toBe(3) - expect(multiDiff.deletions).toBe(0) - }, - }) -}) - -test("diffFull with addition and deletion", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/added.txt`, "added content") - await $`rm ${tmp.path}/a.txt`.quiet() - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + expect(diffs[0].file).toBe("multi.txt") + expect(diffs[0].patch).toContain("+line1") + expect(diffs[0].patch).toContain("+line3") + expect(diffs[0].additions).toBe(3) + expect(diffs[0].deletions).toBe(0) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with addition and deletion", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/added.txt`, "added content") + yield* rm(`${tmp.path}/a.txt`) + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(2) - - const addedFileDiff = diffs.find((d) => d.file === "added.txt") - expect(addedFileDiff).toBeDefined() - expect(addedFileDiff!.patch).toContain("+added content") - expect(addedFileDiff!.additions).toBe(1) - expect(addedFileDiff!.deletions).toBe(0) - - const removedFileDiff = diffs.find((d) => d.file === "a.txt") - expect(removedFileDiff).toBeDefined() - expect(removedFileDiff!.patch).toContain(`-${tmp.extra.aContent}`) - expect(removedFileDiff!.additions).toBe(0) - expect(removedFileDiff!.deletions).toBe(1) - }, - }) -}) - -test("diffFull with multiple additions and deletions", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/multi1.txt`, "line1\nline2\nline3") - await Filesystem.write(`${tmp.path}/multi2.txt`, "single line") - await $`rm ${tmp.path}/a.txt`.quiet() - await $`rm ${tmp.path}/b.txt`.quiet() - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + const added = diffs.find((d) => d.file === "added.txt")! + expect(added.patch).toContain("+added content") + expect(added.additions).toBe(1) + expect(added.deletions).toBe(0) + const removed = diffs.find((d) => d.file === "a.txt")! + expect(removed.patch).toContain(`-${tmp.extra.aContent}`) + expect(removed.additions).toBe(0) + expect(removed.deletions).toBe(1) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with multiple additions and deletions", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/multi1.txt`, "line1\nline2\nline3") + yield* write(`${tmp.path}/multi2.txt`, "single line") + yield* rm(`${tmp.path}/a.txt`) + yield* rm(`${tmp.path}/b.txt`) + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(4) - - const multi1Diff = diffs.find((d) => d.file === "multi1.txt") - expect(multi1Diff).toBeDefined() - expect(multi1Diff!.additions).toBe(3) - expect(multi1Diff!.deletions).toBe(0) - - const multi2Diff = diffs.find((d) => d.file === "multi2.txt") - expect(multi2Diff).toBeDefined() - expect(multi2Diff!.additions).toBe(1) - expect(multi2Diff!.deletions).toBe(0) - - const removedADiff = diffs.find((d) => d.file === "a.txt") - expect(removedADiff).toBeDefined() - expect(removedADiff!.additions).toBe(0) - expect(removedADiff!.deletions).toBe(1) - - const removedBDiff = diffs.find((d) => d.file === "b.txt") - expect(removedBDiff).toBeDefined() - expect(removedBDiff!.additions).toBe(0) - expect(removedBDiff!.deletions).toBe(1) - }, - }) -}) - -test("diffFull with no changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - const after = await run(tmp.path, (snapshot) => snapshot.track()) - expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) - expect(diffs.length).toBe(0) - }, - }) -}) - -test("diffFull with binary file changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/binary.bin`, new Uint8Array([0x00, 0x01, 0x02, 0x03])) - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + expect(diffs.find((d) => d.file === "multi1.txt")!.additions).toBe(3) + expect(diffs.find((d) => d.file === "multi1.txt")!.deletions).toBe(0) + expect(diffs.find((d) => d.file === "multi2.txt")!.additions).toBe(1) + expect(diffs.find((d) => d.file === "multi2.txt")!.deletions).toBe(0) + expect(diffs.find((d) => d.file === "a.txt")!.additions).toBe(0) + expect(diffs.find((d) => d.file === "a.txt")!.deletions).toBe(1) + expect(diffs.find((d) => d.file === "b.txt")!.additions).toBe(0) + expect(diffs.find((d) => d.file === "b.txt")!.deletions).toBe(1) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with no changes", + withTrackedSnapshot(({ snapshot, before }) => + Effect.gen(function* () { + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) - expect(diffs.length).toBe(1) - - const binaryDiff = diffs[0] - expect(binaryDiff.file).toBe("binary.bin") - expect(binaryDiff.patch).toBe("") - }, - }) -}) - -test("diffFull with whitespace changes", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await Filesystem.write(`${tmp.path}/whitespace.txt`, "line1\nline2") - const before = await run(tmp.path, (snapshot) => snapshot.track()) - expect(before).toBeTruthy() - - await Filesystem.write(`${tmp.path}/whitespace.txt`, "line1\n\nline2\n") - - const after = await run(tmp.path, (snapshot) => snapshot.track()) + expect((yield* snapshot.diffFull(before, after!)).length).toBe(0) + }), + ), + { git: true }, +) + +it.instance( + "diffFull with binary file changes", + withTrackedSnapshot(({ tmp, snapshot, before }) => + Effect.gen(function* () { + yield* write(`${tmp.path}/binary.bin`, new Uint8Array([0x00, 0x01, 0x02, 0x03])) + const after = yield* snapshot.track() expect(after).toBeTruthy() - - const diffs = await run(tmp.path, (snapshot) => snapshot.diffFull(before!, after!)) + const diffs = yield* snapshot.diffFull(before, after!) expect(diffs.length).toBe(1) - - const whitespaceDiff = diffs[0] - expect(whitespaceDiff.file).toBe("whitespace.txt") - expect(whitespaceDiff.additions).toBeGreaterThan(0) - }, - }) -}) - -test("revert with overlapping files across patches uses first patch hash", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - // Write initial content and snapshot - await Filesystem.write(`${tmp.path}/shared.txt`, "v1") - const snap1 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snap1).toBeTruthy() - - // Modify and snapshot again - await Filesystem.write(`${tmp.path}/shared.txt`, "v2") - const snap2 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snap2).toBeTruthy() - - // Modify once more so both patches include shared.txt - await Filesystem.write(`${tmp.path}/shared.txt`, "v3") - - const patch1 = await run(tmp.path, (snapshot) => snapshot.patch(snap1!)) - const patch2 = await run(tmp.path, (snapshot) => snapshot.patch(snap2!)) - - // Both patches should include shared.txt - expect(patch1.files).toContain(fwd(tmp.path, "shared.txt")) - expect(patch2.files).toContain(fwd(tmp.path, "shared.txt")) - - // Revert with patch1 first — should use snap1's hash (restoring "v1") - await run(tmp.path, (snapshot) => snapshot.revert([patch1, patch2])) - - const content = await fs.readFile(`${tmp.path}/shared.txt`, "utf-8") - expect(content).toBe("v1") - }, - }) -}) - -test("revert preserves patch order when the same hash appears again", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await $`mkdir -p ${tmp.path}/foo`.quiet() - await Filesystem.write(`${tmp.path}/foo/bar`, "v1") - await Filesystem.write(`${tmp.path}/a.txt`, "v1") - - const snap1 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snap1).toBeTruthy() - - await $`rm -rf ${tmp.path}/foo`.quiet() - await Filesystem.write(`${tmp.path}/foo`, "v2") - await Filesystem.write(`${tmp.path}/a.txt`, "v2") - - const snap2 = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snap2).toBeTruthy() - - await $`rm -rf ${tmp.path}/foo`.quiet() - await Filesystem.write(`${tmp.path}/a.txt`, "v3") - - await run(tmp.path, (snapshot) => - snapshot.revert([ - { hash: snap1!, files: [fwd(tmp.path, "a.txt")] }, - { hash: snap2!, files: [fwd(tmp.path, "foo")] }, - { hash: snap1!, files: [fwd(tmp.path, "foo", "bar")] }, - ]), - ) - - expect(await fs.readFile(`${tmp.path}/a.txt`, "utf-8")).toBe("v1") - expect((await fs.stat(`${tmp.path}/foo`)).isDirectory()).toBe(true) - expect(await fs.readFile(`${tmp.path}/foo/bar`, "utf-8")).toBe("v1") - }, - }) -}) - -test("revert handles large mixed batches across chunk boundaries", async () => { - await using tmp = await bootstrap() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const base = Array.from({ length: 140 }, (_, i) => fwd(tmp.path, "batch", `${i}.txt`)) - const fresh = Array.from({ length: 140 }, (_, i) => fwd(tmp.path, "fresh", `${i}.txt`)) - - await $`mkdir -p ${tmp.path}/batch ${tmp.path}/fresh`.quiet() - await Promise.all(base.map((file, i) => Filesystem.write(file, `base-${i}`))) - - const snap = await run(tmp.path, (snapshot) => snapshot.track()) - expect(snap).toBeTruthy() - - await Promise.all(base.map((file, i) => Filesystem.write(file, `next-${i}`))) - await Promise.all(fresh.map((file, i) => Filesystem.write(file, `fresh-${i}`))) - - const patch = await run(tmp.path, (snapshot) => snapshot.patch(snap!)) - expect(patch.files.length).toBe(base.length + fresh.length) - - await run(tmp.path, (snapshot) => snapshot.revert([patch])) - - await Promise.all( - base.map(async (file, i) => { - expect(await fs.readFile(file, "utf-8")).toBe(`base-${i}`) - }), - ) - - await Promise.all( - fresh.map(async (file) => { - expect( - await fs - .access(file) - .then(() => true) - .catch(() => false), - ).toBe(false) - }), - ) - }, - }) -}) + expect(diffs[0].file).toBe("binary.bin") + expect(diffs[0].patch).toBe("") + }), + ), + { git: true }, +) + +it.instance( + "diffFull with whitespace changes", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* write(`${tmp.path}/whitespace.txt`, "line1\nline2") + const before = yield* snapshot.track() + expect(before).toBeTruthy() + yield* write(`${tmp.path}/whitespace.txt`, "line1\n\nline2\n") + const after = yield* snapshot.track() + expect(after).toBeTruthy() + const diffs = yield* snapshot.diffFull(before!, after!) + expect(diffs.length).toBe(1) + expect(diffs[0].file).toBe("whitespace.txt") + expect(diffs[0].additions).toBeGreaterThan(0) + }), + { git: true }, +) + +it.instance( + "revert with overlapping files across patches uses first patch hash", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* write(`${tmp.path}/shared.txt`, "v1") + const snap1 = yield* snapshot.track() + expect(snap1).toBeTruthy() + yield* write(`${tmp.path}/shared.txt`, "v2") + const snap2 = yield* snapshot.track() + expect(snap2).toBeTruthy() + yield* write(`${tmp.path}/shared.txt`, "v3") + const patch1 = yield* snapshot.patch(snap1!) + const patch2 = yield* snapshot.patch(snap2!) + expect(patch1.files).toContain(fwd(tmp.path, "shared.txt")) + expect(patch2.files).toContain(fwd(tmp.path, "shared.txt")) + yield* snapshot.revert([patch1, patch2]) + expect(yield* readText(`${tmp.path}/shared.txt`)).toBe("v1") + }), + { git: true }, +) + +it.instance( + "revert preserves patch order when the same hash appears again", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + yield* mkdirp(`${tmp.path}/foo`) + yield* write(`${tmp.path}/foo/bar`, "v1") + yield* write(`${tmp.path}/a.txt`, "v1") + const snap1 = yield* snapshot.track() + expect(snap1).toBeTruthy() + yield* rm(`${tmp.path}/foo`) + yield* write(`${tmp.path}/foo`, "v2") + yield* write(`${tmp.path}/a.txt`, "v2") + const snap2 = yield* snapshot.track() + expect(snap2).toBeTruthy() + yield* rm(`${tmp.path}/foo`) + yield* write(`${tmp.path}/a.txt`, "v3") + yield* snapshot.revert([ + { hash: snap1!, files: [fwd(tmp.path, "a.txt")] }, + { hash: snap2!, files: [fwd(tmp.path, "foo")] }, + { hash: snap1!, files: [fwd(tmp.path, "foo", "bar")] }, + ]) + expect(yield* readText(`${tmp.path}/a.txt`)).toBe("v1") + expect((yield* Effect.promise(() => fs.stat(`${tmp.path}/foo`))).isDirectory()).toBe(true) + expect(yield* readText(`${tmp.path}/foo/bar`)).toBe("v1") + }), + { git: true }, +) + +it.instance( + "revert handles large mixed batches across chunk boundaries", + Effect.gen(function* () { + const tmp = yield* bootstrap() + const snapshot = yield* Snapshot.Service + const base = Array.from({ length: 140 }, (_, i) => fwd(tmp.path, "batch", `${i}.txt`)) + const fresh = Array.from({ length: 140 }, (_, i) => fwd(tmp.path, "fresh", `${i}.txt`)) + yield* mkdirp(`${tmp.path}/batch`) + yield* mkdirp(`${tmp.path}/fresh`) + yield* Effect.all( + base.map((file, i) => write(file, `base-${i}`)), + { concurrency: "unbounded" }, + ) + const snap = yield* snapshot.track() + expect(snap).toBeTruthy() + yield* Effect.all( + [...base.map((file, i) => write(file, `next-${i}`)), ...fresh.map((file, i) => write(file, `fresh-${i}`))], + { concurrency: "unbounded" }, + ) + const patch = yield* snapshot.patch(snap!) + expect(patch.files.length).toBe(base.length + fresh.length) + yield* snapshot.revert([patch]) + for (let i = 0; i < base.length; i++) expect(yield* readText(base[i])).toBe(`base-${i}`) + for (const file of fresh) expect(yield* exists(file)).toBe(false) + }), + { git: true }, +) diff --git a/packages/opencode/test/storage/db.test.ts b/packages/opencode/test/storage/db.test.ts index f667fc904506..ba7f0912aa9f 100644 --- a/packages/opencode/test/storage/db.test.ts +++ b/packages/opencode/test/storage/db.test.ts @@ -1,14 +1,38 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import path from "path" +import { Effect } from "effect" import { Global } from "@opencode-ai/core/global" import { InstallationChannel } from "@opencode-ai/core/installation/version" +import { RuntimeFlags } from "@/effect/runtime-flags" import { Database } from "@/storage/db" +import { it } from "../lib/effect" -describe("Database.Path", () => { - test("returns database path for the current channel", () => { - const expected = ["latest", "beta"].includes(InstallationChannel) - ? path.join(Global.Path.data, "opencode.db") - : path.join(Global.Path.data, `opencode-${InstallationChannel.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`) - expect(Database.getChannelPath()).toBe(expected) - }) +describe("Database.getChannelPath", () => { + it.effect("returns database path for the current channel", () => + Effect.gen(function* () { + const flags = yield* RuntimeFlags.Service + const expected = ["latest", "beta", "prod"].includes(InstallationChannel) + ? path.join(Global.Path.data, "opencode.db") + : path.join(Global.Path.data, `opencode-${InstallationChannel.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`) + + expect(Database.getChannelPath(flags)).toBe(expected) + }).pipe(Effect.provide(RuntimeFlags.layer())), + ) + + it.effect("uses the shared database path when channel databases are disabled", () => + Effect.gen(function* () { + const flags = yield* RuntimeFlags.Service + + expect(Database.getChannelPath(flags)).toBe(path.join(Global.Path.data, "opencode.db")) + }).pipe(Effect.provide(RuntimeFlags.layer({ disableChannelDb: true }))), + ) + + it.effect("accepts RuntimeFlags with skipMigrations for database callers", () => + Effect.gen(function* () { + const flags = yield* RuntimeFlags.Service + + expect(flags.skipMigrations).toBe(true) + expect(Database.getChannelPath(flags)).toBe(Database.getChannelPath({ disableChannelDb: flags.disableChannelDb })) + }).pipe(Effect.provide(RuntimeFlags.layer({ skipMigrations: true }))), + ) }) diff --git a/packages/opencode/test/storage/storage.test.ts b/packages/opencode/test/storage/storage.test.ts index f0aff4ba78f3..d0fe5dd34cea 100644 --- a/packages/opencode/test/storage/storage.test.ts +++ b/packages/opencode/test/storage/storage.test.ts @@ -74,20 +74,23 @@ describe("Storage", () => { it.live("maps missing reads to NotFoundError", () => Effect.gen(function* () { const { root, svc } = yield* scope() - const exit = yield* svc.read([...root, "missing", "value"]).pipe(Effect.exit) - expect(Exit.isFailure(exit)).toBe(true) + const error = yield* Effect.flip(svc.read([...root, "missing", "value"])) + expect(error).toBeInstanceOf(Storage.NotFoundError) + expect(error._tag).toBe("NotFoundError") + expect(error.message).toContain(path.join(...root, "missing", "value") + ".json") }), ) it.live("update on missing key throws NotFoundError", () => Effect.gen(function* () { const { root, svc } = yield* scope() - const exit = yield* svc - .update<{ value: number }>([...root, "missing", "key"], (draft) => { + const error = yield* Effect.flip( + svc.update<{ value: number }>([...root, "missing", "key"], (draft) => { draft.value += 1 - }) - .pipe(Effect.exit) - expect(Exit.isFailure(exit)).toBe(true) + }), + ) + expect(error).toBeInstanceOf(Storage.NotFoundError) + expect(error._tag).toBe("NotFoundError") }), ) diff --git a/packages/opencode/test/sync/index.test.ts b/packages/opencode/test/sync/index.test.ts index 10f593a57127..c4e5b86062ba 100644 --- a/packages/opencode/test/sync/index.test.ts +++ b/packages/opencode/test/sync/index.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, beforeEach, afterEach, afterAll } from "bun:test" +import { describe, expect, beforeEach, afterAll } from "bun:test" import { provideTmpdirInstance } from "../fixture/fixture" import { Effect, Layer, Schema } from "effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" @@ -7,21 +7,19 @@ import { SyncEvent } from "../../src/sync" import { Database, eq } from "@/storage/db" import { EventSequenceTable, EventTable } from "../../src/sync/event.sql" import { MessageID } from "../../src/session/schema" -import { Flag } from "@opencode-ai/core/flag/flag" import { initProjectors } from "../../src/server/projectors" import { testEffect } from "../lib/effect" +import { RuntimeFlags } from "@/effect/runtime-flags" -const original = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES -const it = testEffect(Layer.mergeAll(SyncEvent.defaultLayer, CrossSpawnSpawner.defaultLayer)) +const it = testEffect( + Layer.mergeAll( + SyncEvent.layer.pipe(Layer.provide(RuntimeFlags.layer({ experimentalWorkspaces: true }))), + CrossSpawnSpawner.defaultLayer, + ), +) beforeEach(() => { Database.close() - - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true -}) - -afterEach(() => { - Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = original }) describe("SyncEvent", () => { diff --git a/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap b/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap index 601f07cb3a55..9fede8175929 100644 --- a/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap +++ b/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap @@ -45,6 +45,7 @@ Output: Creates directory 'foo'" "description": "Optional timeout in milliseconds", "exclusiveMinimum": 0, "maximum": 9007199254740991, + "minimum": -9007199254740991, "type": "integer", }, "workdir": { @@ -240,7 +241,6 @@ exports[`tool parameters JSON Schema (wire shape) question 1`] = ` "type": "string", }, }, - "ref": "QuestionOption", "required": [ "label", "description", @@ -254,7 +254,6 @@ exports[`tool parameters JSON Schema (wire shape) question 1`] = ` "type": "string", }, }, - "ref": "QuestionPrompt", "required": [ "question", "header", @@ -320,6 +319,10 @@ exports[`tool parameters JSON Schema (wire shape) task 1`] = ` { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { + "background": { + "description": "When true, launch the subagent in the background and return immediately", + "type": "boolean", + }, "command": { "description": "The command that triggered this task", "type": "string", @@ -393,14 +396,21 @@ exports[`tool parameters JSON Schema (wire shape) webfetch 1`] = ` "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "format": { - "default": "markdown", - "description": "The format to return the content in (text, markdown, or html). Defaults to markdown.", - "enum": [ - "text", - "markdown", - "html", + "anyOf": [ + { + "default": "markdown", + "description": "The format to return the content in (text, markdown, or html). Defaults to markdown.", + "enum": [ + "text", + "markdown", + "html", + ], + "type": "string", + }, + { + "type": "null", + }, ], - "type": "string", }, "timeout": { "description": "Optional timeout in seconds (max 120)", diff --git a/packages/opencode/test/tool/apply_patch.test.ts b/packages/opencode/test/tool/apply_patch.test.ts index 3fc034e4e5d3..be5754f3b40d 100644 --- a/packages/opencode/test/tool/apply_patch.test.ts +++ b/packages/opencode/test/tool/apply_patch.test.ts @@ -1,20 +1,19 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import path from "path" import * as fs from "fs/promises" -import { Effect, ManagedRuntime, Layer } from "effect" +import { Cause, Effect, Exit, Layer } from "effect" import { ApplyPatchTool } from "../../src/tool/apply_patch" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { LSP } from "@/lsp/lsp" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Format } from "../../src/format" import { Agent } from "../../src/agent/agent" import { Bus } from "../../src/bus" import { Truncate } from "@/tool/truncate" -import { tmpdir } from "../fixture/fixture" +import { TestInstance } from "../fixture/fixture" import { SessionID, MessageID } from "../../src/session/schema" +import { testEffect } from "../lib/effect" -const runtime = ManagedRuntime.make( +const it = testEffect( Layer.mergeAll( LSP.defaultLayer, AppFileSystem.defaultLayer, @@ -58,11 +57,11 @@ type ToolCtx = typeof baseCtx & { ask: (input: AskInput) => Effect.Effect } -const execute = async (params: { patchText: string }, ctx: ToolCtx) => { - const info = await runtime.runPromise(ApplyPatchTool) - const tool = await runtime.runPromise(info.init()) - return Effect.runPromise(tool.execute(params, ctx)) -} +const execute = Effect.fn("ApplyPatchToolTest.execute")(function* (params: { patchText: string }, ctx: ToolCtx) { + const info = yield* ApplyPatchTool + const tool = yield* info.init() + return yield* tool.execute(params, ctx) +}) const makeCtx = () => { const calls: AskInput[] = [] @@ -77,39 +76,56 @@ const makeCtx = () => { return { ctx, calls } } -describe("tool.apply_patch freeform", () => { - test("requires patchText", async () => { - const { ctx } = makeCtx() - await expect(execute({ patchText: "" }, ctx)).rejects.toThrow("patchText is required") - }) - - test("rejects invalid patch format", async () => { - const { ctx } = makeCtx() - await expect(execute({ patchText: "invalid patch" }, ctx)).rejects.toThrow("apply_patch verification failed") - }) +const readText = (filepath: string) => Effect.promise(() => fs.readFile(filepath, "utf-8")) +const writeText = (filepath: string, content: string) => Effect.promise(() => fs.writeFile(filepath, content, "utf-8")) +const makeDir = (dir: string) => Effect.promise(() => fs.mkdir(dir, { recursive: true })) - test("rejects empty patch", async () => { - const { ctx } = makeCtx() - const emptyPatch = "*** Begin Patch\n*** End Patch" - await expect(execute({ patchText: emptyPatch }, ctx)).rejects.toThrow("patch rejected: empty patch") +const expectFailure = (effect: Effect.Effect, message?: string) => + Effect.gen(function* () { + const exit = yield* Effect.exit(effect) + expect(Exit.isFailure(exit)).toBe(true) + if (Exit.isFailure(exit) && message) expect(Cause.pretty(exit.cause)).toContain(message) }) - test("applies add/update/delete in one patch", async () => { - await using fixture = await tmpdir({ git: true }) - const { ctx, calls } = makeCtx() +const expectReadFailure = (filepath: string) => expectFailure(readText(filepath)) - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const modifyPath = path.join(fixture.path, "modify.txt") - const deletePath = path.join(fixture.path, "delete.txt") - await fs.writeFile(modifyPath, "line1\nline2\n", "utf-8") - await fs.writeFile(deletePath, "obsolete\n", "utf-8") +describe("tool.apply_patch freeform", () => { + it.live("requires patchText", () => + Effect.gen(function* () { + const { ctx } = makeCtx() + yield* expectFailure(execute({ patchText: "" }, ctx), "patchText is required") + }), + ) + + it.live("rejects invalid patch format", () => + Effect.gen(function* () { + const { ctx } = makeCtx() + yield* expectFailure(execute({ patchText: "invalid patch" }, ctx), "apply_patch verification failed") + }), + ) + + it.live("rejects empty patch", () => + Effect.gen(function* () { + const { ctx } = makeCtx() + yield* expectFailure(execute({ patchText: "*** Begin Patch\n*** End Patch" }, ctx), "patch rejected: empty patch") + }), + ) + + it.instance( + "applies add/update/delete in one patch", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx, calls } = makeCtx() + const modifyPath = path.join(test.directory, "modify.txt") + const deletePath = path.join(test.directory, "delete.txt") + yield* writeText(modifyPath, "line1\nline2\n") + yield* writeText(deletePath, "obsolete\n") const patchText = "*** Begin Patch\n*** Add File: nested/new.txt\n+created\n*** Delete File: delete.txt\n*** Update File: modify.txt\n@@\n-line2\n+changed\n*** End Patch" - const result = await execute({ patchText }, ctx) + const result = yield* execute({ patchText }, ctx) expect(result.title).toContain("Success. Updated the following files") expect(result.output).toContain("Success. Updated the following files") @@ -129,38 +145,34 @@ describe("tool.apply_patch freeform", () => { expect(permissionCall.metadata.files.map((f) => f.type).sort()).toEqual(["add", "delete", "update"]) const addFile = permissionCall.metadata.files.find((f) => f.type === "add") - expect(addFile).toBeDefined() - expect(addFile!.relativePath).toBe("nested/new.txt") - expect(addFile!.patch).toContain("+created") + expect(addFile?.relativePath).toBe("nested/new.txt") + expect(addFile?.patch).toContain("+created") const updateFile = permissionCall.metadata.files.find((f) => f.type === "update") - expect(updateFile).toBeDefined() - expect(updateFile!.patch).toContain("-line2") - expect(updateFile!.patch).toContain("+changed") - - const added = await fs.readFile(path.join(fixture.path, "nested", "new.txt"), "utf-8") - expect(added).toBe("created\n") - expect(await fs.readFile(modifyPath, "utf-8")).toBe("line1\nchanged\n") - await expect(fs.readFile(deletePath, "utf-8")).rejects.toThrow() - }, - }) - }) + expect(updateFile?.patch).toContain("-line2") + expect(updateFile?.patch).toContain("+changed") - test("permission metadata includes move file info", async () => { - await using fixture = await tmpdir({ git: true }) - const { ctx, calls } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const original = path.join(fixture.path, "old", "name.txt") - await fs.mkdir(path.dirname(original), { recursive: true }) - await fs.writeFile(original, "old content\n", "utf-8") + expect(yield* readText(path.join(test.directory, "nested", "new.txt"))).toBe("created\n") + expect(yield* readText(modifyPath)).toBe("line1\nchanged\n") + yield* expectReadFailure(deletePath) + }), + { git: true }, + ) + + it.instance( + "permission metadata includes move file info", + () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx, calls } = makeCtx() + const original = path.join(test.directory, "old", "name.txt") + yield* makeDir(path.dirname(original)) + yield* writeText(original, "old content\n") const patchText = "*** Begin Patch\n*** Update File: old/name.txt\n*** Move to: renamed/dir/name.txt\n@@\n-old content\n+new content\n*** End Patch" - await execute({ patchText }, ctx) + yield* execute({ patchText }, ctx) expect(calls.length).toBe(1) const permissionCall = calls[0] @@ -169,447 +181,353 @@ describe("tool.apply_patch freeform", () => { const moveFile = permissionCall.metadata.files[0] expect(moveFile.type).toBe("move") expect(moveFile.relativePath).toBe("renamed/dir/name.txt") - expect(moveFile.movePath).toBe(path.join(fixture.path, "renamed/dir/name.txt")) + expect(moveFile.movePath).toBe(path.join(test.directory, "renamed/dir/name.txt")) expect(moveFile.patch).toContain("-old content") expect(moveFile.patch).toContain("+new content") - }, - }) - }) - - test("applies multiple hunks to one file", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "multi.txt") - await fs.writeFile(target, "line1\nline2\nline3\nline4\n", "utf-8") - - const patchText = - "*** Begin Patch\n*** Update File: multi.txt\n@@\n-line2\n+changed2\n@@\n-line4\n+changed4\n*** End Patch" - - await execute({ patchText }, ctx) - - expect(await fs.readFile(target, "utf-8")).toBe("line1\nchanged2\nline3\nchanged4\n") - }, - }) - }) - - test("does not invent a first-line diff for BOM files", async () => { - await using fixture = await tmpdir() - const { ctx, calls } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const bom = String.fromCharCode(0xfeff) - const target = path.join(fixture.path, "example.cs") - await fs.writeFile(target, `${bom}using System;\n\nclass Test {}\n`, "utf-8") - - const patchText = - "*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch" - - await execute({ patchText }, ctx) - - expect(calls.length).toBe(1) - const shown = calls[0].metadata.files[0]?.patch ?? "" - expect(shown).not.toContain(bom) - expect(shown).not.toContain("-using System;") - expect(shown).not.toContain("+using System;") - - const content = await fs.readFile(target, "utf-8") - expect(content.charCodeAt(0)).toBe(0xfeff) - expect(content.slice(1)).toBe("using System;\n\nclass Test {}\nclass Next {}\n") - }, - }) - }) - - test("inserts lines with insert-only hunk", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "insert_only.txt") - await fs.writeFile(target, "alpha\nomega\n", "utf-8") - - const patchText = "*** Begin Patch\n*** Update File: insert_only.txt\n@@\n alpha\n+beta\n omega\n*** End Patch" - - await execute({ patchText }, ctx) - - expect(await fs.readFile(target, "utf-8")).toBe("alpha\nbeta\nomega\n") - }, - }) - }) - - test("appends trailing newline on update", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "no_newline.txt") - await fs.writeFile(target, "no newline at end", "utf-8") - - const patchText = - "*** Begin Patch\n*** Update File: no_newline.txt\n@@\n-no newline at end\n+first line\n+second line\n*** End Patch" - - await execute({ patchText }, ctx) - - const contents = await fs.readFile(target, "utf-8") - expect(contents.endsWith("\n")).toBe(true) - expect(contents).toBe("first line\nsecond line\n") - }, - }) - }) - - test("moves file to a new directory", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const original = path.join(fixture.path, "old", "name.txt") - await fs.mkdir(path.dirname(original), { recursive: true }) - await fs.writeFile(original, "old content\n", "utf-8") - - const patchText = - "*** Begin Patch\n*** Update File: old/name.txt\n*** Move to: renamed/dir/name.txt\n@@\n-old content\n+new content\n*** End Patch" - - await execute({ patchText }, ctx) - - const moved = path.join(fixture.path, "renamed", "dir", "name.txt") - await expect(fs.readFile(original, "utf-8")).rejects.toThrow() - expect(await fs.readFile(moved, "utf-8")).toBe("new content\n") - }, - }) - }) - - test("moves file overwriting existing destination", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const original = path.join(fixture.path, "old", "name.txt") - const destination = path.join(fixture.path, "renamed", "dir", "name.txt") - await fs.mkdir(path.dirname(original), { recursive: true }) - await fs.mkdir(path.dirname(destination), { recursive: true }) - await fs.writeFile(original, "from\n", "utf-8") - await fs.writeFile(destination, "existing\n", "utf-8") - - const patchText = - "*** Begin Patch\n*** Update File: old/name.txt\n*** Move to: renamed/dir/name.txt\n@@\n-from\n+new\n*** End Patch" - - await execute({ patchText }, ctx) - - await expect(fs.readFile(original, "utf-8")).rejects.toThrow() - expect(await fs.readFile(destination, "utf-8")).toBe("new\n") - }, - }) - }) - - test("adds file overwriting existing file", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "duplicate.txt") - await fs.writeFile(target, "old content\n", "utf-8") - - const patchText = "*** Begin Patch\n*** Add File: duplicate.txt\n+new content\n*** End Patch" - - await execute({ patchText }, ctx) - expect(await fs.readFile(target, "utf-8")).toBe("new content\n") - }, - }) - }) - - test("rejects update when target file is missing", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const patchText = "*** Begin Patch\n*** Update File: missing.txt\n@@\n-nope\n+better\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow( - "apply_patch verification failed: Failed to read file to update", - ) - }, - }) - }) - - test("rejects delete when file is missing", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const patchText = "*** Begin Patch\n*** Delete File: missing.txt\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow() - }, - }) - }) - - test("rejects delete when target is a directory", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const dirPath = path.join(fixture.path, "dir") - await fs.mkdir(dirPath) - - const patchText = "*** Begin Patch\n*** Delete File: dir\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow() - }, - }) - }) - - test("rejects invalid hunk header", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const patchText = "*** Begin Patch\n*** Frobnicate File: foo\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow("apply_patch verification failed") - }, - }) - }) - - test("rejects update with missing context", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "modify.txt") - await fs.writeFile(target, "line1\nline2\n", "utf-8") - - const patchText = "*** Begin Patch\n*** Update File: modify.txt\n@@\n-missing\n+changed\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow("apply_patch verification failed") - expect(await fs.readFile(target, "utf-8")).toBe("line1\nline2\n") - }, - }) - }) - - test("verification failure leaves no side effects", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const patchText = - "*** Begin Patch\n*** Add File: created.txt\n+hello\n*** Update File: missing.txt\n@@\n-old\n+new\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow() - - const createdPath = path.join(fixture.path, "created.txt") - await expect(fs.readFile(createdPath, "utf-8")).rejects.toThrow() - }, - }) - }) - - test("supports end of file anchor", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "tail.txt") - await fs.writeFile(target, "alpha\nlast\n", "utf-8") - - const patchText = "*** Begin Patch\n*** Update File: tail.txt\n@@\n-last\n+end\n*** End of File\n*** End Patch" - - await execute({ patchText }, ctx) - expect(await fs.readFile(target, "utf-8")).toBe("alpha\nend\n") - }, - }) - }) - - test("rejects missing second chunk context", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "two_chunks.txt") - await fs.writeFile(target, "a\nb\nc\nd\n", "utf-8") - - const patchText = "*** Begin Patch\n*** Update File: two_chunks.txt\n@@\n-b\n+B\n\n-d\n+D\n*** End Patch" - - await expect(execute({ patchText }, ctx)).rejects.toThrow() - expect(await fs.readFile(target, "utf-8")).toBe("a\nb\nc\nd\n") - }, - }) - }) - - test("disambiguates change context with @@ header", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "multi_ctx.txt") - await fs.writeFile(target, "fn a\nx=10\ny=2\nfn b\nx=10\ny=20\n", "utf-8") - - const patchText = "*** Begin Patch\n*** Update File: multi_ctx.txt\n@@ fn b\n-x=10\n+x=11\n*** End Patch" - - await execute({ patchText }, ctx) - expect(await fs.readFile(target, "utf-8")).toBe("fn a\nx=10\ny=2\nfn b\nx=11\ny=20\n") - }, - }) - }) - - test("EOF anchor matches from end of file first", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "eof_anchor.txt") - // File has duplicate "marker" lines - one in middle, one at end - await fs.writeFile(target, "start\nmarker\nmiddle\nmarker\nend\n", "utf-8") - - // With EOF anchor, should match the LAST "marker" line, not the first - const patchText = - "*** Begin Patch\n*** Update File: eof_anchor.txt\n@@\n-marker\n-end\n+marker-changed\n+end\n*** End of File\n*** End Patch" - - await execute({ patchText }, ctx) - // First marker unchanged, second marker changed - expect(await fs.readFile(target, "utf-8")).toBe("start\nmarker\nmiddle\nmarker-changed\nend\n") - }, - }) - }) - - test("parses heredoc-wrapped patch", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const patchText = `cat <<'EOF' + }), + { git: true }, + ) + + it.instance("applies multiple hunks to one file", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "multi.txt") + yield* writeText(target, "line1\nline2\nline3\nline4\n") + + const patchText = + "*** Begin Patch\n*** Update File: multi.txt\n@@\n-line2\n+changed2\n@@\n-line4\n+changed4\n*** End Patch" + + yield* execute({ patchText }, ctx) + + expect(yield* readText(target)).toBe("line1\nchanged2\nline3\nchanged4\n") + }), + ) + + it.instance("does not invent a first-line diff for BOM files", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx, calls } = makeCtx() + const bom = String.fromCharCode(0xfeff) + const target = path.join(test.directory, "example.cs") + yield* writeText(target, `${bom}using System;\n\nclass Test {}\n`) + + const patchText = + "*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch" + + yield* execute({ patchText }, ctx) + + expect(calls.length).toBe(1) + const shown = calls[0].metadata.files[0]?.patch ?? "" + expect(shown).not.toContain(bom) + expect(shown).not.toContain("-using System;") + expect(shown).not.toContain("+using System;") + + const content = yield* readText(target) + expect(content.charCodeAt(0)).toBe(0xfeff) + expect(content.slice(1)).toBe("using System;\n\nclass Test {}\nclass Next {}\n") + }), + ) + + it.instance("inserts lines with insert-only hunk", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "insert_only.txt") + yield* writeText(target, "alpha\nomega\n") + + const patchText = "*** Begin Patch\n*** Update File: insert_only.txt\n@@\n alpha\n+beta\n omega\n*** End Patch" + + yield* execute({ patchText }, ctx) + + expect(yield* readText(target)).toBe("alpha\nbeta\nomega\n") + }), + ) + + it.instance("appends trailing newline on update", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "no_newline.txt") + yield* writeText(target, "no newline at end") + + const patchText = + "*** Begin Patch\n*** Update File: no_newline.txt\n@@\n-no newline at end\n+first line\n+second line\n*** End Patch" + + yield* execute({ patchText }, ctx) + + const contents = yield* readText(target) + expect(contents.endsWith("\n")).toBe(true) + expect(contents).toBe("first line\nsecond line\n") + }), + ) + + it.instance("moves file to a new directory", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const original = path.join(test.directory, "old", "name.txt") + yield* makeDir(path.dirname(original)) + yield* writeText(original, "old content\n") + + const patchText = + "*** Begin Patch\n*** Update File: old/name.txt\n*** Move to: renamed/dir/name.txt\n@@\n-old content\n+new content\n*** End Patch" + + yield* execute({ patchText }, ctx) + + const moved = path.join(test.directory, "renamed", "dir", "name.txt") + yield* expectReadFailure(original) + expect(yield* readText(moved)).toBe("new content\n") + }), + ) + + it.instance("moves file overwriting existing destination", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const original = path.join(test.directory, "old", "name.txt") + const destination = path.join(test.directory, "renamed", "dir", "name.txt") + yield* makeDir(path.dirname(original)) + yield* makeDir(path.dirname(destination)) + yield* writeText(original, "from\n") + yield* writeText(destination, "existing\n") + + const patchText = + "*** Begin Patch\n*** Update File: old/name.txt\n*** Move to: renamed/dir/name.txt\n@@\n-from\n+new\n*** End Patch" + + yield* execute({ patchText }, ctx) + + yield* expectReadFailure(original) + expect(yield* readText(destination)).toBe("new\n") + }), + ) + + it.instance("adds file overwriting existing file", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "duplicate.txt") + yield* writeText(target, "old content\n") + + const patchText = "*** Begin Patch\n*** Add File: duplicate.txt\n+new content\n*** End Patch" + + yield* execute({ patchText }, ctx) + expect(yield* readText(target)).toBe("new content\n") + }), + ) + + it.instance("rejects update when target file is missing", () => + Effect.gen(function* () { + const { ctx } = makeCtx() + const patchText = "*** Begin Patch\n*** Update File: missing.txt\n@@\n-nope\n+better\n*** End Patch" + + yield* expectFailure( + execute({ patchText }, ctx), + "apply_patch verification failed: Failed to read file to update", + ) + }), + ) + + it.instance("rejects delete when file is missing", () => + Effect.gen(function* () { + const { ctx } = makeCtx() + const patchText = "*** Begin Patch\n*** Delete File: missing.txt\n*** End Patch" + + yield* expectFailure(execute({ patchText }, ctx)) + }), + ) + + it.instance("rejects delete when target is a directory", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const dirPath = path.join(test.directory, "dir") + yield* makeDir(dirPath) + + const patchText = "*** Begin Patch\n*** Delete File: dir\n*** End Patch" + + yield* expectFailure(execute({ patchText }, ctx)) + }), + ) + + it.instance("rejects invalid hunk header", () => + Effect.gen(function* () { + const { ctx } = makeCtx() + const patchText = "*** Begin Patch\n*** Frobnicate File: foo\n*** End Patch" + + yield* expectFailure(execute({ patchText }, ctx), "apply_patch verification failed") + }), + ) + + it.instance("rejects update with missing context", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "modify.txt") + yield* writeText(target, "line1\nline2\n") + + const patchText = "*** Begin Patch\n*** Update File: modify.txt\n@@\n-missing\n+changed\n*** End Patch" + + yield* expectFailure(execute({ patchText }, ctx), "apply_patch verification failed") + expect(yield* readText(target)).toBe("line1\nline2\n") + }), + ) + + it.instance("verification failure leaves no side effects", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const patchText = + "*** Begin Patch\n*** Add File: created.txt\n+hello\n*** Update File: missing.txt\n@@\n-old\n+new\n*** End Patch" + + yield* expectFailure(execute({ patchText }, ctx)) + yield* expectReadFailure(path.join(test.directory, "created.txt")) + }), + ) + + it.instance("supports end of file anchor", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "tail.txt") + yield* writeText(target, "alpha\nlast\n") + + const patchText = "*** Begin Patch\n*** Update File: tail.txt\n@@\n-last\n+end\n*** End of File\n*** End Patch" + + yield* execute({ patchText }, ctx) + expect(yield* readText(target)).toBe("alpha\nend\n") + }), + ) + + it.instance("rejects missing second chunk context", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "two_chunks.txt") + yield* writeText(target, "a\nb\nc\nd\n") + + const patchText = "*** Begin Patch\n*** Update File: two_chunks.txt\n@@\n-b\n+B\n\n-d\n+D\n*** End Patch" + + yield* expectFailure(execute({ patchText }, ctx)) + expect(yield* readText(target)).toBe("a\nb\nc\nd\n") + }), + ) + + it.instance("disambiguates change context with @@ header", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "multi_ctx.txt") + yield* writeText(target, "fn a\nx=10\ny=2\nfn b\nx=10\ny=20\n") + + const patchText = "*** Begin Patch\n*** Update File: multi_ctx.txt\n@@ fn b\n-x=10\n+x=11\n*** End Patch" + + yield* execute({ patchText }, ctx) + expect(yield* readText(target)).toBe("fn a\nx=10\ny=2\nfn b\nx=11\ny=20\n") + }), + ) + + it.instance("EOF anchor matches from end of file first", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "eof_anchor.txt") + // File has duplicate "marker" lines - one in middle, one at end + yield* writeText(target, "start\nmarker\nmiddle\nmarker\nend\n") + + // With EOF anchor, should match the LAST "marker" line, not the first + const patchText = + "*** Begin Patch\n*** Update File: eof_anchor.txt\n@@\n-marker\n-end\n+marker-changed\n+end\n*** End of File\n*** End Patch" + + yield* execute({ patchText }, ctx) + // First marker unchanged, second marker changed + expect(yield* readText(target)).toBe("start\nmarker\nmiddle\nmarker-changed\nend\n") + }), + ) + + it.instance("parses heredoc-wrapped patch", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const patchText = `cat <<'EOF' *** Begin Patch *** Add File: heredoc_test.txt +heredoc content *** End Patch EOF` - await execute({ patchText }, ctx) - const content = await fs.readFile(path.join(fixture.path, "heredoc_test.txt"), "utf-8") - expect(content).toBe("heredoc content\n") - }, - }) - }) - - test("parses heredoc-wrapped patch without cat", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() + yield* execute({ patchText }, ctx) + expect(yield* readText(path.join(test.directory, "heredoc_test.txt"))).toBe("heredoc content\n") + }), + ) - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const patchText = `< + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const patchText = `< { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "trailing_ws.txt") - // File has trailing spaces on some lines - await fs.writeFile(target, "line1 \nline2\nline3 \n", "utf-8") - - // Patch doesn't have trailing spaces - should still match via rstrip pass - const patchText = "*** Begin Patch\n*** Update File: trailing_ws.txt\n@@\n-line2\n+changed\n*** End Patch" - - await execute({ patchText }, ctx) - expect(await fs.readFile(target, "utf-8")).toBe("line1 \nchanged\nline3 \n") - }, - }) - }) - - test("matches with leading whitespace differences", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "leading_ws.txt") - // File has leading spaces - await fs.writeFile(target, " line1\nline2\n line3\n", "utf-8") - - // Patch without leading spaces - should match via trim pass - const patchText = "*** Begin Patch\n*** Update File: leading_ws.txt\n@@\n-line2\n+changed\n*** End Patch" - - await execute({ patchText }, ctx) - expect(await fs.readFile(target, "utf-8")).toBe(" line1\nchanged\n line3\n") - }, - }) - }) - - test("matches with Unicode punctuation differences", async () => { - await using fixture = await tmpdir() - const { ctx } = makeCtx() - - await WithInstance.provide({ - directory: fixture.path, - fn: async () => { - const target = path.join(fixture.path, "unicode.txt") - // File has fancy Unicode quotes (U+201C, U+201D) and em-dash (U+2014) - const leftQuote = "\u201C" - const rightQuote = "\u201D" - const emDash = "\u2014" - await fs.writeFile(target, `He said ${leftQuote}hello${rightQuote}\nsome${emDash}dash\nend\n`, "utf-8") - - // Patch uses ASCII equivalents - should match via normalized pass - // The replacement uses ASCII quotes from the patch (not preserving Unicode) - const patchText = - '*** Begin Patch\n*** Update File: unicode.txt\n@@\n-He said "hello"\n+He said "hi"\n*** End Patch' - - await execute({ patchText }, ctx) - // Result has ASCII quotes because that's what the patch specifies - expect(await fs.readFile(target, "utf-8")).toBe(`He said "hi"\nsome${emDash}dash\nend\n`) - }, - }) - }) + yield* execute({ patchText }, ctx) + expect(yield* readText(path.join(test.directory, "heredoc_no_cat.txt"))).toBe("no cat prefix\n") + }), + ) + + it.instance("matches with trailing whitespace differences", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "trailing_ws.txt") + // File has trailing spaces on some lines + yield* writeText(target, "line1 \nline2\nline3 \n") + + // Patch doesn't have trailing spaces - should still match via rstrip pass + const patchText = "*** Begin Patch\n*** Update File: trailing_ws.txt\n@@\n-line2\n+changed\n*** End Patch" + + yield* execute({ patchText }, ctx) + expect(yield* readText(target)).toBe("line1 \nchanged\nline3 \n") + }), + ) + + it.instance("matches with leading whitespace differences", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "leading_ws.txt") + // File has leading spaces + yield* writeText(target, " line1\nline2\n line3\n") + + // Patch without leading spaces - should match via trim pass + const patchText = "*** Begin Patch\n*** Update File: leading_ws.txt\n@@\n-line2\n+changed\n*** End Patch" + + yield* execute({ patchText }, ctx) + expect(yield* readText(target)).toBe(" line1\nchanged\n line3\n") + }), + ) + + it.instance("matches with Unicode punctuation differences", () => + Effect.gen(function* () { + const test = yield* TestInstance + const { ctx } = makeCtx() + const target = path.join(test.directory, "unicode.txt") + // File has fancy Unicode quotes (U+201C, U+201D) and em-dash (U+2014) + const leftQuote = "\u201C" + const rightQuote = "\u201D" + const emDash = "\u2014" + yield* writeText(target, `He said ${leftQuote}hello${rightQuote}\nsome${emDash}dash\nend\n`) + + // Patch uses ASCII equivalents - should match via normalized pass + // The replacement uses ASCII quotes from the patch (not preserving Unicode) + const patchText = + '*** Begin Patch\n*** Update File: unicode.txt\n@@\n-He said "hello"\n+He said "hi"\n*** End Patch' + + yield* execute({ patchText }, ctx) + // Result has ASCII quotes because that's what the patch specifies + expect(yield* readText(target)).toBe(`He said "hi"\nsome${emDash}dash\nend\n`) + }), + ) }) diff --git a/packages/opencode/test/tool/edit.test.ts b/packages/opencode/test/tool/edit.test.ts index a629ff07d11a..3f644ed53dde 100644 --- a/packages/opencode/test/tool/edit.test.ts +++ b/packages/opencode/test/tool/edit.test.ts @@ -1,19 +1,19 @@ -import { afterAll, afterEach, describe, test, expect } from "bun:test" +import { afterEach, describe, expect } from "bun:test" import path from "path" import fs from "fs/promises" -import { Effect, Layer, ManagedRuntime } from "effect" +import { Cause, Deferred, Effect, Exit, Fiber, Layer } from "effect" import { EditTool } from "../../src/tool/edit" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { disposeAllInstances, tmpdir } from "../fixture/fixture" +import { disposeAllInstances, TestInstance } from "../fixture/fixture" import { LSP } from "@/lsp/lsp" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Format } from "../../src/format" import { Agent } from "../../src/agent/agent" import { Bus } from "../../src/bus" -import { BusEvent } from "../../src/bus/bus-event" import { Truncate } from "@/tool/truncate" import { SessionID, MessageID } from "../../src/session/schema" +import * as Tool from "../../src/tool/tool" +import { testEffect } from "../lib/effect" +import { FileWatcher } from "../../src/file/watcher" const ctx = { sessionID: SessionID.make("ses_test-edit-session"), @@ -30,487 +30,269 @@ afterEach(async () => { await disposeAllInstances() }) -const runtime = ManagedRuntime.make( - Layer.mergeAll( - LSP.defaultLayer, - AppFileSystem.defaultLayer, - Format.defaultLayer, - Bus.layer, - Truncate.defaultLayer, - Agent.defaultLayer, - ), +const layer = Layer.mergeAll( + LSP.defaultLayer, + AppFileSystem.defaultLayer, + Format.defaultLayer, + Bus.layer, + Truncate.defaultLayer, + Agent.defaultLayer, ) -afterAll(async () => { - await runtime.dispose() -}) - -const resolve = () => - runtime.runPromise( - Effect.gen(function* () { - const info = yield* EditTool - return yield* info.init() - }), - ) - -const subscribeBus = (def: D, callback: () => unknown) => - runtime.runPromise(Bus.Service.use((bus) => bus.subscribeCallback(def, callback))) - -async function onceBus(def: D) { - const result = Promise.withResolvers() - const unsub = await subscribeBus(def, () => { - unsub() - result.resolve() - }) - return { - wait: result.promise, - unsub, - } -} - -describe("tool.edit", () => { - describe("creating new files", () => { - test("creates new file when oldString is empty", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "newfile.txt") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - const result = await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "", - newString: "new content", - }, - ctx, - ), - ) - - expect(result.metadata.diff).toContain("new content") - - const content = await fs.readFile(filepath, "utf-8") - expect(content).toBe("new content") - }, - }) - }) +const it = testEffect(layer) - test("preserves BOM when oldString is empty on existing files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "existing.cs") - const bom = String.fromCharCode(0xfeff) - await fs.writeFile(filepath, `${bom}using System;\n`, "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - const result = await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "", - newString: "using Up;\n", - }, - ctx, - ), - ) - - expect(result.metadata.diff).toContain("-using System;") - expect(result.metadata.diff).toContain("+using Up;") - - const content = await fs.readFile(filepath, "utf-8") - expect(content.charCodeAt(0)).toBe(0xfeff) - expect(content.slice(1)).toBe("using Up;\n") - }, - }) - }) +const init = Effect.fn("EditToolTest.init")(function* () { + const info = yield* EditTool + return yield* info.init() +}) - test("creates new file with nested directories", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "nested", "dir", "file.txt") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "", - newString: "nested file", - }, - ctx, - ), - ) - - const content = await fs.readFile(filepath, "utf-8") - expect(content).toBe("nested file") - }, - }) - }) +const run = Effect.fn("EditToolTest.run")(function* ( + args: Tool.InferParameters, + next: Tool.Context = ctx, +) { + const tool = yield* init() + return yield* tool.execute(args, next) +}) - test("emits add event for new files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "new.txt") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const { FileWatcher } = await import("../../src/file/watcher") - - const updated = await onceBus(FileWatcher.Event.Updated) - - try { - const edit = await resolve() - await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "", - newString: "content", - }, - ctx, - ), - ) - - await updated.wait - } finally { - updated.unsub() - } - }, - }) - }) - }) +const fail = Effect.fn("EditToolTest.fail")(function* (args: Tool.InferParameters) { + const exit = yield* run(args).pipe(Effect.exit) + if (Exit.isFailure(exit)) { + const err = Cause.squash(exit.cause) + return err instanceof Error ? err : new Error(String(err)) + } + throw new Error("expected edit to fail") +}) - describe("editing existing files", () => { - test("replaces text in existing file", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "existing.txt") - await fs.writeFile(filepath, "old content here", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - const result = await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "old content", - newString: "new content", - }, - ctx, - ), - ) - - expect(result.output).toContain("Edit applied successfully") - - const content = await fs.readFile(filepath, "utf-8") - expect(content).toBe("new content here") - }, - }) - }) +const put = Effect.fn("EditToolTest.put")(function* (p: string, content: string) { + const fs = yield* AppFileSystem.Service + yield* fs.writeWithDirs(p, content) +}) - test("replaces the first visible line in BOM files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "existing.cs") - const bom = String.fromCharCode(0xfeff) - await fs.writeFile(filepath, `${bom}using System;\nclass Test {}\n`, "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - const result = await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "using System;", - newString: "using Up;", - }, - ctx, - ), - ) - - expect(result.metadata.diff).toContain("-using System;") - expect(result.metadata.diff).toContain("+using Up;") - expect(result.metadata.diff).not.toContain(bom) - - const content = await fs.readFile(filepath, "utf-8") - expect(content.charCodeAt(0)).toBe(0xfeff) - expect(content.slice(1)).toBe("using Up;\nclass Test {}\n") - }, - }) - }) +const load = Effect.fn("EditToolTest.load")(function* (p: string) { + const fs = yield* AppFileSystem.Service + return yield* fs.readFileString(p) +}) - test("throws error when file does not exist", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "nonexistent.txt") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await expect( - Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "old", - newString: "new", - }, - ctx, - ), - ), - ).rejects.toThrow("not found") - }, - }) - }) +const loadRaw = Effect.fn("EditToolTest.loadRaw")(function* (p: string) { + return yield* Effect.promise(() => fs.readFile(p, "utf-8")) +}) - test("throws error when oldString equals newString", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "content", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await expect( - Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "same", - newString: "same", - }, - ctx, - ), - ), - ).rejects.toThrow("identical") - }, - }) - }) +const makeDirectory = Effect.fn("EditToolTest.makeDirectory")(function* (p: string) { + const fs = yield* AppFileSystem.Service + yield* fs.makeDirectory(p) +}) - test("throws error when oldString not found in file", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "actual content", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await expect( - Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "not in file", - newString: "replacement", - }, - ctx, - ), - ), - ).rejects.toThrow() - }, - }) - }) +const onceBus = Effect.fn("EditToolTest.onceBus")(function* (def: typeof FileWatcher.Event.Updated) { + const bus = yield* Bus.Service + const deferred = yield* Deferred.make() + const unsub = yield* bus.subscribeCallback(def, () => Effect.runSync(Deferred.succeed(deferred, undefined))) + yield* Effect.addFinalizer(() => Effect.sync(unsub)) + return deferred +}) - test("replaces all occurrences with replaceAll option", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "foo bar foo baz foo", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "foo", - newString: "qux", - replaceAll: true, - }, - ctx, - ), - ) - - const content = await fs.readFile(filepath, "utf-8") - expect(content).toBe("qux bar qux baz qux") - }, - }) - }) +describe("tool.edit", () => { + describe("creating new files", () => { + it.instance("creates new file when oldString is empty", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "newfile.txt") + const result = yield* run({ filePath: filepath, oldString: "", newString: "new content" }) + + expect(result.metadata.diff).toContain("new content") + expect(yield* load(filepath)).toBe("new content") + }), + ) + + it.instance("preserves BOM when oldString is empty on existing files", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "existing.cs") + const bom = String.fromCharCode(0xfeff) + yield* put(filepath, `${bom}using System;\n`) + + const result = yield* run({ filePath: filepath, oldString: "", newString: "using Up;\n" }) + + expect(result.metadata.diff).toContain("-using System;") + expect(result.metadata.diff).toContain("+using Up;") + + const content = yield* loadRaw(filepath) + expect(content.charCodeAt(0)).toBe(0xfeff) + expect(content.slice(1)).toBe("using Up;\n") + }), + ) + + it.instance("creates new file with nested directories", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "nested", "dir", "file.txt") + + yield* run({ filePath: filepath, oldString: "", newString: "nested file" }) + + expect(yield* load(filepath)).toBe("nested file") + }), + ) + + it.instance("emits add event for new files", () => + Effect.gen(function* () { + const test = yield* TestInstance + const updated = yield* onceBus(FileWatcher.Event.Updated) + + yield* run({ filePath: path.join(test.directory, "new.txt"), oldString: "", newString: "content" }) + yield* Deferred.await(updated) + }), + ) + }) - test("emits change event for existing files", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "original", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const { FileWatcher } = await import("../../src/file/watcher") - - const updated = await onceBus(FileWatcher.Event.Updated) - - try { - const edit = await resolve() - await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "original", - newString: "modified", - }, - ctx, - ), - ) - - await updated.wait - } finally { - updated.unsub() - } - }, - }) - }) + describe("editing existing files", () => { + it.instance("replaces text in existing file", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "existing.txt") + yield* put(filepath, "old content here") + + const result = yield* run({ filePath: filepath, oldString: "old content", newString: "new content" }) + + expect(result.output).toContain("Edit applied successfully") + expect(yield* load(filepath)).toBe("new content here") + }), + ) + + it.instance("replaces the first visible line in BOM files", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "existing.cs") + const bom = String.fromCharCode(0xfeff) + yield* put(filepath, `${bom}using System;\nclass Test {}\n`) + + const result = yield* run({ filePath: filepath, oldString: "using System;", newString: "using Up;" }) + + expect(result.metadata.diff).toContain("-using System;") + expect(result.metadata.diff).toContain("+using Up;") + expect(result.metadata.diff).not.toContain(bom) + + const content = yield* loadRaw(filepath) + expect(content.charCodeAt(0)).toBe(0xfeff) + expect(content.slice(1)).toBe("using Up;\nclass Test {}\n") + }), + ) + + it.instance("throws error when file does not exist", () => + Effect.gen(function* () { + const test = yield* TestInstance + expect( + (yield* fail({ filePath: path.join(test.directory, "nonexistent.txt"), oldString: "old", newString: "new" })) + .message, + ).toContain("not found") + }), + ) + + it.instance("throws error when oldString equals newString", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "content") + + expect((yield* fail({ filePath: filepath, oldString: "same", newString: "same" })).message).toContain( + "identical", + ) + }), + ) + + it.instance("throws error when oldString not found in file", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "actual content") + + expect(yield* fail({ filePath: filepath, oldString: "not in file", newString: "replacement" })).toBeInstanceOf( + Error, + ) + }), + ) + + it.instance("replaces all occurrences with replaceAll option", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "foo bar foo baz foo") + + yield* run({ filePath: filepath, oldString: "foo", newString: "qux", replaceAll: true }) + + expect(yield* load(filepath)).toBe("qux bar qux baz qux") + }), + ) + + it.instance("emits change event for existing files", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "original") + const updated = yield* onceBus(FileWatcher.Event.Updated) + + yield* run({ filePath: filepath, oldString: "original", newString: "modified" }) + yield* Deferred.await(updated) + }), + ) }) describe("edge cases", () => { - test("handles multiline replacements", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "line1\nline2\nline3", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "line2", - newString: "new line 2\nextra line", - }, - ctx, - ), - ) - - const content = await fs.readFile(filepath, "utf-8") - expect(content).toBe("line1\nnew line 2\nextra line\nline3") - }, - }) - }) - - test("handles CRLF line endings", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "line1\r\nold\r\nline3", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "old", - newString: "new", - }, - ctx, - ), - ) - - const content = await fs.readFile(filepath, "utf-8") - expect(content).toBe("line1\r\nnew\r\nline3") - }, - }) - }) - - test("throws error when oldString equals newString", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "content", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await expect( - Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "", - newString: "", - }, - ctx, - ), - ), - ).rejects.toThrow("identical") - }, - }) - }) - - test("throws error when path is directory", async () => { - await using tmp = await tmpdir() - const dirpath = path.join(tmp.path, "adir") - await fs.mkdir(dirpath) - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - await expect( - Effect.runPromise( - edit.execute( - { - filePath: dirpath, - oldString: "old", - newString: "new", - }, - ctx, - ), - ), - ).rejects.toThrow("directory") - }, - }) - }) - - test("tracks file diff statistics", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "line1\nline2\nline3", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - const result = await Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "line2", - newString: "new line a\nnew line b", - }, - ctx, - ), - ) - - expect(result.metadata.filediff).toBeDefined() - expect(result.metadata.filediff.file).toBe(filepath) - expect(result.metadata.filediff.additions).toBeGreaterThan(0) - }, - }) - }) + it.instance("handles multiline replacements", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "line1\nline2\nline3") + + yield* run({ filePath: filepath, oldString: "line2", newString: "new line 2\nextra line" }) + + expect(yield* load(filepath)).toBe("line1\nnew line 2\nextra line\nline3") + }), + ) + + it.instance("handles CRLF line endings", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "line1\r\nold\r\nline3") + + yield* run({ filePath: filepath, oldString: "old", newString: "new" }) + + expect(yield* load(filepath)).toBe("line1\r\nnew\r\nline3") + }), + ) + + it.instance("throws error when oldString equals newString", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "content") + + expect((yield* fail({ filePath: filepath, oldString: "", newString: "" })).message).toContain("identical") + }), + ) + + it.instance("throws error when path is directory", () => + Effect.gen(function* () { + const test = yield* TestInstance + const dirpath = path.join(test.directory, "adir") + yield* makeDirectory(dirpath) + + expect((yield* fail({ filePath: dirpath, oldString: "old", newString: "new" })).message).toContain("directory") + }), + ) + + it.instance("tracks file diff statistics", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "line1\nline2\nline3") + + const result = yield* run({ filePath: filepath, oldString: "line2", newString: "new line a\nnew line b" }) + + expect(result.metadata.filediff).toBeDefined() + expect(result.metadata.filediff.file).toBe(filepath) + expect(result.metadata.filediff.additions).toBeGreaterThan(0) + }), + ) }) describe("line endings", () => { @@ -552,204 +334,200 @@ describe("tool.edit", () => { replaceAll?: boolean } - const apply = async (input: Input) => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "test.txt"), input.content) - }, - }) - - return await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - const filePath = path.join(tmp.path, "test.txt") - await Effect.runPromise( - edit.execute( - { - filePath, - oldString: input.oldString, - newString: input.newString, - replaceAll: input.replaceAll, - }, - ctx, - ), - ) - return await Bun.file(filePath).text() - }, - }) - } - - test("preserves LF with LF multi-line strings", async () => { - const content = normalize(old + "\n", "\n") - const output = await apply({ - content, - oldString: normalize(old, "\n"), - newString: normalize(next, "\n"), - }) - expect(output).toBe(normalize(next + "\n", "\n")) - expectLf(output) - }) - - test("preserves CRLF with CRLF multi-line strings", async () => { - const content = normalize(old + "\n", "\r\n") - const output = await apply({ - content, - oldString: normalize(old, "\r\n"), - newString: normalize(next, "\r\n"), - }) - expect(output).toBe(normalize(next + "\n", "\r\n")) - expectCrlf(output) - }) - - test("preserves LF when old/new use CRLF", async () => { - const content = normalize(old + "\n", "\n") - const output = await apply({ - content, - oldString: normalize(old, "\r\n"), - newString: normalize(next, "\r\n"), - }) - expect(output).toBe(normalize(next + "\n", "\n")) - expectLf(output) - }) - - test("preserves CRLF when old/new use LF", async () => { - const content = normalize(old + "\n", "\r\n") - const output = await apply({ - content, - oldString: normalize(old, "\n"), - newString: normalize(next, "\n"), - }) - expect(output).toBe(normalize(next + "\n", "\r\n")) - expectCrlf(output) - }) - - test("preserves LF when newString uses CRLF", async () => { - const content = normalize(old + "\n", "\n") - const output = await apply({ - content, - oldString: normalize(old, "\n"), - newString: normalize(next, "\r\n"), - }) - expect(output).toBe(normalize(next + "\n", "\n")) - expectLf(output) - }) - - test("preserves CRLF when newString uses LF", async () => { - const content = normalize(old + "\n", "\r\n") - const output = await apply({ - content, - oldString: normalize(old, "\r\n"), - newString: normalize(next, "\n"), + const apply = Effect.fn("EditToolTest.lineEndings.apply")(function* (input: Input) { + const test = yield* TestInstance + const filePath = path.join(test.directory, "test.txt") + yield* put(filePath, input.content) + yield* run({ + filePath, + oldString: input.oldString, + newString: input.newString, + replaceAll: input.replaceAll, }) - expect(output).toBe(normalize(next + "\n", "\r\n")) - expectCrlf(output) + return yield* load(filePath) }) - test("preserves LF with mixed old/new line endings", async () => { - const content = normalize(old + "\n", "\n") - const output = await apply({ - content, - oldString: "alpha\nbeta\r\ngamma", - newString: "alpha\r\nbeta\nomega", - }) - expect(output).toBe(normalize(alt + "\n", "\n")) - expectLf(output) - }) - - test("preserves CRLF with mixed old/new line endings", async () => { - const content = normalize(old + "\n", "\r\n") - const output = await apply({ - content, - oldString: "alpha\r\nbeta\ngamma", - newString: "alpha\nbeta\r\nomega", - }) - expect(output).toBe(normalize(alt + "\n", "\r\n")) - expectCrlf(output) - }) - - test("replaceAll preserves LF for multi-line blocks", async () => { - const blockOld = "alpha\nbeta" - const blockNew = "alpha\nbeta-updated" - const content = normalize(blockOld + "\n" + blockOld + "\n", "\n") - const output = await apply({ - content, - oldString: normalize(blockOld, "\n"), - newString: normalize(blockNew, "\n"), - replaceAll: true, - }) - expect(output).toBe(normalize(blockNew + "\n" + blockNew + "\n", "\n")) - expectLf(output) - }) - - test("replaceAll preserves CRLF for multi-line blocks", async () => { - const blockOld = "alpha\nbeta" - const blockNew = "alpha\nbeta-updated" - const content = normalize(blockOld + "\n" + blockOld + "\n", "\r\n") - const output = await apply({ - content, - oldString: normalize(blockOld, "\r\n"), - newString: normalize(blockNew, "\r\n"), - replaceAll: true, - }) - expect(output).toBe(normalize(blockNew + "\n" + blockNew + "\n", "\r\n")) - expectCrlf(output) - }) + it.instance("preserves LF with LF multi-line strings", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\n") + const output = yield* apply({ + content, + oldString: normalize(old, "\n"), + newString: normalize(next, "\n"), + }) + expect(output).toBe(normalize(next + "\n", "\n")) + expectLf(output) + }), + ) + + it.instance("preserves CRLF with CRLF multi-line strings", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\r\n") + const output = yield* apply({ + content, + oldString: normalize(old, "\r\n"), + newString: normalize(next, "\r\n"), + }) + expect(output).toBe(normalize(next + "\n", "\r\n")) + expectCrlf(output) + }), + ) + + it.instance("preserves LF when old/new use CRLF", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\n") + const output = yield* apply({ + content, + oldString: normalize(old, "\r\n"), + newString: normalize(next, "\r\n"), + }) + expect(output).toBe(normalize(next + "\n", "\n")) + expectLf(output) + }), + ) + + it.instance("preserves CRLF when old/new use LF", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\r\n") + const output = yield* apply({ + content, + oldString: normalize(old, "\n"), + newString: normalize(next, "\n"), + }) + expect(output).toBe(normalize(next + "\n", "\r\n")) + expectCrlf(output) + }), + ) + + it.instance("preserves LF when newString uses CRLF", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\n") + const output = yield* apply({ + content, + oldString: normalize(old, "\n"), + newString: normalize(next, "\r\n"), + }) + expect(output).toBe(normalize(next + "\n", "\n")) + expectLf(output) + }), + ) + + it.instance("preserves CRLF when newString uses LF", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\r\n") + const output = yield* apply({ + content, + oldString: normalize(old, "\r\n"), + newString: normalize(next, "\n"), + }) + expect(output).toBe(normalize(next + "\n", "\r\n")) + expectCrlf(output) + }), + ) + + it.instance("preserves LF with mixed old/new line endings", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\n") + const output = yield* apply({ + content, + oldString: "alpha\nbeta\r\ngamma", + newString: "alpha\r\nbeta\nomega", + }) + expect(output).toBe(normalize(alt + "\n", "\n")) + expectLf(output) + }), + ) + + it.instance("preserves CRLF with mixed old/new line endings", () => + Effect.gen(function* () { + const content = normalize(old + "\n", "\r\n") + const output = yield* apply({ + content, + oldString: "alpha\r\nbeta\ngamma", + newString: "alpha\nbeta\r\nomega", + }) + expect(output).toBe(normalize(alt + "\n", "\r\n")) + expectCrlf(output) + }), + ) + + it.instance("replaceAll preserves LF for multi-line blocks", () => + Effect.gen(function* () { + const blockOld = "alpha\nbeta" + const blockNew = "alpha\nbeta-updated" + const content = normalize(blockOld + "\n" + blockOld + "\n", "\n") + const output = yield* apply({ + content, + oldString: normalize(blockOld, "\n"), + newString: normalize(blockNew, "\n"), + replaceAll: true, + }) + expect(output).toBe(normalize(blockNew + "\n" + blockNew + "\n", "\n")) + expectLf(output) + }), + ) + + it.instance("replaceAll preserves CRLF for multi-line blocks", () => + Effect.gen(function* () { + const blockOld = "alpha\nbeta" + const blockNew = "alpha\nbeta-updated" + const content = normalize(blockOld + "\n" + blockOld + "\n", "\r\n") + const output = yield* apply({ + content, + oldString: normalize(blockOld, "\r\n"), + newString: normalize(blockNew, "\r\n"), + replaceAll: true, + }) + expect(output).toBe(normalize(blockNew + "\n" + blockNew + "\n", "\r\n")) + expectCrlf(output) + }), + ) }) describe("concurrent editing", () => { - test("preserves concurrent edits to different sections of the same file", async () => { - await using tmp = await tmpdir() - const filepath = path.join(tmp.path, "file.txt") - await fs.writeFile(filepath, "top = 0\nmiddle = keep\nbottom = 0\n", "utf-8") - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const edit = await resolve() - let asks = 0 - const firstAsk = Promise.withResolvers() - const delayedCtx = { - ...ctx, - ask: () => - Effect.gen(function* () { - asks++ - if (asks !== 1) return - firstAsk.resolve() - yield* Effect.promise(() => Bun.sleep(50)) - }), - } - - const promise1 = Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "top = 0", - newString: "top = 1", - }, - delayedCtx, - ), - ) - - await firstAsk.promise - - const promise2 = Effect.runPromise( - edit.execute( - { - filePath: filepath, - oldString: "bottom = 0", - newString: "bottom = 2", - }, - delayedCtx, - ), - ) - - const results = await Promise.allSettled([promise1, promise2]) - expect(results[0]?.status).toBe("fulfilled") - expect(results[1]?.status).toBe("fulfilled") - expect(await fs.readFile(filepath, "utf-8")).toBe("top = 1\nmiddle = keep\nbottom = 2\n") - }, - }) - }) + it.instance("preserves concurrent edits to different sections of the same file", () => + Effect.gen(function* () { + const test = yield* TestInstance + const filepath = path.join(test.directory, "file.txt") + yield* put(filepath, "top = 0\nmiddle = keep\nbottom = 0\n") + + const firstAsk = yield* Deferred.make() + let asks = 0 + const delayedCtx = { + ...ctx, + ask: () => + Effect.gen(function* () { + asks++ + if (asks !== 1) return + yield* Deferred.succeed(firstAsk, undefined) + yield* Effect.sleep("50 millis") + }), + } + + const first = yield* run( + { + filePath: filepath, + oldString: "top = 0", + newString: "top = 1", + }, + delayedCtx, + ).pipe(Effect.forkScoped) + + yield* Deferred.await(firstAsk) + yield* Effect.all([ + Fiber.join(first), + run( + { + filePath: filepath, + oldString: "bottom = 0", + newString: "bottom = 2", + }, + delayedCtx, + ), + ]) + + expect(yield* load(filepath)).toBe("top = 1\nmiddle = keep\nbottom = 2\n") + }), + ) }) }) diff --git a/packages/opencode/test/tool/external-directory.test.ts b/packages/opencode/test/tool/external-directory.test.ts index 0560ea03002a..04ef5c5d012c 100644 --- a/packages/opencode/test/tool/external-directory.test.ts +++ b/packages/opencode/test/tool/external-directory.test.ts @@ -1,14 +1,16 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect } from "bun:test" import path from "path" import { Effect } from "effect" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import type { Tool } from "@/tool/tool" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" -import { assertExternalDirectory } from "../../src/tool/external-directory" +import { assertExternalDirectoryEffect } from "../../src/tool/external-directory" import { Filesystem } from "@/util/filesystem" -import { tmpdir } from "../fixture/fixture" +import { provideInstance, TestInstance, tmpdirScoped } from "../fixture/fixture" import type { Permission } from "../../src/permission" import { SessionID, MessageID } from "../../src/session/schema" +import { testEffect } from "../lib/effect" + +const it = testEffect(CrossSpawnSpawner.defaultLayer) const baseCtx: Omit = { sessionID: SessionID.make("ses_test"), @@ -36,135 +38,120 @@ function makeCtx() { } describe("tool.assertExternalDirectory", () => { - test("no-ops for empty target", async () => { - const { requests, ctx } = makeCtx() - - await WithInstance.provide({ - directory: "/tmp", - fn: async () => { - await assertExternalDirectory(ctx) - }, - }) - - expect(requests.length).toBe(0) - }) - - test("no-ops for paths inside Instance.directory", async () => { - const { requests, ctx } = makeCtx() - - await WithInstance.provide({ - directory: "/tmp/project", - fn: async () => { - await assertExternalDirectory(ctx, path.join("/tmp/project", "file.txt")) - }, - }) - - expect(requests.length).toBe(0) - }) - - test("asks with a single canonical glob", async () => { - const { requests, ctx } = makeCtx() - - const directory = "/tmp/project" - const target = "/tmp/outside/file.txt" - const expected = glob(path.join(path.dirname(target), "*")) - - await WithInstance.provide({ - directory, - fn: async () => { - await assertExternalDirectory(ctx, target) - }, - }) - - const req = requests.find((r) => r.permission === "external_directory") - expect(req).toBeDefined() - expect(req!.patterns).toEqual([expected]) - expect(req!.always).toEqual([expected]) - }) - - test("uses target directory when kind=directory", async () => { - const { requests, ctx } = makeCtx() - - const directory = "/tmp/project" - const target = "/tmp/outside" - const expected = glob(path.join(target, "*")) - - await WithInstance.provide({ - directory, - fn: async () => { - await assertExternalDirectory(ctx, target, { kind: "directory" }) - }, - }) - - const req = requests.find((r) => r.permission === "external_directory") - expect(req).toBeDefined() - expect(req!.patterns).toEqual([expected]) - expect(req!.always).toEqual([expected]) - }) - - test("skips prompting when bypass=true", async () => { - const { requests, ctx } = makeCtx() - - await WithInstance.provide({ - directory: "/tmp/project", - fn: async () => { - await assertExternalDirectory(ctx, "/tmp/outside/file.txt", { bypass: true }) - }, - }) - - expect(requests.length).toBe(0) - }) + it.live("no-ops for empty target", () => + Effect.gen(function* () { + const { requests, ctx } = makeCtx() - if (process.platform === "win32") { - test("normalizes Windows path variants to one glob", async () => { + yield* assertExternalDirectoryEffect(ctx) + + expect(requests.length).toBe(0) + }), + ) + + it.live("no-ops for paths inside Instance.directory", () => + provideInstance("/tmp/project")( + Effect.gen(function* () { + const { requests, ctx } = makeCtx() + + yield* assertExternalDirectoryEffect(ctx, path.join("/tmp/project", "file.txt")) + + expect(requests.length).toBe(0) + }), + ), + ) + + it.live("asks with a single canonical glob", () => + Effect.gen(function* () { const { requests, ctx } = makeCtx() - await using outerTmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "outside.txt"), "x") - }, - }) - await using tmp = await tmpdir({ git: true }) - - const target = path.join(outerTmp.path, "outside.txt") - const alt = target - .replace(/^[A-Za-z]:/, "") - .replaceAll("\\", "/") - .toLowerCase() - - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await assertExternalDirectory(ctx, alt) - }, - }) + const directory = "/tmp/project" + const target = "/tmp/outside/file.txt" + const expected = glob(path.join(path.dirname(target), "*")) + + yield* provideInstance(directory)(assertExternalDirectoryEffect(ctx, target)) const req = requests.find((r) => r.permission === "external_directory") - const expected = glob(path.join(outerTmp.path, "*")) expect(req).toBeDefined() expect(req!.patterns).toEqual([expected]) expect(req!.always).toEqual([expected]) - }) + }), + ) - test("uses drive root glob for root files", async () => { + it.live("uses target directory when kind=directory", () => + Effect.gen(function* () { const { requests, ctx } = makeCtx() - await using tmp = await tmpdir({ git: true }) - const root = path.parse(tmp.path).root - const target = path.join(root, "boot.ini") + const directory = "/tmp/project" + const target = "/tmp/outside" + const expected = glob(path.join(target, "*")) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - await assertExternalDirectory(ctx, target) - }, - }) + yield* provideInstance(directory)(assertExternalDirectoryEffect(ctx, target, { kind: "directory" })) const req = requests.find((r) => r.permission === "external_directory") - const expected = path.join(root, "*") expect(req).toBeDefined() expect(req!.patterns).toEqual([expected]) expect(req!.always).toEqual([expected]) - }) + }), + ) + + it.live("skips prompting when bypass=true", () => + provideInstance("/tmp/project")( + Effect.gen(function* () { + const { requests, ctx } = makeCtx() + + yield* assertExternalDirectoryEffect(ctx, "/tmp/outside/file.txt", { bypass: true }) + + expect(requests.length).toBe(0) + }), + ), + ) + + if (process.platform === "win32") { + it.instance( + "normalizes Windows path variants to one glob", + () => + Effect.gen(function* () { + const { requests, ctx } = makeCtx() + + const outerTmp = yield* tmpdirScoped() + yield* Effect.promise(() => Bun.write(path.join(outerTmp, "outside.txt"), "x")) + + const target = path.join(outerTmp, "outside.txt") + const alt = target + .replace(/^[A-Za-z]:/, "") + .replaceAll("\\", "/") + .toLowerCase() + + yield* assertExternalDirectoryEffect(ctx, alt) + + const req = requests.find((r) => r.permission === "external_directory") + const expected = glob(path.join(outerTmp, "*")) + expect(req).toBeDefined() + expect(req!.patterns).toEqual([expected]) + expect(req!.always).toEqual([expected]) + }), + { git: true }, + ) + + it.instance( + "uses drive root glob for root files", + () => + Effect.gen(function* () { + const { requests, ctx } = makeCtx() + + const tmp = yield* TestInstance + const root = path.parse(tmp.directory).root + const target = path.join(root, "boot.ini") + + yield* assertExternalDirectoryEffect(ctx, target) + + const req = requests.find((r) => r.permission === "external_directory") + const expected = path.join(root, "*") + expect(req).toBeDefined() + expect(req!.patterns).toEqual([expected]) + expect(req!.always).toEqual([expected]) + }), + { git: true }, + ) } }) diff --git a/packages/opencode/test/tool/fixtures/models-api.json b/packages/opencode/test/tool/fixtures/models-api.json index 5a3eb7e8010e..6302a951dd89 100644 --- a/packages/opencode/test/tool/fixtures/models-api.json +++ b/packages/opencode/test/tool/fixtures/models-api.json @@ -1,339 +1,429 @@ { - "ollama-cloud": { - "id": "ollama-cloud", - "env": ["OLLAMA_API_KEY"], + "302ai": { + "id": "302ai", + "env": ["302AI_API_KEY"], "npm": "@ai-sdk/openai-compatible", - "api": "https://ollama.com/v1", - "name": "Ollama Cloud", - "doc": "https://docs.ollama.com/cloud", + "api": "https://api.302.ai/v1", + "name": "302.AI", + "doc": "https://doc.302.ai", "models": { - "mistral-large-3:675b": { - "id": "mistral-large-3:675b", - "name": "mistral-large-3:675b", - "family": "mistral-large", - "attachment": true, - "reasoning": false, - "tool_call": true, - "release_date": "2025-12-02", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 262144 } - }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "kimi-k2-thinking", - "family": "kimi-thinking", - "attachment": false, - "reasoning": true, - "tool_call": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 262144 } - }, - "qwen3-coder-next": { - "id": "qwen3-coder-next", - "name": "qwen3-coder-next", + "qwen3-235b-a22b": { + "id": "qwen3-235b-a22b", + "name": "Qwen3-235B-A22B", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "release_date": "2026-02-02", - "last_updated": "2026-02-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 65536 } + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.29, + "output": 2.86 + } }, - "qwen3-vl:235b-instruct": { - "id": "qwen3-vl:235b-instruct", - "name": "qwen3-vl:235b-instruct", - "family": "qwen", + "grok-4.1": { + "id": "grok-4.1", + "name": "grok-4.1", "attachment": true, "reasoning": false, "tool_call": true, - "release_date": "2025-09-22", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 131072 } + "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-oss:120b": { - "id": "gpt-oss:120b", - "name": "gpt-oss:120b", - "family": "gpt-oss", + "MiniMax-M2": { + "id": "MiniMax-M2", + "name": "MiniMax-M2", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "release_date": "2025-08-05", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 131072, "output": 32768 } + "temperature": true, + "release_date": "2025-10-26", + "last_updated": "2025-10-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 0.33, + "output": 1.32 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "kimi-k2.5", - "family": "kimi", + "grok-4-1-fast-reasoning": { + "id": "grok-4-1-fast-reasoning", + "name": "grok-4-1-fast-reasoning", "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 262144 } - }, - "cogito-2.1:671b": { - "id": "cogito-2.1:671b", - "name": "cogito-2.1:671b", - "family": "cogito", - "attachment": false, - "reasoning": true, - "tool_call": true, - "release_date": "2025-11-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 163840, "output": 32000 } - }, - "nemotron-3-nano:30b": { - "id": "nemotron-3-nano:30b", - "name": "nemotron-3-nano:30b", - "family": "nemotron", - "attachment": false, - "reasoning": true, - "tool_call": true, - "release_date": "2025-12-15", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 1048576, "output": 131072 } + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } }, - "ministral-3:14b": { - "id": "ministral-3:14b", - "name": "ministral-3:14b", - "family": "ministral", + "gemini-2.5-flash-nothink": { + "id": "gemini-2.5-flash-nothink", + "name": "gemini-2.5-flash-nothink", + "family": "gemini-flash", "attachment": true, "reasoning": false, "tool_call": true, - "release_date": "2024-12-01", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 128000 } + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-06-24", + "last_updated": "2025-06-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "devstral-small-2:24b": { - "id": "devstral-small-2:24b", - "name": "devstral-small-2:24b", - "family": "devstral", + "grok-4.20-multi-agent-beta-0309": { + "id": "grok-4.20-multi-agent-beta-0309", + "name": "grok-4.20-multi-agent-beta-0309", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "release_date": "2025-12-09", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 262144 } + "temperature": true, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "minimax-m2": { - "id": "minimax-m2", - "name": "minimax-m2", - "family": "minimax", + "kimi-k2-0905-preview": { + "id": "kimi-k2-0905-preview", + "name": "kimi-k2-0905-preview", "attachment": false, "reasoning": false, "tool_call": true, - "release_date": "2025-10-23", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 204800, "output": 128000 } - }, - "qwen3-next:80b": { - "id": "qwen3-next:80b", - "name": "qwen3-next:80b", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": true, - "release_date": "2025-09-15", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 32768 } + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.632, + "output": 2.53 + } }, - "qwen3-vl:235b": { - "id": "qwen3-vl:235b", - "name": "qwen3-vl:235b", - "family": "qwen", + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "claude-haiku-4-5", + "family": "claude-haiku", "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2025-09-22", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 32768 } + "temperature": true, + "knowledge": "2025-02-28", + "release_date": "2025-10-16", + "last_updated": "2025-10-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "minimax-m2.1": { - "id": "minimax-m2.1", - "name": "minimax-m2.1", - "family": "minimax", - "attachment": false, + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "claude-opus-4-5-20251101", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2025-12-23", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 204800, "output": 131072 } - }, - "gemma3:12b": { - "id": "gemma3:12b", - "name": "gemma3:12b", - "family": "gemma", - "attachment": true, - "reasoning": false, - "tool_call": false, - "release_date": "2024-12-01", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 131072, "output": 131072 } + "temperature": true, + "knowledge": "2025-03-31", + "release_date": "2025-11-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25 + } }, - "gemma3:27b": { - "id": "gemma3:27b", - "name": "gemma3:27b", - "family": "gemma", + "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", "attachment": true, "reasoning": false, - "tool_call": false, - "release_date": "2025-07-27", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 131072, "output": 131072 } + "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 + } }, - "qwen3-coder:480b": { - "id": "qwen3-coder:480b", - "name": "qwen3-coder:480b", - "family": "qwen", + "qwen3-235b-a22b-instruct-2507": { + "id": "qwen3-235b-a22b-instruct-2507", + "name": "qwen3-235b-a22b-instruct-2507", "attachment": false, "reasoning": false, "tool_call": true, - "release_date": "2025-07-22", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 65536 } + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 0.29, + "output": 1.143 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "glm-4.6", + "glm-5v-turbo": { + "id": "glm-5v-turbo", + "name": "GLM-5V-Turbo", "family": "glm", - "attachment": false, + "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2025-09-29", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 202752, "output": 131072 } + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image", "video", "audio", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.72, + "output": 3.2 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "gemini-3-flash-preview", - "family": "gemini-flash", - "attachment": false, - "reasoning": true, + "mistral-large-2512": { + "id": "mistral-large-2512", + "name": "mistral-large-2512", + "attachment": true, + "reasoning": false, "tool_call": true, - "knowledge": "2025-01", - "release_date": "2025-12-17", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 1048576, "output": 65536 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 262144 + }, + "cost": { + "input": 1.1, + "output": 3.3 + } }, - "minimax-m2.7": { - "id": "minimax-m2.7", - "name": "minimax-m2.7", - "family": "minimax", + "glm-4.7": { + "id": "glm-4.7", + "name": "glm-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.286, + "output": 1.142 + } }, - "gpt-oss:20b": { - "id": "gpt-oss:20b", - "name": "gpt-oss:20b", - "family": "gpt-oss", - "attachment": false, - "reasoning": true, + "claude-3-5-haiku-20241022": { + "id": "claude-3-5-haiku-20241022", + "name": "claude-3-5-haiku-20241022", + "family": "claude-haiku", + "attachment": true, + "reasoning": false, "tool_call": true, - "release_date": "2025-08-05", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 131072, "output": 32768 } + "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 + }, + "cost": { + "input": 0.8, + "output": 4 + } }, - "ministral-3:8b": { - "id": "ministral-3:8b", - "name": "ministral-3:8b", - "family": "ministral", + "doubao-seed-1-8-251215": { + "id": "doubao-seed-1-8-251215", + "name": "doubao-seed-1-8-251215", "attachment": true, "reasoning": false, "tool_call": true, - "release_date": "2024-12-01", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 128000 } + "temperature": true, + "release_date": "2025-12-18", + "last_updated": "2025-12-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 224000, + "output": 64000 + }, + "cost": { + "input": 0.114, + "output": 0.286 + } }, - "gemma3:4b": { - "id": "gemma3:4b", - "name": "gemma3:4b", - "family": "gemma", + "chatgpt-4o-latest": { + "id": "chatgpt-4o-latest", + "name": "chatgpt-4o-latest", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": false, - "release_date": "2024-12-01", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 131072, "output": 131072 } - }, - "qwen3.5:397b": { - "id": "qwen3.5:397b", - "name": "qwen3.5:397b", - "family": "qwen", - "attachment": true, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "release_date": "2026-02-15", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 81920 } - }, - "nemotron-3-super": { - "id": "nemotron-3-super", - "name": "nemotron-3-super", - "family": "nemotron", - "attachment": false, - "reasoning": true, - "tool_call": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 65536 } + "temperature": true, + "knowledge": "2023-09", + "release_date": "2024-08-08", + "last_updated": "2024-08-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 5, + "output": 15 + } }, "glm-5": { "id": "glm-5", @@ -342,529 +432,720 @@ "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.6 + } }, - "devstral-2:123b": { - "id": "devstral-2:123b", - "name": "devstral-2:123b", - "family": "devstral", + "deepseek-chat": { + "id": "deepseek-chat", + "name": "Deepseek-Chat", + "family": "deepseek", "attachment": false, "reasoning": false, "tool_call": true, - "release_date": "2025-12-09", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 262144 } + "temperature": true, + "knowledge": "2024-07", + "release_date": "2024-11-29", + "last_updated": "2024-11-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.29, + "output": 0.43 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "glm-4.7", - "family": "glm", + "deepseek-v3.2-thinking": { + "id": "deepseek-v3.2-thinking", + "name": "DeepSeek-V3.2-Thinking", "attachment": false, "reasoning": true, "tool_call": true, - "release_date": "2025-12-22", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 202752, "output": 131072 } - }, - "rnj-1:8b": { - "id": "rnj-1:8b", - "name": "rnj-1:8b", - "family": "rnj", - "attachment": false, - "reasoning": false, - "tool_call": true, - "release_date": "2025-12-06", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 32768, "output": 4096 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.29, + "output": 0.43 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "deepseek-v3.2", - "family": "deepseek", - "attachment": false, + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "claude-sonnet-4-6", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2025-06-15", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 163840, "output": 65536 } - }, - "deepseek-v3.1:671b": { - "id": "deepseek-v3.1:671b", - "name": "deepseek-v3.1:671b", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "tool_call": true, - "release_date": "2025-08-21", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 163840, "output": 163840 } + "temperature": true, + "knowledge": "2025-08-31", + "release_date": "2026-02-18", + "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 + } }, - "ministral-3:3b": { - "id": "ministral-3:3b", - "name": "ministral-3:3b", - "family": "ministral", + "gpt-5-thinking": { + "id": "gpt-5-thinking", + "name": "gpt-5-thinking", "attachment": true, - "reasoning": false, - "tool_call": true, - "release_date": "2024-10-22", - "last_updated": "2026-01-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 128000 } - }, - "kimi-k2:1t": { - "id": "kimi-k2:1t", - "name": "kimi-k2:1t", - "family": "kimi", - "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "temperature": true, "knowledge": "2024-10", - "release_date": "2025-07-11", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } }, - "minimax-m2.5": { - "id": "minimax-m2.5", - "name": "minimax-m2.5", - "family": "minimax", - "attachment": false, - "reasoning": true, - "tool_call": 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 } - } - } - }, - "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": { - "GLM-4.7": { - "id": "GLM-4.7", - "name": "GLM-4.7", - "family": "glm", + "glm-4.7-flashx": { + "id": "glm-4.7-flashx", + "name": "glm-4.7-flashx", + "family": "glm-flash", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-01-20", + "last_updated": "2026-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 3.5, "output": 14 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.0715, + "output": 0.429 + } }, - "MiniMax-M2.1": { - "id": "MiniMax-M2.1", - "name": "MiniMax-M2.1", - "family": "minimax", - "attachment": false, - "reasoning": true, + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "gemini-3-flash-preview", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2.1, "output": 8.4 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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", - "family": "deepseek-thinking", + "knowledge": "2025-06", + "release_date": "2025-12-18", + "last_updated": "2025-12-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } + }, + "qwen-plus": { + "id": "qwen-plus", + "name": "Qwen-Plus", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 2.2 }, - "limit": { "context": 131072, "output": 32000 } + "knowledge": "2024-10", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.12, + "output": 1.2 + } }, - "public/deepseek-v3": { - "id": "public/deepseek-v3", - "name": "DeepSeek V3", - "family": "deepseek", - "attachment": false, + "grok-4.20-beta-0309-non-reasoning": { + "id": "grok-4.20-beta-0309-non-reasoning", + "name": "grok-4.20-beta-0309-non-reasoning", + "attachment": true, "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, - "cost": { "input": 0.28, "output": 1.1 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "public/minimax-m25": { - "id": "public/minimax-m25", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "claude-opus-4-7", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, "temperature": true, - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2026-01-31", + "release_date": "2026-04-17", + "last_updated": "2026-04-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 1.16 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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": { - "google/gemma-3": { - "id": "google/gemma-3", - "name": "Google Gemma 3", - "family": "gemma", + "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 + } + } + }, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "gpt-5-mini", + "family": "gpt-mini", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.15, "output": 0.3 }, - "limit": { "context": 125000, "output": 4096 } - }, - "qwen/qwen3-embedding-4b": { - "id": "qwen/qwen3-embedding-4b", - "name": "Qwen 3 Embedding 4B", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, + "structured_output": true, "temperature": false, - "knowledge": "2024-12", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32000, "output": 2048 } + "knowledge": "2024-05-30", + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2 + } }, - "qwen/qwen-2.5-7b-vision-instruct": { - "id": "qwen/qwen-2.5-7b-vision-instruct", - "name": "Qwen 2.5 7B Vision Instruct", - "family": "qwen", + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "gemini-3-pro-preview", "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, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 125000, "output": 4096 } + "knowledge": "2025-06", + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 12 + } }, - "mistral/mistral-nemo-12b-instruct": { - "id": "mistral/mistral-nemo-12b-instruct", - "name": "Mistral Nemo 12B Instruct", - "family": "mistral-nemo", + "MiniMax-M2.7": { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", "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, - "cost": { "input": 0.038, "output": 0.1 }, - "limit": { "context": 16000, "output": 4096 } + "release_date": "2026-03-19", + "last_updated": "2026-03-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "meta/llama-3.2-1b-instruct": { - "id": "meta/llama-3.2-1b-instruct", - "name": "Llama 3.2 1B Instruct", - "family": "llama", + "qwen3-max-2025-09-23": { + "id": "qwen3-max-2025-09-23", + "name": "qwen3-max-2025-09-23", "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, - "cost": { "input": 0.01, "output": 0.01 }, - "limit": { "context": 16000, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 258048, + "output": 65536 + }, + "cost": { + "input": 0.86, + "output": 3.43 + } }, - "meta/llama-3.1-8b-instruct": { - "id": "meta/llama-3.1-8b-instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "claude-sonnet-4-5-20250929", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.025, "output": 0.025 }, - "limit": { "context": 16000, "output": 4096 } + "knowledge": "2025-07-31", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "meta/llama-3.2-11b-vision-instruct": { - "id": "meta/llama-3.2-11b-vision-instruct", - "name": "Llama 3.2 11B Vision Instruct", - "family": "llama", - "attachment": true, + "qwen-flash": { + "id": "qwen-flash", + "name": "Qwen-Flash", + "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", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.055, "output": 0.055 }, - "limit": { "context": 16000, "output": 4096 } + "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 + } }, - "meta/llama-3.2-3b-instruct": { - "id": "meta/llama-3.2-3b-instruct", - "name": "Llama 3.2 3B Instruct", - "family": "llama", - "attachment": false, + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "gemini-2.5-pro", + "family": "gemini-pro", + "attachment": true, "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, - "cost": { "input": 0.02, "output": 0.02 }, - "limit": { "context": 16000, "output": 4096 } + "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 + } }, - "osmosis/osmosis-structure-0.6b": { - "id": "osmosis/osmosis-structure-0.6b", - "name": "Osmosis Structure 0.6B", - "family": "osmosis", - "attachment": false, + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "grok-4-1-fast-non-reasoning", + "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"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 4000, "output": 2048 } - } - } - }, - "bailing": { - "id": "bailing", - "env": ["BAILING_API_TOKEN"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://api.tbox.cn/api/llm/v1/chat/completions", - "name": "Bailing", - "doc": "https://alipaytbox.yuque.com/sxs0ba/ling/intro", - "models": { - "Ling-1T": { - "id": "Ling-1T", - "name": "Ling-1T", - "family": "ling", - "attachment": false, + "knowledge": "2025-06", + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "claude-3-5-haiku-latest": { + "id": "claude-3-5-haiku-latest", + "name": "claude-3-5-haiku-latest", + "family": "claude-haiku", + "attachment": true, "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, - "cost": { "input": 0.57, "output": 2.29 }, - "limit": { "context": 128000, "output": 32000 } + "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 + }, + "cost": { + "input": 0.8, + "output": 4 + } }, - "Ring-1T": { - "id": "Ring-1T", - "name": "Ring-1T", - "family": "ring", - "attachment": false, + "claude-opus-4-5-20251101-thinking": { + "id": "claude-opus-4-5-20251101-thinking", + "name": "claude-opus-4-5-20251101-thinking", + "attachment": true, "reasoning": true, - "tool_call": 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, - "cost": { "input": 0.57, "output": 2.29 }, - "limit": { "context": 128000, "output": 32000 } - } - } - }, - "openai": { - "id": "openai", - "env": ["OPENAI_API_KEY"], - "npm": "@ai-sdk/openai", - "name": "OpenAI", - "doc": "https://platform.openai.com/docs/models", - "models": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", + "knowledge": "2025-03", + "release_date": "2025-11-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25 + } + }, + "gpt-5.2": { + "id": "gpt-5.2", + "name": "gpt-5.2", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-12-12", + "last_updated": "2025-12-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } }, - "o1-pro": { - "id": "o1-pro", - "name": "o1-pro", - "family": "o-pro", + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "gpt-5.4-mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-08-31", + "release_date": "2026-03-19", + "last_updated": "2026-03-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 150, "output": 600 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5 + } }, - "text-embedding-3-large": { - "id": "text-embedding-3-large", - "name": "text-embedding-3-large", - "family": "text-embedding", - "attachment": false, + "gemini-3-pro-image-preview": { + "id": "gemini-3-pro-image-preview", + "name": "gemini-3-pro-image-preview", + "attachment": true, "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"] }, + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.13, "output": 0 }, - "limit": { "context": 8191, "output": 3072 } + "limit": { + "context": 32768, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 120 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex mini", - "family": "gpt-codex", - "attachment": true, + "glm-5.1": { + "id": "glm-5.1", + "name": "glm-5.1", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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"] }, + "temperature": true, + "release_date": "2026-04-10", + "last_updated": "2026-04-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.86, + "output": 3.5 + } }, - "gpt-5.4-pro": { - "id": "gpt-5.4-pro", - "name": "GPT-5.4 Pro", - "family": "gpt-pro", + "qwen-max-latest": { + "id": "qwen-max-latest", + "name": "Qwen-Max-Latest", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-11", + "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.343, + "output": 1.372 + } + }, + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "gpt-5.4-nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, + "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"] }, + "release_date": "2026-03-19", + "last_updated": "2026-03-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25 + } + }, + "gemini-2.5-flash-image": { + "id": "gemini-2.5-flash-image", + "name": "gemini-2.5-flash-image", + "attachment": true, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-10-08", + "last_updated": "2025-10-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 180, "context_over_200k": { "input": 60, "output": 270 } }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 30 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "o3-mini", - "family": "o-mini", + "glm-4.5": { + "id": "glm-4.5", + "name": "GLM-4.5", + "family": "glm", "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.286, + "output": 1.142 + } }, - "gpt-5.4-mini": { - "id": "gpt-5.4-mini", - "name": "GPT-5.4 mini", + "gpt-5.4-mini-2026-03-17": { + "id": "gpt-5.4-mini-2026-03-17", + "name": "gpt-5.4-mini-2026-03-17", "family": "gpt-mini", "attachment": true, "reasoning": true, @@ -872,33 +1153,51 @@ "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"] }, + "release_date": "2026-03-19", + "last_updated": "2026-03-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.75, "output": 4.5, "cache_read": 0.075 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "GPT-5 Pro", - "family": "gpt-pro", + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "gemini-2.5-flash", + "family": "gemini-flash", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "input": 272000, "output": 272000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, "gpt-5.2-chat-latest": { "id": "gpt-5.2-chat-latest", - "name": "GPT-5.2 Chat", + "name": "gpt-5.2-chat-latest", "family": "gpt-codex", "attachment": true, "reasoning": true, @@ -906,376 +1205,585 @@ "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"] }, + "release_date": "2025-12-12", + "last_updated": "2025-12-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", + "doubao-seed-1-6-vision-250815": { + "id": "doubao-seed-1-6-vision-250815", + "name": "doubao-seed-1-6-vision-250815", "attachment": true, - "reasoning": 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"] }, + "temperature": true, + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.114, + "output": 1.143 + } }, - "gpt-4-turbo": { - "id": "gpt-4-turbo", - "name": "GPT-4 Turbo", - "family": "gpt", + "gemini-3.1-flash-image-preview": { + "id": "gemini-3.1-flash-image-preview", + "name": "gemini-3.1-flash-image-preview", "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": false, + "tool_call": false, "temperature": true, - "knowledge": "2023-12", - "release_date": "2023-11-06", - "last_updated": "2024-04-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-02-27", + "last_updated": "2026-02-27", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 60 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "MiniMax-M2.7-highspeed": { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "attachment": false, "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"] }, + "release_date": "2026-03-19", + "last_updated": "2026-03-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 4.8 + } }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, + "glm-4.5-x": { + "id": "glm-4.5-x", + "name": "glm-4.5-x", + "family": "glm", + "attachment": false, + "reasoning": false, "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"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.143, + "output": 2.29 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": true, + "MiniMax-M2.1": { + "id": "MiniMax-M2.1", + "name": "MiniMax-M2.1", + "attachment": false, + "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"] }, + "temperature": true, + "release_date": "2025-12-19", + "last_updated": "2025-12-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "gpt-5.3-codex-spark": { - "id": "gpt-5.3-codex-spark", - "name": "GPT-5.3 Codex Spark", - "family": "gpt-codex-spark", + "gpt-5.1": { + "id": "gpt-5.1", + "name": "gpt-5.1", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "input": 100000, "output": 32000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } }, - "gpt-4o-mini": { - "id": "gpt-4o-mini", - "name": "GPT-4o mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": false, + "kimi-k2-thinking-turbo": { + "id": "kimi-k2-thinking-turbo", + "name": "kimi-k2-thinking-turbo", + "attachment": false, + "reasoning": true, "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"] }, + "knowledge": "2025-06", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 1.265, + "output": 9.119 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1 Codex Max", - "family": "gpt-codex", - "attachment": true, + "deepseek-reasoner": { + "id": "deepseek-reasoner", + "name": "Deepseek-Reasoner", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.29, + "output": 0.43 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", + "grok-4-fast-reasoning": { + "id": "grok-4-fast-reasoning", + "name": "grok-4-fast-reasoning", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "knowledge": "2025-06", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } }, - "gpt-5.1-chat-latest": { - "id": "gpt-5.1-chat-latest", - "name": "GPT-5.1 Chat", - "family": "gpt-codex", + "claude-opus-4-1-20250805-thinking": { + "id": "claude-opus-4-1-20250805-thinking", + "name": "claude-opus-4-1-20250805-thinking", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-03", + "release_date": "2025-05-27", + "last_updated": "2025-05-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75 + } }, - "gpt-3.5-turbo": { - "id": "gpt-3.5-turbo", - "name": "GPT-3.5-turbo", - "family": "gpt", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "glm-4.5-air", + "family": "glm-air", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2021-09-01", - "release_date": "2023-03-01", - "last_updated": "2023-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5, "cache_read": 1.25 }, - "limit": { "context": 16385, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.1143, + "output": 0.286 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "gpt-5.4-pro": { + "id": "gpt-5.4-pro", + "name": "gpt-5.4-pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": 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"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2.5, - "output": 15, - "cache_read": 0.25, - "context_over_200k": { "input": 5, "output": 22.5, "cache_read": 0.5 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "cost": { + "input": 30, + "output": 180, + "cache_read": 0, + "cache_write": 0, + "tiers": [ + { + "input": 60, + "output": 270, + "tier": { + "type": "context", + "size": 272000 + } + } + ], + "context_over_200k": { + "input": 60, + "output": 270 + } + } }, - "o1": { - "id": "o1", - "name": "o1", - "family": "o", - "attachment": true, + "glm-5-turbo": { + "id": "glm-5-turbo", + "name": "glm-5-turbo", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-12-05", - "last_updated": "2024-12-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.72, + "output": 3.2 + } }, - "codex-mini-latest": { - "id": "codex-mini-latest", - "name": "Codex Mini", - "family": "gpt-codex-mini", - "attachment": true, - "reasoning": true, + "qwen3-30b-a3b": { + "id": "qwen3-30b-a3b", + "name": "Qwen3-30B-A3B", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2024-04", - "release_date": "2025-05-16", - "last_updated": "2025-05-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.375 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.11, + "output": 1.08 + } }, - "o3": { - "id": "o3", - "name": "o3", - "family": "o", + "claude-opus-4-5": { + "id": "claude-opus-4-5", + "name": "claude-opus-4-5", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-03-31", + "release_date": "2025-11-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25 + } }, - "gpt-5.3-chat-latest": { - "id": "gpt-5.3-chat-latest", - "name": "GPT-5.3 Chat (latest)", - "family": "gpt", + "glm-4.5v": { + "id": "glm-4.5v", + "name": "GLM-4.5V", + "family": "glm", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2025-04", + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 16384 + }, + "cost": { + "input": 0.29, + "output": 0.86 + } }, - "gpt-5.4-nano": { - "id": "gpt-5.4-nano", - "name": "GPT-5.4 nano", - "family": "gpt-nano", - "attachment": true, + "glm-4.6": { + "id": "glm-4.6", + "name": "glm-4.6", + "family": "glm", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.2, "output": 1.25, "cache_read": 0.02 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } }, - "gpt-4o-2024-05-13": { - "id": "gpt-4o-2024-05-13", - "name": "GPT-4o (2024-05-13)", - "family": "gpt", + "claude-opus-4-6-thinking": { + "id": "claude-opus-4-6-thinking", + "name": "claude-opus-4-6-thinking", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "knowledge": "2025-05", + "release_date": "2026-02-06", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 15 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25 + } }, - "gpt-4": { - "id": "gpt-4", - "name": "GPT-4", - "family": "gpt", + "gemini-2.5-flash-preview-09-2025": { + "id": "gemini-2.5-flash-preview-09-2025", + "name": "gemini-2.5-flash-preview-09-2025", "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"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-09-26", + "last_updated": "2025-09-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 60 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "gpt-4o-2024-11-20": { - "id": "gpt-4o-2024-11-20", - "name": "GPT-4o (2024-11-20)", - "family": "gpt", + "claude-sonnet-4-6-thinking": { + "id": "claude-sonnet-4-6-thinking", + "name": "claude-sonnet-4-6-thinking", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "knowledge": "2025-08", + "release_date": "2026-02-18", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "text-embedding-ada-002": { - "id": "text-embedding-ada-002", - "name": "text-embedding-ada-002", - "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"] }, + "glm-4.6v": { + "id": "glm-4.6v", + "name": "GLM-4.6V", + "family": "glm", + "attachment": true, + "reasoning": true, + "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 + } + }, + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "claude-opus-4-1-20250805", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "gpt-5.4", "family": "gpt", "attachment": true, "reasoning": true, @@ -1283,134 +1791,241 @@ "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"] }, + "release_date": "2026-03-05", + "last_updated": "2026-03-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } + } }, - "o4-mini-deep-research": { - "id": "o4-mini-deep-research", - "name": "o4-mini-deep-research", - "family": "o-mini", + "gpt-5.1-chat-latest": { + "id": "gpt-5.1-chat-latest", + "name": "gpt-5.1-chat-latest", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2024-05", - "release_date": "2024-06-26", - "last_updated": "2024-06-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "claude-haiku-4-5-20251001", + "family": "claude-haiku", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-02-28", + "release_date": "2025-10-16", + "last_updated": "2025-10-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "GPT-4.1 mini", - "family": "gpt-mini", - "attachment": true, + "MiniMax-M1": { + "id": "MiniMax-M1", + "name": "MiniMax-M1", + "family": "minimax", + "attachment": false, "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"] }, + "release_date": "2025-06-16", + "last_updated": "2025-06-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 0.132, + "output": 1.254 + } }, - "gpt-5-chat-latest": { - "id": "gpt-5-chat-latest", - "name": "GPT-5 Chat (latest)", - "family": "gpt-codex", + "gpt-5.4-nano-2026-03-17": { + "id": "gpt-5.4-nano-2026-03-17", + "name": "gpt-5.4-nano-2026-03-17", + "family": "gpt-nano", "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "structured_output": true, - "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-03-19", + "last_updated": "2026-03-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", + "claude-sonnet-4-20250514": { + "id": "claude-sonnet-4-20250514", + "name": "claude-sonnet-4-20250514", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.005 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "o3-pro": { - "id": "o3-pro", - "name": "o3-pro", - "family": "o-pro", + "qwen3-coder-480b-a35b-instruct": { + "id": "qwen3-coder-480b-a35b-instruct", + "name": "qwen3-coder-480b-a35b-instruct", + "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": 262144, + "output": 65536 + }, + "cost": { + "input": 0.86, + "output": 3.43 + } + }, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "claude-opus-4-6", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-02-06", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 20, "output": 80 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25 + } }, - "gpt-4o-2024-08-06": { - "id": "gpt-4o-2024-08-06", - "name": "GPT-4o (2024-08-06)", - "family": "gpt", + "doubao-seed-code-preview-251028": { + "id": "doubao-seed-code-preview-251028", + "name": "doubao-seed-code-preview-251028", "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"] }, + "release_date": "2025-11-11", + "last_updated": "2025-11-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.17, + "output": 1.14 + } }, "gpt-4.1-nano": { "id": "gpt-4.1-nano", - "name": "GPT-4.1 nano", + "name": "gpt-4.1-nano", "family": "gpt-nano", "attachment": true, "reasoning": false, @@ -1420,11838 +2035,32461 @@ "knowledge": "2024-04", "release_date": "2025-04-14", "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1047576, "output": 32768 } - }, - "o1-preview": { - "id": "o1-preview", - "name": "o1-preview", - "family": "o", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2023-09", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "text-embedding-3-small": { - "id": "text-embedding-3-small", - "name": "text-embedding-3-small", - "family": "text-embedding", + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "deepseek-v3.2", "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"] }, + "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": false, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 8191, "output": 1536 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.29, + "output": 0.43 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "GPT-5-Codex", - "family": "gpt-codex", - "attachment": false, + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "gpt-5-pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-10-08", + "last_updated": "2025-10-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "o4-mini": { - "id": "o4-mini", - "name": "o4-mini", - "family": "o-mini", + "gpt-4o": { + "id": "gpt-4o", + "name": "gpt-4o", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "o3-deep-research": { - "id": "o3-deep-research", - "name": "o3-deep-research", - "family": "o", + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "claude-sonnet-4-5", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-05", - "release_date": "2024-06-26", - "last_updated": "2024-06-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-07-31", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 40, "cache_read": 2.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt-codex", + "gpt-5": { + "id": "gpt-5", + "name": "gpt-5", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } }, - "o1-mini": { - "id": "o1-mini", - "name": "o1-mini", - "family": "o-mini", - "attachment": false, + "grok-4.20-beta-0309-reasoning": { + "id": "grok-4.20-beta-0309-reasoning", + "name": "grok-4.20-beta-0309-reasoning", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 128000, "output": 65536 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "gpt-5.2-pro": { - "id": "gpt-5.2-pro", - "name": "GPT-5.2 Pro", - "family": "gpt-pro", + "claude-opus-4-20250514": { + "id": "claude-opus-4-20250514", + "name": "claude-opus-4-20250514", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT-OSS 120B", - "family": "gpt-oss", + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75 + } + }, + "glm-for-coding": { + "id": "glm-for-coding", + "name": "glm-for-coding", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.4, "cache_read": 0.02, "cache_write": 0.08 }, - "limit": { "context": 131072, "output": 4096 } + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.086, + "output": 0.343 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT-OSS 20B", - "family": "gpt-oss", - "attachment": false, - "reasoning": false, + "claude-sonnet-4-5-20250929-thinking": { + "id": "claude-sonnet-4-5-20250929-thinking", + "name": "claude-sonnet-4-5-20250929-thinking", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.14, "cache_read": 0.015, "cache_write": 0.06 }, - "limit": { "context": 64000, "output": 4096 } + "knowledge": "2025-03", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "GLM 4.6", + "glm-4.5-airx": { + "id": "glm-4.5-airx", + "name": "glm-4.5-airx", "family": "glm", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-11-15", - "last_updated": "2024-11-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.75, "cache_read": 0.2, "cache_write": 0.8 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.572, + "output": 1.714 + } }, - "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar": { - "id": "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar", - "name": "Qwen 3 Coder 480B", - "family": "qwen", - "attachment": false, + "gpt-4.1": { + "id": "gpt-4.1", + "name": "gpt-4.1", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 0.95, "cache_read": 0.11, "cache_write": 0.44 }, - "limit": { "context": 106000, "output": 4096 } + "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 + } }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "kimi-k2-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.13, "output": 0.38, "cache_read": 0.065, "cache_write": 0.26 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-06", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.575, + "output": 2.3 + } }, - "meta-llama/Llama-3.2-90B-Vision-Instruct": { - "id": "meta-llama/Llama-3.2-90B-Vision-Instruct", - "name": "Llama 3.2 90B Vision Instruct", - "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", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 0.4, "cache_read": 0.175, "cache_write": 0.7 }, - "limit": { "context": 16000, "output": 4096 } + "gemini-2.0-flash-lite": { + "id": "gemini-2.0-flash-lite", + "name": "gemini-2.0-flash-lite", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2024-11", + "release_date": "2025-06-16", + "last_updated": "2025-06-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "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", - "family": "llama", - "attachment": false, + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "gpt-4.1-mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.075, "cache_write": 0.3 }, - "limit": { "context": 430000, "output": 4096 } + "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 + } }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek R1", - "family": "deepseek-thinking", - "attachment": false, + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "grok-4-fast-non-reasoning", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "doubao-seed-1-6-thinking-250715": { + "id": "doubao-seed-1-6-thinking-250715", + "name": "doubao-seed-1-6-thinking-250715", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-01-20", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 8.75, "cache_read": 1, "cache_write": 4 }, - "limit": { "context": 128000, "output": 4096 } + "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 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen 3 235B Thinking", + "ministral-14b-2512": { + "id": "ministral-14b-2512", + "name": "ministral-14b-2512", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.33, + "output": 0.33 + } + } + } + }, + "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-235b-a22b": { + "id": "qwen3-235b-a22b", + "name": "Qwen3 235B-A22B", "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.11, "output": 0.6, "cache_read": 0.055, "cache_write": 0.22 }, - "limit": { "context": 262144, "output": 4096 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 2.8, + "reasoning": 8.4 + } }, - "Qwen/Qwen3-Next-80B-A3B-Instruct": { - "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "name": "Qwen 3 Next 80B Instruct", + "qwen3.5-122b-a10b": { + "id": "qwen3.5-122b-a10b", + "name": "Qwen3.5 122B-A10B", "family": "qwen", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-10", - "last_updated": "2025-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-23", + "last_updated": "2026-02-23", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.8, "cache_read": 0.05, "cache_write": 0.2 }, - "limit": { "context": 262144, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 3.2 + } }, - "Qwen/Qwen2.5-VL-32B-Instruct": { - "id": "Qwen/Qwen2.5-VL-32B-Instruct", - "name": "Qwen 2.5 VL 32B Instruct", + "qwen3-coder-plus": { + "id": "qwen3-coder-plus", + "name": "Qwen3 Coder Plus", "family": "qwen", "attachment": false, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.22, "cache_read": 0.025, "cache_write": 0.1 }, - "limit": { "context": 32000, "output": 4096 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi K2 Instruct", - "family": "kimi", - "attachment": false, - "reasoning": false, + "qwen3.6-27b": { + "id": "qwen3.6-27b", + "name": "Qwen3.6 27B", + "family": "qwen", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-09-05", - "last_updated": "2024-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.39, "output": 1.9, "cache_read": 0.195, "cache_write": 0.78 }, - "limit": { "context": 32768, "output": 4096 } + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, + "qwen3.5-27b": { + "id": "qwen3.5-27b", + "name": "Qwen3.5 27B", + "family": "qwen", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.55, "output": 2.25, "cache_read": 0.275, "cache_write": 1.1 }, - "limit": { "context": 32768, "output": 4096 } + "release_date": "2026-02-23", + "last_updated": "2026-02-23", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.4 + } }, - "mistralai/Devstral-Small-2505": { - "id": "mistralai/Devstral-Small-2505", - "name": "Devstral Small 2505", - "family": "devstral", + "qwen-vl-ocr": { + "id": "qwen-vl-ocr", + "name": "Qwen-VL OCR", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-05-01", - "last_updated": "2025-05-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-10-28", + "last_updated": "2025-04-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.22, "cache_read": 0.025, "cache_write": 0.1 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 34096, + "output": 4096 + }, + "cost": { + "input": 0.72, + "output": 0.72 + } }, - "mistralai/Mistral-Large-Instruct-2411": { - "id": "mistralai/Mistral-Large-Instruct-2411", - "name": "Mistral Large Instruct 2411", - "family": "mistral-large", + "qwen-omni-turbo-realtime": { + "id": "qwen-omni-turbo-realtime", + "name": "Qwen-Omni Turbo Realtime", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-05-08", + "last_updated": "2025-05-08", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text", "audio"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 1, "cache_write": 4 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0.27, + "output": 1.07, + "input_audio": 4.44, + "output_audio": 8.89 + } }, - "mistralai/Mistral-Nemo-Instruct-2407": { - "id": "mistralai/Mistral-Nemo-Instruct-2407", - "name": "Mistral Nemo Instruct 2407", - "family": "mistral-nemo", + "qwen3-8b": { + "id": "qwen3-8b", + "name": "Qwen3 8B", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-05", - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.04, "cache_read": 0.01, "cache_write": 0.04 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.18, + "output": 0.7, + "reasoning": 2.1 + } }, - "mistralai/Magistral-Small-2506": { - "id": "mistralai/Magistral-Small-2506", - "name": "Magistral Small 2506", - "family": "magistral-small", - "attachment": false, - "reasoning": false, + "qwen3.5-397b-a17b": { + "id": "qwen3.5-397b-a17b", + "name": "Qwen3.5 397B-A17B", + "family": "qwen", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5, "cache_read": 0.25, "cache_write": 1 }, - "limit": { "context": 128000, "output": 4096 } - } - } - }, - "cohere": { - "id": "cohere", - "env": ["COHERE_API_KEY"], - "npm": "@ai-sdk/cohere", - "name": "Cohere", - "doc": "https://docs.cohere.com/docs/models", - "models": { - "command-a-reasoning-08-2025": { - "id": "command-a-reasoning-08-2025", - "name": "Command A Reasoning", - "family": "command-a", + "release_date": "2026-02-15", + "last_updated": "2026-02-15", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } + }, + "qwq-plus": { + "id": "qwq-plus", + "name": "QwQ Plus", + "family": "qwen", "attachment": false, "reasoning": true, "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "output": 32000 } + "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 + }, + "cost": { + "input": 0.8, + "output": 2.4 + } }, - "command-r-08-2024": { - "id": "command-r-08-2024", - "name": "Command R", - "family": "command-r", + "qwen-vl-plus": { + "id": "qwen-vl-plus", + "name": "Qwen-VL Plus", + "family": "qwen", "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4000 } + "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 + }, + "cost": { + "input": 0.21, + "output": 0.63 + } }, - "command-a-translate-08-2025": { - "id": "command-a-translate-08-2025", - "name": "Command A Translate", - "family": "command-a", + "qwen3-livetranslate-flash-realtime": { + "id": "qwen3-livetranslate-flash-realtime", + "name": "Qwen3-LiveTranslate Flash Realtime", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-06-01", - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 8000, "output": 8000 } + "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 + }, + "cost": { + "input": 10, + "output": 10, + "input_audio": 10, + "output_audio": 38 + } }, - "command-a-03-2025": { - "id": "command-a-03-2025", - "name": "Command A", - "family": "command-a", + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3 32B", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-06-01", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "output": 8000 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 2.8, + "reasoning": 8.4 + } }, - "command-r-plus-08-2024": { - "id": "command-r-plus-08-2024", - "name": "Command R+", - "family": "command-r", + "qwen-max": { + "id": "qwen-max", + "name": "Qwen Max", + "family": "qwen", "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 4000 } + "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 + } }, - "c4ai-aya-expanse-32b": { - "id": "c4ai-aya-expanse-32b", - "name": "Aya Expanse 32B", + "qwen-plus": { + "id": "qwen-plus", + "name": "Qwen Plus", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "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 } + "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 + } }, - "command-a-vision-07-2025": { - "id": "command-a-vision-07-2025", - "name": "Command A Vision", - "family": "command-a", - "attachment": false, - "reasoning": false, - "tool_call": false, + "qwen3.6-35b-a3b": { + "id": "qwen3.6-35b-a3b", + "name": "Qwen3.6 35B-A3B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "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"] }, + "release_date": "2026-04-17", + "last_updated": "2026-04-17", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 8000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.248, + "output": 1.485 + } }, - "command-r7b-arabic-02-2025": { - "id": "command-r7b-arabic-02-2025", - "name": "Command R7B Arabic", - "family": "command-r", + "qwen-omni-turbo": { + "id": "qwen-omni-turbo", + "name": "Qwen-Omni Turbo", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": 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, - "cost": { "input": 0.0375, "output": 0.15 }, - "limit": { "context": 128000, "output": 4000 } + "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 + }, + "cost": { + "input": 0.07, + "output": 0.27, + "input_audio": 4.44, + "output_audio": 8.89 + } }, - "c4ai-aya-vision-8b": { - "id": "c4ai-aya-vision-8b", - "name": "Aya Vision 8B", - "attachment": true, - "reasoning": false, - "tool_call": false, + "qwen-flash": { + "id": "qwen-flash", + "name": "Qwen Flash", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, "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 } + "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 + } }, - "command-r7b-12-2024": { - "id": "command-r7b-12-2024", - "name": "Command R7B", - "family": "command-r", + "qwen2-5-vl-7b-instruct": { + "id": "qwen2-5-vl-7b-instruct", + "name": "Qwen2.5-VL 7B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-06-01", - "release_date": "2024-02-27", - "last_updated": "2024-02-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.0375, "output": 0.15 }, - "limit": { "context": 128000, "output": 4000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.35, + "output": 1.05 + } }, - "c4ai-aya-expanse-8b": { - "id": "c4ai-aya-expanse-8b", - "name": "Aya Expanse 8B", + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2024-10-24", - "last_updated": "2024-10-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 8000, "output": 4000 } + "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 + } + } }, - "c4ai-aya-vision-32b": { - "id": "c4ai-aya-vision-32b", - "name": "Aya Vision 32B", - "attachment": true, + "qwen3-max": { + "id": "qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "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 } - } - } - }, - "minimax-coding-plan": { - "id": "minimax-coding-plan", - "env": ["MINIMAX_API_KEY"], - "npm": "@ai-sdk/anthropic", - "api": "https://api.minimax.io/anthropic/v1", - "name": "MiniMax Coding Plan (minimax.io)", - "doc": "https://platform.minimax.io/docs/coding-plan/intro", - "models": { - "MiniMax-M2.7": { - "id": "MiniMax-M2.7", - "name": "MiniMax-M2.7", - "family": "minimax", + "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 + } + }, + "qwen3-omni-flash": { + "id": "qwen3-omni-flash", + "name": "Qwen3-Omni Flash", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "MiniMax-M2.1": { - "id": "MiniMax-M2.1", - "name": "MiniMax-M2.1", - "family": "minimax", + "qwen2-5-72b-instruct": { + "id": "qwen2-5-72b-instruct", + "name": "Qwen2.5 72B Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 1.4, + "output": 5.6 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "qwen3-vl-235b-a22b": { + "id": "qwen3-vl-235b-a22b", + "name": "Qwen3-VL 235B-A22B", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.7, + "output": 2.8, + "reasoning": 8.4 + } }, - "MiniMax-M2": { - "id": "MiniMax-M2", - "name": "MiniMax-M2", - "family": "minimax", + "qwen3-asr-flash": { + "id": "qwen3-asr-flash", + "name": "Qwen3-ASR Flash", + "family": "qwen", + "attachment": false, + "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 + }, + "cost": { + "input": 0.035, + "output": 0.035 + } + }, + "qwen3-next-80b-a3b-thinking": { + "id": "qwen3-next-80b-a3b-thinking", + "name": "Qwen3-Next 80B-A3B (Thinking)", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09", + "last_updated": "2025-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 196608, "output": 128000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 6 + } }, - "MiniMax-M2.5-highspeed": { - "id": "MiniMax-M2.5-highspeed", - "name": "MiniMax-M2.5-highspeed", - "family": "minimax", + "qwen-mt-plus": { + "id": "qwen-mt-plus", + "name": "Qwen-MT Plus", + "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "MiniMax-M2.7-highspeed": { - "id": "MiniMax-M2.7-highspeed", - "name": "MiniMax-M2.7-highspeed", - "family": "minimax", + "qwen-vl-max": { + "id": "qwen-vl-max", + "name": "Qwen-VL Max", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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": { - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, - "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"] }, + "knowledge": "2024-04", + "release_date": "2024-04-08", + "last_updated": "2025-08-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "ai-gateway-provider" } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 3.2 + } }, - "openai/o3-mini": { - "id": "openai/o3-mini", - "name": "o3-mini", - "family": "o-mini", + "qwen3-coder-flash": { + "id": "qwen3-coder-flash", + "name": "Qwen3 Coder Flash", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1.5 + } }, - "openai/gpt-4-turbo": { - "id": "openai/gpt-4-turbo", - "name": "GPT-4 Turbo", - "family": "gpt", - "attachment": true, + "qwen2-5-7b-instruct": { + "id": "qwen2-5-7b-instruct", + "name": "Qwen2.5 7B Instruct", + "family": "qwen", + "attachment": false, "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, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.175, + "output": 0.7 + } }, - "openai/gpt-4o": { - "id": "openai/gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "qwen2-5-14b-instruct": { + "id": "qwen2-5-14b-instruct", + "name": "Qwen2.5 14B Instruct", + "family": "qwen", + "attachment": false, "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, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.35, + "output": 1.4 + } }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, + "qwen2-5-32b-instruct": { + "id": "qwen2-5-32b-instruct", + "name": "Qwen2.5 32B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "ai-gateway-provider" } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.7, + "output": 2.8 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "GPT-4o mini", - "family": "gpt-mini", - "attachment": true, + "qwen3-next-80b-a3b-instruct": { + "id": "qwen3-next-80b-a3b-instruct", + "name": "Qwen3-Next 80B-A3B Instruct", + "family": "qwen", + "attachment": false, "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, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "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.5, + "output": 2 + } }, - "openai/gpt-3.5-turbo": { - "id": "openai/gpt-3.5-turbo", - "name": "GPT-3.5-turbo", - "family": "gpt", + "qwen-plus-character-ja": { + "id": "qwen-plus-character-ja", + "name": "Qwen Plus Character (Japanese)", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "knowledge": "2021-09-01", - "release_date": "2023-03-01", - "last_updated": "2023-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-01", + "last_updated": "2024-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 1.5, "cache_read": 1.25 }, - "limit": { "context": 16385, "output": 4096 } + "limit": { + "context": 8192, + "output": 512 + }, + "cost": { + "input": 0.5, + "output": 1.4 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", - "attachment": true, - "reasoning": true, + "qwen3-omni-flash-realtime": { + "id": "qwen3-omni-flash-realtime", + "name": "Qwen3-Omni Flash Realtime", + "family": "qwen", + "attachment": false, + "reasoning": false, "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"] }, + "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, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 }, - "provider": { "npm": "ai-gateway-provider" } + "limit": { + "context": 65536, + "output": 16384 + }, + "cost": { + "input": 0.52, + "output": 1.99, + "input_audio": 4.57, + "output_audio": 18.13 + } }, - "openai/o1": { - "id": "openai/o1", - "name": "o1", - "family": "o", - "attachment": true, + "qwen3-vl-30b-a3b": { + "id": "qwen3-vl-30b-a3b", + "name": "Qwen3-VL 30B-A3B", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "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 + } }, - "openai/o3": { - "id": "openai/o3", - "name": "o3", - "family": "o", - "attachment": true, + "qwen3-vl-plus": { + "id": "qwen3-vl-plus", + "name": "Qwen3-VL Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 1.6, + "reasoning": 4.8 + } }, - "openai/gpt-4": { - "id": "openai/gpt-4", - "name": "GPT-4", - "family": "gpt", - "attachment": true, + "qwen3-coder-480b-a35b-instruct": { + "id": "qwen3-coder-480b-a35b-instruct", + "name": "Qwen3-Coder 480B-A35B Instruct", + "family": "qwen", + "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, - "cost": { "input": 30, "output": 60 }, - "limit": { "context": 8192, "output": 8192 } + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 1.5, + "output": 7.5 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, - "reasoning": true, + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3-Coder 30B-A3B Instruct", + "family": "qwen", + "attachment": false, + "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "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 + }, + "cost": { + "input": 0.45, + "output": 2.25 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", - "attachment": true, + "qwen-turbo": { + "id": "qwen-turbo", + "name": "Qwen Turbo", + "family": "qwen", + "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-11-01", + "last_updated": "2025-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.2, + "reasoning": 0.5 + } }, - "openai/o3-pro": { - "id": "openai/o3-pro", - "name": "o3-pro", - "family": "o-pro", - "attachment": true, - "reasoning": true, - "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"] }, + "qwen-mt-turbo": { + "id": "qwen-mt-turbo", + "name": "Qwen-MT Turbo", + "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, - "cost": { "input": 20, "output": 80 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 16384, + "output": 8192 + }, + "cost": { + "input": 0.16, + "output": 0.49 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "o4-mini", - "family": "o-mini", - "attachment": true, + "qwen3.6-max-preview": { + "id": "qwen3.6-max-preview", + "name": "Qwen3.6 Max Preview", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } - }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } - }, - "anthropic/claude-3-opus": { - "id": "anthropic/claude-3-opus", - "name": "Claude Opus 3", - "family": "claude-opus", - "attachment": true, - "reasoning": false, - "tool_call": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-02-29", - "last_updated": "2024-02-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 1.3, + "output": 7.8, + "cache_read": 0.13, + "cache_write": 1.625 + } }, - "anthropic/claude-3-sonnet": { - "id": "anthropic/claude-3-sonnet", - "name": "Claude Sonnet 3", - "family": "claude-sonnet", - "attachment": true, + "qwen2-5-omni-7b": { + "id": "qwen2-5-omni-7b", + "name": "Qwen2.5-Omni 7B", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-03-04", - "last_updated": "2024-03-04", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "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 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "input_audio": 6.76 + } }, - "anthropic/claude-opus-4-5": { - "id": "anthropic/claude-opus-4-5", - "name": "Claude Opus 4.5 (latest)", - "family": "claude-opus", - "attachment": true, + "qwen3.5-plus": { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2025-04", + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2.4, + "reasoning": 2.4 + } }, - "anthropic/claude-opus-4-6": { - "id": "anthropic/claude-opus-4-6", - "name": "Claude Opus 4.6 (latest)", - "family": "claude-opus", - "attachment": true, - "reasoning": true, + "qwen2-5-vl-72b-instruct": { + "id": "qwen2-5-vl-72b-instruct", + "name": "Qwen2.5-VL 72B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "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, - "cost": { - "input": 5, - "output": 25, - "cache_read": 0.5, - "cache_write": 6.25, - "context_over_200k": { "input": 10, "output": 37.5, "cache_read": 1, "cache_write": 12.5 } + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 }, - "limit": { "context": 1000000, "output": 128000 } + "cost": { + "input": 2.8, + "output": 8.4 + } }, - "anthropic/claude-sonnet-4-6": { - "id": "anthropic/claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "qvq-max": { + "id": "qvq-max", + "name": "QVQ Max", + "family": "qvq", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2025-07-31", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 131072, + "output": 8192 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "ai-gateway-provider" } + "cost": { + "input": 1.2, + "output": 4.8 + } }, - "anthropic/claude-opus-4-1": { - "id": "anthropic/claude-opus-4-1", - "name": "Claude Opus 4.1 (latest)", - "family": "claude-opus", - "attachment": true, + "qwen3-14b": { + "id": "qwen3-14b", + "name": "Qwen3 14B", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.35, + "output": 1.4, + "reasoning": 4.2 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude Sonnet 4 (latest)", - "family": "claude-sonnet", + "qwen3.5-35b-a3b": { + "id": "qwen3.5-35b-a3b", + "name": "Qwen3.5 35B-A3B", + "family": "qwen", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-02-23", + "last_updated": "2026-02-23", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 2 + } + } + } + }, + "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": { + "qwen3-embedding-8b": { + "id": "qwen3-embedding-8b", + "name": "Qwen3 Embedding 8B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2025-25-11", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 32768, + "output": 4096 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "anthropic/claude-3.5-haiku": { - "id": "anthropic/claude-3.5-haiku", - "name": "Claude Haiku 3.5 (latest)", - "family": "claude-haiku", + "qwen3-235b-a22b-instruct-2507": { + "id": "qwen3-235b-a22b-instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "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, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2025-07-01", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 260000, + "output": 16384 + }, + "cost": { + "input": 0.75, + "output": 2.25 + } }, - "anthropic/claude-3-5-haiku": { - "id": "anthropic/claude-3-5-haiku", - "name": "Claude Haiku 3.5 (latest)", - "family": "claude-haiku", + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", "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, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "knowledge": "2023-12", + "release_date": "2024-12-06", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 100000, + "output": 16384 + }, + "cost": { + "input": 0.9, + "output": 0.9 + } }, - "anthropic/claude-sonnet-4-5": { - "id": "anthropic/claude-sonnet-4-5", - "name": "Claude Sonnet 4.5 (latest)", - "family": "claude-sonnet", - "attachment": true, + "qwen3.5-397b-a17b": { + "id": "qwen3.5-397b-a17b", + "name": "Qwen3.5 397B A17B", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-04", + "release_date": "2026-03-17", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "anthropic/claude-3.5-sonnet": { - "id": "anthropic/claude-3.5-sonnet", - "name": "Claude Sonnet 3.5 v2", - "family": "claude-sonnet", - "attachment": true, + "devstral-2-123b-instruct-2512": { + "id": "devstral-2-123b-instruct-2512", + "name": "Devstral 2 123B Instruct (2512)", + "family": "devstral", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04-30", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2026-01-07", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "anthropic/claude-3-haiku": { - "id": "anthropic/claude-3-haiku", - "name": "Claude Haiku 3", - "family": "claude-haiku", + "deepseek-r1-distill-llama-70b": { + "id": "deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 8196 + }, + "cost": { + "input": 0.9, + "output": 0.9 + } + }, + "pixtral-12b-2409": { + "id": "pixtral-12b-2409", + "name": "Pixtral 12B 2409", + "family": "pixtral", "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, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "release_date": "2024-09-25", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "anthropic/claude-haiku-4-5": { - "id": "anthropic/claude-haiku-4-5", - "name": "Claude Haiku 4.5 (latest)", - "family": "claude-haiku", + "whisper-large-v3": { + "id": "whisper-large-v3", + "name": "Whisper Large v3", + "family": "whisper", + "attachment": false, + "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 + }, + "cost": { + "input": 0.003, + "output": 0 + } + }, + "voxtral-small-24b-2507": { + "id": "voxtral-small-24b-2507", + "name": "Voxtral Small 24B 2507", + "family": "voxtral", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-07-01", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.35 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Claude Opus 4 (latest)", - "family": "claude-opus", + "gemma-3-27b-it": { + "id": "gemma-3-27b-it", + "name": "Gemma-3-27B-IT", + "family": "gemma", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 40000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.5 + } }, - "workers-ai/@cf/openai/gpt-oss-120b": { - "id": "workers-ai/@cf/openai/gpt-oss-120b", - "name": "GPT OSS 120B", + "bge-multilingual-gemma2": { + "id": "bge-multilingual-gemma2", + "name": "BGE Multilingual Gemma2", + "family": "gemma", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-07-26", + "last_updated": "2025-06-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 0.75 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 8191, + "output": 3072 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "workers-ai/@cf/openai/gpt-oss-20b": { - "id": "workers-ai/@cf/openai/gpt-oss-20b", - "name": "GPT OSS 20B", + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3-Coder 30B-A3B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.3 }, - "limit": { "context": 128000, "output": 16384 } - }, - "workers-ai/@cf/zai-org/glm-4.7-flash": { - "id": "workers-ai/@cf/zai-org/glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", - "attachment": false, - "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.4 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "workers-ai/@cf/nvidia/nemotron-3-120b-a12b": { - "id": "workers-ai/@cf/nvidia/nemotron-3-120b-a12b", - "name": "Nemotron 3 Super 120B", - "family": "nemotron", + "mistral-small-3.2-24b-instruct-2506": { + "id": "mistral-small-3.2-24b-instruct-2506", + "name": "Mistral Small 3.2 24B Instruct (2506)", + "family": "mistral-small", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-06-20", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.35 + } }, - "workers-ai/@cf/myshell-ai/melotts": { - "id": "workers-ai/@cf/myshell-ai/melotts", - "name": "MyShell MeloTTS", - "family": "melotts", - "attachment": false, + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT-OSS 120B", + "family": "gpt-oss", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2024-01-01", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "workers-ai/@cf/google/gemma-3-12b-it": { - "id": "workers-ai/@cf/google/gemma-3-12b-it", - "name": "Gemma 3 12B IT", - "family": "gemma", - "attachment": false, + "mistral-nemo-instruct-2407": { + "id": "mistral-nemo-instruct-2407", + "name": "Mistral Nemo Instruct 2407", + "family": "mistral-nemo", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.35, "output": 0.56 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2024-07-25", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "workers-ai/@cf/ibm-granite/granite-4.0-h-micro": { - "id": "workers-ai/@cf/ibm-granite/granite-4.0-h-micro", - "name": "IBM Granite 4.0 H Micro", - "family": "granite", + "llama-3.1-8b-instruct": { + "id": "llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.017, "output": 0.11 }, - "limit": { "context": 128000, "output": 16384 } - }, - "workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B": { - "id": "workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B", - "name": "IndicTrans2 EN-Indic 1B", - "family": "indictrans", + "knowledge": "2023-12", + "release_date": "2025-01-01", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + } + } + }, + "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": { + "glm-4-flash": { + "id": "glm-4-flash", + "name": "GLM-4 Flash", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-08-01", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.34, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 0.1003, + "output": 0.1003 + } }, - "workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": { - "id": "workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "name": "DeepSeek R1 Distill Qwen 32B", - "family": "deepseek-thinking", + "Meta-Llama-3-1-8B-Instruct-FP8": { + "id": "Meta-Llama-3-1-8B-Instruct-FP8", + "name": "Llama 3.1 8B (decentralized)", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 4.88 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0.03 + } }, - "workers-ai/@cf/qwen/qwq-32b": { - "id": "workers-ai/@cf/qwen/qwq-32b", - "name": "QwQ 32B", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "claude-opus-4-thinking:32000": { + "id": "claude-opus-4-thinking:32000", + "name": "Claude 4 Opus Thinking (32K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.66, "output": 1 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } }, - "workers-ai/@cf/qwen/qwen3-30b-a3b-fp8": { - "id": "workers-ai/@cf/qwen/qwen3-30b-a3b-fp8", - "name": "Qwen3 30B A3B FP8", - "family": "qwen", - "attachment": false, - "reasoning": false, + "gemini-2.5-pro-preview-05-06": { + "id": "gemini-2.5-pro-preview-05-06", + "name": "Gemini 2.5 Pro Preview 0506", + "attachment": true, + "reasoning": true, "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-05-06", + "last_updated": "2025-05-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.051, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "workers-ai/@cf/qwen/qwen3-embedding-0.6b": { - "id": "workers-ai/@cf/qwen/qwen3-embedding-0.6b", - "name": "Qwen3 Embedding 0.6B", - "family": "qwen", + "grok-3-mini-fast-beta": { + "id": "grok-3-mini-fast-beta", + "name": "Grok 3 Mini Fast Beta", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.012, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 131072, + "input": 131072, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 4 + } }, - "workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct": { - "id": "workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct", - "name": "Qwen 2.5 Coder 32B Instruct", - "family": "qwen", + "MiniMax-M2": { + "id": "MiniMax-M2", + "name": "MiniMax M2", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, - "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-10-25", + "last_updated": "2025-10-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.66, "output": 1 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "input": 200000, + "output": 131072 + }, + "cost": { + "input": 0.17, + "output": 1.53 + } }, - "workers-ai/@cf/huggingface/distilbert-sst-2-int8": { - "id": "workers-ai/@cf/huggingface/distilbert-sst-2-int8", - "name": "DistilBERT SST-2 INT8", - "family": "distilbert", + "command-a-reasoning-08-2025": { + "id": "command-a-reasoning-08-2025", + "name": "Cohere Command A (08/2025)", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-08-22", + "last_updated": "2025-08-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.026, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "input": 256000, + "output": 8192 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "workers-ai/@cf/facebook/bart-large-cnn": { - "id": "workers-ai/@cf/facebook/bart-large-cnn", - "name": "BART Large CNN", - "family": "bart", + "brave": { + "id": "brave", + "name": "Brave (Answers)", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-09", - "last_updated": "2025-04-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2023-03-02", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 8192, + "input": 8192, + "output": 8192 + }, + "cost": { + "input": 5, + "output": 5 + } }, - "workers-ai/@cf/baai/bge-base-en-v1.5": { - "id": "workers-ai/@cf/baai/bge-base-en-v1.5", - "name": "BGE Base EN v1.5", - "family": "bge", + "exa-research": { + "id": "exa-research", + "name": "Exa (Research)", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-06-04", + "last_updated": "2025-06-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.067, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 8192, + "input": 8192, + "output": 8192 + }, + "cost": { + "input": 2.5, + "output": 2.5 + } }, - "workers-ai/@cf/baai/bge-small-en-v1.5": { - "id": "workers-ai/@cf/baai/bge-small-en-v1.5", - "name": "BGE Small EN v1.5", - "family": "bge", + "Llama-3.3-70B-Nova": { + "id": "Llama-3.3-70B-Nova", + "name": "Llama 3.3 70B Nova", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "workers-ai/@cf/baai/bge-large-en-v1.5": { - "id": "workers-ai/@cf/baai/bge-large-en-v1.5", - "name": "BGE Large EN v1.5", - "family": "bge", - "attachment": false, + "gemini-exp-1206": { + "id": "gemini-exp-1206", + "name": "Gemini 2.0 Pro 1206", + "attachment": true, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 2097152, + "input": 2097152, + "output": 8192 + }, + "cost": { + "input": 1.258, + "output": 4.998 + } }, - "workers-ai/@cf/baai/bge-reranker-base": { - "id": "workers-ai/@cf/baai/bge-reranker-base", - "name": "BGE Reranker Base", - "family": "bge", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-09", - "last_updated": "2025-04-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "Claude 4.5 Opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-11-01", + "last_updated": "2025-11-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.0031, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } }, - "workers-ai/@cf/baai/bge-m3": { - "id": "workers-ai/@cf/baai/bge-m3", - "name": "BGE M3", - "family": "bge", + "auto-model-basic": { + "id": "auto-model-basic", + "name": "Auto model (Basic)", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.012, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 1000000 + }, + "cost": { + "input": 9.996, + "output": 19.992 + } }, - "workers-ai/@cf/pipecat-ai/smart-turn-v2": { - "id": "workers-ai/@cf/pipecat-ai/smart-turn-v2", - "name": "Pipecat Smart Turn v2", - "family": "smart-turn", + "jamba-mini": { + "id": "jamba-mini", + "name": "Jamba Mini", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "input": 256000, + "output": 4096 + }, + "cost": { + "input": 0.1989, + "output": 0.408 + } }, - "workers-ai/@cf/moonshotai/kimi-k2.5": { - "id": "workers-ai/@cf/moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "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)", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 256000, "output": 256000 } - }, - "workers-ai/@cf/deepgram/aura-2-en": { - "id": "workers-ai/@cf/deepgram/aura-2-en", - "name": "Deepgram Aura 2 (EN)", - "family": "aura", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "workers-ai/@cf/deepgram/nova-3": { - "id": "workers-ai/@cf/deepgram/nova-3", - "name": "Deepgram Nova 3", - "family": "nova", + "yi-large": { + "id": "yi-large", + "name": "Yi Large", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32000, + "input": 32000, + "output": 4096 + }, + "cost": { + "input": 3.196, + "output": 3.196 + } }, - "workers-ai/@cf/deepgram/aura-2-es": { - "id": "workers-ai/@cf/deepgram/aura-2-es", - "name": "Deepgram Aura 2 (ES)", - "family": "aura", + "auto-model-premium": { + "id": "auto-model-premium", + "name": "Auto model (Premium)", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 1000000 + }, + "cost": { + "input": 9.996, + "output": 19.992 + } }, - "workers-ai/@cf/mistral/mistral-7b-instruct-v0.1": { - "id": "workers-ai/@cf/mistral/mistral-7b-instruct-v0.1", - "name": "Mistral 7B Instruct v0.1", - "family": "mistral", - "attachment": false, + "azure-gpt-4o": { + "id": "azure-gpt-4o", + "name": "Azure gpt-4o", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.11, "output": 0.19 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 2.499, + "output": 9.996 + } }, - "workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it": { - "id": "workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it", - "name": "Gemma SEA-LION v4 27B IT", - "family": "gemma", + "deepseek-v3-0324": { + "id": "deepseek-v3-0324", + "name": "DeepSeek Chat 0324", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 0.56 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.7 + } }, - "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast": { - "id": "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast", - "name": "Llama 3.3 70B Instruct FP8 Fast", - "family": "llama", - "attachment": false, + "claude-3-5-haiku-20241022": { + "id": "claude-3-5-haiku-20241022", + "name": "Claude 3.5 Haiku", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 2.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "input": 200000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 4 + } }, - "workers-ai/@cf/meta/llama-3-8b-instruct-awq": { - "id": "workers-ai/@cf/meta/llama-3-8b-instruct-awq", - "name": "Llama 3 8B Instruct AWQ", - "family": "llama", + "doubao-seed-1-8-251215": { + "id": "doubao-seed-1-8-251215", + "name": "Doubao Seed 1.8", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-12-15", + "last_updated": "2025-12-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 0.27 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.612, + "output": 6.12 + } }, - "workers-ai/@cf/meta/llama-3.2-1b-instruct": { - "id": "workers-ai/@cf/meta/llama-3.2-1b-instruct", - "name": "Llama 3.2 1B Instruct", - "family": "llama", + "doubao-seed-1-6-250615": { + "id": "doubao-seed-1-6-250615", + "name": "Doubao Seed 1.6", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-06-15", + "last_updated": "2025-06-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.027, "output": 0.2 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.204, + "output": 0.51 + } }, - "workers-ai/@cf/meta/m2m100-1.2b": { - "id": "workers-ai/@cf/meta/m2m100-1.2b", - "name": "M2M100 1.2B", - "family": "m2m", - "attachment": false, + "ernie-x1.1-preview": { + "id": "ernie-x1.1-preview", + "name": "ERNIE X1.1", + "attachment": true, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-09-10", + "last_updated": "2025-09-10", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.34, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 64000, + "input": 64000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "workers-ai/@cf/meta/llama-3.1-8b-instruct": { - "id": "workers-ai/@cf/meta/llama-3.1-8b-instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "ernie-5.0-thinking-preview": { + "id": "ernie-5.0-thinking-preview", + "name": "Ernie 5.0 Thinking Preview", + "attachment": true, + "reasoning": true, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 0.8299999999999998 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 1.1, + "output": 2 + } }, - "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct": { - "id": "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17B 16E Instruct", - "family": "llama", + "glm-4-air-0111": { + "id": "glm-4-air-0111", + "name": "GLM 4 Air 0111", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-01-11", + "last_updated": "2025-01-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.85 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 0.1394, + "output": 0.1394 + } }, - "workers-ai/@cf/meta/llama-3.2-11b-vision-instruct": { - "id": "workers-ai/@cf/meta/llama-3.2-11b-vision-instruct", - "name": "Llama 3.2 11B Vision Instruct", - "family": "llama", + "fastgpt": { + "id": "fastgpt", + "name": "Web Answer", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2023-08-01", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.049, "output": 0.68 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 7.5, + "output": 7.5 + } }, - "workers-ai/@cf/meta/llama-3-8b-instruct": { - "id": "workers-ai/@cf/meta/llama-3-8b-instruct", - "name": "Llama 3 8B Instruct", - "family": "llama", + "doubao-seed-1-6-thinking-250615": { + "id": "doubao-seed-1-6-thinking-250615", + "name": "Doubao Seed 1.6 Thinking", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-06-15", + "last_updated": "2025-06-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 0.83 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.204, + "output": 2.04 + } }, - "workers-ai/@cf/meta/llama-guard-3-8b": { - "id": "workers-ai/@cf/meta/llama-guard-3-8b", - "name": "Llama Guard 3 8B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "gemini-2.0-flash-001": { + "id": "gemini-2.0-flash-001", + "name": "Gemini 2.0 Flash", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.48, "output": 0.03 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 8192 + }, + "cost": { + "input": 0.1003, + "output": 0.408 + } }, - "workers-ai/@cf/meta/llama-3.2-3b-instruct": { - "id": "workers-ai/@cf/meta/llama-3.2-3b-instruct", - "name": "Llama 3.2 3B Instruct", - "family": "llama", + "claude-opus-4-1-thinking:32000": { + "id": "claude-opus-4-1-thinking:32000", + "name": "Claude 4.1 Opus Thinking (32K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "Llama-3.3-70B-RAWMAW": { + "id": "Llama-3.3-70B-RAWMAW", + "name": "Llama 3.3 70B RAWMAW", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.051, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "workers-ai/@cf/meta/llama-3.1-8b-instruct-awq": { - "id": "workers-ai/@cf/meta/llama-3.1-8b-instruct-awq", - "name": "Llama 3.1 8B Instruct AWQ", - "family": "llama", + "GLM-4.5-Air-Derestricted-Steam": { + "id": "GLM-4.5-Air-Derestricted-Steam", + "name": "GLM 4.5 Air Derestricted Steam", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 220600, + "input": 220600, + "output": 65536 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "claude-3-5-sonnet-20241022": { + "id": "claude-3-5-sonnet-20241022", + "name": "Claude 3.5 Sonnet", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 0.27 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "input": 200000, + "output": 8192 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8": { - "id": "workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8", - "name": "Llama 3.1 8B Instruct FP8", - "family": "llama", + "yi-medium-200k": { + "id": "yi-medium-200k", + "name": "Yi Medium 200k", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-03-01", + "last_updated": "2024-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.29 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "input": 200000, + "output": 4096 + }, + "cost": { + "input": 2.499, + "output": 2.499 + } }, - "workers-ai/@cf/meta/llama-2-7b-chat-fp16": { - "id": "workers-ai/@cf/meta/llama-2-7b-chat-fp16", - "name": "Llama 2 7B Chat FP16", - "family": "llama", + "Gemma-3-27B-ArliAI-RPMax-v3": { + "id": "Gemma-3-27B-ArliAI-RPMax-v3", + "name": "Gemma 3 27B RPMax v3", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-07-03", + "last_updated": "2025-07-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.56, "output": 6.67 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "workers-ai/@cf/pfnet/plamo-embedding-1b": { - "id": "workers-ai/@cf/pfnet/plamo-embedding-1b", - "name": "PLaMo Embedding 1B", - "family": "plamo", + "phi-4-mini-instruct": { + "id": "phi-4-mini-instruct", + "name": "Phi 4 Mini", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-07-26", + "last_updated": "2025-07-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.019, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } }, - "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct": { - "id": "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct", - "name": "Mistral Small 3.1 24B Instruct", - "family": "mistral-small", + "Llama-3.3+(3v3.3)-70B-TenyxChat-DaybreakStorywriter": { + "id": "Llama-3.3+(3v3.3)-70B-TenyxChat-DaybreakStorywriter", + "name": "Llama 3.3+ 70B TenyxChat DaybreakStorywriter", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 0.56 }, - "limit": { "context": 128000, "output": 16384 } - } - } - }, - "wandb": { - "id": "wandb", - "env": ["WANDB_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://api.inference.wandb.ai/v1", - "name": "Weights & Biases", - "doc": "https://docs.wandb.ai/guides/integrations/inference/", - "models": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "gpt-oss-120b", - "family": "gpt-oss", - "attachment": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "ernie-x1-32k": { + "id": "ernie-x1-32k", + "name": "Ernie X1 32k", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-05-08", + "last_updated": "2025-05-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 16384 + }, + "cost": { + "input": 0.33, + "output": 1.32 + } + }, + "deepseek-chat": { + "id": "deepseek-chat", + "name": "DeepSeek V3/Deepseek Chat", + "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-02-27", + "last_updated": "2025-02-27", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.7 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "gpt-oss-20b", - "family": "gpt-oss", + "glm-z1-air": { + "id": "glm-z1-air", + "name": "GLM Z1 Air", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 32000, + "input": 32000, + "output": 16384 + }, + "cost": { + "input": 0.07, + "output": 0.07 + } }, - "microsoft/Phi-4-mini-instruct": { - "id": "microsoft/Phi-4-mini-instruct", - "name": "Phi-4-mini-instruct", - "family": "phi", - "attachment": false, + "claude-3-7-sonnet-thinking:128000": { + "id": "claude-3-7-sonnet-thinking:128000", + "name": "Claude 3.7 Sonnet Thinking (128K)", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.08, "output": 0.35 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "zai-org/GLM-5-FP8": { - "id": "zai-org/GLM-5-FP8", - "name": "GLM 5", - "family": "glm", + "glm-4-air": { + "id": "glm-4-air", + "name": "GLM-4 Air", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 200000, "output": 200000 } + "tool_call": false, + "structured_output": false, + "release_date": "2024-06-05", + "last_updated": "2024-06-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 0.2006, + "output": 0.2006 + } }, - "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8": { - "id": "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8", - "name": "NVIDIA Nemotron 3 Super 120B", - "family": "nemotron", + "Llama-3.3-70B-MiraiFanfare": { + "id": "Llama-3.3-70B-MiraiFanfare", + "name": "Llama 3.3 70b Mirai Fanfare", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262144, "output": 262144 } + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-26", + "last_updated": "2025-07-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.493, + "output": 0.493 + } }, - "OpenPipe/Qwen3-14B-Instruct": { - "id": "OpenPipe/Qwen3-14B-Instruct", - "name": "OpenPipe Qwen3 14B Instruct", - "family": "qwen", + "gemini-2.0-flash-thinking-exp-01-21": { + "id": "gemini-2.0-flash-thinking-exp-01-21", + "name": "Gemini 2.0 Flash Thinking 0121", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-21", + "last_updated": "2025-01-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 8192 + }, + "cost": { + "input": 0.306, + "output": 1.003 + } + }, + "Magistral-Small-2506": { + "id": "Magistral-Small-2506", + "name": "Magistral Small 2506", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.22 }, - "limit": { "context": 32768, "output": 32768 } + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.4 + } }, - "meta-llama/Llama-4-Scout-17B-16E-Instruct": { - "id": "meta-llama/Llama-4-Scout-17B-16E-Instruct", - "name": "Llama 4 Scout 17B 16E Instruct", - "family": "llama", + "doubao-1.5-pro-32k": { + "id": "doubao-1.5-pro-32k", + "name": "Doubao 1.5 Pro 32k", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-31", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.17, "output": 0.66 }, - "limit": { "context": 64000, "output": 64000 } + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-22", + "last_updated": "2025-01-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8192 + }, + "cost": { + "input": 0.1343, + "output": 0.3349 + } }, - "meta-llama/Llama-3.1-8B-Instruct": { - "id": "meta-llama/Llama-3.1-8B-Instruct", - "name": "Meta-Llama-3.1-8B-Instruct", - "family": "llama", + "venice-uncensored:web": { + "id": "venice-uncensored:web", + "name": "Venice Uncensored Web", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-07-23", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 0.22 }, - "limit": { "context": 128000, "output": 128000 } + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-05-01", + "last_updated": "2024-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 80000, + "input": 80000, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", + "glm-4": { + "id": "glm-4", + "name": "GLM-4", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-12-06", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.71, "output": 0.71 }, - "limit": { "context": 128000, "output": 128000 } + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-01-16", + "last_updated": "2024-01-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 14.994, + "output": 14.994 + } }, - "meta-llama/Llama-3.1-70B-Instruct": { - "id": "meta-llama/Llama-3.1-70B-Instruct", - "name": "Llama 3.1 70B", - "family": "llama", + "qwen-max": { + "id": "qwen-max", + "name": "Qwen 2.5 Max", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.8, "output": 0.8 }, - "limit": { "context": 128000, "output": 128000 } + "tool_call": false, + "structured_output": false, + "release_date": "2024-04-03", + "last_updated": "2024-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8192 + }, + "cost": { + "input": 1.5997, + "output": 6.392 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "qwen3-vl-235b-a22b-instruct-original": { + "id": "qwen3-vl-235b-a22b-instruct-original", + "name": "Qwen3 VL 235B A22B Instruct Original", + "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196608, "output": 196608 } + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 1.2 + } }, - "deepseek-ai/DeepSeek-V3.1": { - "id": "deepseek-ai/DeepSeek-V3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "jamba-large-1.6": { + "id": "jamba-large-1.6", + "name": "Jamba Large 1.6", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-08-21", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 1.65 }, - "limit": { "context": 161000, "output": 161000 } + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-12", + "last_updated": "2025-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 4096 + }, + "cost": { + "input": 1.989, + "output": 7.99 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen3-235B-A22B-Thinking-2507", - "family": "qwen", + "qwen-plus": { + "id": "qwen-plus", + "name": "Qwen Plus", "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-25", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "tool_call": false, + "structured_output": false, + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 995904, + "input": 995904, + "output": 32768 + }, + "cost": { + "input": 0.3995, + "output": 1.2002 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "name": "Qwen3-Coder-480B-A35B-Instruct", - "family": "qwen", - "attachment": false, + "qwen25-vl-72b-instruct": { + "id": "qwen25-vl-72b-instruct", + "name": "Qwen25 VL 72b", + "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": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 32768 + }, + "cost": { + "input": 0.69989, + "output": 0.69989 + } + }, + "claude-sonnet-4-thinking:64000": { + "id": "claude-sonnet-4-thinking:64000", + "name": "Claude 4 Sonnet Thinking (64K)", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 1.5 }, - "limit": { "context": 262144, "output": 262144 } - }, - "Qwen/Qwen3-30B-A3B-Instruct-2507": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-07-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262144, "output": 262144 } - }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-28", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "Gemini 3 Pro", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, - "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2.85 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "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.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1048576, "output": 64000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12 + } }, - "qwen3-235b-a22b-instruct-2507": { - "id": "qwen3-235b-a22b-instruct-2507", - "name": "Qwen3 235b A22B Instruct 2507", + "Llama-3.3+(3.1v3.3)-70B-New-Dawn-v1.1": { + "id": "Llama-3.3+(3.1v3.3)-70B-New-Dawn-v1.1", + "name": "Llama 3.3+ 70B New Dawn v1.1", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-12", - "last_updated": "2025-08-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 262144, "output": 64000 } - }, - "claude-4.5-opus": { - "id": "claude-4.5-opus", - "name": "Claude 4.5 Opus", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-11-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 200000, "output": 200000 } - }, - "doubao-1.5-vision-pro": { - "id": "doubao-1.5-vision-pro", - "name": "Doubao 1.5 Vision Pro", - "attachment": true, - "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "qwen-turbo": { - "id": "qwen-turbo", - "name": "Qwen-Turbo", + "GLM-4.5-Air-Derestricted-Iceblink-ReExtract": { + "id": "GLM-4.5-Air-Derestricted-Iceblink-ReExtract", + "name": "GLM 4.5 Air Derestricted Iceblink ReExtract", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-12", + "last_updated": "2025-12-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1000000, "output": 4096 } + "limit": { + "context": 131072, + "input": 131072, + "output": 98304 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "deepseek-v3-0324": { - "id": "deepseek-v3-0324", - "name": "DeepSeek-V3-0324", + "universal-summarizer": { + "id": "universal-summarizer", + "name": "Universal Summarizer", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-05-01", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 30, + "output": 30 + } }, - "deepseek-r1": { - "id": "deepseek-r1", - "name": "DeepSeek-R1", - "attachment": false, + "claude-sonnet-4-thinking:32768": { + "id": "claude-sonnet-4-thinking:32768", + "name": "Claude 4 Sonnet Thinking (32K)", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "qwen3-max-preview": { - "id": "qwen3-max-preview", - "name": "Qwen3 Max Preview", + "sarvan-medium": { + "id": "sarvan-medium", + "name": "Sarvam Medium", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-06", - "last_updated": "2025-09-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.25, + "output": 0.75 + } }, - "claude-4.0-sonnet": { - "id": "claude-4.0-sonnet", - "name": "Claude 4.0 Sonnet", + "claude-3-7-sonnet-thinking:8192": { + "id": "claude-3-7-sonnet-thinking:8192", + "name": "Claude 3.7 Sonnet Thinking (8K)", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 200000, "output": 64000 } - }, - "doubao-1.5-pro-32k": { - "id": "doubao-1.5-pro-32k", - "name": "Doubao 1.5 Pro 32k", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 12000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "gemini-3.0-flash-preview": { - "id": "gemini-3.0-flash-preview", - "name": "Gemini 3.0 Flash Preview", + "gemini-2.5-flash-preview-05-20": { + "id": "gemini-2.5-flash-preview-05-20", + "name": "Gemini 2.5 Flash 0520", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 1048000, + "input": 1048000, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "deepseek-v3": { - "id": "deepseek-v3", - "name": "DeepSeek-V3", + "GLM-4.5-Air-Derestricted-Iceblink-v2-ReExtract": { + "id": "GLM-4.5-Air-Derestricted-Iceblink-v2-ReExtract", + "name": "GLM 4.5 Air Derestricted Iceblink v2 ReExtract", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-08-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-12", + "last_updated": "2025-12-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 131072, + "input": 131072, + "output": 65536 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "MiniMax-M1": { - "id": "MiniMax-M1", - "name": "MiniMax M1", + "Llama-3.3-70B-Fallen-v1": { + "id": "Llama-3.3-70B-Fallen-v1", + "name": "Llama 3.3 70B Fallen v1", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1000000, "output": 80000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "gemini-3.0-pro-image-preview": { - "id": "gemini-3.0-pro-image-preview", - "name": "Gemini 3.0 Pro Image Preview", + "qwen3-vl-235b-a22b-thinking": { + "id": "qwen3-vl-235b-a22b-thinking", + "name": "Qwen3 VL 235B A22B Thinking", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 6 + } }, - "doubao-seed-2.0-lite": { - "id": "doubao-seed-2.0-lite", - "name": "Doubao Seed 2.0 Lite", + "claude-3-7-sonnet-thinking:32768": { + "id": "claude-3-7-sonnet-thinking:32768", + "name": "Claude 3.7 Sonnet Thinking (32K)", "attachment": true, "reasoning": true, "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"] }, + "structured_output": true, + "release_date": "2025-07-15", + "last_updated": "2025-07-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "doubao-seed-2.0-mini": { - "id": "doubao-seed-2.0-mini", - "name": "Doubao Seed 2.0 Mini", + "claude-3-7-sonnet-thinking:1024": { + "id": "claude-3-7-sonnet-thinking:1024", + "name": "Claude 3.7 Sonnet Thinking (1K)", "attachment": true, "reasoning": true, "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"] }, + "structured_output": true, + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "qwen3-30b-a3b-thinking-2507": { - "id": "qwen3-30b-a3b-thinking-2507", - "name": "Qwen3 30b A3b Thinking 2507", - "attachment": false, - "reasoning": true, + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "attachment": true, + "reasoning": false, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2026-02-04", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 126000, "output": 32000 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "kimi-k2": { - "id": "kimi-k2", - "name": "Kimi K2", + "Llama-3.3-70B-Vulpecula-R1": { + "id": "Llama-3.3-70B-Vulpecula-R1", + "name": "Llama 3.3 70B Vulpecula R1", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "qwen3-30b-a3b": { - "id": "qwen3-30b-a3b", - "name": "Qwen3 30B A3B", - "attachment": false, + "claude-sonnet-4-thinking:8192": { + "id": "claude-sonnet-4-thinking:8192", + "name": "Claude 4 Sonnet Thinking (8K)", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 40000, "output": 4096 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "doubao-seed-2.0-pro": { - "id": "doubao-seed-2.0-pro", - "name": "Doubao Seed 2.0 Pro", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 128000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "gpt-oss-120b", + "Llama-3.3-70B-Ignition-v0.1": { + "id": "Llama-3.3-70B-Ignition-v0.1", + "name": "Llama 3.3 70B Ignition v0.1", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "gemini-2.0-flash-lite": { - "id": "gemini-2.0-flash-lite", - "name": "Gemini 2.0 Flash Lite", - "attachment": true, - "reasoning": true, - "tool_call": true, + "glm-4-plus-0111": { + "id": "glm-4-plus-0111", + "name": "GLM 4 Plus 0111", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1048576, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 9.996, + "output": 9.996 + } }, - "doubao-seed-2.0-code": { - "id": "doubao-seed-2.0-code", - "name": "Doubao Seed 2.0 Code", - "attachment": true, - "reasoning": true, - "tool_call": true, + "KAT-Coder-Air-V1": { + "id": "KAT-Coder-Air-V1", + "name": "KAT Coder Air V1", + "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", "image", "video"], "output": ["text"] }, + "release_date": "2025-10-28", + "last_updated": "2025-10-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 128000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.2 + } }, - "doubao-seed-1.6": { - "id": "doubao-seed-1.6", - "name": "Doubao-Seed 1.6", - "attachment": true, - "reasoning": true, - "tool_call": true, + "deepseek-r1-sambanova": { + "id": "deepseek-r1-sambanova", + "name": "DeepSeek R1 Fast", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-15", - "last_updated": "2025-08-15", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-02-20", + "last_updated": "2025-02-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 4.998, + "output": 6.987 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM 4.5", + "deepseek-r1": { + "id": "deepseek-r1", + "name": "DeepSeek R1", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.4, + "output": 1.7 + } }, - "qwen2.5-vl-72b-instruct": { - "id": "qwen2.5-vl-72b-instruct", - "name": "Qwen 2.5 VL 72B Instruct", + "doubao-1-5-thinking-pro-250415": { + "id": "doubao-1-5-thinking-pro-250415", + "name": "Doubao 1.5 Thinking Pro", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2025-04-17", + "last_updated": "2025-04-17", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.4 + } }, - "claude-3.7-sonnet": { - "id": "claude-3.7-sonnet", - "name": "Claude 3.7 Sonnet", - "attachment": true, - "reasoning": true, - "tool_call": true, + "sonar-pro": { + "id": "sonar-pro", + "name": "Perplexity Pro", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 128000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "doubao-seed-1.6-flash": { - "id": "doubao-seed-1.6-flash", - "name": "Doubao-Seed 1.6 Flash", - "attachment": true, - "reasoning": true, - "tool_call": true, + "Gemma-3-27B-it-Abliterated": { + "id": "Gemma-3-27B-it-Abliterated", + "name": "Gemma 3 27B IT Abliterated", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-15", - "last_updated": "2025-08-15", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-07-03", + "last_updated": "2025-07-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 96000 + }, + "cost": { + "input": 0.42, + "output": 0.42 + } }, - "gemini-3.0-pro-preview": { - "id": "gemini-3.0-pro-preview", - "name": "Gemini 3.0 Pro Preview", + "deepseek-chat-cheaper": { + "id": "deepseek-chat-cheaper", + "name": "DeepSeek V3/Chat Cheaper", "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image", "video", "pdf", "audio"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 1000000, "output": 64000 } - }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-14", - "last_updated": "2025-08-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 262000, "output": 4096 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.7 + } }, - "qwen3-next-80b-a3b-thinking": { - "id": "qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", - "attachment": false, - "reasoning": true, - "tool_call": true, + "gemini-2.0-pro-exp-02-05": { + "id": "gemini-2.0-pro-exp-02-05", + "name": "Gemini 2.0 Pro 0205", + "attachment": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-12", - "last_updated": "2025-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-02-05", + "last_updated": "2025-02-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 2097152, + "input": 2097152, + "output": 8192 + }, + "cost": { + "input": 1.989, + "output": 7.956 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", + "azure-gpt-4o-mini": { + "id": "azure-gpt-4o-mini", + "name": "Azure gpt-4o-mini", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "structured_output": true, + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.1496, + "output": 0.595 + } }, - "qwen-max-2025-01-25": { - "id": "qwen-max-2025-01-25", - "name": "Qwen2.5-Max-2025-01-25", + "Llama-3.3-70B-MS-Nevoria": { + "id": "Llama-3.3-70B-MS-Nevoria", + "name": "Llama 3.3 70B MS Nevoria", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "claude-4.0-opus": { - "id": "claude-4.0-opus", - "name": "Claude 4.0 Opus", + "claude-opus-4-thinking": { + "id": "claude-opus-4-thinking", + "name": "Claude 4 Opus Thinking", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-07-15", + "last_updated": "2025-07-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "attachment": true, - "reasoning": true, - "tool_call": true, + "Llama-3.3-70B-Sapphira-0.1": { + "id": "Llama-3.3-70B-Sapphira-0.1", + "name": "Llama 3.3 70B Sapphira 0.1", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1048576, "output": 64000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "qwen3-235b-a22b-thinking-2507": { - "id": "qwen3-235b-a22b-thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", + "doubao-seed-code-preview-latest": { + "id": "doubao-seed-code-preview-latest", + "name": "Doubao Seed Code Preview", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-12", - "last_updated": "2025-08-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 262144, "output": 4096 } + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "qwen-vl-max-2025-01-25": { - "id": "qwen-vl-max-2025-01-25", - "name": "Qwen VL-MAX-2025-01-25", - "attachment": true, + "qwen-3.6-plus": { + "id": "qwen-3.6-plus", + "name": "Qwen 3.6 Plus", + "family": "qwen3.6", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 991800, + "output": 65536 + }, + "cost": { + "input": 0.45, + "output": 2.7 + } }, - "qwen3-next-80b-a3b-instruct": { - "id": "qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", + "Llama-3.3-70B-ArliAI-RPMax-v1.4": { + "id": "Llama-3.3-70B-ArliAI-RPMax-v1.4", + "name": "Llama 3.3 70B RPMax v1.4", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-12", - "last_updated": "2025-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "claude-3.5-haiku": { - "id": "claude-3.5-haiku", - "name": "Claude 3.5 Haiku", + "mistral-small-31-24b-instruct": { + "id": "mistral-small-31-24b-instruct", + "name": "Mistral Small 31 24b Instruct", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "kling-v2-6": { - "id": "kling-v2-6", - "name": "Kling-V2 6", + "glm-4.1v-thinking-flashx": { + "id": "glm-4.1v-thinking-flashx", + "name": "GLM 4.1V Thinking FlashX", "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"] }, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 99999999, "output": 99999999 } + "limit": { + "context": 64000, + "input": 64000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } }, - "deepseek-v3.1": { - "id": "deepseek-v3.1", - "name": "DeepSeek-V3.1", + "hunyuan-t1-latest": { + "id": "hunyuan-t1-latest", + "name": "Hunyuan T1", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-22", + "last_updated": "2025-03-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.17, + "output": 0.66 + } }, - "gemini-2.0-flash": { - "id": "gemini-2.0-flash", - "name": "Gemini 2.0 Flash", + "doubao-1-5-thinking-vision-pro-250428": { + "id": "doubao-1-5-thinking-vision-pro-250428", + "name": "Doubao 1.5 Thinking Vision Pro", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2025-05-15", + "last_updated": "2025-05-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 1048576, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.55, + "output": 1.43 + } }, - "doubao-seed-1.6-thinking": { - "id": "doubao-seed-1.6-thinking", - "name": "Doubao-Seed 1.6 Thinking", + "asi1-mini": { + "id": "asi1-mini", + "name": "ASI1 Mini", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 1 + } + }, + "ernie-5.0-thinking-latest": { + "id": "ernie-5.0-thinking-latest", + "name": "Ernie 5.0 Thinking", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-15", - "last_updated": "2025-08-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 1.1, + "output": 2 + } }, - "qwen3-235b-a22b": { - "id": "qwen3-235b-a22b", - "name": "Qwen 3 235B A22B", + "Llama-3.3-70B-Incandescent-Malevolence": { + "id": "Llama-3.3-70B-Incandescent-Malevolence", + "name": "Llama 3.3 70B Incandescent Malevolence", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "qwen3-vl-30b-a3b-thinking": { - "id": "qwen3-vl-30b-a3b-thinking", - "name": "Qwen3-Vl 30b A3b Thinking", - "attachment": true, + "Llama-3.3-70B-Damascus-R1": { + "id": "Llama-3.3-70B-Damascus-R1", + "name": "Damascus R1", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-09", - "last_updated": "2026-02-09", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "doubao-1.5-thinking-pro": { - "id": "doubao-1.5-thinking-pro", - "name": "Doubao 1.5 Thinking Pro", + "Gemma-3-27B-Nidum-Uncensored": { + "id": "Gemma-3-27B-Nidum-Uncensored", + "name": "Gemma 3 27B Nidum Uncensored", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 96000 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "claude-4.1-opus": { - "id": "claude-4.1-opus", - "name": "Claude 4.1 Opus", + "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", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM 4.5 Air", + "doubao-seed-2-0-pro-260215": { + "id": "doubao-seed-2-0-pro-260215", + "name": "Doubao Seed 2.0 Pro", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 131000, "output": 4096 } + "limit": { + "context": 256000, + "input": 256000, + "output": 128000 + }, + "cost": { + "input": 0.782, + "output": 3.876 + } }, - "qwen3.5-397b-a17b": { - "id": "qwen3.5-397b-a17b", - "name": "Qwen3.5 397B A17B", + "gemini-3-pro-image-preview": { + "id": "gemini-3-pro-image-preview", + "name": "Gemini 3 Pro Image", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-22", - "last_updated": "2026-02-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12 + } }, - "gemini-2.5-flash-image": { - "id": "gemini-2.5-flash-image", - "name": "Gemini 2.5 Flash Image", - "attachment": true, + "Gemma-3-27B-CardProjector-v4": { + "id": "Gemma-3-27B-CardProjector-v4", + "name": "Gemma 3 27B CardProjector v4", + "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-10-22", - "last_updated": "2025-10-22", - "modalities": { "input": ["text", "image"], "output": ["image"] }, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "claude-4.5-sonnet": { - "id": "claude-4.5-sonnet", - "name": "Claude 4.5 Sonnet", - "attachment": true, - "reasoning": true, - "tool_call": true, + "jamba-mini-1.7": { + "id": "jamba-mini-1.7", + "name": "Jamba Mini 1.7", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 4096 + }, + "cost": { + "input": 0.1989, + "output": 0.408 + } }, - "deepseek-r1-0528": { - "id": "deepseek-r1-0528", - "name": "DeepSeek-R1-0528", + "Llama-3.3-70B-Forgotten-Safeword-3.6": { + "id": "Llama-3.3-70B-Forgotten-Safeword-3.6", + "name": "Llama 3.3 70B Forgotten Safeword 3.6", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "qwen3-max": { - "id": "qwen3-max", - "name": "Qwen3 Max", - "attachment": false, + "doubao-1-5-thinking-pro-vision-250415": { + "id": "doubao-1-5-thinking-pro-vision-250415", + "name": "Doubao 1.5 Thinking Pro Vision", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.4 + } }, - "gpt-oss-20b": { - "id": "gpt-oss-20b", - "name": "gpt-oss-20b", - "attachment": false, + "gemini-2.5-pro-preview-06-05": { + "id": "gemini-2.5-pro-preview-06-05", + "name": "Gemini 2.5 Pro Preview 0605", + "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3 32B", + "gemini-2.0-pro-reasoner": { + "id": "gemini-2.0-pro-reasoner", + "name": "Gemini 2.0 Pro Reasoner", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 40000, "output": 4096 } - }, - "claude-4.5-haiku": { - "id": "claude-4.5-haiku", - "name": "Claude 4.5 Haiku", - "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-10-16", - "last_updated": "2025-10-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-02-05", + "last_updated": "2025-02-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 1.292, + "output": 4.998 + } }, - "qwen2.5-vl-7b-instruct": { - "id": "qwen2.5-vl-7b-instruct", - "name": "Qwen 2.5 VL 7B Instruct", - "attachment": true, + "doubao-seed-2-0-lite-260215": { + "id": "doubao-seed-2-0-lite-260215", + "name": "Doubao Seed 2.0 Lite", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 256000, + "input": 256000, + "output": 32000 + }, + "cost": { + "input": 0.1462, + "output": 0.8738 + } }, - "claude-3.5-sonnet": { - "id": "claude-3.5-sonnet", - "name": "Claude 3.5 Sonnet", + "gemini-2.5-flash-lite-preview-06-17": { + "id": "gemini-2.5-flash-lite-preview-06-17", + "name": "Gemini 2.5 Flash Lite Preview", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-09", - "last_updated": "2025-09-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 8200 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "mimo-v2-flash": { - "id": "mimo-v2-flash", - "name": "Mimo-V2-Flash", + "sonar-deep-research": { + "id": "sonar-deep-research", + "name": "Perplexity Deep Research", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-02-25", + "last_updated": "2025-02-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 60000, + "input": 60000, + "output": 128000 + }, + "cost": { + "input": 3.4, + "output": 13.6 + } }, - "qwen3-30b-a3b-instruct-2507": { - "id": "qwen3-30b-a3b-instruct-2507", - "name": "Qwen3 30b A3b Instruct 2507", + "Gemma-3-27B-it": { + "id": "Gemma-3-27B-it", + "name": "Gemma 3 27B IT", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-04", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "meituan/longcat-flash-lite": { - "id": "meituan/longcat-flash-lite", - "name": "Meituan/Longcat-Flash-Lite", + "Llama-3.3-70B-GeneticLemonade-Unleashed-v3": { + "id": "Llama-3.3-70B-GeneticLemonade-Unleashed-v3", + "name": "Llama 3.3 70B GeneticLemonade Unleashed v3", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-06", - "last_updated": "2026-02-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 320000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "meituan/longcat-flash-chat": { - "id": "meituan/longcat-flash-chat", - "name": "Meituan/Longcat-Flash-Chat", + "Gemma-3-27B-Glitter": { + "id": "Gemma-3-27B-Glitter", + "name": "Gemma 3 27B Glitter", "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"] }, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "OpenAI/GPT-5", + "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.1": { + "id": "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.1", + "name": "Llama 3.3 70B Omega Directive Unslop v2.1", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "OpenAI/GPT-5.2", - "attachment": true, - "reasoning": true, - "tool_call": true, + "qwen3-30b-a3b-instruct-2507": { + "id": "qwen3-30b-a3b-instruct-2507", + "name": "Qwen3 30B A3B Instruct 2507", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-02-20", + "last_updated": "2025-02-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } }, - "x-ai/grok-4-fast": { - "id": "x-ai/grok-4-fast", - "name": "x-AI/Grok-4-Fast", + "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", "attachment": true, "reasoning": true, "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"] }, + "structured_output": true, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "x-ai/grok-4.1-fast": { - "id": "x-ai/grok-4.1-fast", - "name": "x-AI/Grok-4.1-Fast", - "attachment": false, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "x-ai/grok-4-fast-non-reasoning": { - "id": "x-ai/grok-4-fast-non-reasoning", - "name": "X-Ai/Grok-4-Fast-Non-Reasoning", + "deepclaude": { + "id": "deepclaude", + "name": "DeepClaude", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2025-02-01", + "last_updated": "2025-02-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "x-ai/grok-code-fast-1": { - "id": "x-ai/grok-code-fast-1", - "name": "x-AI/Grok-Code-Fast 1", + "ernie-4.5-8k-preview": { + "id": "ernie-4.5-8k-preview", + "name": "Ernie 4.5 8k Preview", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-02", - "last_updated": "2025-09-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 10000 } + "limit": { + "context": 8000, + "input": 8000, + "output": 16384 + }, + "cost": { + "input": 0.66, + "output": 2.6 + } }, - "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", - "attachment": true, - "reasoning": true, - "tool_call": true, + "doubao-seed-2-0-mini-260215": { + "id": "doubao-seed-2-0-mini-260215", + "name": "Doubao Seed 2.0 Mini", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-19", - "last_updated": "2025-12-19", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 32000 + }, + "cost": { + "input": 0.0493, + "output": 0.4845 + } }, - "x-ai/grok-4.1-fast-reasoning": { - "id": "x-ai/grok-4.1-fast-reasoning", - "name": "X-Ai/Grok 4.1 Fast Reasoning", + "gemini-3-pro-preview-thinking": { + "id": "gemini-3-pro-preview-thinking", + "name": "Gemini 3 Pro Thinking", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-12-19", - "last_updated": "2025-12-19", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 20000000, "output": 2000000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12 + } }, - "x-ai/grok-4-fast-reasoning": { - "id": "x-ai/grok-4-fast-reasoning", - "name": "X-Ai/Grok-4-Fast-Reasoning", - "attachment": true, - "reasoning": true, - "tool_call": true, + "Llama-3.3-70B-GeneticLemonade-Opus": { + "id": "Llama-3.3-70B-GeneticLemonade-Opus", + "name": "Llama 3.3 70B GeneticLemonade Opus", + "attachment": false, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "deepseek/deepseek-v3.1-terminus-thinking": { - "id": "deepseek/deepseek-v3.1-terminus-thinking", - "name": "DeepSeek/DeepSeek-V3.1-Terminus-Thinking", + "v0-1.5-lg": { + "id": "v0-1.5-lg", + "name": "v0 1.5 LG", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-04", + "last_updated": "2025-07-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 15, + "output": 75 + } }, - "deepseek/deepseek-v3.1-terminus": { - "id": "deepseek/deepseek-v3.1-terminus", - "name": "DeepSeek/DeepSeek-V3.1-Terminus", - "attachment": false, + "ernie-4.5-turbo-128k": { + "id": "ernie-4.5-turbo-128k", + "name": "Ernie 4.5 Turbo 128k", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-05-08", + "last_updated": "2025-05-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.132, + "output": 0.55 + } }, - "deepseek/deepseek-v3.2-exp-thinking": { - "id": "deepseek/deepseek-v3.2-exp-thinking", - "name": "DeepSeek/DeepSeek-V3.2-Exp-Thinking", + "KAT-Coder-Pro-V1": { + "id": "KAT-Coder-Pro-V1", + "name": "KAT Coder Pro V1", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-28", + "last_updated": "2025-10-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 1.5, + "output": 6 + } }, - "deepseek/deepseek-v3.2-exp": { - "id": "deepseek/deepseek-v3.2-exp", - "name": "DeepSeek/DeepSeek-V3.2-Exp", - "attachment": false, + "claude-3-5-sonnet-20240620": { + "id": "claude-3-5-sonnet-20240620", + "name": "Claude 3.5 Sonnet Old", + "attachment": true, "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"] }, + "structured_output": true, + "release_date": "2024-06-20", + "last_updated": "2024-06-20", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 8192 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } }, - "deepseek/deepseek-math-v2": { - "id": "deepseek/deepseek-math-v2", - "name": "Deepseek/Deepseek-Math-V2", - "attachment": false, + "claude-opus-4-1-thinking:8192": { + "id": "claude-opus-4-1-thinking:8192", + "name": "Claude 4.1 Opus Thinking (8K)", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-12-04", - "last_updated": "2025-12-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 160000, "output": 160000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } }, - "deepseek/deepseek-v3.2-251201": { - "id": "deepseek/deepseek-v3.2-251201", - "name": "Deepseek/DeepSeek-V3.2", + "gemini-2.0-flash-exp-image-generation": { + "id": "gemini-2.0-flash-exp-image-generation", + "name": "Gemini Text + Image", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 32767, + "input": 32767, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "z-ai/glm-4.6": { - "id": "z-ai/glm-4.6", - "name": "Z-AI/GLM 4.6", + "Llama-3.3-70B-Magnum-v4-SE": { + "id": "Llama-3.3-70B-Magnum-v4-SE", + "name": "Llama 3.3 70B Magnum v4 SE", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-10-11", - "last_updated": "2025-10-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 200000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "z-ai/glm-5": { - "id": "z-ai/glm-5", - "name": "Z-Ai/GLM 5", + "glm-zero-preview": { + "id": "glm-zero-preview", + "name": "GLM Zero Preview", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 8000, + "input": 8000, + "output": 4096 + }, + "cost": { + "input": 1.802, + "output": 1.802 + } }, - "z-ai/autoglm-phone-9b": { - "id": "z-ai/autoglm-phone-9b", - "name": "Z-Ai/Autoglm Phone 9b", + "study_gpt-chatgpt-4o-latest": { + "id": "study_gpt-chatgpt-4o-latest", + "name": "Study Mode", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 12800, "output": 4096 } + "limit": { + "context": 200000, + "input": 200000, + "output": 16384 + }, + "cost": { + "input": 4.998, + "output": 14.994 + } }, - "z-ai/glm-4.7": { - "id": "z-ai/glm-4.7", - "name": "Z-Ai/GLM 4.7", + "glm-4-airx": { + "id": "glm-4-airx", + "name": "GLM-4 AirX", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-06-05", + "last_updated": "2024-06-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 200000 } + "limit": { + "context": 8000, + "input": 8000, + "output": 4096 + }, + "cost": { + "input": 2.006, + "output": 2.006 + } }, - "stepfun-ai/gelab-zero-4b-preview": { - "id": "stepfun-ai/gelab-zero-4b-preview", - "name": "Stepfun-Ai/Gelab Zero 4b Preview", - "attachment": true, + "step-2-mini": { + "id": "step-2-mini", + "name": "Step-2 Mini", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-07-05", + "last_updated": "2024-07-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 8192, "output": 4096 } + "limit": { + "context": 8000, + "input": 8000, + "output": 4096 + }, + "cost": { + "input": 0.2006, + "output": 0.408 + } }, - "minimax/minimax-m2": { - "id": "minimax/minimax-m2", - "name": "Minimax/Minimax-M2", - "attachment": false, + "gemini-2.5-flash-preview-04-17:thinking": { + "id": "gemini-2.5-flash-preview-04-17:thinking", + "name": "Gemini 2.5 Flash Preview Thinking", + "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-10-28", - "last_updated": "2025-10-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-17", + "last_updated": "2025-04-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 3.5 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "Minimax/Minimax-M2.1", + "Llama-3.3-70B-Mokume-Gane-R1": { + "id": "Llama-3.3-70B-Mokume-Gane-R1", + "name": "Llama 3.3 70B Mokume Gane R1", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 204800, "output": 128000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "Minimax/Minimax-M2.5", + "deepseek-reasoner": { + "id": "deepseek-reasoner", + "name": "DeepSeek Reasoner", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 204800, "output": 128000 } + "limit": { + "context": 64000, + "input": 64000, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 1.7 + } }, - "minimax/minimax-m2.5-highspeed": { - "id": "minimax/minimax-m2.5-highspeed", - "name": "Minimax/Minimax-M2.5 Highspeed", + "glm-z1-airx": { + "id": "glm-z1-airx", + "name": "GLM Z1 AirX", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 204800, "output": 128000 } + "limit": { + "context": 32000, + "input": 32000, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } }, - "xiaomi/mimo-v2-flash": { - "id": "xiaomi/mimo-v2-flash", - "name": "Xiaomi/Mimo-V2-Flash", + "jamba-mini-1.6": { + "id": "jamba-mini-1.6", + "name": "Jamba Mini 1.6", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-12-26", - "last_updated": "2025-12-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-01", + "last_updated": "2025-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 4096 + }, + "cost": { + "input": 0.1989, + "output": 0.408 + } }, - "stepfun/step-3.5-flash": { - "id": "stepfun/step-3.5-flash", - "name": "Stepfun/Step-3.5 Flash", + "claude-opus-4-1-thinking": { + "id": "claude-opus-4-1-thinking", + "name": "Claude 4.1 Opus Thinking", "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "grok-3-beta": { + "id": "grok-3-beta", + "name": "Grok 3 Beta", + "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-02-02", - "last_updated": "2026-02-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 64000, "output": 4096 } + "limit": { + "context": 131072, + "input": 131072, + "output": 131072 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", + "Llama-3.3-70B-Legion-V2.1": { + "id": "Llama-3.3-70B-Legion-V2.1", + "name": "Llama 3.3 70B Legion V2.1", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-11-07", - "last_updated": "2025-11-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 100000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Moonshotai/Kimi-K2.5", - "attachment": true, + "sonar": { + "id": "sonar", + "name": "Perplexity Simple", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2026-01-28", - "last_updated": "2026-01-28", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 127000, + "input": 127000, + "output": 128000 + }, + "cost": { + "input": 1.003, + "output": 1.003 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "Kimi K2 0905", - "attachment": false, + "z-image-turbo": { + "id": "z-image-turbo", + "name": "Z Image Turbo", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, "temperature": true, - "release_date": "2025-09-08", - "last_updated": "2025-09-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-27", + "last_updated": "2025-11-27", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "limit": { "context": 256000, "output": 100000 } - } - } - }, - "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-v3-large": { - "id": "morph-v3-large", - "name": "Morph v3 Large", - "family": "morph", + "limit": { + "context": 0, + "output": 0 + } + }, + "GLM-4.5-Air-Derestricted-Iceblink-v2": { + "id": "GLM-4.5-Air-Derestricted-Iceblink-v2", + "name": "GLM 4.5 Air Derestricted Iceblink v2", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.9, "output": 1.9 }, - "limit": { "context": 32000, "output": 32000 } + "limit": { + "context": 158600, + "input": 158600, + "output": 65536 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "auto": { - "id": "auto", - "name": "Auto", - "family": "auto", + "jamba-large": { + "id": "jamba-large", + "name": "Jamba Large", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.85, "output": 1.55 }, - "limit": { "context": 32000, "output": 32000 } + "limit": { + "context": 256000, + "input": 256000, + "output": 4096 + }, + "cost": { + "input": 1.989, + "output": 7.99 + } }, - "morph-v3-fast": { - "id": "morph-v3-fast", - "name": "Morph v3 Fast", - "family": "morph", - "attachment": false, + "claude-3-7-sonnet-reasoner": { + "id": "claude-3-7-sonnet-reasoner", + "name": "Claude 3.7 Sonnet Reasoner", + "attachment": true, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "release_date": "2025-03-29", + "last_updated": "2025-03-29", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 1.2 }, - "limit": { "context": 16000, "output": 16000 } - } - } - }, - "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": { - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "GPT OSS 120B", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-08", - "last_updated": "2025-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.0675, "output": 0.27 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02", - "last_updated": "2026-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.75, "output": 2.4 }, - "limit": { "context": 200000, "output": 128000 } + "ernie-4.5-turbo-vl-32k": { + "id": "ernie-4.5-turbo-vl-32k", + "name": "Ernie 4.5 Turbo VL 32k", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-05-08", + "last_updated": "2025-05-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 16384 + }, + "cost": { + "input": 0.495, + "output": 1.43 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-12", - "last_updated": "2025-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.45, "output": 1.65 }, - "limit": { "context": 200000, "output": 128000 } - } - } - }, - "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": { - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 202752, "output": 131072 } + "Mistral-Nemo-12B-Instruct-2407": { + "id": "Mistral-Nemo-12B-Instruct-2407", + "name": "Mistral Nemo 12B Instruct 2407", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.01, + "output": 0.01 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM-5", - "family": "glm", + "doubao-seed-1-6-flash-250615": { + "id": "doubao-seed-1-6-flash-250615", + "name": "Doubao Seed 1.6 Flash", "attachment": false, - "reasoning": true, - "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": true, - "cost": { "input": 0.8, "output": 2.56 }, - "limit": { "context": 202752, "output": 131072 } + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-15", + "last_updated": "2025-06-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.0374, + "output": 0.374 + } }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "GLM-4.6", - "family": "glm", + "qwq-32b": { + "id": "qwq-32b", + "name": "Qwen: QwQ 32B", "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.45, "output": 1.9 }, - "limit": { "context": 202752, "output": 131072 } + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 0.25599999, + "output": 0.30499999 + } }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "Llama-3.3-70B-Strawberrylemonade-v1.2": { + "id": "Llama-3.3-70B-Strawberrylemonade-v1.2", + "name": "Llama 3.3 70B StrawberryLemonade v1.2", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, + "tool_call": false, + "structured_output": false, "release_date": "2024-12-06", "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 131072, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "MiniMaxAI/MiniMax-M2.1": { - "id": "MiniMaxAI/MiniMax-M2.1", - "name": "MiniMax M2.1", - "family": "minimax", - "attachment": false, + "gemini-2.5-flash-preview-04-17": { + "id": "gemini-2.5-flash-preview-04-17", + "name": "Gemini 2.5 Flash Preview", + "attachment": true, "reasoning": true, - "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, - "cost": { "input": 0.28, "output": 1.2 }, - "limit": { "context": 196608, "output": 131072 } + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-17", + "last_updated": "2025-04-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "ernie-x1-turbo-32k": { + "id": "ernie-x1-turbo-32k", + "name": "Ernie X1 Turbo 32k", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-05-08", + "last_updated": "2025-05-08", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 16384 + }, + "cost": { + "input": 0.165, + "output": 0.66 + } }, - "deepseek-ai/DeepSeek-V3.1": { - "id": "deepseek-ai/DeepSeek-V3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "deepseek-math-v2": { + "id": "deepseek-math-v2", + "name": "DeepSeek Math V2", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-08-25", - "last_updated": "2025-08-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-03", + "last_updated": "2025-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "deepseek-ai/DeepSeek-V3.2-Exp": { - "id": "deepseek-ai/DeepSeek-V3.2-Exp", - "name": "DeepSeek V3.2 Exp", - "family": "deepseek", + "Llama-3.3-70B-Electranova-v1.0": { + "id": "Llama-3.3-70B-Electranova-v1.0", + "name": "Llama 3.3 70B Electranova v1.0", "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, - "cost": { "input": 0.27, "output": 0.4 }, - "limit": { "context": 164000, "output": 164000 } + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } }, - "deepseek-ai/DeepSeek-V3-0324": { - "id": "deepseek-ai/DeepSeek-V3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", + "Llama-3.3-70B-ArliAI-RPMax-v2": { + "id": "Llama-3.3-70B-ArliAI-RPMax-v2", + "name": "Llama 3.3 70B ArliAI RPMax v2", "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, - "cost": { "input": 0.25, "output": 0.88 }, - "limit": { "context": 163840, "output": 163840 } - }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "qwen-image": { + "id": "qwen-image", + "name": "Qwen Image", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } + }, + "Llama-3.3-70B-Cu-Mai-R1": { + "id": "Llama-3.3-70B-Cu-Mai-R1", + "name": "Llama 3.3 70B Cu Mai R1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "GLM-4.5-Air-Derestricted-Iceblink": { + "id": "GLM-4.5-Air-Derestricted-Iceblink", + "name": "GLM 4.5 Air Derestricted Iceblink", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 98304 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-Bigger-Body": { + "id": "Llama-3.3-70B-Bigger-Body", + "name": "Llama 3.3 70B Bigger Body", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3+(3.1v3.3)-70B-Hanami-x1": { + "id": "Llama-3.3+(3.1v3.3)-70B-Hanami-x1", + "name": "Llama 3.3+ 70B Hanami x1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "hunyuan-turbos-20250226": { + "id": "hunyuan-turbos-20250226", + "name": "Hunyuan Turbo S", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-27", + "last_updated": "2025-02-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 24000, + "input": 24000, + "output": 8192 + }, + "cost": { + "input": 0.187, + "output": 0.374 + } + }, + "gemini-2.5-flash-preview-09-2025": { + "id": "gemini-2.5-flash-preview-09-2025", + "name": "Gemini 2.5 Flash Preview (09/2025)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } + }, + "GLM-4.6-Derestricted-v5": { + "id": "GLM-4.6-Derestricted-v5", + "name": "GLM 4.6 Derestricted v5", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.4, + "output": 1.5 + } + }, + "glm-4-plus": { + "id": "glm-4-plus", + "name": "GLM-4 Plus", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-08-01", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 7.497, + "output": 7.497 + } + }, + "Gemma-3-27B-Big-Tiger-v3": { + "id": "Gemma-3-27B-Big-Tiger-v3", + "name": "Gemma 3 27B Big Tiger v3", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "brave-research": { + "id": "brave-research", + "name": "Brave (Research)", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2023-03-02", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 5, + "output": 5 + } + }, + "hidream": { + "id": "hidream", + "name": "Hidream", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "temperature": true, + "release_date": "2024-01-01", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } + }, + "qwen3-max-2026-01-23": { + "id": "qwen3-max-2026-01-23", + "name": "Qwen3 Max 2026-01-23", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-26", + "last_updated": "2026-01-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 1.2002, + "output": 6.001 + } + }, + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "Claude 4.1 Opus", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "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": 14.994, + "output": 75.004 + } + }, + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "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 + } + }, + "MiniMax-M1": { + "id": "MiniMax-M1", + "name": "MiniMax M1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-16", + "last_updated": "2025-06-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 131072 + }, + "cost": { + "input": 0.1394, + "output": 1.3328 + } + }, + "gemini-2.5-flash-nothinking": { + "id": "gemini-2.5-flash-nothinking", + "name": "Gemini 2.5 Flash (No Thinking)", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } + }, + "exa-research-pro": { + "id": "exa-research-pro", + "name": "Exa (Research Pro)", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-04", + "last_updated": "2025-06-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 2.5 + } + }, + "grok-3-fast-beta": { + "id": "grok-3-fast-beta", + "name": "Grok 3 Fast Beta", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 131072 + }, + "cost": { + "input": 5, + "output": 25 + } + }, + "claude-opus-4-5-20251101:thinking": { + "id": "claude-opus-4-5-20251101:thinking", + "name": "Claude 4.5 Opus Thinking", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-11-01", + "last_updated": "2025-11-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } + }, + "gemini-2.5-pro-exp-03-25": { + "id": "gemini-2.5-pro-exp-03-25", + "name": "Gemini 2.5 Pro Experimental 0325", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2.5, + "output": 10 + } + }, + "claude-3-7-sonnet-thinking": { + "id": "claude-3-7-sonnet-thinking", + "name": "Claude 3.7 Sonnet Thinking", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 16000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } + }, + "claude-opus-4-thinking:8192": { + "id": "claude-opus-4-thinking:8192", + "name": "Claude 4 Opus Thinking (8K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "claude-sonnet-4-thinking:1024": { + "id": "claude-sonnet-4-thinking:1024", + "name": "Claude 4 Sonnet Thinking (1K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } + }, + "Llama-3.3-70B-Magnum-v4-SE-Cirrus-x1-SLERP": { + "id": "Llama-3.3-70B-Magnum-v4-SE-Cirrus-x1-SLERP", + "name": "Llama 3.3 70B Magnum v4 SE Cirrus x1 SLERP", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "step-r1-v-mini": { + "id": "step-r1-v-mini", + "name": "Step R1 V Mini", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-08", + "last_updated": "2025-04-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 2.5, + "output": 11 + } + }, + "ernie-x1-32k-preview": { + "id": "ernie-x1-32k-preview", + "name": "Ernie X1 32k", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 16384 + }, + "cost": { + "input": 0.33, + "output": 1.32 + } + }, + "Llama-3.3-70B-StrawberryLemonade-v1.0": { + "id": "Llama-3.3-70B-StrawberryLemonade-v1.0", + "name": "Llama 3.3 70B StrawberryLemonade v1.0", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "KAT-Coder-Exp-72B-1010": { + "id": "KAT-Coder-Exp-72B-1010", + "name": "KAT Coder Exp 72B 1010", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-10-28", + "last_updated": "2025-10-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.2 + } + }, + "gemini-2.5-pro-preview-03-25": { + "id": "gemini-2.5-pro-preview-03-25", + "name": "Gemini 2.5 Pro Preview 0325", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 2.5, + "output": 10 + } + }, + "claude-opus-4-thinking:1024": { + "id": "claude-opus-4-thinking:1024", + "name": "Claude 4 Opus Thinking (1K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "claude-sonnet-4-20250514": { + "id": "claude-sonnet-4-20250514", + "name": "Claude 4 Sonnet", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "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": 2.992, + "output": 14.994 + } + }, + "Llama-3.3-70B-Progenitor-V3.3": { + "id": "Llama-3.3-70B-Progenitor-V3.3", + "name": "Llama 3.3 70B Progenitor V3.3", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Qwen2.5-32B-EVA-v0.2": { + "id": "Qwen2.5-32B-EVA-v0.2", + "name": "Qwen 2.5 32b EVA", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-09-01", + "last_updated": "2024-09-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 24576, + "input": 24576, + "output": 8192 + }, + "cost": { + "input": 0.493, + "output": 0.493 + } + }, + "brave-pro": { + "id": "brave-pro", + "name": "Brave (Pro)", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2023-03-02", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "input": 8192, + "output": 8192 + }, + "cost": { + "input": 5, + "output": 5 + } + }, + "step-2-16k-exp": { + "id": "step-2-16k-exp", + "name": "Step-2 16k Exp", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-05", + "last_updated": "2024-07-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16000, + "input": 16000, + "output": 8192 + }, + "cost": { + "input": 7.004, + "output": 19.992 + } + }, + "Llama-3.3-70B-Fallen-R1-v1": { + "id": "Llama-3.3-70B-Fallen-R1-v1", + "name": "Llama 3.3 70B Fallen R1 v1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "claude-sonnet-4-thinking": { + "id": "claude-sonnet-4-thinking", + "name": "Claude 4 Sonnet Thinking", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } + }, + "doubao-1.5-pro-256k": { + "id": "doubao-1.5-pro-256k", + "name": "Doubao 1.5 Pro 256k", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-12", + "last_updated": "2025-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.799, + "output": 1.445 + } + }, + "claude-3-7-sonnet-20250219": { + "id": "claude-3-7-sonnet-20250219", + "name": "Claude 3.7 Sonnet", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 16000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } + }, + "learnlm-1.5-pro-experimental": { + "id": "learnlm-1.5-pro-experimental", + "name": "Gemini LearnLM Experimental", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-05-14", + "last_updated": "2024-05-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32767, + "input": 32767, + "output": 8192 + }, + "cost": { + "input": 3.502, + "output": 10.506 + } + }, + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3 Coder 30B A3B Instruct", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "chroma": { + "id": "chroma", + "name": "Chroma", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } + }, + "Llama-3.3-70B-Predatorial-Extasy": { + "id": "Llama-3.3-70B-Predatorial-Extasy", + "name": "Llama 3.3 70B Predatorial Extasy", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-Aurora-Borealis": { + "id": "Llama-3.3-70B-Aurora-Borealis", + "name": "Llama 3.3 70B Aurora Borealis", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-ArliAI-RPMax-v3": { + "id": "Llama-3.3-70B-ArliAI-RPMax-v3", + "name": "Llama 3.3 70B ArliAI RPMax v3", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "venice-uncensored": { + "id": "venice-uncensored", + "name": "Venice Uncensored", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } + }, + "step-3": { + "id": "step-3", + "name": "Step-3", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-31", + "last_updated": "2025-07-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 0.2499, + "output": 0.6494 + } + }, + "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.0": { + "id": "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.0", + "name": "Llama 3.3 70B Omega Directive Unslop v2.0", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "auto-model": { + "id": "auto-model", + "name": "Auto model", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-06-01", + "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 + } + }, + "claude-opus-4-1-thinking:32768": { + "id": "claude-opus-4-1-thinking:32768", + "name": "Claude 4.1 Opus Thinking (32K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "Llama-3.3-70B-Shakudo": { + "id": "Llama-3.3-70B-Shakudo", + "name": "Llama 3.3 70B Shakudo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Baichuan4-Air": { + "id": "Baichuan4-Air", + "name": "Baichuan 4 Air", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.157, + "output": 0.157 + } + }, + "kimi-thinking-preview": { + "id": "kimi-thinking-preview", + "name": "Kimi Thinking Preview", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 31.46, + "output": 31.46 + } + }, + "qwen-turbo": { + "id": "qwen-turbo", + "name": "Qwen Turbo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 8192 + }, + "cost": { + "input": 0.04998, + "output": 0.2006 + } + }, + "Llama-3.3-70B-Mhnnn-x1": { + "id": "Llama-3.3-70B-Mhnnn-x1", + "name": "Llama 3.3 70B Mhnnn x1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "claude-opus-4-thinking:32768": { + "id": "claude-opus-4-thinking:32768", + "name": "Claude 4 Opus Thinking (32K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "Llama-3.3-70B-Argunaut-1-SFT": { + "id": "Llama-3.3-70B-Argunaut-1-SFT", + "name": "Llama 3.3 70B Argunaut 1 SFT", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "claude-opus-4-1-thinking:1024": { + "id": "claude-opus-4-1-thinking:1024", + "name": "Claude 4.1 Opus Thinking (1K)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "phi-4-multimodal-instruct": { + "id": "phi-4-multimodal-instruct", + "name": "Phi 4 Multimodal", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.07, + "output": 0.11 + } + }, + "doubao-seed-2-0-code-preview-260215": { + "id": "doubao-seed-2-0-code-preview-260215", + "name": "Doubao Seed 2.0 Code Preview", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": 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.893 + } + }, + "deepseek-reasoner-cheaper": { + "id": "deepseek-reasoner-cheaper", + "name": "Deepseek R1 Cheaper", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 1.7 + } + }, + "exa-answer": { + "id": "exa-answer", + "name": "Exa (Answer)", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-04", + "last_updated": "2025-06-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 4096, + "input": 4096, + "output": 4096 + }, + "cost": { + "input": 2.5, + "output": 2.5 + } + }, + "v0-1.0-md": { + "id": "v0-1.0-md", + "name": "v0 1.0 MD", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-04", + "last_updated": "2025-07-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "glm-4.1v-thinking-flash": { + "id": "glm-4.1v-thinking-flash", + "name": "GLM 4.1V Thinking Flash", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 64000, + "input": 64000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } + }, + "azure-o1": { + "id": "azure-o1", + "name": "Azure o1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-17", + "last_updated": "2024-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 100000 + }, + "cost": { + "input": 14.994, + "output": 59.993 + } + }, + "GLM-4.5-Air-Derestricted": { + "id": "GLM-4.5-Air-Derestricted", + "name": "GLM 4.5 Air Derestricted", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 202600, + "input": 202600, + "output": 98304 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "azure-o3-mini": { + "id": "azure-o3-mini", + "name": "Azure o3-mini", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 65536 + }, + "cost": { + "input": 1.088, + "output": 4.3996 + } + }, + "qwen3.6-max-preview": { + "id": "qwen3.6-max-preview", + "name": "Qwen3.6 Max Preview", + "family": "qwen3.6", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-04-20", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 245800, + "output": 65536 + }, + "cost": { + "input": 1.3, + "output": 7.8 + } + }, + "Llama-3.3-70B-Sapphira-0.2": { + "id": "Llama-3.3-70B-Sapphira-0.2", + "name": "Llama 3.3 70B Sapphira 0.2", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-Anthrobomination": { + "id": "Llama-3.3-70B-Anthrobomination", + "name": "Llama 3.3 70B Anthrobomination", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "QwQ-32B-ArliAI-RpR-v1": { + "id": "QwQ-32B-ArliAI-RpR-v1", + "name": "QwQ 32b Arli V1", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "claude-opus-4-20250514": { + "id": "claude-opus-4-20250514", + "name": "Claude 4 Opus", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-05-14", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 32000 + }, + "cost": { + "input": 14.994, + "output": 75.004 + } + }, + "yi-lightning": { + "id": "yi-lightning", + "name": "Yi Lightning", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-10-16", + "last_updated": "2024-10-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 12000, + "input": 12000, + "output": 4096 + }, + "cost": { + "input": 0.2006, + "output": 0.2006 + } + }, + "Llama-3.3-70B-Electra-R1": { + "id": "Llama-3.3-70B-Electra-R1", + "name": "Llama 3.3 70B Electra R1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-Forgotten-Abomination-v5.0": { + "id": "Llama-3.3-70B-Forgotten-Abomination-v5.0", + "name": "Llama 3.3 70B Forgotten Abomination v5.0", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-Cirrus-x1": { + "id": "Llama-3.3-70B-Cirrus-x1", + "name": "Llama 3.3 70B Cirrus x1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "grok-3-mini-beta": { + "id": "grok-3-mini-beta", + "name": "Grok 3 Mini Beta", + "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": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 0.5 + } + }, + "auto-model-standard": { + "id": "auto-model-standard", + "name": "Auto model (Standard)", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-06-01", + "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 + } + }, + "claude-sonnet-4-5-20250929-thinking": { + "id": "claude-sonnet-4-5-20250929-thinking", + "name": "Claude Sonnet 4.5 Thinking", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 64000 + }, + "cost": { + "input": 2.992, + "output": 14.994 + } + }, + "v0-1.5-md": { + "id": "v0-1.5-md", + "name": "v0 1.5 MD", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-04", + "last_updated": "2025-07-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "kimi-k2-instruct-fast": { + "id": "kimi-k2-instruct-fast", + "name": "Kimi K2 0711 Fast", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-15", + "last_updated": "2025-07-15", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 2 + } + }, + "glm-4-long": { + "id": "glm-4-long", + "name": "GLM-4 Long", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-08-01", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 4096 + }, + "cost": { + "input": 0.2006, + "output": 0.2006 + } + }, + "jamba-large-1.7": { + "id": "jamba-large-1.7", + "name": "Jamba Large 1.7", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 4096 + }, + "cost": { + "input": 1.989, + "output": 7.99 + } + }, + "qvq-max": { + "id": "qvq-max", + "name": "Qwen: QvQ Max", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-28", + "last_updated": "2025-03-28", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 1.4, + "output": 5.3 + } + }, + "gemini-2.0-flash-thinking-exp-1219": { + "id": "gemini-2.0-flash-thinking-exp-1219", + "name": "Gemini 2.0 Flash Thinking 1219", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-19", + "last_updated": "2024-12-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32767, + "input": 32767, + "output": 8192 + }, + "cost": { + "input": 0.1003, + "output": 0.408 + } + }, + "gemini-2.0-flash-lite": { + "id": "gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 8192 + }, + "cost": { + "input": 0.0748, + "output": 0.306 + } + }, + "azure-gpt-4-turbo": { + "id": "azure-gpt-4-turbo", + "name": "Azure gpt-4-turbo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2023-11-06", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 9.996, + "output": 30.005 + } + }, + "Baichuan-M2": { + "id": "Baichuan-M2", + "name": "Baichuan M2 32B Medical", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 15.73, + "output": 15.73 + } + }, + "qwen-long": { + "id": "qwen-long", + "name": "Qwen Long 10M", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-25", + "last_updated": "2025-01-25", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 10000000, + "input": 10000000, + "output": 8192 + }, + "cost": { + "input": 0.1003, + "output": 0.408 + } + }, + "sonar-reasoning-pro": { + "id": "sonar-reasoning-pro", + "name": "Perplexity Reasoning Pro", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 127000, + "input": 127000, + "output": 128000 + }, + "cost": { + "input": 2.006, + "output": 7.9985 + } + }, + "gemini-2.5-flash-preview-05-20:thinking": { + "id": "gemini-2.5-flash-preview-05-20:thinking", + "name": "Gemini 2.5 Flash 0520 Thinking", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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 + }, + "cost": { + "input": 0.15, + "output": 3.5 + } + }, + "GLM-4.5-Air-Derestricted-Steam-ReExtract": { + "id": "GLM-4.5-Air-Derestricted-Steam-ReExtract", + "name": "GLM 4.5 Air Derestricted Steam ReExtract", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-12", + "last_updated": "2025-12-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 65536 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Llama-3.3-70B-Dark-Ages-v0.1": { + "id": "Llama-3.3-70B-Dark-Ages-v0.1", + "name": "Llama 3.3 70B Dark Ages v0.1", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "Baichuan4-Turbo": { + "id": "Baichuan4-Turbo", + "name": "Baichuan 4 Turbo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 2.42, + "output": 2.42 + } + }, + "doubao-1.5-vision-pro-32k": { + "id": "doubao-1.5-vision-pro-32k", + "name": "Doubao 1.5 Vision Pro 32k", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-22", + "last_updated": "2025-01-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8192 + }, + "cost": { + "input": 0.459, + "output": 1.377 + } + }, + "alibaba/qwen3.6-flash": { + "id": "alibaba/qwen3.6-flash", + "name": "Qwen3.6 Flash", + "family": "qwen3.6", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-04-17", + "last_updated": "2026-04-17", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 991800, + "output": 65536 + }, + "cost": { + "input": 0.19, + "output": 1.16 + } + }, + "inflection/inflection-3-pi": { + "id": "inflection/inflection-3-pi", + "name": "Inflection 3 Pi", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-10-11", + "last_updated": "2024-10-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8000, + "input": 8000, + "output": 4096 + }, + "cost": { + "input": 2.499, + "output": 9.996 + } + }, + "inflection/inflection-3-productivity": { + "id": "inflection/inflection-3-productivity", + "name": "Inflection 3 Productivity", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-10-11", + "last_updated": "2024-10-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8000, + "input": 8000, + "output": 4096 + }, + "cost": { + "input": 2.499, + "output": 9.996 + } + }, + "essentialai/rnj-1-instruct": { + "id": "essentialai/rnj-1-instruct", + "name": "RNJ-1 Instruct 8B", + "family": "rnj", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-13", + "last_updated": "2025-12-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } + }, + "LLM360/K2-Think": { + "id": "LLM360/K2-Think", + "name": "K2-Think", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } + }, + "TEE/kimi-k2.5": { + "id": "TEE/kimi-k2.5", + "name": "Kimi K2.5 TEE", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65535 + }, + "cost": { + "input": 0.3, + "output": 1.9 + } + }, + "TEE/glm-4.7": { + "id": "TEE/glm-4.7", + "name": "GLM 4.7 TEE", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "input": 131000, + "output": 65535 + }, + "cost": { + "input": 0.85, + "output": 3.3 + } + }, + "TEE/qwen3.5-397b-a17b": { + "id": "TEE/qwen3.5-397b-a17b", + "name": "Qwen3.5 397B A17B TEE", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-02-28", + "last_updated": "2026-02-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 258048, + "input": 258048, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } + }, + "TEE/glm-5": { + "id": "TEE/glm-5", + "name": "GLM 5 TEE", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 203000, + "input": 203000, + "output": 65535 + }, + "cost": { + "input": 1.2, + "output": 3.5 + } + }, + "TEE/qwen2.5-vl-72b-instruct": { + "id": "TEE/qwen2.5-vl-72b-instruct", + "name": "Qwen2.5 VL 72B TEE", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-01", + "last_updated": "2025-02-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } + }, + "TEE/minimax-m2.1": { + "id": "TEE/minimax-m2.1", + "name": "MiniMax M2.1 TEE", + "family": "minimax", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "TEE/qwen3-30b-a3b-instruct-2507": { + "id": "TEE/qwen3-30b-a3b-instruct-2507", + "name": "Qwen3 30B A3B Instruct 2507 TEE", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "input": 262000, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.44999999999999996 + } + }, + "TEE/deepseek-v3.1": { + "id": "TEE/deepseek-v3.1", + "name": "DeepSeek V3.1 TEE", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "input": 164000, + "output": 8192 + }, + "cost": { + "input": 1, + "output": 2.5 + } + }, + "TEE/llama3-3-70b": { + "id": "TEE/llama3-3-70b", + "name": "Llama 3.3 70B", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-03", + "last_updated": "2025-07-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 2, + "output": 2 + } + }, + "TEE/glm-4.6": { + "id": "TEE/glm-4.6", + "name": "GLM 4.6 TEE", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 203000, + "input": 203000, + "output": 65535 + }, + "cost": { + "input": 0.75, + "output": 2 + } + }, + "TEE/kimi-k2.5-thinking": { + "id": "TEE/kimi-k2.5-thinking", + "name": "Kimi K2.5 Thinking TEE", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65535 + }, + "cost": { + "input": 0.3, + "output": 1.9 + } + }, + "TEE/gemma-3-27b-it": { + "id": "TEE/gemma-3-27b-it", + "name": "Gemma 3 27B TEE", + "family": "gemma", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } + }, + "TEE/deepseek-v3.2": { + "id": "TEE/deepseek-v3.2", + "name": "DeepSeek V3.2 TEE", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "input": 164000, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 1 + } + }, + "TEE/gpt-oss-20b": { + "id": "TEE/gpt-oss-20b", + "name": "GPT-OSS 20B TEE", + "family": "gpt-oss", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } + }, + "TEE/qwen3-coder": { + "id": "TEE/qwen3-coder", + "name": "Qwen3 Coder 480B TEE", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 1.5, + "output": 2 + } + }, + "TEE/glm-4.7-flash": { + "id": "TEE/glm-4.7-flash", + "name": "GLM 4.7 Flash TEE", + "family": "glm-flash", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 203000, + "input": 203000, + "output": 65535 + }, + "cost": { + "input": 0.15, + "output": 0.5 + } + }, + "TEE/gpt-oss-120b": { + "id": "TEE/gpt-oss-120b", + "name": "GPT-OSS 120B TEE", + "family": "gpt-oss", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 2, + "output": 2 + } + }, + "TEE/deepseek-r1-0528": { + "id": "TEE/deepseek-r1-0528", + "name": "DeepSeek R1 0528 TEE", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 2 + } + }, + "TEE/kimi-k2-thinking": { + "id": "TEE/kimi-k2-thinking", + "name": "Kimi K2 Thinking TEE", + "family": "kimi-thinking", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65535 + }, + "cost": { + "input": 2, + "output": 2 + } + }, + "CrucibleLab/L3.3-70B-Loki-V2.0": { + "id": "CrucibleLab/L3.3-70B-Loki-V2.0", + "name": "L3.3 70B Loki v2.0", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-22", + "last_updated": "2026-01-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "deepseek/deepseek-v3.2:thinking": { + "id": "deepseek/deepseek-v3.2:thinking", + "name": "DeepSeek V3.2 Thinking", + "family": "deepseek", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 163000, + "input": 163000, + "output": 65536 + }, + "cost": { + "input": 0.27999999999999997, + "output": 0.42000000000000004 + } + }, + "deepseek/deepseek-prover-v2-671b": { + "id": "deepseek/deepseek-prover-v2-671b", + "name": "DeepSeek Prover v2 671B", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-30", + "last_updated": "2025-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 160000, + "input": 160000, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 2.5 + } + }, + "deepseek/deepseek-v3.2-speciale": { + "id": "deepseek/deepseek-v3.2-speciale", + "name": "DeepSeek V3.2 Speciale", + "family": "deepseek", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 163000, + "input": 163000, + "output": 65536 + }, + "cost": { + "input": 0.27999999999999997, + "output": 0.42000000000000004 + } + }, + "deepseek/deepseek-v3.2": { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 163000, + "input": 163000, + "output": 65536 + }, + "cost": { + "input": 0.27999999999999997, + "output": 0.42000000000000004 + } + }, + "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond": { + "id": "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond", + "name": "MS3.2 24B Magnum Diamond", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 32768 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "NeverSleep/Llama-3-Lumimaid-70B-v0.1": { + "id": "NeverSleep/Llama-3-Lumimaid-70B-v0.1", + "name": "Lumimaid 70b", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 2.006, + "output": 2.006 + } + }, + "NeverSleep/Lumimaid-v0.2-70B": { + "id": "NeverSleep/Lumimaid-v0.2-70B", + "name": "Lumimaid v0.2", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 1, + "output": 1.5 + } + }, + "Steelskull/L3.3-Cu-Mai-R1-70b": { + "id": "Steelskull/L3.3-Cu-Mai-R1-70b", + "name": "Llama 3.3 70B Cu Mai", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Steelskull/L3.3-Nevoria-R1-70b": { + "id": "Steelskull/L3.3-Nevoria-R1-70b", + "name": "Steelskull Nevoria R1 70b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Steelskull/L3.3-MS-Evayale-70B": { + "id": "Steelskull/L3.3-MS-Evayale-70B", + "name": "Evayale 70b ", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Steelskull/L3.3-Electra-R1-70b": { + "id": "Steelskull/L3.3-Electra-R1-70b", + "name": "Steelskull Electra R1 70b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.69989, + "output": 0.69989 + } + }, + "Steelskull/L3.3-MS-Nevoria-70b": { + "id": "Steelskull/L3.3-MS-Nevoria-70b", + "name": "Steelskull Nevoria 70b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Steelskull/L3.3-MS-Evalebis-70b": { + "id": "Steelskull/L3.3-MS-Evalebis-70b", + "name": "MS Evalebis 70b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "miromind-ai/mirothinker-v1.5-235b": { + "id": "miromind-ai/mirothinker-v1.5-235b", + "name": "MiroThinker v1.5 235B", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-07", + "last_updated": "2026-01-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 4000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "pamanseau/OpenReasoning-Nemotron-32B": { + "id": "pamanseau/OpenReasoning-Nemotron-32B", + "name": "OpenReasoning Nemotron 32B", + "family": "nemotron", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "arcee-ai/trinity-mini": { + "id": "arcee-ai/trinity-mini", + "name": "Trinity Mini", + "family": "trinity-mini", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.045000000000000005, + "output": 0.15 + } + }, + "arcee-ai/trinity-large": { + "id": "arcee-ai/trinity-large", + "name": "Trinity Large", + "family": "trinity", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 1 + } + }, + "cognitivecomputations/dolphin-2.9.2-qwen2-72b": { + "id": "cognitivecomputations/dolphin-2.9.2-qwen2-72b", + "name": "Dolphin 72b", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-27", + "last_updated": "2025-02-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "input": 8192, + "output": 4096 + }, + "cost": { + "input": 0.306, + "output": 0.306 + } + }, + "deepcogito/cogito-v1-preview-qwen-32B": { + "id": "deepcogito/cogito-v1-preview-qwen-32B", + "name": "Cogito v1 Preview Qwen 32B", + "family": "qwen", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 1.7999999999999998, + "output": 1.7999999999999998 + } + }, + "deepcogito/cogito-v2.1-671b": { + "id": "deepcogito/cogito-v2.1-671b", + "name": "Cogito v2.1 671B MoE", + "family": "cogito", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 1.25 + } + }, + "Salesforce/Llama-xLAM-2-70b-fc-r": { + "id": "Salesforce/Llama-xLAM-2-70b-fc-r", + "name": "Llama-xLAM-2 70B fc-r", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 2.5 + } + }, + "NousResearch 2/hermes-4-405b:thinking": { + "id": "NousResearch 2/hermes-4-405b:thinking", + "name": "Hermes 4 Large (Thinking)", + "family": "nousresearch", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "NousResearch 2/DeepHermes-3-Mistral-24B-Preview": { + "id": "NousResearch 2/DeepHermes-3-Mistral-24B-Preview", + "name": "DeepHermes-3 Mistral 24B (Preview)", + "family": "nousresearch", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } + }, + "NousResearch 2/Hermes-4-70B:thinking": { + "id": "NousResearch 2/Hermes-4-70B:thinking", + "name": "Hermes 4 (Thinking)", + "family": "nousresearch", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-17", + "last_updated": "2025-09-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.2006, + "output": 0.39949999999999997 + } + }, + "NousResearch 2/hermes-4-405b": { + "id": "NousResearch 2/hermes-4-405b", + "name": "Hermes 4 Large", + "family": "nousresearch", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "NousResearch 2/hermes-3-llama-3.1-70b": { + "id": "NousResearch 2/hermes-3-llama-3.1-70b", + "name": "Hermes 3 70B", + "family": "nousresearch", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-07", + "last_updated": "2026-01-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 0.408, + "output": 0.408 + } + }, + "NousResearch 2/hermes-4-70b": { + "id": "NousResearch 2/hermes-4-70b", + "name": "Hermes 4 Medium", + "family": "nousresearch", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-03", + "last_updated": "2025-07-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.2006, + "output": 0.39949999999999997 + } + }, + "soob3123/Veiled-Calla-12B": { + "id": "soob3123/Veiled-Calla-12B", + "name": "Veiled Calla 12B", + "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": false, + "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", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } + }, + "soob3123/amoral-gemma3-27B-v2": { + "id": "soob3123/amoral-gemma3-27B-v2", + "name": "Amoral Gemma3 27B v2", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } + }, + "nex-agi/deepseek-v3.1-nex-n1": { + "id": "nex-agi/deepseek-v3.1-nex-n1", + "name": "DeepSeek V3.1 Nex N1", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-10", + "last_updated": "2025-12-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.27999999999999997, + "output": 0.42000000000000004 + } + }, + "Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B": { + "id": "Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B", + "name": "Llama 3.05 Storybreaker Ministral 70b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B": { + "id": "Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B", + "name": "Nemotron Tenyxchat Storybreaker 70b", + "family": "nemotron", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "anthracite-org/magnum-v4-72b": { + "id": "anthracite-org/magnum-v4-72b", + "name": "Magnum v4 72B", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 2.006, + "output": 2.992 + } + }, + "anthracite-org/magnum-v2-72b": { + "id": "anthracite-org/magnum-v2-72b", + "name": "Magnum V2 72B", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 2.006, + "output": 2.992 + } + }, + "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", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 0.5 + } + }, + "ReadyArt/The-Omega-Abomination-L-70B-v1.0": { + "id": "ReadyArt/The-Omega-Abomination-L-70B-v1.0", + "name": "The Omega Abomination V1", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 0.95 + } + }, + "undi95/remm-slerp-l2-13b": { + "id": "undi95/remm-slerp-l2-13b", + "name": "ReMM SLERP 13B", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 6144, + "input": 6144, + "output": 4096 + }, + "cost": { + "input": 0.7989999999999999, + "output": 1.2069999999999999 + } + }, + "MarinaraSpaghetti/NemoMix-Unleashed-12B": { + "id": "MarinaraSpaghetti/NemoMix-Unleashed-12B", + "name": "NemoMix 12B Unleashed", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "allenai/molmo-2-8b": { + "id": "allenai/molmo-2-8b", + "name": "Molmo 2 8B", + "family": "allenai", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 36864, + "input": 36864, + "output": 36864 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "allenai/olmo-3.1-32b-instruct": { + "id": "allenai/olmo-3.1-32b-instruct", + "name": "Olmo 3.1 32B Instruct", + "family": "allenai", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-25", + "last_updated": "2026-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } + }, + "allenai/olmo-3.1-32b-think": { + "id": "allenai/olmo-3.1-32b-think", + "name": "Olmo 3.1 32B Think", + "family": "allenai", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-25", + "last_updated": "2026-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.5 + } + }, + "allenai/olmo-3-32b-think": { + "id": "allenai/olmo-3-32b-think", + "name": "Olmo 3 32B Think", + "family": "allenai", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-01", + "last_updated": "2025-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.44999999999999996 + } + }, + "stepfun-ai/step-3.5-flash:thinking": { + "id": "stepfun-ai/step-3.5-flash:thinking", + "name": "Step 3.5 Flash Thinking", + "family": "step", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2026-02-02", + "last_updated": "2026-02-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 256000 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "stepfun-ai/step-3.5-flash": { + "id": "stepfun-ai/step-3.5-flash", + "name": "Step 3.5 Flash", + "family": "step", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2026-02-02", + "last_updated": "2026-02-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 256000 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "zai-org/glm-4.7": { + "id": "zai-org/glm-4.7", + "name": "GLM 4.7", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-01-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "input": 200000, + "output": 128000 + }, + "cost": { + "input": 0.15, + "output": 0.8 + } + }, + "zai-org/glm-5": { + "id": "zai-org/glm-5", + "name": "GLM 5", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "input": 200000, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 2.55 + } + }, + "zai-org/glm-5.1": { + "id": "zai-org/glm-5.1", + "name": "GLM 5.1", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "input": 200000, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 2.55 + } + }, + "zai-org/glm-5.1:thinking": { + "id": "zai-org/glm-5.1:thinking", + "name": "GLM 5.1 Thinking", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "input": 200000, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 2.55 + } + }, + "zai-org/glm-5:thinking": { + "id": "zai-org/glm-5:thinking", + "name": "GLM 5 Thinking", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "input": 200000, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 2.55 + } + }, + "zai-org/glm-4.7-flash": { + "id": "zai-org/glm-4.7-flash", + "name": "GLM 4.7 Flash", + "family": "glm-flash", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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 + } + }, + "featherless-ai/Qwerky-72B": { + "id": "featherless-ai/Qwerky-72B", + "name": "Qwerky 72B", + "family": "qwerky", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-20", + "last_updated": "2025-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8192 + }, + "cost": { + "input": 0.5, + "output": 0.5 + } + }, + "mlabonne/NeuralDaredevil-8B-abliterated": { + "id": "mlabonne/NeuralDaredevil-8B-abliterated", + "name": "Neural Daredevil 8B abliterated", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "input": 8192, + "output": 8192 + }, + "cost": { + "input": 0.44, + "output": 0.44 + } + }, + "raifle/sorcererlm-8x22b": { + "id": "raifle/sorcererlm-8x22b", + "name": "SorcererLM 8x22B", + "family": "mixtral", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16000, + "input": 16000, + "output": 8192 + }, + "cost": { + "input": 4.505, + "output": 4.505 + } + }, + "mistralai/mixtral-8x7b-instruct-v0.1": { + "id": "mistralai/mixtral-8x7b-instruct-v0.1", + "name": "Mixtral 8x7B", + "family": "mixtral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.27, + "output": 0.27 + } + }, + "mistralai/mistral-saba": { + "id": "mistralai/mistral-saba", + "name": "Mistral Saba", + "family": "mistral", + "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": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 32768 + }, + "cost": { + "input": 0.1989, + "output": 0.595 + } + }, + "mistralai/mistral-large-3-675b-instruct-2512": { + "id": "mistralai/mistral-large-3-675b-instruct-2512", + "name": "Mistral Large 3 675B", + "family": "mistral-large", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "input": 262144, + "output": 256000 + }, + "cost": { + "input": 1, + "output": 3 + } + }, + "mistralai/devstral-2-123b-instruct-2512": { + "id": "mistralai/devstral-2-123b-instruct-2512", + "name": "Devstral 2 123B", + "family": "devstral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "input": 262144, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 1.4 + } + }, + "mistralai/codestral-2508": { + "id": "mistralai/codestral-2508", + "name": "Codestral 2508", + "family": "codestral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.8999999999999999 + } + }, + "mistralai/ministral-14b-instruct-2512": { + "id": "mistralai/ministral-14b-instruct-2512", + "name": "Ministral 3 14B", + "family": "ministral", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "input": 262144, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "mistralai/mistral-tiny": { + "id": "mistralai/mistral-tiny", + "name": "Mistral Tiny", + "family": "mistral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2023-12-11", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8192 + }, + "cost": { + "input": 0.25499999999999995, + "output": 0.25499999999999995 + } + }, + "mistralai/ministral-8b-2512": { + "id": "mistralai/ministral-8b-2512", + "name": "Ministral 8B", + "family": "ministral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-04", + "last_updated": "2025-12-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "input": 262144, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } + }, + "mistralai/mixtral-8x22b-instruct-v0.1": { + "id": "mistralai/mixtral-8x22b-instruct-v0.1", + "name": "Mixtral 8x22B", + "family": "mixtral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 32768 + }, + "cost": { + "input": 0.8999999999999999, + "output": 0.8999999999999999 + } + }, + "mistralai/mistral-medium-3.1": { + "id": "mistralai/mistral-medium-3.1", + "name": "Mistral Medium 3.1", + "family": "mistral-medium", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 2 + } + }, + "mistralai/ministral-3b-2512": { + "id": "mistralai/ministral-3b-2512", + "name": "Ministral 3B", + "family": "ministral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-04", + "last_updated": "2025-12-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } + }, + "mistralai/Mistral-Nemo-Instruct-2407": { + "id": "mistralai/Mistral-Nemo-Instruct-2407", + "name": "Mistral Nemo", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.1003, + "output": 0.1207 + } + }, + "mistralai/mistral-medium-3": { + "id": "mistralai/mistral-medium-3", + "name": "Mistral Medium 3", + "family": "mistral-medium", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 2 + } + }, + "mistralai/mistral-7b-instruct": { + "id": "mistralai/mistral-7b-instruct", + "name": "Mistral 7B Instruct", + "family": "mistral", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-05-27", + "last_updated": "2024-05-27", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.0544, + "output": 0.0544 + } + }, + "mistralai/Devstral-Small-2505": { + "id": "mistralai/Devstral-Small-2505", + "name": "Mistral Devstral Small 2505", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.060000000000000005, + "output": 0.060000000000000005 + } + }, + "mistralai/mistral-small-creative": { + "id": "mistralai/mistral-small-creative", + "name": "Mistral Small Creative", + "family": "mistral-small", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } + }, + "mistralai/mistral-large": { + "id": "mistralai/mistral-large", + "name": "Mistral Large 2411", + "family": "mistral-large", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-02-26", + "last_updated": "2024-02-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 256000 + }, + "cost": { + "input": 2.006, + "output": 6.001 + } + }, + "mistralai/ministral-14b-2512": { + "id": "mistralai/ministral-14b-2512", + "name": "Ministral 14B", + "family": "ministral", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-04", + "last_updated": "2025-12-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "input": 262144, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "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", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 0.5 + } + }, + "shisa-ai/shisa-v2-llama3.3-70b": { + "id": "shisa-ai/shisa-v2-llama3.3-70b", + "name": "Shisa V2 Llama 3.3 70B", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.5, + "output": 0.5 + } + }, + "meta-llama/llama-3.3-70b-instruct": { + "id": "meta-llama/llama-3.3-70b-instruct", + "name": "Llama 3.3 70b Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-02-27", + "last_updated": "2025-02-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.23 + } + }, + "meta-llama/llama-4-scout": { + "id": "meta-llama/llama-4-scout", + "name": "Llama 4 Scout", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 328000, + "input": 328000, + "output": 65536 + }, + "cost": { + "input": 0.085, + "output": 0.46 + } + }, + "meta-llama/llama-4-maverick": { + "id": "meta-llama/llama-4-maverick", + "name": "Llama 4 Maverick", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "input": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.18000000000000002, + "output": 0.8 + } + }, + "meta-llama/llama-3.2-90b-vision-instruct": { + "id": "meta-llama/llama-3.2-90b-vision-instruct", + "name": "Llama 3.2 Medium", + "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": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 0.9009999999999999, + "output": 0.9009999999999999 + } + }, + "meta-llama/llama-3.2-3b-instruct": { + "id": "meta-llama/llama-3.2-3b-instruct", + "name": "Llama 3.2 3b Instruct", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.0306, + "output": 0.0493 + } + }, + "meta-llama/llama-3.1-8b-instruct": { + "id": "meta-llama/llama-3.1-8b-instruct", + "name": "Llama 3.1 8b Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 0.0544, + "output": 0.0544 + } + }, + "GalrionSoftworks/MN-LooseCannon-12B-v1": { + "id": "GalrionSoftworks/MN-LooseCannon-12B-v1", + "name": "MN-LooseCannon-12B-v1", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "baseten/Kimi-K2-Instruct-FP4": { + "id": "baseten/Kimi-K2-Instruct-FP4", + "name": "Kimi K2 0711 Instruct FP4", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-11", + "last_updated": "2025-07-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 2 + } + }, + "Gryphe/MythoMax-L2-13b": { + "id": "Gryphe/MythoMax-L2-13b", + "name": "MythoMax 13B", + "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": false, + "limit": { + "context": 4000, + "input": 4000, + "output": 4096 + }, + "cost": { + "input": 0.1003, + "output": 0.1003 + } + }, + "x-ai/grok-4-fast:thinking": { + "id": "x-ai/grok-4-fast:thinking", + "name": "Grok 4 Fast Thinking", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "input": 2000000, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "x-ai/grok-4-07-09": { + "id": "x-ai/grok-4-07-09", + "name": "Grok 4", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 131072 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "x-ai/grok-4-fast": { + "id": "x-ai/grok-4-fast", + "name": "Grok 4 Fast", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-20", + "last_updated": "2025-09-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "input": 2000000, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "x-ai/grok-code-fast-1": { + "id": "x-ai/grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } + }, + "x-ai/grok-4.1-fast": { + "id": "x-ai/grok-4.1-fast", + "name": "Grok 4.1 Fast", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "input": 2000000, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "x-ai/grok-4.1-fast-reasoning": { + "id": "x-ai/grok-4.1-fast-reasoning", + "name": "Grok 4.1 Fast Reasoning", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "input": 2000000, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "tencent/Hunyuan-MT-7B": { + "id": "tencent/Hunyuan-MT-7B", + "name": "Hunyuan MT 7B", + "family": "hunyuan", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-18", + "last_updated": "2025-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "input": 8192, + "output": 8192 + }, + "cost": { + "input": 10, + "output": 20 + } + }, + "microsoft/wizardlm-2-8x22b": { + "id": "microsoft/wizardlm-2-8x22b", + "name": "WizardLM-2 8x22B", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "microsoft/MAI-DS-R1-FP8": { + "id": "microsoft/MAI-DS-R1-FP8", + "name": "Microsoft DeepSeek R1", + "family": "deepseek", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } + }, + "cohere/command-r": { + "id": "cohere/command-r", + "name": "Cohere: Command R", + "family": "command-r", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-03-11", + "last_updated": "2024-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 0.476, + "output": 1.428 + } + }, + "cohere/command-r-plus-08-2024": { + "id": "cohere/command-r-plus-08-2024", + "name": "Cohere: Command R+", + "family": "command-r", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": false, + "release_date": "2024-08-30", + "last_updated": "2024-08-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 2.856, + "output": 14.246 + } + }, + "chutesai/Mistral-Small-3.2-24B-Instruct-2506": { + "id": "chutesai/Mistral-Small-3.2-24B-Instruct-2506", + "name": "Mistral Small 3.2 24b Instruct", + "family": "chutesai", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.4 + } + }, + "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": { + "id": "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1", + "name": "Nvidia Nemotron Ultra 253B", + "family": "nemotron", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-03", + "last_updated": "2025-07-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 0.8 + } + }, + "nvidia/nemotron-3-nano-30b-a3b": { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "Nvidia Nemotron 3 Nano 30B", + "family": "nemotron", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-15", + "last_updated": "2025-12-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 262144 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } + }, + "nvidia/nvidia-nemotron-nano-9b-v2": { + "id": "nvidia/nvidia-nemotron-nano-9b-v2", + "name": "Nvidia Nemotron Nano 9B v2", + "family": "nemotron", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-18", + "last_updated": "2025-08-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } + }, + "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": { + "id": "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF", + "name": "Nvidia Nemotron 70b", + "family": "nemotron", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.357, + "output": 0.408 + } + }, + "nvidia/Llama-3.3-Nemotron-Super-49B-v1": { + "id": "nvidia/Llama-3.3-Nemotron-Super-49B-v1", + "name": "Nvidia Nemotron Super 49B", + "family": "nemotron", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } + }, + "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5": { + "id": "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5", + "name": "Nvidia Nemotron Super 49B v1.5", + "family": "nemotron", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.25 + } + }, + "TheDrummer 2/Anubis-70B-v1": { + "id": "TheDrummer 2/Anubis-70B-v1", + "name": "Anubis 70B v1", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 16384 + }, + "cost": { + "input": 0.31, + "output": 0.31 + } + }, + "TheDrummer 2/Cydonia-24B-v4.3": { + "id": "TheDrummer 2/Cydonia-24B-v4.3", + "name": "The Drummer Cydonia 24B v4.3", + "family": "llama", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.1003, + "output": 0.1207 + } + }, + "TheDrummer 2/Magidonia-24B-v4.3": { + "id": "TheDrummer 2/Magidonia-24B-v4.3", + "name": "The Drummer Magidonia 24B v4.3", + "family": "llama", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.1003, + "output": 0.1207 + } + }, + "TheDrummer 2/Cydonia-24B-v4": { + "id": "TheDrummer 2/Cydonia-24B-v4", + "name": "The Drummer Cydonia 24B v4", + "family": "llama", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 32768 + }, + "cost": { + "input": 0.2006, + "output": 0.2414 + } + }, + "TheDrummer 2/Anubis-70B-v1.1": { + "id": "TheDrummer 2/Anubis-70B-v1.1", + "name": "Anubis 70B v1.1", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 0.31, + "output": 0.31 + } + }, + "TheDrummer 2/Rocinante-12B-v1.1": { + "id": "TheDrummer 2/Rocinante-12B-v1.1", + "name": "Rocinante 12b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.408, + "output": 0.595 + } + }, + "TheDrummer 2/Cydonia-24B-v4.1": { + "id": "TheDrummer 2/Cydonia-24B-v4.1", + "name": "The Drummer Cydonia 24B v4.1", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 32768 + }, + "cost": { + "input": 0.1003, + "output": 0.1207 + } + }, + "TheDrummer 2/UnslopNemo-12B-v4.1": { + "id": "TheDrummer 2/UnslopNemo-12B-v4.1", + "name": "UnslopNemo 12b v4", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "TheDrummer 2/Cydonia-24B-v2": { + "id": "TheDrummer 2/Cydonia-24B-v2", + "name": "The Drummer Cydonia 24B v2", + "family": "llama", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 32768 + }, + "cost": { + "input": 0.1003, + "output": 0.1207 + } + }, + "TheDrummer 2/skyfall-36b-v2": { + "id": "TheDrummer 2/skyfall-36b-v2", + "name": "TheDrummer Skyfall 36B V2", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 64000, + "input": 64000, + "output": 32768 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "deepseek-ai/DeepSeek-V3.1:thinking": { + "id": "deepseek-ai/DeepSeek-V3.1:thinking", + "name": "DeepSeek V3.1 Thinking", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 0.7 + } + }, + "deepseek-ai/DeepSeek-V3.1": { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-07-26", + "last_updated": "2025-07-26", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 0.7 + } + }, + "deepseek-ai/DeepSeek-V3.1-Terminus:thinking": { + "id": "deepseek-ai/DeepSeek-V3.1-Terminus:thinking", + "name": "DeepSeek V3.1 Terminus (Thinking)", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 0.7 + } + }, + "deepseek-ai/deepseek-v3.2-exp-thinking": { + "id": "deepseek-ai/deepseek-v3.2-exp-thinking", + "name": "DeepSeek V3.2 Exp Thinking", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 163840, + "input": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27999999999999997, + "output": 0.42000000000000004 + } + }, + "deepseek-ai/deepseek-v3.2-exp": { + "id": "deepseek-ai/deepseek-v3.2-exp", + "name": "DeepSeek V3.2 Exp", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 163840, + "input": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27999999999999997, + "output": 0.42000000000000004 + } + }, + "deepseek-ai/DeepSeek-R1-0528": { + "id": "deepseek-ai/DeepSeek-R1-0528", "name": "DeepSeek R1 0528", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 163840 + }, + "cost": { + "input": 0.4, + "output": 1.7 + } + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + "id": "deepseek-ai/DeepSeek-V3.1-Terminus", + "name": "DeepSeek V3.1 Terminus", + "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": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 0.7 + } + }, + "openai/gpt-5.1-codex-max": { + "id": "openai/gpt-5.1-codex-max", + "name": "GPT 5.1 Codex Max", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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 + } + }, + "openai/gpt-5.2-chat": { + "id": "openai/gpt-5.2-chat", + "name": "GPT 5.2 Chat", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-01", + "last_updated": "2026-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 400000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "openai/gpt-4o-mini-search-preview": { + "id": "openai/gpt-4o-mini-search-preview", + "name": "GPT-4o mini Search Preview", + "family": "gpt-mini", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.088, + "output": 0.35 + } + }, + "openai/chatgpt-4o-latest": { + "id": "openai/chatgpt-4o-latest", + "name": "ChatGPT 4o", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 4.998, + "output": 14.993999999999998 + } + }, + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "GPT 5.2 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-01-01", + "last_updated": "2026-01-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 400000, + "output": 128000 + }, + "cost": { + "input": 21, + "output": 168 + } + }, + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT 5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "GPT 5 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/gpt-4-turbo": { + "id": "openai/gpt-4-turbo", + "name": "GPT-4 Turbo", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2023-11-06", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } + }, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT 5.2", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-01-01", + "last_updated": "2026-01-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "openai/o3-mini-high": { + "id": "openai/o3-mini-high", + "name": "OpenAI o3-mini (High)", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 100000 + }, + "cost": { + "input": 0.64, + "output": 2.588 + } + }, + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "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.1496, + "output": 0.595 + } + }, + "openai/o4-mini-deep-research": { + "id": "openai/o4-mini-deep-research", + "name": "OpenAI o4-mini Deep Research", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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": 9.996, + "output": 19.992 + } + }, + "openai/gpt-5.1-chat": { + "id": "openai/gpt-5.1-chat", + "name": "GPT 5.1 Chat", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "OpenAI o4-mini", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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": 1.1, + "output": 4.4 + } + }, + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT 5.2 Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT 5.1 Codex Mini", + "family": "gpt-codex-mini", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/o1-preview": { + "id": "openai/o1-preview", + "name": "OpenAI o1-preview", + "family": "o", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 14.993999999999998, + "output": 59.993 + } + }, + "openai/gpt-4o-2024-08-06": { + "id": "openai/gpt-4o-2024-08-06", + "name": "GPT-4o (2024-08-06)", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "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.499, + "output": 9.996 + } + }, + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT 5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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 + } + }, + "openai/o1": { + "id": "openai/o1", + "name": "OpenAI o1", + "family": "o", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-17", + "last_updated": "2024-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 100000 + }, + "cost": { + "input": 14.993999999999998, + "output": 59.993 + } + }, + "openai/gpt-3.5-turbo": { + "id": "openai/gpt-3.5-turbo", + "name": "GPT-3.5 Turbo", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2022-11-30", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16385, + "input": 16385, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } + }, + "openai/o3-deep-research": { + "id": "openai/o3-deep-research", + "name": "OpenAI o3 Deep Research", + "family": "o", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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": 9.996, + "output": 19.992 + } + }, + "openai/o3-mini": { + "id": "openai/o3-mini", + "name": "OpenAI o3-mini", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4 + } + }, + "openai/gpt-4-turbo-preview": { + "id": "openai/gpt-4-turbo-preview", + "name": "GPT-4 Turbo Preview", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2023-11-06", + "last_updated": "2024-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 4096 + }, + "cost": { + "input": 9.996, + "output": 30.004999999999995 + } + }, + "openai/o1-pro": { + "id": "openai/o1-pro", + "name": "OpenAI o1 Pro", + "family": "o-pro", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-25", + "last_updated": "2025-01-25", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 100000 + }, + "cost": { + "input": 150, + "output": 600 + } + }, + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "GPT-5 Codex", + "family": "gpt-codex", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 9.996, + "output": 19.992 + } + }, + "openai/gpt-5.1-chat-latest": { + "id": "openai/gpt-5.1-chat-latest", + "name": "GPT 5.1 Chat (Latest)", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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": 16384 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "openai/gpt-4o-search-preview": { + "id": "openai/gpt-4o-search-preview", + "name": "GPT-4o Search Preview", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 1.47, + "output": 5.88 + } + }, + "openai/gpt-4.1-nano": { + "id": "openai/gpt-4.1-nano", + "name": "GPT 4.1 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/o4-mini-high": { + "id": "openai/o4-mini-high", + "name": "OpenAI o4-mini high", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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": 1.1, + "output": 4.4 + } + }, + "openai/o3": { + "id": "openai/o3", + "name": "OpenAI o3", + "family": "o", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.04, + "output": 0.15 + } + }, + "openai/gpt-5-pro": { + "id": "openai/gpt-5-pro", + "name": "GPT 5 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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": 15, + "output": 120 + } + }, + "openai/gpt-5.1-2025-11-13": { + "id": "openai/gpt-5.1-2025-11-13", + "name": "GPT-5.1 (2025-11-13)", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 32768 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "openai/gpt-4o": { + "id": "openai/gpt-4o", + "name": "GPT-4o", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 2.499, + "output": 9.996 + } + }, + "openai/o3-mini-low": { + "id": "openai/o3-mini-low", + "name": "OpenAI o3-mini (Low)", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 100000 + }, + "cost": { + "input": 9.996, + "output": 19.992 + } + }, + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT 5", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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 + } + }, + "openai/gpt-oss-safeguard-20b": { + "id": "openai/gpt-oss-safeguard-20b", + "name": "GPT OSS Safeguard 20B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-10-29", + "last_updated": "2025-10-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } + }, + "openai/o3-pro-2025-06-10": { + "id": "openai/o3-pro-2025-06-10", + "name": "OpenAI o3-pro (2025-06-10)", + "family": "o-pro", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "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": 9.996, + "output": 19.992 + } + }, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.25 + } + }, + "openai/gpt-5-chat-latest": { + "id": "openai/gpt-5-chat-latest", + "name": "GPT 5 Chat", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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": 1.25, + "output": 10 + } + }, + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT 4.1", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-10", + "last_updated": "2025-09-10", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1047576, + "input": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8 + } + }, + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "GPT 4.1 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT 5.1 Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "openai/gpt-4o-2024-11-20": { + "id": "openai/gpt-4o-2024-11-20", + "name": "GPT-4o (2024-11-20)", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "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 + } + }, + "VongolaChouko/Starcannon-Unleashed-12B-v1.0": { + "id": "VongolaChouko/Starcannon-Unleashed-12B-v1.0", + "name": "Mistral Nemo Starcannon 12b v1", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "amazon/nova-lite-v1": { + "id": "amazon/nova-lite-v1", + "name": "Amazon Nova Lite 1.0", + "family": "nova-lite", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 300000, + "input": 300000, + "output": 5120 + }, + "cost": { + "input": 0.0595, + "output": 0.238 + } + }, + "amazon/nova-pro-v1": { + "id": "amazon/nova-pro-v1", + "name": "Amazon Nova Pro 1.0", + "family": "nova-pro", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 300000, + "input": 300000, + "output": 32000 + }, + "cost": { + "input": 0.7989999999999999, + "output": 3.1959999999999997 + } + }, + "amazon/nova-2-lite-v1": { + "id": "amazon/nova-2-lite-v1", + "name": "Amazon Nova 2 Lite", + "family": "nova", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 65535 + }, + "cost": { + "input": 0.5099999999999999, + "output": 4.25 + } + }, + "amazon/nova-micro-v1": { + "id": "amazon/nova-micro-v1", + "name": "Amazon Nova Micro 1.0", + "family": "nova-micro", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 5120 + }, + "cost": { + "input": 0.0357, + "output": 0.1394 + } + }, + "Sao10K/L3.3-70B-Euryale-v2.3": { + "id": "Sao10K/L3.3-70B-Euryale-v2.3", + "name": "Llama 3.3 70B Euryale", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 20480, + "input": 20480, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Sao10K/L3.1-70B-Euryale-v2.2": { + "id": "Sao10K/L3.1-70B-Euryale-v2.2", + "name": "Llama 3.1 70B Euryale", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 20480, + "input": 20480, + "output": 16384 + }, + "cost": { + "input": 0.306, + "output": 0.357 + } + }, + "Sao10K/L3.1-70B-Hanami-x1": { + "id": "Sao10K/L3.1-70B-Hanami-x1", + "name": "Llama 3.1 70B Hanami", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "Sao10K/L3-8B-Stheno-v3.2": { + "id": "Sao10K/L3-8B-Stheno-v3.2", + "name": "Sao10K Stheno 8b", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-11-29", + "last_updated": "2024-11-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.2006, + "output": 0.2006 + } + }, + "LatitudeGames/Wayfarer-Large-70B-Llama-3.3": { + "id": "LatitudeGames/Wayfarer-Large-70B-Llama-3.3", + "name": "Llama 3.3 70B Wayfarer", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.700000007, + "output": 0.700000007 + } + }, + "z-ai/glm-4.6:thinking": { + "id": "z-ai/glm-4.6:thinking", + "name": "GLM 4.6 Thinking", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 65535 + }, + "cost": { + "input": 0.4, + "output": 1.5 + } + }, + "z-ai/glm-4.5v": { + "id": "z-ai/glm-4.5v", + "name": "GLM 4.5V", + "family": "glmv", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-22", + "last_updated": "2025-11-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 64000, + "input": 64000, + "output": 96000 + }, + "cost": { + "input": 0.6, + "output": 1.7999999999999998 + } + }, + "z-ai/glm-4.6": { + "id": "z-ai/glm-4.6", + "name": "GLM 4.6", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 65535 + }, + "cost": { + "input": 0.4, + "output": 1.5 + } + }, + "z-ai/glm-4.5v:thinking": { + "id": "z-ai/glm-4.5v:thinking", + "name": "GLM 4.5V Thinking", + "family": "glmv", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-22", + "last_updated": "2025-11-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 64000, + "input": 64000, + "output": 96000 + }, + "cost": { + "input": 0.6, + "output": 1.7999999999999998 + } + }, + "baidu/ernie-4.5-vl-28b-a3b": { + "id": "baidu/ernie-4.5-vl-28b-a3b", + "name": "ERNIE 4.5 VL 28B", + "family": "ernie", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-30", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.13999999999999999, + "output": 0.5599999999999999 + } + }, + "baidu/ernie-4.5-300b-a47b": { + "id": "baidu/ernie-4.5-300b-a47b", + "name": "ERNIE 4.5 300B", + "family": "ernie", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-30", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 16384 + }, + "cost": { + "input": 0.35, + "output": 1.15 + } + }, + "dmind/dmind-1": { + "id": "dmind/dmind-1", + "name": "DMind-1", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-01", + "last_updated": "2025-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.6 + } + }, + "dmind/dmind-1-mini": { + "id": "dmind/dmind-1-mini", + "name": "DMind-1-Mini", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-01", + "last_updated": "2025-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.4 + } + }, + "Infermatic/MN-12B-Inferor-v0.0": { + "id": "Infermatic/MN-12B-Inferor-v0.0", + "name": "Mistral Nemo Inferor 12B", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.25499999999999995, + "output": 0.49299999999999994 + } + }, + "meituan-longcat/LongCat-Flash-Chat-FP8": { + "id": "meituan-longcat/LongCat-Flash-Chat-FP8", + "name": "LongCat Flash", + "family": "longcat", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-08-31", + "last_updated": "2025-08-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.7 + } + }, + "meganova-ai/manta-mini-1.0": { + "id": "meganova-ai/manta-mini-1.0", + "name": "Manta Mini 1.0", + "family": "nova", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-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 + } + }, + "meganova-ai/manta-pro-1.0": { + "id": "meganova-ai/manta-pro-1.0", + "name": "Manta Pro 1.0", + "family": "nova", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-20", + "last_updated": "2025-12-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0.060000000000000005, + "output": 0.5 + } + }, + "meganova-ai/manta-flash-1.0": { + "id": "meganova-ai/manta-flash-1.0", + "name": "Manta Flash 1.0", + "family": "nova", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-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 + } + }, + "minimax/minimax-m2.7": { + "id": "minimax/minimax-m2.7", + "name": "MiniMax M2.7", + "family": "minimax", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "input": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "minimax/minimax-01": { + "id": "minimax/minimax-01", + "name": "MiniMax 01", + "family": "minimax", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-15", + "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.1219999999999999 + } + }, + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "MiniMax M2.1", + "family": "minimax", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-12-19", + "last_updated": "2025-12-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 200000, + "output": 131072 + }, + "cost": { + "input": 0.33, + "output": 1.32 + } + }, + "minimax/minimax-m2-her": { + "id": "minimax/minimax-m2-her", + "name": "MiniMax M2-her", + "family": "minimax", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-01-24", + "last_updated": "2026-01-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65532, + "input": 65532, + "output": 2048 + }, + "cost": { + "input": 0.30200000000000005, + "output": 1.2069999999999999 + } + }, + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "input": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "qwen/Qwen3.6-35B-A3B:thinking": { + "id": "qwen/Qwen3.6-35B-A3B:thinking", + "name": "Qwen3.6 35B A3B Thinking", + "family": "qwen3.6", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2026-04-19", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.29, + "output": 1.74 + } + }, + "qwen/qwen3.5-397b-a17b": { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen3.5 397B A17B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 258048, + "input": 258048, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } + }, + "qwen/Qwen3.6-35B-A3B": { + "id": "qwen/Qwen3.6-35B-A3B", + "name": "Qwen3.6 35B A3B", + "family": "qwen3.6", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2026-04-17", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.29, + "output": 1.74 + } + }, + "unsloth/gemma-3-1b-it": { + "id": "unsloth/gemma-3-1b-it", + "name": "Gemma 3 1B IT", + "family": "unsloth", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.1003, + "output": 0.1003 + } + }, + "unsloth/gemma-3-12b-it": { + "id": "unsloth/gemma-3-12b-it", + "name": "Gemma 3 12B IT", + "family": "unsloth", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 131072 + }, + "cost": { + "input": 0.272, + "output": 0.272 + } + }, + "unsloth/gemma-3-4b-it": { + "id": "unsloth/gemma-3-4b-it", + "name": "Gemma 3 4B IT", + "family": "unsloth", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.2006, + "output": 0.2006 + } + }, + "unsloth/gemma-3-27b-it": { + "id": "unsloth/gemma-3-27b-it", + "name": "Gemma 3 27B IT", + "family": "unsloth", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-03-10", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 96000 + }, + "cost": { + "input": 0.2992, + "output": 0.2992 + } + }, + "THUDM/GLM-Z1-9B-0414": { + "id": "THUDM/GLM-Z1-9B-0414", + "name": "GLM Z1 9B 0414", + "family": "glm-z", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8000 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "THUDM/GLM-4-9B-0414": { + "id": "THUDM/GLM-4-9B-0414", + "name": "GLM 4 9B 0414", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 8000 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "THUDM/GLM-Z1-Rumination-32B-0414": { + "id": "THUDM/GLM-Z1-Rumination-32B-0414", + "name": "GLM Z1 Rumination 32B 0414", + "family": "glm-z", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "input": 32000, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "THUDM/GLM-4-32B-0414": { + "id": "THUDM/GLM-4-32B-0414", + "name": "GLM 4 32B 0414", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "THUDM/GLM-Z1-32B-0414": { + "id": "THUDM/GLM-Z1-32B-0414", + "name": "GLM Z1 32B 0414", + "family": "glm-z", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "google/gemini-3-flash-preview": { + "id": "google/gemini-3-flash-preview", + "name": "Gemini 3 Flash (Preview)", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } + }, + "google/gemini-flash-1.5": { + "id": "google/gemini-flash-1.5", + "name": "Gemini 1.5 Flash", + "family": "gemini-flash", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-05-14", + "last_updated": "2024-05-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "input": 2000000, + "output": 8192 + }, + "cost": { + "input": 0.0748, + "output": 0.306 + } + }, + "google/gemini-3-flash-preview-thinking": { + "id": "google/gemini-3-flash-preview-thinking", + "name": "Gemini 3 Flash Thinking", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048756, + "input": 1048756, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } + }, + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": false, + "release_date": "2026-01-26", + "last_updated": "2026-01-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1.9 + } + }, + "moonshotai/kimi-k2-instruct": { + "id": "moonshotai/kimi-k2-instruct", + "name": "Kimi K2 Instruct", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 2 + } + }, + "moonshotai/kimi-k2-thinking-original": { + "id": "moonshotai/kimi-k2-thinking-original", + "name": "Kimi K2 Thinking Original", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.5 + } + }, + "moonshotai/kimi-k2-instruct-0711": { + "id": "moonshotai/kimi-k2-instruct-0711", + "name": "Kimi K2 0711", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-07-11", + "last_updated": "2025-07-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 2 + } + }, + "moonshotai/Kimi-Dev-72B": { + "id": "moonshotai/Kimi-Dev-72B", + "name": "Kimi Dev 72B", + "family": "kimi", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } + }, + "moonshotai/kimi-k2-thinking-turbo-original": { + "id": "moonshotai/kimi-k2-thinking-turbo-original", + "name": "Kimi K2 Thinking Turbo Original", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 16384 + }, + "cost": { + "input": 1.15, + "output": 8 + } + }, + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": false, + "release_date": "2026-04-16", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.53, + "output": 2.73 + } + }, + "moonshotai/kimi-k2.6:thinking": { + "id": "moonshotai/kimi-k2.6:thinking", + "name": "Kimi K2.6 Thinking", + "family": "kimi-thinking", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": false, + "release_date": "2026-04-16", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.53, + "output": 2.73 + } + }, + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi K2 0905", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 262144 + }, + "cost": { + "input": 0.4, + "output": 2 + } + }, + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 262144 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "moonshotai/kimi-k2.5:thinking": { + "id": "moonshotai/kimi-k2.5:thinking", + "name": "Kimi K2.5 Thinking", + "family": "kimi-thinking", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": false, + "release_date": "2026-01-26", + "last_updated": "2026-01-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1.9 + } + }, + "Tongyi-Zhiwen/QwenLong-L1-32B": { + "id": "Tongyi-Zhiwen/QwenLong-L1-32B", + "name": "QwenLong L1 32B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-25", + "last_updated": "2025-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 40960 + }, + "cost": { + "input": 0.13999999999999999, + "output": 0.6 + } + }, + "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", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "aion-labs/aion-1.0": { + "id": "aion-labs/aion-1.0", + "name": "Aion 1.0", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-02-01", + "last_updated": "2025-02-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "input": 65536, + "output": 8192 + }, + "cost": { + "input": 3.995, + "output": 7.99 + } + }, + "aion-labs/aion-rp-llama-3.1-8b": { + "id": "aion-labs/aion-rp-llama-3.1-8b", + "name": "Llama 3.1 8b (uncensored)", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 16384 + }, + "cost": { + "input": 0.2006, + "output": 0.2006 + } + }, + "aion-labs/aion-1.0-mini": { + "id": "aion-labs/aion-1.0-mini", + "name": "Aion 1.0 mini (DeepSeek)", + "family": "deepseek", + "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": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 8192 + }, + "cost": { + "input": 0.7989999999999999, + "output": 1.394 + } + }, + "Alibaba-NLP/Tongyi-DeepResearch-30B-A3B": { + "id": "Alibaba-NLP/Tongyi-DeepResearch-30B-A3B", + "name": "Tongyi DeepResearch 30B A3B", + "family": "yi", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.08, + "output": 0.24000000000000002 + } + }, + "MiniMaxAI/MiniMax-M1-80k": { + "id": "MiniMaxAI/MiniMax-M1-80k", + "name": "MiniMax M1 80K", + "family": "minimax", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-06-16", + "last_updated": "2025-06-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 131072 + }, + "cost": { + "input": 0.6052, + "output": 2.4225000000000003 + } + }, + "anthropic/claude-opus-4.6:thinking:low": { + "id": "anthropic/claude-opus-4.6:thinking:low", + "name": "Claude 4.6 Opus Thinking Low", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } + }, + "anthropic/claude-opus-4.6": { + "id": "anthropic/claude-opus-4.6", + "name": "Claude 4.6 Opus", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } + }, + "anthropic/claude-sonnet-4.6:thinking": { + "id": "anthropic/claude-sonnet-4.6:thinking", + "name": "Claude Sonnet 4.6 Thinking", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 2.992, + "output": 14.993999999999998 + } + }, + "anthropic/claude-opus-4.6:thinking:max": { + "id": "anthropic/claude-opus-4.6:thinking:max", + "name": "Claude 4.6 Opus Thinking Max", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } + }, + "anthropic/claude-opus-4.6:thinking:medium": { + "id": "anthropic/claude-opus-4.6:thinking:medium", + "name": "Claude 4.6 Opus Thinking Medium", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } + }, + "anthropic/claude-sonnet-4.6": { + "id": "anthropic/claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 2.992, + "output": 14.993999999999998 + } + }, + "anthropic/claude-opus-4.6:thinking": { + "id": "anthropic/claude-opus-4.6:thinking", + "name": "Claude 4.6 Opus Thinking", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "input": 1000000, + "output": 128000 + }, + "cost": { + "input": 4.998, + "output": 25.007 + } + }, + "abacusai/Dracarys-72B-Instruct": { + "id": "abacusai/Dracarys-72B-Instruct", + "name": "Llama 3.1 70B Dracarys 2", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "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", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 2.006, + "output": 2.006 + } + }, + "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", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.7989999999999999, + "output": 0.7989999999999999 + } + }, + "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", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 2.006, + "output": 2.006 + } + }, + "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", + "family": "qwen", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.7989999999999999, + "output": 0.7989999999999999 + } + }, + "huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated": { + "id": "huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated", + "name": "DeepSeek R1 Qwen Abliterated", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 1.4, + "output": 1.4 + } + }, + "huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated": { + "id": "huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated", + "name": "DeepSeek R1 Llama 70B Abliterated", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } + }, + "huihui-ai/Llama-3.3-70B-Instruct-abliterated": { + "id": "huihui-ai/Llama-3.3-70B-Instruct-abliterated", + "name": "Llama 3.3 70B Instruct abliterated", + "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": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } + }, + "huihui-ai/Qwen2.5-32B-Instruct-abliterated": { + "id": "huihui-ai/Qwen2.5-32B-Instruct-abliterated", + "name": "Qwen 2.5 32B Abliterated", + "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": false, + "limit": { + "context": 32768, + "input": 32768, + "output": 8192 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } + }, + "huihui-ai/Llama-3.1-Nemotron-70B-Instruct-HF-abliterated": { + "id": "huihui-ai/Llama-3.1-Nemotron-70B-Instruct-HF-abliterated", + "name": "Nemotron 3.1 70B abliterated", + "family": "nemotron", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } + }, + "xiaomi/mimo-v2-flash-thinking-original": { + "id": "xiaomi/mimo-v2-flash-thinking-original", + "name": "MiMo V2 Flash (Thinking) Original", + "family": "mimo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.102, + "output": 0.306 + } + }, + "xiaomi/mimo-v2-flash-thinking": { + "id": "xiaomi/mimo-v2-flash-thinking", + "name": "MiMo V2 Flash (Thinking)", + "family": "mimo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.102, + "output": 0.306 + } + }, + "xiaomi/mimo-v2-flash": { + "id": "xiaomi/mimo-v2-flash", + "name": "MiMo V2 Flash", + "family": "mimo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.102, + "output": 0.306 + } + }, + "xiaomi/mimo-v2-flash-original": { + "id": "xiaomi/mimo-v2-flash-original", + "name": "MiMo V2 Flash Original", + "family": "mimo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.102, + "output": 0.306 + } + }, + "tngtech/DeepSeek-TNG-R1T2-Chimera": { + "id": "tngtech/DeepSeek-TNG-R1T2-Chimera", + "name": "DeepSeek TNG R1T2 Chimera", + "family": "tngtech", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "cost": { + "input": 0.31, + "output": 0.31 + } + }, + "tngtech/tng-r1t-chimera": { + "id": "tngtech/tng-r1t-chimera", + "name": "TNG R1T Chimera", + "family": "tngtech", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2025-11-26", + "last_updated": "2025-11-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "inflatebot/MN-12B-Mag-Mell-R1": { + "id": "inflatebot/MN-12B-Mag-Mell-R1", + "name": "Mag Mell R1", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 0.49299999999999994, + "output": 0.49299999999999994 + } + }, + "failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5": { + "id": "failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5", + "name": "Llama 3 70B abliterated", + "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": false, + "limit": { + "context": 8192, + "input": 8192, + "output": 8192 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } + } + } + }, + "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": { + "gpt-5.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + } + }, + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-03-31", + "release_date": "2025-11-01", + "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 + } + }, + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.6, + "output": 3 + } + }, + "gemini-3.1-flash-lite-preview": { + "id": "gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2026-03-01", + "last_updated": "2026-03-01", + "modalities": { + "input": ["text", "image", "audio", "video", "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 + } + }, + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "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 + } + }, + "gpt-5.3-chat-latest": { + "id": "gpt-5.3-chat-latest", + "name": "GPT-5.3 Chat Latest", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-01", + "last_updated": "2026-03-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "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": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } + }, + "llama-3.3-70b-versatile": { + "id": "llama-3.3-70b-versatile", + "name": "Llama 3.3 70B Versatile", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.59, + "output": 0.79 + } + }, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2 + } + }, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4 + } + }, + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + } + }, + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + } + }, + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "Grok 4.1 Fast (Non-Reasoning)", + "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 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "o3-pro": { + "id": "o3-pro", + "name": "o3-pro", + "family": "o-pro", + "attachment": true, + "reasoning": true, + "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": 20, + "output": 40 + } + }, + "gpt-4o-mini": { + "id": "gpt-4o-mini", + "name": "GPT-4o Mini", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-04", + "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 + } + }, + "qwen3-max": { + "id": "qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 1.2, + "output": 6 + } + }, + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o-mini", + "attachment": true, + "reasoning": true, + "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.1, + "output": 4.4 + } + }, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + } + }, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } + }, + "gpt-5.2-chat-latest": { + "id": "gpt-5.2-chat-latest", + "name": "GPT-5.2 Chat Latest", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-09-30", + "release_date": "2026-01-01", + "last_updated": "2026-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "gpt-5.3-codex-xhigh": { + "id": "gpt-5.3-codex-xhigh", + "name": "GPT-5.3 Codex XHigh", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + } + }, + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "release_date": "2025-09-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } + }, + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "o3-mini": { + "id": "o3-mini", + "name": "o3-mini", + "family": "o-mini", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 1.1, + "output": 4.4 + } + }, + "grok-4-0709": { + "id": "grok-4-0709", + "name": "Grok 4", + "family": "grok", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "route-llm": { + "id": "route-llm", + "name": "Route LLM", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "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": 3, + "output": 15 + } + }, + "qwen-2.5-coder-32b": { + "id": "qwen-2.5-coder-32b", + "name": "Qwen 2.5 Coder 32B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "release_date": "2024-11-11", + "last_updated": "2024-11-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.79, + "output": 0.79 + } + }, + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "GPT-5 Codex", + "family": "gpt", + "attachment": false, + "reasoning": true, + "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 + } + }, + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "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 + } + }, + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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": 2.5, + "output": 15 + } + }, + "gpt-5.1-chat-latest": { + "id": "gpt-5.1-chat-latest", + "name": "GPT-5.1 Chat Latest", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, + "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 + } + }, + "claude-sonnet-4-20250514": { + "id": "claude-sonnet-4-20250514", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-05-14", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "kimi-k2-turbo-preview": { + "id": "kimi-k2-turbo-preview", + "name": "Kimi K2 Turbo Preview", + "family": "kimi", + "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 + }, + "cost": { + "input": 0.15, + "output": 8 + } + }, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25 + } + }, + "gpt-4.1-nano": { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 Nano", + "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": 0.1, + "output": 0.4 + } + }, + "claude-3-7-sonnet-20250219": { + "id": "claude-3-7-sonnet-20250219", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "o3": { + "id": "o3", + "name": "o3", + "family": "o", + "attachment": true, + "reasoning": true, + "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": 2, + "output": 8 + } + }, + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "claude-opus-4-20250514": { + "id": "claude-opus-4-20250514", + "name": "Claude Opus 4", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-05-14", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75 + } + }, + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", + "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 + } + }, + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 Mini", + "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": 0.4, + "output": 1.6 + } + }, + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + } + }, + "gpt-4o-2024-11-20": { + "id": "gpt-4o-2024-11-20", + "name": "GPT-4o (2024-11-20)", + "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", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10 + } + }, + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "Grok 4 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, + "reasoning": false, + "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": 2000000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "deepseek/deepseek-v3.1": { + "id": "deepseek/deepseek-v3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.55, + "output": 1.66 + } + }, + "Qwen/QwQ-32B": { + "id": "Qwen/QwQ-32B", + "name": "QwQ 32B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2024-11-28", + "last_updated": "2024-11-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 8192 + }, + "cost": { + "input": 0.13, + "output": 0.6 + } + }, + "Qwen/Qwen3-32B": { + "id": "Qwen/Qwen3-32B", + "name": "Qwen3 32B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "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": 128000, + "output": 8192 + }, + "cost": { + "input": 0.09, + "output": 0.29 + } + }, + "Qwen/qwen3-coder-480b-a35b-instruct": { + "id": "Qwen/qwen3-coder-480b-a35b-instruct", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "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.29, + "output": 1.2 + } + }, + "Qwen/Qwen2.5-72B-Instruct": { + "id": "Qwen/Qwen2.5-72B-Instruct", + "name": "Qwen 2.5 72B Instruct", + "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 + }, + "cost": { + "input": 0.11, + "output": 0.38 + } + }, + "zai-org/glm-4.7": { + "id": "zai-org/glm-4.7", + "name": "GLM-4.7", + "family": "glm", + "attachment": false, + "reasoning": false, + "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 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } + }, + "zai-org/glm-5": { + "id": "zai-org/glm-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2 + } + }, + "zai-org/glm-4.5": { + "id": "zai-org/glm-4.5", + "name": "GLM-4.5", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": 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": 8192 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } + }, + "zai-org/glm-4.6": { + "id": "zai-org/glm-4.6", + "name": "GLM-4.6", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "release_date": "2025-03-01", + "last_updated": "2025-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } + }, + "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", + "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 + }, + "cost": { + "input": 3.5, + "output": 3.5 + } + }, + "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", + "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": 32768 + }, + "cost": { + "input": 0.14, + "output": 0.59 + } + }, + "meta-llama/Meta-Llama-3.1-8B-Instruct": { + "id": "meta-llama/Meta-Llama-3.1-8B-Instruct", + "name": "Llama 3.1 8B Instruct", + "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 + }, + "cost": { + "input": 0.02, + "output": 0.05 + } + }, + "deepseek-ai/DeepSeek-R1": { + "id": "deepseek-ai/DeepSeek-R1", + "name": "DeepSeek R1", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 7 + } + }, + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-06-15", + "last_updated": "2025-06-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.27, + "output": 0.4 + } + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + "id": "deepseek-ai/DeepSeek-V3.1-Terminus", + "name": "DeepSeek V3.1 Terminus", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 0.27, + "output": 1 + } + }, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT-OSS 120B", + "family": "gpt-oss", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.08, + "output": 0.44 + } + } + } + }, + "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": { + "perplexity/sonar": { + "id": "perplexity/sonar", + "name": "Sonar", + "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 + } + }, + "xai/grok-4-1-fast-non-reasoning": { + "id": "xai/grok-4-1-fast-non-reasoning", + "name": "Grok 4.1 Fast (Non-Reasoning)", + "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 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } + }, + "nvidia/nemotron-3-super-120b-a12b": { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "Nemotron 3 Super 120B", + "family": "nemotron", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 0.25, + "output": 2.5 + } + }, + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + } + }, + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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.25, + "output": 2, + "cache_read": 0.025 + } + }, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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.75, + "output": 14, + "cache_read": 0.175 + } + }, + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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.25, + "output": 10, + "cache_read": 0.125 + } + }, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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": 2.5, + "output": 15, + "cache_read": 0.25 + } + }, + "google/gemini-3.1-pro-preview": { + "id": "google/gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "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 + } + } + }, + "google/gemini-3-flash-preview": { + "id": "google/gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "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 + } + } + }, + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } + } + }, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } + }, + "anthropic/claude-haiku-4-5": { + "id": "anthropic/claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, + "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 + } + }, + "anthropic/claude-sonnet-4-6": { + "id": "anthropic/claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3 + } + }, + "anthropic/claude-opus-4-7": { + "id": "anthropic/claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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 + } + }, + "anthropic/claude-opus-4-5": { + "id": "anthropic/claude-opus-4-5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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 + } + }, + "anthropic/claude-opus-4-6": { + "id": "anthropic/claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5 + } + }, + "anthropic/claude-sonnet-4-5": { + "id": "anthropic/claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + } + } + } + }, + "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": { + "Kwaipilot/KAT-Dev": { + "id": "Kwaipilot/KAT-Dev", + "name": "Kwaipilot/KAT-Dev", + "family": "kat-coder", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-27", + "last_updated": "2026-01-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } + }, + "Qwen/Qwen3.5-397B-A17B": { + "id": "Qwen/Qwen3.5-397B-A17B", + "name": "Qwen/Qwen3.5-397B-A17B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "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": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.29, + "output": 1.74 + } + }, + "Qwen/Qwen3.5-35B-A3B": { + "id": "Qwen/Qwen3.5-35B-A3B", + "name": "Qwen/Qwen3.5-35B-A3B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-02-25", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.23, + "output": 1.86 + } + }, + "Qwen/Qwen3.5-122B-A10B": { + "id": "Qwen/Qwen3.5-122B-A10B", + "name": "Qwen/Qwen3.5-122B-A10B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.29, + "output": 2.32 + } + }, + "Qwen/Qwen3.5-9B": { + "id": "Qwen/Qwen3.5-9B", + "name": "Qwen/Qwen3.5-9B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-03-03", + "last_updated": "2026-03-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.22, + "output": 1.74 + } + }, + "Qwen/Qwen3.5-27B": { + "id": "Qwen/Qwen3.5-27B", + "name": "Qwen/Qwen3.5-27B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-02-25", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.26, + "output": 2.09 + } + }, + "Qwen/Qwen3.5-4B": { + "id": "Qwen/Qwen3.5-4B", + "name": "Qwen/Qwen3.5-4B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-03-03", + "last_updated": "2026-03-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "Qwen/Qwen3.6-35B-A3B": { + "id": "Qwen/Qwen3.6-35B-A3B", + "name": "Qwen/Qwen3.6-35B-A3B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "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.23, + "output": 1.86 + } + }, + "Qwen/Qwen2.5-72B-Instruct": { + "id": "Qwen/Qwen2.5-72B-Instruct", + "name": "Qwen/Qwen2.5-72B-Instruct", + "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": false, + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.59, + "output": 0.59 + } + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "name": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-31", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.25, + "output": 1 + } + }, + "Qwen/Qwen3-VL-8B-Instruct": { + "id": "Qwen/Qwen3-VL-8B-Instruct", + "name": "Qwen/Qwen3-VL-8B-Instruct", + "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": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.18, + "output": 0.68 + } + }, + "Qwen/Qwen3-VL-32B-Instruct": { + "id": "Qwen/Qwen3-VL-32B-Instruct", + "name": "Qwen/Qwen3-VL-32B-Instruct", + "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": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } + }, + "Qwen/Qwen3-VL-30B-A3B-Thinking": { + "id": "Qwen/Qwen3-VL-30B-A3B-Thinking", + "name": "Qwen/Qwen3-VL-30B-A3B-Thinking", + "family": "qwen", + "attachment": true, + "reasoning": true, + "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": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.29, + "output": 1 + } + }, + "Qwen/Qwen2.5-14B-Instruct": { + "id": "Qwen/Qwen2.5-14B-Instruct", + "name": "Qwen/Qwen2.5-14B-Instruct", + "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": false, + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } + }, + "Qwen/Qwen3-VL-235B-A22B-Instruct": { + "id": "Qwen/Qwen3-VL-235B-A22B-Instruct", + "name": "Qwen/Qwen3-VL-235B-A22B-Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.3, + "output": 1.5 + } + }, + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", + "name": "Qwen/Qwen3-Next-80B-A3B-Thinking", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } + }, + "Qwen/Qwen2.5-VL-32B-Instruct": { + "id": "Qwen/Qwen2.5-VL-32B-Instruct", + "name": "Qwen/Qwen2.5-VL-32B-Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-03-24", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.27, + "output": 0.27 + } + }, + "Qwen/Qwen3-Omni-30B-A3B-Thinking": { + "id": "Qwen/Qwen3-Omni-30B-A3B-Thinking", + "name": "Qwen/Qwen3-Omni-30B-A3B-Thinking", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.13, + "output": 0.6 + } + }, + "Qwen/Qwen2.5-32B-Instruct": { + "id": "Qwen/Qwen2.5-32B-Instruct", + "name": "Qwen/Qwen2.5-32B-Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2024-09-19", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } + }, + "Qwen/Qwen2.5-72B-Instruct-128K": { + "id": "Qwen/Qwen2.5-72B-Instruct-128K", + "name": "Qwen/Qwen2.5-72B-Instruct-128K", + "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": false, + "limit": { + "context": 131000, + "output": 4000 + }, + "cost": { + "input": 0.59, + "output": 0.59 + } + }, + "Qwen/Qwen3-14B": { + "id": "Qwen/Qwen3-14B", + "name": "Qwen/Qwen3-14B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "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": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } + }, + "Qwen/Qwen3-Omni-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-Omni-30B-A3B-Instruct", + "name": "Qwen/Qwen3-Omni-30B-A3B-Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "Qwen/Qwen3-Coder-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", + "name": "Qwen/Qwen3-Coder-30B-A3B-Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-08-01", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } + }, + "Qwen/Qwen3-32B": { + "id": "Qwen/Qwen3-32B", + "name": "Qwen/Qwen3-32B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "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": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } + }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-23", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.09, + "output": 0.6 + } + }, + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", + "name": "Qwen/Qwen3-30B-A3B-Instruct-2507", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.09, + "output": 0.3 + } + }, + "Qwen/Qwen3-8B": { + "id": "Qwen/Qwen3-8B", + "name": "Qwen/Qwen3-8B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "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": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.06, + "output": 0.06 + } + }, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "name": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "family": "qwen", + "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": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.14, + "output": 1.4 + } + }, + "Qwen/Qwen3-VL-8B-Thinking": { + "id": "Qwen/Qwen3-VL-8B-Thinking", + "name": "Qwen/Qwen3-VL-8B-Thinking", + "family": "qwen", + "attachment": true, + "reasoning": true, + "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": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.18, + "output": 2 + } + }, + "Qwen/Qwen3-Omni-30B-A3B-Captioner": { + "id": "Qwen/Qwen3-Omni-30B-A3B-Captioner", + "name": "Qwen/Qwen3-Omni-30B-A3B-Captioner", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } + }, + "Qwen/QwQ-32B": { + "id": "Qwen/QwQ-32B", + "name": "Qwen/QwQ-32B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-03-06", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.15, + "output": 0.58 + } + }, + "Qwen/Qwen3-VL-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", + "name": "Qwen/Qwen3-VL-30B-A3B-Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-05", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.29, + "output": 1 + } + }, + "Qwen/Qwen2.5-Coder-32B-Instruct": { + "id": "Qwen/Qwen2.5-Coder-32B-Instruct", + "name": "Qwen/Qwen2.5-Coder-32B-Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2024-11-11", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } + }, + "Qwen/Qwen2.5-7B-Instruct": { + "id": "Qwen/Qwen2.5-7B-Instruct", + "name": "Qwen/Qwen2.5-7B-Instruct", + "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": false, + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.05, + "output": 0.05 + } + }, + "Qwen/Qwen3-VL-235B-A22B-Thinking": { + "id": "Qwen/Qwen3-VL-235B-A22B-Thinking", + "name": "Qwen/Qwen3-VL-235B-A22B-Thinking", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.45, + "output": 3.5 + } + }, + "Qwen/Qwen3-30B-A3B-Thinking-2507": { + "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", + "name": "Qwen/Qwen3-30B-A3B-Thinking-2507", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-31", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 131000 + }, + "cost": { + "input": 0.09, + "output": 0.3 + } + }, + "Qwen/Qwen3-VL-32B-Thinking": { + "id": "Qwen/Qwen3-VL-32B-Thinking", + "name": "Qwen/Qwen3-VL-32B-Thinking", + "family": "qwen", + "attachment": true, + "reasoning": true, + "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": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } + }, + "Qwen/Qwen2.5-VL-72B-Instruct": { + "id": "Qwen/Qwen2.5-VL-72B-Instruct", + "name": "Qwen/Qwen2.5-VL-72B-Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-01-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 4000 + }, + "cost": { + "input": 0.59, + "output": 0.59 + } + }, + "stepfun-ai/Step-3.5-Flash": { + "id": "stepfun-ai/Step-3.5-Flash", + "name": "stepfun-ai/Step-3.5-Flash", + "family": "step", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } + }, + "zai-org/GLM-4.5V": { + "id": "zai-org/GLM-4.5V", + "name": "zai-org/GLM-4.5V", + "family": "glm", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-08-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.14, + "output": 0.86 + } + }, + "zai-org/GLM-4.6": { + "id": "zai-org/GLM-4.6", + "name": "zai-org/GLM-4.6", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 0.5, + "output": 1.9 + } + }, + "zai-org/GLM-4.6V": { + "id": "zai-org/GLM-4.6V", + "name": "zai-org/GLM-4.6V", + "family": "glm", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": false, + "temperature": true, + "release_date": "2025-12-07", + "last_updated": "2025-12-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } + }, + "zai-org/GLM-4.5-Air": { + "id": "zai-org/GLM-4.5-Air", + "name": "zai-org/GLM-4.5-Air", + "family": "glm-air", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.86 + } + }, + "inclusionAI/Ling-flash-2.0": { + "id": "inclusionAI/Ling-flash-2.0", + "name": "inclusionAI/Ling-flash-2.0", + "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": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } + }, + "inclusionAI/Ling-mini-2.0": { + "id": "inclusionAI/Ling-mini-2.0", + "name": "inclusionAI/Ling-mini-2.0", + "family": "ling", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-10", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } + }, + "inclusionAI/Ring-flash-2.0": { + "id": "inclusionAI/Ring-flash-2.0", + "name": "inclusionAI/Ring-flash-2.0", + "family": "ring", + "attachment": false, + "reasoning": true, + "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": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } + }, + "ascend-tribe/pangu-pro-moe": { + "id": "ascend-tribe/pangu-pro-moe", + "name": "ascend-tribe/pangu-pro-moe", + "family": "pangu", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-02", + "last_updated": "2026-01-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } + }, + "tencent/Hunyuan-MT-7B": { + "id": "tencent/Hunyuan-MT-7B", + "name": "tencent/Hunyuan-MT-7B", + "family": "hunyuan", + "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": false, + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "tencent/Hunyuan-A13B-Instruct": { + "id": "tencent/Hunyuan-A13B-Instruct", + "name": "tencent/Hunyuan-A13B-Instruct", + "family": "hunyuan", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-06-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } + }, + "Pro/zai-org/GLM-4.7": { + "id": "Pro/zai-org/GLM-4.7", + "name": "Pro/zai-org/GLM-4.7", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } + }, + "Pro/zai-org/GLM-5.1": { + "id": "Pro/zai-org/GLM-5.1", + "name": "Pro/zai-org/GLM-5.1", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2026-04-08", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_write": 0 + } + }, + "Pro/zai-org/GLM-5": { + "id": "Pro/zai-org/GLM-5", + "name": "Pro/zai-org/GLM-5", + "family": "glm", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 1, + "output": 3.2 + } + }, + "Pro/deepseek-ai/DeepSeek-V3": { + "id": "Pro/deepseek-ai/DeepSeek-V3", + "name": "Pro/deepseek-ai/DeepSeek-V3", + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.25, + "output": 1 + } + }, + "Pro/deepseek-ai/DeepSeek-R1": { + "id": "Pro/deepseek-ai/DeepSeek-R1", + "name": "Pro/deepseek-ai/DeepSeek-R1", "family": "deepseek-thinking", "attachment": false, "reasoning": true, + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.5, + "output": 2.18 + } + }, + "Pro/deepseek-ai/DeepSeek-V3.2": { + "id": "Pro/deepseek-ai/DeepSeek-V3.2", + "name": "Pro/deepseek-ai/DeepSeek-V3.2", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 0.42 + } + }, + "Pro/deepseek-ai/DeepSeek-V3.1-Terminus": { + "id": "Pro/deepseek-ai/DeepSeek-V3.1-Terminus", + "name": "Pro/deepseek-ai/DeepSeek-V3.1-Terminus", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 1 + } + }, + "Pro/moonshotai/Kimi-K2-Thinking": { + "id": "Pro/moonshotai/Kimi-K2-Thinking", + "name": "Pro/moonshotai/Kimi-K2-Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-11-07", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.55, + "output": 2.5 + } + }, + "Pro/moonshotai/Kimi-K2.6": { + "id": "Pro/moonshotai/Kimi-K2.6", + "name": "Pro/moonshotai/Kimi-K2.6", + "family": "kimi", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } + }, + "Pro/moonshotai/Kimi-K2-Instruct-0905": { + "id": "Pro/moonshotai/Kimi-K2-Instruct-0905", + "name": "Pro/moonshotai/Kimi-K2-Instruct-0905", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-08", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.4, + "output": 2 + } + }, + "Pro/moonshotai/Kimi-K2.5": { + "id": "Pro/moonshotai/Kimi-K2.5", + "name": "Pro/moonshotai/Kimi-K2.5", + "family": "kimi", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "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 + } + }, + "Pro/MiniMaxAI/MiniMax-M2.5": { + "id": "Pro/MiniMaxAI/MiniMax-M2.5", + "name": "Pro/MiniMaxAI/MiniMax-M2.5", + "family": "minimax", + "attachment": false, + "reasoning": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2026-02-13", + "last_updated": "2026-02-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 192000, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 1.22 + } + }, + "Pro/MiniMaxAI/MiniMax-M2.1": { + "id": "Pro/MiniMaxAI/MiniMax-M2.1", + "name": "Pro/MiniMaxAI/MiniMax-M2.1", + "family": "minimax", + "attachment": false, + "reasoning": false, + "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": false, + "limit": { + "context": 197000, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "PaddlePaddle/PaddleOCR-VL": { + "id": "PaddlePaddle/PaddleOCR-VL", + "name": "PaddlePaddle/PaddleOCR-VL", + "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, + "output": 0 + } + }, + "PaddlePaddle/PaddleOCR-VL-1.5": { + "id": "PaddlePaddle/PaddleOCR-VL-1.5", + "name": "PaddlePaddle/PaddleOCR-VL-1.5", + "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 + } + }, + "deepseek-ai/DeepSeek-OCR": { + "id": "deepseek-ai/DeepSeek-OCR", + "name": "deepseek-ai/DeepSeek-OCR", + "attachment": true, + "reasoning": false, "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"] }, + "release_date": "2025-10-20", + "last_updated": "2025-10-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 2.15 }, - "limit": { "context": 163840, "output": 64000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "deepseek-ai/DeepSeek-V3.1-Terminus": { + "id": "deepseek-ai/DeepSeek-V3.1-Terminus", + "name": "deepseek-ai/DeepSeek-V3.1-Terminus", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, "deepseek-ai/DeepSeek-V3.2": { "id": "deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek V3.2", + "name": "deepseek-ai/DeepSeek-V3.2", "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "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": true, - "cost": { "input": 0.26, "output": 0.38 }, - "limit": { "context": 164000, "output": 164000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 0.42 + } }, - "Qwen/Qwen3.5-Plus": { - "id": "Qwen/Qwen3.5-Plus", - "name": "Qwen3.5 Plus", + "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { + "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02", - "last_updated": "2026-02", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-01-20", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2.4, "reasoning": 2.4 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "Qwen/Qwen2.5-VL-32B-Instruct": { - "id": "Qwen/Qwen2.5-VL-32B-Instruct", - "name": "Qwen2.5 VL 32B Instruct", + "deepseek-ai/DeepSeek-R1": { + "id": "deepseek-ai/DeepSeek-R1", + "name": "deepseek-ai/DeepSeek-R1", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.5, + "output": 2.18 + } + }, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { + "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-01-20", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } + }, + "deepseek-ai/DeepSeek-V3": { + "id": "deepseek-ai/DeepSeek-V3", + "name": "deepseek-ai/DeepSeek-V3", + "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": 164000, + "output": 164000 + }, + "cost": { + "input": 0.25, + "output": 1 + } + }, + "deepseek-ai/deepseek-vl2": { + "id": "deepseek-ai/deepseek-vl2", + "name": "deepseek-ai/deepseek-vl2", + "family": "deepseek", "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, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 16384, "output": 16384 } + "release_date": "2024-12-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 4000, + "output": 4000 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", + "baidu/ERNIE-4.5-300B-A47B": { + "id": "baidu/ERNIE-4.5-300B-A47B", + "name": "baidu/ERNIE-4.5-300B-A47B", + "family": "ernie", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.09, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2025-07-02", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.28, + "output": 1.1 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", + "THUDM/GLM-Z1-32B-0414": { + "id": "THUDM/GLM-Z1-32B-0414", + "name": "THUDM/GLM-Z1-32B-0414", + "family": "glm-z", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.45, "output": 2.8 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "THUDM/GLM-4-32B-0414": { + "id": "THUDM/GLM-4-32B-0414", + "name": "THUDM/GLM-4-32B-0414", + "family": "glm", "attachment": false, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0.6, "output": 2.6 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0.27, + "output": 0.27 + } }, - "XiaomiMiMo/MiMo-V2-Flash": { - "id": "XiaomiMiMo/MiMo-V2-Flash", - "name": "MiMo V2 Flash", - "family": "mimo", + "THUDM/GLM-4-9B-0414": { + "id": "THUDM/GLM-4-9B-0414", + "name": "THUDM/GLM-4-9B-0414", + "family": "glm", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0.086, + "output": 0.086 + } + }, + "THUDM/GLM-Z1-9B-0414": { + "id": "THUDM/GLM-Z1-9B-0414", + "name": "THUDM/GLM-Z1-9B-0414", + "family": "glm-z", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-12-01", - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262144, "output": 32000 } + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.086, + "output": 0.086 + } }, - "mistralai/Mistral-Nemo-Instruct-2407": { - "id": "mistralai/Mistral-Nemo-Instruct-2407", - "name": "Mistral Nemo Instruct 2407", - "family": "mistral", + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "moonshotai/Kimi-K2-Instruct-0905", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.04 }, - "limit": { "context": 131072, "output": 65536 } + "release_date": "2025-09-08", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "mistralai/Mistral-Small-3.2-24B-Instruct-2506": { - "id": "mistralai/Mistral-Small-3.2-24B-Instruct-2506", - "name": "Mistral Small 3.2 24B Instruct", - "family": "mistral-small", - "attachment": true, + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "moonshotai/Kimi-K2-Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-11-07", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.55, + "output": 2.5 + } + }, + "ByteDance-Seed/Seed-OSS-36B-Instruct": { + "id": "ByteDance-Seed/Seed-OSS-36B-Instruct", + "name": "ByteDance-Seed/Seed-OSS-36B-Instruct", + "family": "seed", + "attachment": false, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } + "release_date": "2025-09-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.21, + "output": 0.57 + } } } }, - "zai-coding-plan": { - "id": "zai-coding-plan", - "env": ["ZHIPU_API_KEY"], + "submodel": { + "id": "submodel", + "env": ["SUBMODEL_INSTAGEN_ACCESS_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", + "api": "https://llm.submodel.ai/v1", + "name": "submodel", + "doc": "https://submodel.gitbook.io", "models": { - "glm-4.7-flash": { - "id": "glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.3 + } }, - "glm-5-turbo": { - "id": "glm-5-turbo", - "name": "GLM-5-Turbo", - "family": "glm", + "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM-4.5", - "family": "glm", + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen3 235B A22B Thinking 2507", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } + }, + "zai-org/GLM-4.5-Air": { + "id": "zai-org/GLM-4.5-Air", + "name": "GLM 4.5 Air", + "family": "glm-air", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, "release_date": "2025-07-28", "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.5 + } }, - "glm-4.7-flashx": { - "id": "glm-4.7-flashx", - "name": "GLM-4.7-FlashX", - "family": "glm-flash", + "zai-org/GLM-4.5-FP8": { + "id": "zai-org/GLM-4.5-FP8", + "name": "GLM 4.5 FP8", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.4, "cache_read": 0.01, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", - "family": "glm", + "deepseek-ai/DeepSeek-V3.1": { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 75000, + "output": 163840 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", - "attachment": true, + "deepseek-ai/DeepSeek-V3-0324": { + "id": "deepseek-ai/DeepSeek-V3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 75000, + "output": 163840 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } + }, + "deepseek-ai/DeepSeek-R1-0528": { + "id": "deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek R1 0528", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 75000, + "output": 163840 + }, + "cost": { + "input": 0.5, + "output": 2.15 + } }, - "glm-4.5-flash": { - "id": "glm-4.5-flash", - "name": "GLM-4.5-Flash", - "family": "glm-flash", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-23", + "last_updated": "2025-08-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.5 + } + } + } + }, + "minimax-coding-plan": { + "id": "minimax-coding-plan", + "env": ["MINIMAX_API_KEY"], + "npm": "@ai-sdk/anthropic", + "api": "https://api.minimax.io/anthropic/v1", + "name": "MiniMax Coding Plan (minimax.io)", + "doc": "https://platform.minimax.io/docs/coding-plan/intro", + "models": { + "MiniMax-M2": { + "id": "MiniMax-M2", + "name": "MiniMax-M2", + "family": "minimax", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 196608, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM-4.5-Air", - "family": "glm-air", + "MiniMax-M2.7": { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "glm-4.5v": { - "id": "glm-4.5v", - "name": "GLM-4.5V", - "family": "glm", - "attachment": true, + "MiniMax-M2.7-highspeed": { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "family": "minimax", + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 64000, "output": 16384 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "glm-5.1": { - "id": "glm-5.1", - "name": "GLM-5.1", - "family": "glm", + "MiniMax-M2.1": { + "id": "MiniMax-M2.1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2026-03-27", - "last_updated": "2026-03-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "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, + "output": 0 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", + "MiniMax-M2.5-highspeed": { + "id": "MiniMax-M2.5-highspeed", + "name": "MiniMax-M2.5-highspeed", + "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-02-13", + "last_updated": "2026-02-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } } } }, - "anthropic": { - "id": "anthropic", - "env": ["ANTHROPIC_API_KEY"], - "npm": "@ai-sdk/anthropic", - "name": "Anthropic", - "doc": "https://docs.anthropic.com/en/docs/about-claude/models", + "perplexity": { + "id": "perplexity", + "env": ["PERPLEXITY_API_KEY"], + "npm": "@ai-sdk/perplexity", + "name": "Perplexity", + "doc": "https://docs.perplexity.ai", "models": { - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "sonar-pro": { + "id": "sonar-pro", + "name": "Sonar Pro", + "family": "sonar-pro", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-09-01", + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "claude-opus-4-20250514": { - "id": "claude-opus-4-20250514", - "name": "Claude Opus 4", - "family": "claude-opus", - "attachment": true, + "sonar-deep-research": { + "id": "sonar-deep-research", + "name": "Perplexity Sonar Deep Research", + "attachment": false, "reasoning": true, - "tool_call": true, + "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 + } + }, + "sonar": { + "id": "sonar", + "name": "Sonar", + "family": "sonar", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-09-01", + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 1, + "output": 1 + } }, - "claude-opus-4-5": { - "id": "claude-opus-4-5", - "name": "Claude Opus 4.5 (latest)", - "family": "claude-opus", + "sonar-reasoning-pro": { + "id": "sonar-reasoning-pro", + "name": "Sonar Reasoning Pro", + "family": "sonar-reasoning", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-09-01", + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } - }, - "claude-3-7-sonnet-20250219": { - "id": "claude-3-7-sonnet-20250219", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 8 + } + } + } + }, + "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-chat": { + "id": "deepseek-chat", + "name": "DeepSeek Chat", + "family": "deepseek", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "deepseek-reasoner": { + "id": "deepseek-reasoner", + "name": "DeepSeek Reasoner", + "family": "deepseek-thinking", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "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.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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.028 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } - }, - "claude-3-5-haiku-20241022": { - "id": "claude-3-5-haiku-20241022", - "name": "Claude Haiku 3.5", - "family": "claude-haiku", + "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 + } + } + } + }, + "llama": { + "id": "llama", + "env": ["LLAMA_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.llama.com/compat/v1/", + "name": "Llama", + "doc": "https://llama.developer.meta.com/docs/models", + "models": { + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", "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, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "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 + } }, - "claude-sonnet-4-0": { - "id": "claude-sonnet-4-0", - "name": "Claude Sonnet 4 (latest)", - "family": "claude-sonnet", + "cerebras-llama-4-maverick-17b-128e-instruct": { + "id": "cerebras-llama-4-maverick-17b-128e-instruct", + "name": "Cerebras-Llama-4-Maverick-17B-128E-Instruct", + "family": "llama", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-01", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-haiku-20240307": { - "id": "claude-3-haiku-20240307", - "name": "Claude Haiku 3", - "family": "claude-haiku", + "llama-3.3-8b-instruct": { + "id": "llama-3.3-8b-instruct", + "name": "Llama-3.3-8B-Instruct", + "family": "llama", "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, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "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 + } }, - "claude-sonnet-4-20250514": { - "id": "claude-sonnet-4-20250514", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "cerebras-llama-4-scout-17b-16e-instruct": { + "id": "cerebras-llama-4-scout-17b-16e-instruct", + "name": "Cerebras-Llama-4-Scout-17B-16E-Instruct", + "family": "llama", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-01", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-opus-4-1": { - "id": "claude-opus-4-1", - "name": "Claude Opus 4.1 (latest)", - "family": "claude-opus", + "groq-llama-4-maverick-17b-128e-instruct": { + "id": "groq-llama-4-maverick-17b-128e-instruct", + "name": "Groq-Llama-4-Maverick-17B-128E-Instruct", + "family": "llama", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2025-01", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-opus-20240229": { - "id": "claude-3-opus-20240229", - "name": "Claude Opus 3", - "family": "claude-opus", + "llama-4-scout-17b-16e-instruct-fp8": { + "id": "llama-4-scout-17b-16e-instruct-fp8", + "name": "Llama-4-Scout-17B-16E-Instruct-FP8", + "family": "llama", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-02-29", - "last_updated": "2024-02-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 4096 } + "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": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-5-haiku-latest": { - "id": "claude-3-5-haiku-latest", - "name": "Claude Haiku 3.5 (latest)", - "family": "claude-haiku", + "llama-4-maverick-17b-128e-instruct-fp8": { + "id": "llama-4-maverick-17b-128e-instruct-fp8", + "name": "Llama-4-Maverick-17B-128E-Instruct-FP8", + "family": "llama", "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, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } - }, - "claude-3-5-sonnet-20240620": { - "id": "claude-3-5-sonnet-20240620", - "name": "Claude Sonnet 3.5", - "family": "claude-sonnet", - "attachment": 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": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } + } + } + }, + "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": { + "liquid/lfm-2.5-1.2b-instruct:free": { + "id": "liquid/lfm-2.5-1.2b-instruct:free", + "name": "LFM2.5-1.2B-Instruct (free)", + "family": "liquid", + "attachment": false, "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2025-06", + "release_date": "2026-01-20", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "liquid/lfm-2.5-1.2b-thinking:free": { + "id": "liquid/lfm-2.5-1.2b-thinking:free", + "name": "LFM2.5-1.2B-Thinking (free)", + "family": "liquid", + "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "knowledge": "2025-06", + "release_date": "2026-01-20", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "deepseek/deepseek-chat-v3.1": { + "id": "deepseek/deepseek-chat-v3.1", + "name": "DeepSeek-V3.1", + "family": "deepseek", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04-30", - "release_date": "2024-06-20", - "last_updated": "2024-06-20", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "knowledge": "2025-07", + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "Claude Opus 4.1", - "family": "claude-opus", - "attachment": true, + "deepseek/deepseek-r1-distill-llama-70b": { + "id": "deepseek/deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-01-23", + "last_updated": "2025-01-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "deepseek/deepseek-r1": { + "id": "deepseek/deepseek-r1", + "name": "DeepSeek: R1", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 16000 + }, + "cost": { + "input": 0.7, + "output": 2.5 + } }, - "claude-opus-4-0": { - "id": "claude-opus-4-0", - "name": "Claude Opus 4 (latest)", - "family": "claude-opus", - "attachment": true, + "deepseek/deepseek-v3.2-speciale": { + "id": "deepseek/deepseek-v3.2-speciale", + "name": "DeepSeek V3.2 Speciale", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "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.27, + "output": 0.41 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, + "deepseek/deepseek-v3.2": { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5 (latest)", - "family": "claude-sonnet", - "attachment": true, + "deepseek/deepseek-v3.1-terminus:exacto": { + "id": "deepseek/deepseek-v3.1-terminus:exacto", + "name": "DeepSeek V3.1 Terminus (exacto)", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-07", + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "claude-3-7-sonnet-latest": { - "id": "claude-3-7-sonnet-latest", - "name": "Claude Sonnet 3.7 (latest)", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, - "tool_call": true, + "deepseek/deepseek-chat-v3-0324": { + "id": "deepseek/deepseek-chat-v3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": 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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2024-10", + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5 (latest)", - "family": "claude-haiku", - "attachment": true, + "deepseek/deepseek-v3.1-terminus": { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "DeepSeek V3.1 Terminus", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-07", + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "claude-3-sonnet-20240229": { - "id": "claude-3-sonnet-20240229", - "name": "Claude Sonnet 3", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, + "openrouter/owl-alpha": { + "id": "openrouter/owl-alpha", + "name": "Owl Alpha", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-03-04", - "last_updated": "2024-03-04", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-04-28", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 1048756, + "output": 262144 + }, + "status": "alpha", + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-5-sonnet-20241022": { - "id": "claude-3-5-sonnet-20241022", - "name": "Claude Sonnet 3.5 v2", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-04-30", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } - } - } - }, - "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-lite-v1": { - "id": "nova-2-lite-v1", - "name": "Nova 2 Lite", - "family": "nova-lite", + "openrouter/pareto-code": { + "id": "openrouter/pareto-code", + "name": "Pareto Code Router", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text", "image", "video", "pdf"], "output": ["text"] }, + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "reasoning": 0 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 200000, + "output": 200000 + } }, - "nova-2-pro-v1": { - "id": "nova-2-pro-v1", - "name": "Nova 2 Pro", - "family": "nova-pro", - "attachment": true, + "openrouter/elephant-alpha": { + "id": "openrouter/elephant-alpha", + "name": "Elephant (free)", + "family": "elephant", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-12-03", - "last_updated": "2026-01-03", - "modalities": { "input": ["text", "image", "video", "pdf"], "output": ["text"] }, + "release_date": "2026-04-13", + "last_updated": "2026-04-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "reasoning": 0 }, - "limit": { "context": 1000000, "output": 64000 } - } - } - }, - "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-pro3": { - "id": "solar-pro3", - "name": "solar-pro3", - "family": "solar-pro", - "attachment": false, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "openrouter/free": { + "id": "openrouter/free", + "name": "Free Models Router", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-01", + "last_updated": "2026-02-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.25 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "input": 200000, + "output": 8000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "solar-pro2": { - "id": "solar-pro2", - "name": "solar-pro2", - "family": "solar-pro", + "arcee-ai/trinity-large-thinking": { + "id": "arcee-ai/trinity-large-thinking", + "name": "Trinity Large Thinking", + "family": "trinity", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.25, "output": 0.25 }, - "limit": { "context": 65536, "output": 8192 } + "release_date": "2026-04-01", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 80000 + }, + "cost": { + "input": 0.22, + "output": 0.85 + } }, - "solar-mini": { - "id": "solar-mini", - "name": "solar-mini", - "family": "solar-mini", + "arcee-ai/trinity-large-preview:free": { + "id": "arcee-ai/trinity-large-preview:free", + "name": "Trinity Large Preview", + "family": "trinity", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-06-12", - "last_updated": "2025-04-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 32768, "output": 4096 } - } - } - }, - "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-instruct": { - "id": "hunyuan-2.0-instruct", - "name": "Tencent HY 2.0 Instruct", - "family": "hunyuan", + "knowledge": "2025-06", + "release_date": "2026-01-28", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "cognitivecomputations/dolphin-mistral-24b-venice-edition:free": { + "id": "cognitivecomputations/dolphin-mistral-24b-venice-edition:free", + "name": "Uncensored (free)", + "family": "mistral", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, + "structured_output": true, "temperature": true, - "release_date": "2026-03-08", - "last_updated": "2026-03-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 16384 } + "knowledge": "2025-06", + "release_date": "2025-07-09", + "last_updated": "2026-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi-K2.5", - "family": "kimi", - "attachment": true, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "bytedance-seed/seedream-4.5": { + "id": "bytedance-seed/seedream-4.5", + "name": "Seedream 4.5", + "family": "seed", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-12-23", + "last_updated": "2026-01-31", + "modalities": { + "input": ["image", "text"], + "output": ["image"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "hunyuan-t1": { - "id": "hunyuan-t1", - "name": "Hunyuan-T1", - "family": "hunyuan", + "black-forest-labs/flux.2-max": { + "id": "black-forest-labs/flux.2-max", + "name": "FLUX.2 Max", + "family": "flux", "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-08", - "last_updated": "2026-03-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-12-16", + "last_updated": "2026-01-31", + "modalities": { + "input": ["image", "text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 46864, + "output": 46864 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "hunyuan-2.0-thinking": { - "id": "hunyuan-2.0-thinking", - "name": "Tencent HY 2.0 Think", - "family": "hunyuan", + "black-forest-labs/flux.2-flex": { + "id": "black-forest-labs/flux.2-flex", + "name": "FLUX.2 Flex", + "family": "flux", "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-08", - "last_updated": "2026-03-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-11-25", + "last_updated": "2026-01-31", + "modalities": { + "input": ["image", "text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 67344, + "output": 67344 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "tc-code-latest": { - "id": "tc-code-latest", - "name": "Auto", - "family": "auto", + "black-forest-labs/flux.2-pro": { + "id": "black-forest-labs/flux.2-pro", + "name": "FLUX.2 Pro", + "family": "flux", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2026-03-08", - "last_updated": "2026-03-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-11-25", + "last_updated": "2026-01-31", + "modalities": { + "input": ["image", "text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 46864, + "output": 46864 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", + "black-forest-labs/flux.2-klein-4b": { + "id": "black-forest-labs/flux.2-klein-4b", + "name": "FLUX.2 Klein 4B", + "family": "flux", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2025-06", + "release_date": "2026-01-14", + "last_updated": "2026-01-31", + "modalities": { + "input": ["image", "text"], + "output": ["image"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "nousresearch/hermes-3-llama-3.1-405b:free": { + "id": "nousresearch/hermes-3-llama-3.1-405b:free", + "name": "Hermes 3 405B Instruct (free)", + "family": "hermes", "attachment": false, "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "tool_call": false, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 202752, "output": 16384 } + "knowledge": "2023-12", + "release_date": "2024-08-16", + "last_updated": "2024-08-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "hunyuan-turbos": { - "id": "hunyuan-turbos", - "name": "Hunyuan-TurboS", - "family": "hunyuan", + "nousresearch/hermes-4-405b": { + "id": "nousresearch/hermes-4-405b", + "name": "Hermes 4 405B", + "family": "hermes", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-08", - "last_updated": "2026-03-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 16384 } + "knowledge": "2023-12", + "release_date": "2025-08-25", + "last_updated": "2025-08-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3 + } }, - "minimax-m2.5": { - "id": "minimax-m2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "nousresearch/hermes-4-70b": { + "id": "nousresearch/hermes-4-70b", + "name": "Hermes 4 70B", + "family": "hermes", "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2023-12", + "release_date": "2025-08-25", + "last_updated": "2025-08-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 32768 } - } - } - }, - "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": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "gpt-5.2-codex", - "family": "gpt-codex", - "attachment": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.13, + "output": 0.4 + } + }, + "stepfun/step-3.5-flash": { + "id": "stepfun/step-3.5-flash", + "name": "Step 3.5 Flash", + "family": "step", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-01", + "release_date": "2026-01-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.02 + } }, - "gemini-2.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "gemini-2.5-flash-lite", - "family": "gemini-flash-lite", + "mistralai/mistral-small-3.1-24b-instruct": { + "id": "mistralai/mistral-small-3.1-24b-instruct", + "name": "Mistral Small 3.1 24B Instruct", + "family": "mistral-small", "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09, "output": 0.36 }, - "limit": { "context": 1048576, "output": 65535 } + "knowledge": "2024-10", + "release_date": "2025-03-17", + "last_updated": "2025-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "gpt-5.1-codex-mini", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, + "mistralai/devstral-2512": { + "id": "mistralai/devstral-2512", + "name": "Devstral 2 2512", + "family": "devstral", + "attachment": false, + "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, - "cost": { "input": 0.225, "output": 1.8 }, - "limit": { "context": 400000, "output": 128000 } - }, - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "claude-opus-4-5-20251101", - "family": "claude-opus", - "attachment": true, + "knowledge": "2025-12", + "release_date": "2025-09-12", + "last_updated": "2025-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } + }, + "mistralai/codestral-2508": { + "id": "mistralai/codestral-2508", + "name": "Codestral 2508", + "family": "codestral", + "attachment": false, "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, - "cost": { "input": 4.5, "output": 22.5 }, - "limit": { "context": 200000, "output": 65536 } + "knowledge": "2025-05", + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "o3-mini", - "family": "o", + "mistralai/mistral-medium-3.1": { + "id": "mistralai/mistral-medium-3.1", + "name": "Mistral Medium 3.1", + "family": "mistral-medium", "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"] }, + "knowledge": "2025-05", + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "gpt-5-pro", - "family": "gpt-pro", + "mistralai/mistral-small-2603": { + "id": "mistralai/mistral-small-2603", + "name": "Mistral Small 4", + "family": "mistral-small", "attachment": true, "reasoning": true, "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, - "cost": { "input": 13.5, "output": 108 }, - "limit": { "context": 400000, "output": 272000 } + "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": 262144 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "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", - "family": "gemini-flash-lite", + "mistralai/mistral-medium-3": { + "id": "mistralai/mistral-medium-3", + "name": "Mistral Medium 3", + "family": "mistral-medium", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.09, "output": 0.36 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "claude-opus-4-20250514": { - "id": "claude-opus-4-20250514", - "name": "claude-opus-4-20250514", - "family": "claude-opus", - "attachment": true, + "mistralai/devstral-small-2505": { + "id": "mistralai/devstral-small-2505", + "name": "Devstral Small", + "family": "devstral", + "attachment": false, "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, - "cost": { "input": 13.5, "output": 67.5 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2025-05", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.06, + "output": 0.12 + } }, - "gemini-2.5-flash-preview-05-20": { - "id": "gemini-2.5-flash-preview-05-20", - "name": "gemini-2.5-flash-preview-05-20", - "family": "gemini-flash", + "mistralai/mistral-small-3.2-24b-instruct": { + "id": "mistralai/mistral-small-3.2-24b-instruct", + "name": "Mistral Small 3.2 24B Instruct", + "family": "mistral-small", "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.135, "output": 3.15 }, - "limit": { "context": 1048576, "output": 200000 } + "knowledge": "2024-10", + "release_date": "2025-06-20", + "last_updated": "2025-06-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 96000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "gemini-3-pro-preview", - "family": "gemini-pro", - "attachment": true, + "mistralai/devstral-medium-2507": { + "id": "mistralai/devstral-medium-2507", + "name": "Devstral Medium", + "family": "devstral", + "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.8, "output": 10.8 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2025-05", + "release_date": "2025-07-10", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "grok-4-fast-non-reasoning", - "family": "grok", - "attachment": true, + "mistralai/devstral-small-2507": { + "id": "mistralai/devstral-small-2507", + "name": "Devstral Small 1.1", + "family": "devstral", + "attachment": false, "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, - "cost": { "input": 0.18, "output": 0.45 }, - "limit": { "context": 2000000, "output": 2000000 } + "knowledge": "2025-05", + "release_date": "2025-07-10", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "grok-code-fast-1", - "family": "grok", + "meta-llama/llama-3.2-11b-vision-instruct": { + "id": "meta-llama/llama-3.2-11b-vision-instruct", + "name": "Llama 3.2 11B Vision Instruct", + "family": "llama", "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 1.35 }, - "limit": { "context": 256000, "output": 256000 } + "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": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "gpt-5-mini", - "family": "gpt-mini", + "meta-llama/llama-3.2-3b-instruct:free": { + "id": "meta-llama/llama-3.2-3b-instruct:free", + "name": "Llama 3.2 3B Instruct (free)", + "family": "llama", "attachment": true, - "reasoning": true, + "reasoning": false, + "tool_call": 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": 131072, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "meta-llama/llama-3.3-70b-instruct:free": { + "id": "meta-llama/llama-3.3-70b-instruct:free", + "name": "Llama 3.3 70B Instruct (free)", + "family": "llama", + "attachment": false, + "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, - "cost": { "input": 0.225, "output": 1.8 }, - "limit": { "context": 400000, "output": 128000 } + "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": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "claude-opus-4-6", - "family": "claude-opus", + "x-ai/grok-4.20-multi-agent-beta": { + "id": "x-ai/grok-4.20-multi-agent-beta", + "name": "Grok 4.20 Multi - Agent Beta", + "family": "grok", "attachment": true, "reasoning": true, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2026-02", - "last_updated": "2026-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-12", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "status": "beta", + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "tiers": [ + { + "input": 4, + "output": 12, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + } + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "claude-sonnet-4-5-20250929", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, + "x-ai/grok-4-fast": { + "id": "x-ai/grok-4-fast", + "name": "Grok 4 Fast", + "family": "grok", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.7, "output": 13.5 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05, + "cache_write": 0.05 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "gpt-5.1-codex-max", - "family": "gpt-codex", - "attachment": true, + "x-ai/grok-code-fast-1": { + "id": "x-ai/grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08", + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "gemini-2.5-pro-preview-06-05": { - "id": "gemini-2.5-pro-preview-06-05", - "name": "gemini-2.5-pro-preview-06-05", - "family": "gemini-pro", - "attachment": true, + "x-ai/grok-3-beta": { + "id": "x-ai/grok-3-beta", + "name": "Grok 3 Beta", + "family": "grok", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 1048576, "output": 200000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75, + "cache_write": 15 + } }, - "o3": { - "id": "o3", - "name": "o3", - "attachment": true, - "reasoning": false, + "x-ai/grok-4": { + "id": "x-ai/grok-4", + "name": "Grok 4", + "family": "grok", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 40 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75, + "cache_write": 15, + "tiers": [ + { + "input": 6, + "output": 30, + "tier": { + "type": "context", + "size": 128000 + } + } + ] + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "grok-4-1-fast-non-reasoning", + "x-ai/grok-3-mini": { + "id": "x-ai/grok-3-mini", + "name": "Grok 3 Mini", "family": "grok", - "attachment": true, - "reasoning": false, + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.18, "output": 0.45 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "cache_read": 0.075, + "cache_write": 0.5 + } }, - "claude-sonnet-4-20250514": { - "id": "claude-sonnet-4-20250514", - "name": "claude-sonnet-4-20250514", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, + "x-ai/grok-4.1-fast": { + "id": "x-ai/grok-4.1-fast", + "name": "Grok 4.1 Fast", + "family": "grok", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.7, "output": 13.5 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05, + "cache_write": 0.05 + } }, - "grok-4-0709": { - "id": "grok-4-0709", - "name": "grok-4-0709", + "x-ai/grok-4.20-beta": { + "id": "x-ai/grok-4.20-beta", + "name": "Grok 4.20 Beta", "family": "grok", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-12", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.7, "output": 13.5 }, - "limit": { "context": 256000, "output": 8192 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "status": "beta", + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "tiers": [ + { + "input": 4, + "output": 12, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + } + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "gemini-3-flash-preview", - "family": "gemini-flash", - "attachment": true, - "reasoning": false, + "x-ai/grok-3-mini-beta": { + "id": "x-ai/grok-3-mini-beta", + "name": "Grok 3 Mini Beta", + "family": "grok", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "cache_read": 0.075, + "cache_write": 0.5 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "gemini-2.5-pro", - "family": "gemini-pro", - "attachment": true, + "x-ai/grok-3": { + "id": "x-ai/grok-3", + "name": "Grok 3", + "family": "grok", + "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75, + "cache_write": 15 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "claude-opus-4-1-20250805", - "family": "claude-opus", - "attachment": true, - "reasoning": false, + "tencent/hy3-preview": { + "id": "tencent/hy3-preview", + "name": "Hy3 preview", + "family": "Hy", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 13.5, "output": 67.5 }, - "limit": { "context": 200000, "output": 32000 } + "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.066, + "output": 0.26, + "cache_read": 0.029, + "cache_write": 0.029 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "gemini-2.5-flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": false, + "poolside/laguna-m.1:free": { + "id": "poolside/laguna-m.1:free", + "name": "Laguna M.1", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "release_date": "2026-04-28", + "last_updated": "2026-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 2.25 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "gpt-5.2", - "family": "gpt", - "attachment": true, - "reasoning": false, + "poolside/laguna-xs.2:free": { + "id": "poolside/laguna-xs.2:free", + "name": "Laguna XS.2", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.575, "output": 12.6 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2026-04-28", + "last_updated": "2026-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "grok-4-1-fast-reasoning": { - "id": "grok-4-1-fast-reasoning", - "name": "grok-4-1-fast-reasoning", - "family": "grok", - "attachment": true, - "reasoning": false, + "prime-intellect/intellect-3": { + "id": "prime-intellect/intellect-3", + "name": "Intellect 3", + "family": "glm", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 0.18, "output": 0.45 }, - "limit": { "context": 2000000, "output": 2000000 } + "knowledge": "2024-10", + "release_date": "2025-01-15", + "last_updated": "2025-01-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 1.1 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "gpt-5.1", - "family": "gpt", - "attachment": true, + "nvidia/nemotron-3-super-120b-a12b": { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "Nemotron 3 Super", + "family": "nemotron", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02", - "last_updated": "2026-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2024-04", + "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 + } }, - "gpt-5-chat-latest": { - "id": "gpt-5-chat-latest", - "name": "gpt-5-chat-latest", - "family": "gpt", + "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)", + "family": "nemotron", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "grok-4-fast-reasoning": { - "id": "grok-4-fast-reasoning", - "name": "grok-4-fast-reasoning", - "family": "grok", - "attachment": true, - "reasoning": false, + "nvidia/nemotron-3-nano-30b-a3b:free": { + "id": "nvidia/nemotron-3-nano-30b-a3b:free", + "name": "Nemotron 3 Nano 30B A3B (free)", + "family": "nemotron", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 0.18, "output": 0.45 }, - "limit": { "context": 2000000, "output": 2000000 } + "knowledge": "2025-11", + "release_date": "2025-12-14", + "last_updated": "2026-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "gpt-5-nano", - "family": "gpt-nano", - "attachment": true, - "reasoning": false, + "nvidia/nemotron-nano-9b-v2:free": { + "id": "nvidia/nemotron-nano-9b-v2:free", + "name": "Nemotron Nano 9B V2 (free)", + "family": "nemotron", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 0.045, "output": 0.36 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2024-09", + "release_date": "2025-09-05", + "last_updated": "2025-08-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 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-06-17", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": false, + "nvidia/nemotron-3-super-120b-a12b:free": { + "id": "nvidia/nemotron-3-super-120b-a12b:free", + "name": "Nemotron 3 Super (free)", + "family": "nemotron", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "video", "image", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09, "output": 0.36 }, - "limit": { "context": 1048576, "output": 65535 } + "knowledge": "2024-04", + "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 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "claude-haiku-4-5-20251001", - "family": "claude-haiku", - "attachment": true, - "reasoning": false, + "nvidia/nemotron-nano-9b-v2": { + "id": "nvidia/nemotron-nano-9b-v2", + "name": "nvidia-nemotron-nano-9b-v2", + "family": "nemotron", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 0.9, "output": 4.5 }, - "limit": { "context": 20000, "output": 64000 } + "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.04, + "output": 0.16 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "gpt-5-codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": false, + "nvidia/nemotron-nano-12b-v2-vl:free": { + "id": "nvidia/nemotron-nano-12b-v2-vl:free", + "name": "Nemotron Nano 12B 2 VL (free)", + "family": "nemotron", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-10-28", + "last_updated": "2026-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "inception/mercury-edit-2": { + "id": "inception/mercury-edit-2", + "name": "Mercury Edit 2", + "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2026-03-30", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.025 + } }, - "o4-mini": { - "id": "o4-mini", - "name": "o4-mini", - "family": "o", - "attachment": true, - "reasoning": false, + "inception/mercury-2": { + "id": "inception/mercury-2", + "name": "Mercury 2", + "family": "mercury", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-04", + "last_updated": "2026-03-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 128000, + "output": 50000 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.025 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "gpt-5.1-codex", + "openai/gpt-5.1-codex-max": { + "id": "openai/gpt-5.1-codex-max", + "name": "GPT-5.1-Codex-Max", "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.125, "output": 9 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "gpt-5.2-pro": { - "id": "gpt-5.2-pro", - "name": "gpt-5.2-pro", - "family": "gpt-pro", + "openai/gpt-5.2-chat": { + "id": "openai/gpt-5.2-chat", + "name": "GPT-5.2 Chat", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 18.9, "output": 151.2 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "deepseek/deepseek-v3-0324": { - "id": "deepseek/deepseek-v3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", + "openai/gpt-oss-120b:exacto": { + "id": "openai/gpt-oss-120b:exacto", + "name": "GPT OSS 120B (exacto)", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 1.14 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0.24 + } }, - "deepseek/deepseek-v3.1": { - "id": "deepseek/deepseek-v3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", - "attachment": false, + "openai/gpt-5-chat": { + "id": "openai/gpt-5-chat", + "name": "GPT-5 Chat (latest)", + "family": "gpt-codex", + "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 163840, "output": 32768 } + "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 + } }, - "deepseek/deepseek-r1-0528": { - "id": "deepseek/deepseek-r1-0528", - "name": "DeepSeek R1 0528", - "family": "deepseek-thinking", - "attachment": false, + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "GPT-5.2 Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.5 }, - "limit": { "context": 163840, "output": 32768 } + "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": 21, + "output": 168 + } }, - "zai-org/glm-4.7-flash": { - "id": "zai-org/glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm", - "attachment": false, + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.4 }, - "limit": { "context": 200000, "output": 128000 } + "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, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2 + } }, - "zai-org/glm-4.5": { - "id": "zai-org/glm-4.5", - "name": "GLM-4.5", - "family": "glm", - "attachment": false, + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 131072, "output": 98304 } + "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, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4 + } }, - "zai-org/glm-4.5v": { - "id": "zai-org/glm-4.5v", - "name": "GLM 4.5V", - "family": "glmv", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "GPT-5.3-Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 1.8 }, - "limit": { "context": 65536, "output": 16384 } + "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, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "zai-org/glm-4.7": { - "id": "zai-org/glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 204800, "output": 131072 } + "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, + "cache_read": 0.175 + } }, - "baidu/ernie-4.5-300b-a47b-paddle": { - "id": "baidu/ernie-4.5-300b-a47b-paddle", - "name": "ERNIE 4.5 300B A47B", - "family": "ernie", + "openai/gpt-oss-20b:free": { + "id": "openai/gpt-oss-20b:free", + "name": "gpt-oss-20b (free)", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2026-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 1.1 }, - "limit": { "context": 123000, "output": 12000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "baidu/ernie-4.5-vl-424b-a47b": { - "id": "baidu/ernie-4.5-vl-424b-a47b", - "name": "ERNIE 4.5 VL 424B A47B", - "family": "ernie", + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o-mini", + "family": "gpt-mini", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": false, + "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.42, "output": 1.25 }, - "limit": { "context": 123000, "output": 16000 } + "knowledge": "2024-10", + "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.08 + } }, - "minimaxai/minimax-m1-80k": { - "id": "minimaxai/minimax-m1-80k", - "name": "MiniMax M1", - "family": "minimax", - "attachment": false, + "openai/gpt-5.4-mini": { + "id": "openai/gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, + "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 2.2 }, - "limit": { "context": 1000000, "output": 40000 } + "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 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "Minimax M2.1", - "family": "minimax", - "attachment": false, + "openai/gpt-5.1-chat": { + "id": "openai/gpt-5.1-chat", + "name": "GPT-5.1 Chat", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "qwen/qwen3-235b-a22b-instruct-2507": { - "id": "qwen/qwen3-235b-a22b-instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "o4 Mini", + "family": "o-mini", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.8 }, - "limit": { "context": 131072, "output": 16384 } + "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.28 + } }, - "qwen/qwen3-coder-next": { - "id": "qwen/qwen3-coder-next", - "name": "qwen/qwen3-coder-next", - "family": "qwen", - "attachment": false, + "openai/gpt-5.4-nano": { + "id": "openai/gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "family": "gpt-nano", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02", - "last_updated": "2026-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 262144, "output": 65536 } - }, - "qwen/qwen3-30b-a3b-fp8": { - "id": "qwen/qwen3-30b-a3b-fp8", - "name": "Qwen3 30B A3B", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.09, "output": 0.45 }, - "limit": { "context": 40960, "output": 20000 } - }, - "qwen/qwen3-235b-a22b-fp8": { - "id": "qwen/qwen3-235b-a22b-fp8", - "name": "Qwen3 235B A22B", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, + "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 40960, "output": 20000 } + "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 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "qwen/qwen3-coder-480b-a35b-instruct": { - "id": "qwen/qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT-5.2-Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.29, "output": 1.2 }, - "limit": { "context": 262144, "output": 65536 } + "knowledge": "2025-08-31", + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "qwen/qwen3-next-80b-a3b-thinking": { - "id": "qwen/qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", - "family": "qwen", - "attachment": false, + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT-5.1-Codex-Mini", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 65536, "output": 65536 } + "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 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "qwen/qwen3-235b-a22b-thinking-2507": { - "id": "qwen/qwen3-235b-a22b-thinking-2507", - "name": "Qwen3 235B A22b Thinking 2507", - "family": "qwen", - "attachment": false, + "openai/gpt-5-image": { + "id": "openai/gpt-5-image", + "name": "GPT-5 Image", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 3 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2024-10-01", + "release_date": "2025-10-14", + "last_updated": "2025-10-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 10, + "cache_read": 1.25 + } }, - "qwen/qwen3-next-80b-a3b-instruct": { - "id": "qwen/qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 65536, "output": 65536 } + "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, + "cache_read": 0.125 + } }, - "qwen/qwen3-32b-fp8": { - "id": "qwen/qwen3-32b-fp8", - "name": "Qwen3 32B", - "family": "qwen", - "attachment": false, + "openai/gpt-5.4-pro": { + "id": "openai/gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "structured_output": false, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.45 }, - "limit": { "context": 40960, "output": 20000 } + "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, + "cache_read": 30 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "GPT-5 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2024-10-01", + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "Kimi K2 0905", - "family": "kimi", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0.2 + } }, - "moonshotai/kimi-k2-instruct": { - "id": "moonshotai/kimi-k2-instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", - "attachment": false, - "reasoning": false, + "openai/gpt-5-pro": { + "id": "openai/gpt-5-pro", + "name": "GPT-5 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.57, "output": 2.3 }, - "limit": { "context": 131072, "output": 131072 } + "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, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "xiaomimimo/mimo-v2-flash": { - "id": "xiaomimimo/mimo-v2-flash", - "name": "XiaomiMiMo/MiMo-V2-Flash", - "family": "mimo", + "openai/gpt-oss-120b:free": { + "id": "openai/gpt-oss-120b:free", + "name": "gpt-oss-120b (free)", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 131072 } - } - } - }, - "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-chat": { - "id": "deepseek-chat", - "name": "DeepSeek Chat", - "family": "deepseek", - "attachment": true, - "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"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 0.42, "cache_read": 0.028 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-reasoner": { - "id": "deepseek-reasoner", - "name": "DeepSeek Reasoner", - "family": "deepseek-thinking", + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT-5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "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, - "cost": { "input": 0.28, "output": 0.42, "cache_read": 0.028 }, - "limit": { "context": 128000, "output": 64000 } - } - } - }, - "llama": { - "id": "llama", - "env": ["LLAMA_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://api.llama.com/compat/v1/", - "name": "Llama", - "doc": "https://llama.developer.meta.com/docs/models", - "models": { - "cerebras-llama-4-scout-17b-16e-instruct": { - "id": "cerebras-llama-4-scout-17b-16e-instruct", - "name": "Cerebras-Llama-4-Scout-17B-16E-Instruct", - "family": "llama", - "attachment": true, - "reasoning": 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, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } + }, + "openai/gpt-oss-safeguard-20b": { + "id": "openai/gpt-oss-safeguard-20b", + "name": "GPT OSS Safeguard 20B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2025-10-29", + "last_updated": "2025-10-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "llama-3.3-70b-instruct": { - "id": "llama-3.3-70b-instruct", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", - "attachment": true, - "reasoning": false, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, "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"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.072, + "output": 0.28 + } }, - "cerebras-llama-4-maverick-17b-128e-instruct": { - "id": "cerebras-llama-4-maverick-17b-128e-instruct", - "name": "Cerebras-Llama-4-Maverick-17B-128E-Instruct", - "family": "llama", + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "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 + } }, - "groq-llama-4-maverick-17b-128e-instruct": { - "id": "groq-llama-4-maverick-17b-128e-instruct", - "name": "Groq-Llama-4-Maverick-17B-128E-Instruct", - "family": "llama", + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "GPT-4.1 Mini", + "family": "gpt-mini", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "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 + } }, - "llama-4-scout-17b-16e-instruct-fp8": { - "id": "llama-4-scout-17b-16e-instruct-fp8", - "name": "Llama-4-Scout-17B-16E-Instruct-FP8", - "family": "llama", + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "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, + "cache_read": 0.125 + } }, - "llama-3.3-8b-instruct": { - "id": "llama-3.3-8b-instruct", - "name": "Llama-3.3-8B-Instruct", - "family": "llama", - "attachment": true, - "reasoning": false, + "z-ai/glm-4.7": { + "id": "z-ai/glm-4.7", + "name": "GLM-4.7", + "family": "glm", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11 + } }, - "llama-4-maverick-17b-128e-instruct-fp8": { - "id": "llama-4-maverick-17b-128e-instruct-fp8", - "name": "Llama-4-Maverick-17B-128E-Instruct-FP8", - "family": "llama", - "attachment": true, - "reasoning": false, - "tool_call": true, + "z-ai/glm-4.5-air:free": { + "id": "z-ai/glm-4.5-air:free", + "name": "GLM 4.5 Air (free)", + "family": "glm-air", + "attachment": false, + "reasoning": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - } - } - }, - "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": { - "gpt-5.4-mini": { - "id": "gpt-5.4-mini", - "name": "GPT-5.4 Mini", - "family": "gpt-mini", - "attachment": true, + "limit": { + "context": 128000, + "output": 96000 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "z-ai/glm-5": { + "id": "z-ai/glm-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.75, "output": 4.5, "cache_read": 0.075 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "temperature": true, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131000 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "claude-opus-4-5": { - "id": "claude-opus-4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", - "attachment": true, + "z-ai/glm-5.1": { + "id": "z-ai/glm-5.1", + "name": "GLM-5.1", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "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 } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "z-ai/glm-4.5": { + "id": "z-ai/glm-4.5", + "name": "GLM 4.5", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 5, - "output": 25, - "cache_read": 0.5, - "cache_write": 6.25, - "context_over_200k": { "input": 10, "output": 37.5, "cache_read": 1, "cache_write": 12.5 } + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 200000, "output": 128000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "open_weights": true, + "limit": { + "context": 128000, + "output": 96000 + }, + "cost": { + "input": 0.6, + "output": 2.2 } }, - "claude-opus-4-1": { - "id": "claude-opus-4-1", - "name": "Claude Opus 4.1", - "family": "claude-opus", - "attachment": true, + "z-ai/glm-4.6:exacto": { + "id": "z-ai/glm-4.6:exacto", + "name": "GLM 4.6 (exacto)", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "knowledge": "2025-09", + "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.6, + "output": 1.9, + "cache_read": 0.11 } }, - "gpt-5.4-nano": { - "id": "gpt-5.4-nano", - "name": "GPT-5.4 Nano", - "family": "gpt-nano", - "attachment": true, + "z-ai/glm-4.5-air": { + "id": "z-ai/glm-4.5-air", + "name": "GLM 4.5 Air", + "family": "glm-air", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.2, "output": 1.25, "cache_read": 0.02 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, + "z-ai/glm-5-turbo": { + "id": "z-ai/glm-5-turbo", + "name": "GLM-5-Turbo", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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"] }, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 0.96, + "output": 3.2, + "cache_read": 0.192, + "cache_write": 0 } }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", + "z-ai/glm-4.5v": { + "id": "z-ai/glm-4.5v", + "name": "GLM 4.5V", + "family": "glm", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-02-31", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "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 } }, - "o1-mini": { - "id": "o1-mini", - "name": "o1-mini", - "family": "o-mini", + "z-ai/glm-4.6": { + "id": "z-ai/glm-4.6", + "name": "GLM 4.6", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 128000, "output": 65536 } + "structured_output": true, + "temperature": true, + "knowledge": "2025-09", + "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.6, + "output": 2.2, + "cache_read": 0.11 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt-codex", + "z-ai/glm-4.7-flash": { + "id": "z-ai/glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, "structured_output": true, - "temperature": false, - "knowledge": "2024-09-30", - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text", "image", "audio"], "output": ["text", "image", "audio"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } - }, - "o4-mini": { - "id": "o4-mini", - "name": "o4-mini", - "family": "o-mini", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } + "temperature": true, + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "output": 65535 + }, + "cost": { + "input": 0.07, + "output": 0.4 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "GPT-5-Codex", - "family": "gpt-codex", + "sourceful/riverflow-v2-standard-preview": { + "id": "sourceful/riverflow-v2-standard-preview", + "name": "Riverflow V2 Standard Preview", + "family": "sourceful", "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-12-08", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "text-embedding-3-small": { - "id": "text-embedding-3-small", - "name": "text-embedding-3-small", - "family": "text-embedding", + "sourceful/riverflow-v2-fast-preview": { + "id": "sourceful/riverflow-v2-fast-preview", + "name": "Riverflow V2 Fast Preview", + "family": "sourceful", "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, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 8191, "output": 1536 } + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-12-08", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-3.5-turbo-0125": { - "id": "gpt-3.5-turbo-0125", - "name": "GPT-3.5 Turbo 0125", - "family": "gpt", + "sourceful/riverflow-v2-max-preview": { + "id": "sourceful/riverflow-v2-max-preview", + "name": "Riverflow V2 Max Preview", + "family": "sourceful", "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, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 16384, "output": 16384 } + "knowledge": "2025-06", + "release_date": "2025-12-08", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek-V3.2", - "family": "deepseek", + "minimax/minimax-m2.7": { + "id": "minimax/minimax-m2.7", + "name": "MiniMax M2.7", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.58, "output": 1.68 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06, + "cache_write": 0.375 + } }, - "o1-preview": { - "id": "o1-preview", - "name": "o1-preview", - "family": "o", + "minimax/minimax-m2": { + "id": "minimax/minimax-m2", + "name": "MiniMax M2", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 16.5, "output": 66, "cache_read": 8.25 }, - "limit": { "context": 128000, "output": 32768 } + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-23", + "last_updated": "2025-10-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196600, + "output": 118000 + }, + "cost": { + "input": 0.28, + "output": 1.15, + "cache_read": 0.28, + "cache_write": 1.15 + } }, - "gpt-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "GPT-4.1 nano", - "family": "gpt-nano", + "minimax/minimax-01": { + "id": "minimax/minimax-01", + "name": "MiniMax-01", + "family": "minimax", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-05", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1047576, "output": 32768 } + "release_date": "2025-01-15", + "last_updated": "2025-01-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 1000000 + }, + "cost": { + "input": 0.2, + "output": 1.1 + } }, - "meta-llama-3.1-70b-instruct": { - "id": "meta-llama-3.1-70b-instruct", - "name": "Meta-Llama-3.1-70B-Instruct", - "family": "llama", + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "MiniMax M2.1", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.68, "output": 3.54 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "phi-3-small-128k-instruct": { - "id": "phi-3-small-128k-instruct", - "name": "Phi-3-small-instruct (128k)", - "family": "phi", + "minimax/minimax-m2.5:free": { + "id": "minimax/minimax-m2.5:free", + "name": "MiniMax M2.5 (free)", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + } + }, + "minimax/minimax-m1": { + "id": "minimax/minimax-m1", + "name": "MiniMax M1", + "family": "minimax", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 40000 + }, + "cost": { + "input": 0.4, + "output": 2.2 + } }, - "deepseek-r1-0528": { - "id": "deepseek-r1-0528", - "name": "DeepSeek-R1-0528", - "family": "deepseek-thinking", + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "llama-4-maverick-17b-128e-instruct-fp8": { - "id": "llama-4-maverick-17b-128e-instruct-fp8", - "name": "Llama 4 Maverick 17B 128E Instruct FP8", - "family": "llama", - "attachment": true, + "qwen/qwen3-coder-plus": { + "id": "qwen/qwen3-coder-plus", + "name": "Qwen3 Coder Plus", + "family": "qwen", + "attachment": false, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.65, + "output": 3.25, + "cache_read": 0.13, + "cache_write": 0.8125 + } }, - "cohere-embed-v-4-0": { - "id": "cohere-embed-v-4-0", - "name": "Embed v4", - "family": "cohere-embed", + "qwen/qwen3.5-397b-a17b": { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen3.5 397B A17B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "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.6, + "output": 3.6 + } + }, + "qwen/qwen2.5-vl-72b-instruct": { + "id": "qwen/qwen2.5-vl-72b-instruct", + "name": "Qwen2.5 VL 72B Instruct", + "family": "qwen", "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"] }, + "structured_output": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-02-01", + "last_updated": "2025-02-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.12, "output": 0 }, - "limit": { "context": 128000, "output": 1536 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "phi-4-reasoning-plus": { - "id": "phi-4-reasoning-plus", - "name": "Phi-4-reasoning-plus", - "family": "phi", + "qwen/qwen-plus": { + "id": "qwen/qwen-plus", + "name": "Qwen: Qwen-Plus", + "family": "qwen", "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": false, + "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": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.26, + "output": 0.78, + "cache_read": 0.052, + "cache_write": 0.325 + } + }, + "qwen/qwen3.5-flash-02-23": { + "id": "qwen/qwen3.5-flash-02-23", + "name": "Qwen: Qwen3.5-Flash", + "family": "qwen", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "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.6-plus": { + "id": "qwen/qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen", + "attachment": true, + "reasoning": true, + "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_read": 0.0325, + "cache_write": 0.40625 + } + }, + "qwen/qwen3-max": { + "id": "qwen/qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 1.2, + "output": 6, + "cache_read": 0.156, + "cache_write": 0.975 + } + }, + "qwen/qwen3-coder:exacto": { + "id": "qwen/qwen3-coder:exacto", + "name": "Qwen3 Coder (exacto)", + "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": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.38, + "output": 1.53 + } + }, + "qwen/qwen3-30b-a3b-instruct-2507": { + "id": "qwen/qwen3-30b-a3b-instruct-2507", + "name": "Qwen3 30B A3B Instruct 2507", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 32000, "output": 4096 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "grok-3": { - "id": "grok-3", - "name": "Grok 3", - "family": "grok", - "attachment": false, + "qwen/qwen-3.6-27b": { + "id": "qwen/qwen-3.6-27b", + "name": "Qwen3.6 27B", + "family": "qwen", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-04", + "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.195, + "output": 1.56 + } }, - "cohere-command-a": { - "id": "cohere-command-a", - "name": "Command A", - "family": "command-a", + "qwen/qwen3-235b-a22b-thinking-2507": { + "id": "qwen/qwen3-235b-a22b-thinking-2507", + "name": "Qwen3 235B A22B Thinking 2507", + "family": "qwen", "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "output": 8000 } + "limit": { + "context": 262144, + "output": 81920 + }, + "cost": { + "input": 0.078, + "output": 0.312 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", - "attachment": true, + "qwen/qwen3-next-80b-a3b-thinking": { + "id": "qwen/qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 272000, "output": 128000 } + "structured_output": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-09-11", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.14, + "output": 1.4 + } }, - "grok-4-fast-reasoning": { - "id": "grok-4-fast-reasoning", - "name": "Grok 4 Fast (Reasoning)", - "family": "grok", - "attachment": true, + "qwen/qwen3-30b-a3b-thinking-2507": { + "id": "qwen/qwen3-30b-a3b-thinking-2507", + "name": "Qwen3 30B A3B Thinking 2507", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "phi-3.5-moe-instruct": { - "id": "phi-3.5-moe-instruct", - "name": "Phi-3.5-MoE-instruct", - "family": "phi", + "qwen/qwen3-coder-flash": { + "id": "qwen/qwen3-coder-flash", + "name": "Qwen3 Coder Flash", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.16, "output": 0.64 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 66536 + }, + "cost": { + "input": 0.3, + "output": 1.5, + "cache_read": 0.039, + "cache_write": 0.24375 + } }, - "meta-llama-3.1-405b-instruct": { - "id": "meta-llama-3.1-405b-instruct", - "name": "Meta-Llama-3.1-405B-Instruct", - "family": "llama", + "qwen/qwen3-next-80b-a3b-instruct": { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", + "family": "qwen", "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"] }, + "knowledge": "2025-04", + "release_date": "2025-09-11", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 5.33, "output": 16 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.14, + "output": 1.4 + } }, - "phi-3-medium-128k-instruct": { - "id": "phi-3-medium-128k-instruct", - "name": "Phi-3-medium-instruct (128k)", - "family": "phi", + "qwen/qwen-2.5-coder-32b-instruct": { + "id": "qwen/qwen-2.5-coder-32b-instruct", + "name": "Qwen2.5 Coder 32B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": false, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-11-11", + "last_updated": "2024-11-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 128000, "output": 4096 } - }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "GPT-4.1 mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-05", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "cohere-command-r-08-2024": { - "id": "cohere-command-r-08-2024", - "name": "Command R", - "family": "command-r", + "qwen/qwen3-coder-30b-a3b-instruct": { + "id": "qwen/qwen3-coder-30b-a3b-instruct", + "name": "Qwen3 Coder 30B A3B Instruct", + "family": "qwen", "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-31", + "last_updated": "2025-07-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4000 } + "limit": { + "context": 160000, + "output": 65536 + }, + "cost": { + "input": 0.07, + "output": 0.27 + } }, - "deepseek-v3.1": { - "id": "deepseek-v3.1", - "name": "DeepSeek-V3.1", - "family": "deepseek", + "qwen/qwen3-coder": { + "id": "qwen/qwen3-coder", + "name": "Qwen3 Coder", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.56, "output": 1.68 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", + "qwen/qwen3.5-plus-02-15": { + "id": "qwen/qwen3.5-plus-02-15", + "name": "Qwen3.5 Plus 2026-02-15", + "family": "qwen", "attachment": true, "reasoning": true, "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", "audio"], "output": ["text", "image", "audio"] }, + "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 272000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2.4 + } }, - "phi-4": { - "id": "phi-4", - "name": "Phi-4", - "family": "phi", + "qwen/qwen3-235b-a22b-07-25": { + "id": "qwen/qwen3-235b-a22b-07-25", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04-28", + "last_updated": "2025-07-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 128000, "output": 4096 } - }, - "gpt-3.5-turbo-0301": { - "id": "gpt-3.5-turbo-0301", - "name": "GPT-3.5 Turbo 0301", - "family": "gpt", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2021-08", - "release_date": "2023-03-01", - "last_updated": "2023-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 4096, "output": 4096 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.15, + "output": 0.85 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", + "google/gemini-2.5-pro-preview-05-06": { + "id": "google/gemini-2.5-pro-preview-05-06", + "name": "Gemini 2.5 Pro Preview 05-06", + "family": "gemini-pro", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-05-06", + "last_updated": "2025-05-06", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31 + } }, - "gpt-5.2-chat": { - "id": "gpt-5.2-chat", - "name": "GPT-5.2 Chat", - "family": "gpt-codex", + "google/gemini-3.1-pro-preview-customtools": { + "id": "google/gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, "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"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "reasoning": 12, + "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 + } + } }, - "mistral-nemo": { - "id": "mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", - "attachment": false, + "google/gemma-3-4b-it:free": { + "id": "google/gemma-3-4b-it:free", + "name": "Gemma 3 4B (free)", + "family": "gemma", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "ministral-3b": { - "id": "ministral-3b", - "name": "Ministral 3B", - "family": "ministral", - "attachment": false, - "reasoning": false, + "google/gemini-2.5-flash-lite-preview-09-2025": { + "id": "google/gemini-2.5-flash-lite-preview-09-2025", + "name": "Gemini 2.5 Flash Lite Preview 09-25", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "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.025 + } }, - "text-embedding-ada-002": { - "id": "text-embedding-ada-002", - "name": "text-embedding-ada-002", - "family": "text-embedding", - "attachment": false, + "google/gemini-2.0-flash-001": { + "id": "google/gemini-2.0-flash-001", + "name": "Gemini 2.0 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": false, - "tool_call": false, - "release_date": "2022-12-15", - "last_updated": "2022-12-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "deepseek-v3.2-speciale": { - "id": "deepseek-v3.2-speciale", - "name": "DeepSeek-V3.2-Speciale", - "family": "deepseek", - "attachment": false, - "reasoning": true, + "google/gemma-3n-e4b-it": { + "id": "google/gemma-3n-e4b-it", + "name": "Gemma 3n 4B", + "family": "gemma", + "attachment": true, + "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.58, "output": 1.68 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.02, + "output": 0.04 + } }, - "llama-3.2-90b-vision-instruct": { - "id": "llama-3.2-90b-vision-instruct", - "name": "Llama-3.2-90B-Vision-Instruct", - "family": "llama", + "google/gemini-3.1-flash-lite-preview": { + "id": "google/gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash-lite", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 2.04, "output": 2.04 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2026-03-03", + "last_updated": "2026-03-03", + "modalities": { + "input": ["text", "image", "video", "pdf", "audio"], + "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.083, + "input_audio": 0.5, + "output_audio": 0.5 + } }, - "gpt-4": { - "id": "gpt-4", - "name": "GPT-4", - "family": "gpt", - "attachment": false, + "google/gemma-3n-e4b-it:free": { + "id": "google/gemma-3n-e4b-it:free", + "name": "Gemma 3n 4B (free)", + "family": "gemma", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-03-14", - "last_updated": "2023-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 60, "output": 120 }, - "limit": { "context": 8192, "output": 8192 } + "knowledge": "2024-06", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "mistral-medium-2505": { - "id": "mistral-medium-2505", - "name": "Mistral Medium 3", - "family": "mistral-medium", + "google/gemini-3.1-pro-preview": { + "id": "google/gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "reasoning": 12, + "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 + } + } }, - "gpt-4-32k": { - "id": "gpt-4-32k", - "name": "GPT-4 32K", - "family": "gpt", - "attachment": false, - "reasoning": false, + "google/gemini-3-flash-preview": { + "id": "google/gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-03-14", - "last_updated": "2023-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 60, "output": 120 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05 + } }, - "grok-3-mini": { - "id": "grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": false, + "google/gemini-3-pro-preview": { + "id": "google/gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-11-18", + "last_updated": "2025-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "reasoning": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 8192 } - }, - "meta-llama-3-8b-instruct": { - "id": "meta-llama-3-8b-instruct", - "name": "Meta-Llama-3-8B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.61 }, - "limit": { "context": 8192, "output": 2048 } + "limit": { + "context": 1050000, + "output": 66000 + }, + "cost": { + "input": 2, + "output": 12 + } }, - "phi-3.5-mini-instruct": { - "id": "phi-3.5-mini-instruct", - "name": "Phi-3.5-mini-instruct", - "family": "phi", - "attachment": false, + "google/gemma-3n-e2b-it:free": { + "id": "google/gemma-3n-e2b-it:free", + "name": "Gemma 3n 2B (free)", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 8192, + "output": 2000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "meta-llama-3-70b-instruct": { - "id": "meta-llama-3-70b-instruct", - "name": "Meta-Llama-3-70B-Instruct", - "family": "llama", + "google/gemma-2-9b-it": { + "id": "google/gemma-2-9b-it", + "name": "Gemma 2 9B", + "family": "gemma", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-28", + "last_updated": "2024-06-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.68, "output": 3.54 }, - "limit": { "context": 8192, "output": 2048 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.03, + "output": 0.09 + } }, - "cohere-command-r-plus-08-2024": { - "id": "cohere-command-r-plus-08-2024", - "name": "Command R+", - "family": "command-r", - "attachment": false, - "reasoning": false, + "google/gemma-4-31b-it": { + "id": "google/gemma-4-31b-it", + "name": "Gemma 4 31B", + "family": "gemma", + "attachment": true, + "reasoning": true, "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"] }, + "knowledge": "2025-01", + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 4000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.14, + "output": 0.4 + } }, - "gpt-5-chat": { - "id": "gpt-5-chat", - "name": "GPT-5 Chat", - "family": "gpt-codex", + "google/gemini-2.5-pro-preview-06-05": { + "id": "google/gemini-2.5-pro-preview-06-05", + "name": "Gemini 2.5 Pro Preview 06-05", + "family": "gemini-pro", "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": false, - "knowledge": "2024-10-24", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 128000, "output": 16384 } - }, - "mistral-small-2503": { - "id": "mistral-small-2503", - "name": "Mistral Small 3.1", - "family": "mistral-small", - "attachment": true, - "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31 + } }, - "mai-ds-r1": { - "id": "mai-ds-r1", - "name": "MAI-DS-R1", - "family": "mai", - "attachment": false, - "reasoning": true, + "google/gemma-3-12b-it": { + "id": "google/gemma-3-12b-it", + "name": "Gemma 3 12B", + "family": "gemma", + "attachment": true, + "reasoning": false, "tool_call": false, + "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.03, + "output": 0.1 + } }, - "o3": { - "id": "o3", - "name": "o3", - "family": "o", + "google/gemma-3-27b-it:free": { + "id": "google/gemma-3-27b-it:free", + "name": "Gemma 3 27B (free)", + "family": "gemma", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "temperature": true, + "knowledge": "2024-10", + "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, + "output": 0 + } }, - "o1": { - "id": "o1", - "name": "o1", - "family": "o", - "attachment": false, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-12-05", - "last_updated": "2024-12-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-07-17", + "last_updated": "2025-07-17", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.0375 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "google/gemini-3.1-flash-image-preview": { + "id": "google/gemini-3.1-flash-image-preview", + "name": "Gemini 3.1 Flash Image Preview (Nano Banana 2)", + "family": "gemini-flash", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "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"] }, + "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, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } }, - "gpt-5.1-chat": { - "id": "gpt-5.1-chat", - "name": "GPT-5.1 Chat", - "family": "gpt-codex", + "google/gemma-4-31b-it:free": { + "id": "google/gemma-4-31b-it:free", + "name": "Gemma 4 31B (free)", + "family": "gemma", "attachment": true, "reasoning": true, "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", "audio"], "output": ["text", "image", "audio"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } - }, - "gpt-3.5-turbo-instruct": { - "id": "gpt-3.5-turbo-instruct", - "name": "GPT-3.5 Turbo Instruct", - "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, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 4096, "output": 4096 } + "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, + "output": 0 + } }, - "model-router": { - "id": "model-router", - "name": "Model Router", - "family": "model-router", + "google/gemma-3-12b-it:free": { + "id": "google/gemma-3-12b-it:free", + "name": "Gemma 3 12B (free)", + "family": "gemma", "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, - "cost": { "input": 0.14, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } - }, - "phi-3-medium-4k-instruct": { - "id": "phi-3-medium-4k-instruct", - "name": "Phi-3-medium-instruct (4k)", - "family": "phi", - "attachment": false, - "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 4096, "output": 1024 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "phi-3-mini-4k-instruct": { - "id": "phi-3-mini-4k-instruct", - "name": "Phi-3-mini-instruct (4k)", - "family": "phi", - "attachment": false, + "google/gemma-3-4b-it": { + "id": "google/gemma-3-4b-it", + "name": "Gemma 3 4B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 4096, "output": 1024 } + "limit": { + "context": 96000, + "output": 96000 + }, + "cost": { + "input": 0.01703, + "output": 0.06815 + } }, - "llama-3.2-11b-vision-instruct": { - "id": "llama-3.2-11b-vision-instruct", - "name": "Llama-3.2-11B-Vision-Instruct", - "family": "llama", + "google/gemini-2.5-flash-preview-09-2025": { + "id": "google/gemini-2.5-flash-preview-09-2025", + "name": "Gemini 2.5 Flash Preview 09-25", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "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", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.031 + } + }, + "google/gemma-3-27b-it": { + "id": "google/gemma-3-27b-it", + "name": "Gemma 3 27B", + "family": "gemma", "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"] }, + "knowledge": "2024-10", + "release_date": "2025-03-12", + "last_updated": "2025-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.37, "output": 0.37 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 96000, + "output": 96000 + }, + "cost": { + "input": 0.04, + "output": 0.15 + } }, - "llama-4-scout-17b-16e-instruct": { - "id": "llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17B 16E Instruct", - "family": "llama", + "google/gemma-4-26b-a4b-it": { + "id": "google/gemma-4-26b-a4b-it", + "name": "Gemma 4 26B A4B", + "family": "gemma", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "knowledge": "2025-01", + "release_date": "2026-04-03", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.78 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.13, + "output": 0.4 + } }, - "phi-4-mini-reasoning": { - "id": "phi-4-mini-reasoning", - "name": "Phi-4-mini-reasoning", - "family": "phi", - "attachment": false, + "google/gemma-4-26b-a4b-it:free": { + "id": "google/gemma-4-26b-a4b-it:free", + "name": "Gemma 4 26B A4B (free)", + "family": "gemma", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-03", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "codex-mini": { - "id": "codex-mini", - "name": "Codex Mini", - "family": "gpt-codex-mini", + "google/gemini-2.5-flash-lite": { + "id": "google/gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-04", - "release_date": "2025-05-16", - "last_updated": "2025-05-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.375 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, + "reasoning": true, + "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", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } + }, + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "Kimi K2 Instruct 0905", + "family": "kimi", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-05", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "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": 0.6, + "output": 2.5 + } }, - "gpt-4o-mini": { - "id": "gpt-4o-mini", - "name": "GPT-4o mini", - "family": "gpt-mini", + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi", "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, + "structured_output": true, + "temperature": true, + "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 + } + }, + "moonshotai/kimi-k2-0905:exacto": { + "id": "moonshotai/kimi-k2-0905:exacto", + "name": "Kimi K2 Instruct 0905 (exacto)", + "family": "kimi", + "attachment": false, "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, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "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": 0.6, + "output": 2.5 + } }, - "mistral-large-2411": { - "id": "mistral-large-2411", - "name": "Mistral Large 24.11", - "family": "mistral-large", + "moonshotai/kimi-k2": { + "id": "moonshotai/kimi-k2", + "name": "Kimi K2", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 32768 } + "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": 32768 + }, + "cost": { + "input": 0.55, + "output": 2.2 + } }, - "gpt-4-turbo-vision": { - "id": "gpt-4-turbo-vision", - "name": "GPT-4 Turbo Vision", - "family": "gpt", + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "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": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } + }, + "anthropic/claude-opus-4.1": { + "id": "anthropic/claude-opus-4.1", + "name": "Claude Opus 4.1", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-11-06", - "last_updated": "2024-04-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", + "anthropic/claude-3.7-sonnet": { + "id": "anthropic/claude-3.7-sonnet", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2024-01", + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 272000, "output": 128000 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt-codex", - "attachment": false, + "anthropic/claude-opus-4.6": { + "id": "anthropic/claude-opus-4.6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } - }, - "codestral-2501": { - "id": "codestral-2501", - "name": "Codestral 25.01", - "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"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 256000 } + "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 + } + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", - "attachment": false, + "anthropic/claude-opus-4.7": { + "id": "anthropic/claude-opus-4.7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "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 + } + } }, - "phi-4-reasoning": { - "id": "phi-4-reasoning", - "name": "Phi-4-reasoning", - "family": "phi", - "attachment": false, + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, - "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, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 32000, "output": 4096 } - }, - "phi-4-mini": { - "id": "phi-4-mini", - "name": "Phi-4-mini", - "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, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 128000, "output": 4096 } - }, - "gpt-3.5-turbo-1106": { - "id": "gpt-3.5-turbo-1106", - "name": "GPT-3.5 Turbo 1106", - "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"] }, + "knowledge": "2025-03-31", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 2 }, - "limit": { "context": 16384, "output": 16384 } + "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 + } + } }, - "grok-4": { - "id": "grok-4", - "name": "Grok 4", - "family": "grok", - "attachment": false, + "anthropic/claude-sonnet-4.5": { + "id": "anthropic/claude-sonnet-4.5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "reasoning": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 64000 } + "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 + } + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "Grok 4 Fast (Non-Reasoning)", - "family": "grok", + "anthropic/claude-opus-4.5": { + "id": "anthropic/claude-opus-4.5", + "name": "Claude Opus 4.5", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-05-30", + "release_date": "2025-11-24", + "last_updated": "2025-11-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", + "anthropic/claude-haiku-4.5": { + "id": "anthropic/claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "gpt-4-turbo": { - "id": "gpt-4-turbo", - "name": "GPT-4 Turbo", - "family": "gpt", + "anthropic/claude-sonnet-4.6": { + "id": "anthropic/claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-11-06", - "last_updated": "2024-04-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "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 + } + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "deepseek/deepseek-v4-flash": { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-02-06", - "last_updated": "2026-02-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 262144, "output": 262144 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", - "shape": "completions" + "limit": { + "context": 1048576, + "output": 393216 + }, + "cost": { + "input": 0.14, + "output": 0.28, + "cache_read": 0.028 } }, - "phi-3-small-8k-instruct": { - "id": "phi-3-small-8k-instruct", - "name": "Phi-3-small-instruct (8k)", - "family": "phi", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 8192, "output": 2048 } - }, - "phi-3-mini-128k-instruct": { - "id": "phi-3-mini-128k-instruct", - "name": "Phi-3-mini-instruct (128k)", - "family": "phi", + "deepseek/deepseek-v4-pro": { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1048576, + "output": 393216 + }, + "cost": { + "input": 1.74, + "output": 3.48, + "cache_read": 0.145 + } }, - "llama-3.3-70b-instruct": { - "id": "llama-3.3-70b-instruct", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "x-ai/grok-4.3": { + "id": "x-ai/grok-4.3", + "name": "Grok 4.3", + "family": "grok", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.71, "output": 0.71 }, - "limit": { "context": 128000, "output": 32768 } + "release_date": "2026-05-01", + "last_updated": "2026-05-01", + "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, + "context_over_200k": { + "input": 2.5, + "output": 5, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2.5, + "output": 5, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "GPT-5.5", "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-12-01", + "release_date": "2026-04-23", + "last_updated": "2026-04-23", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 272000, "output": 128000 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "deepseek-r1": { - "id": "deepseek-r1", - "name": "DeepSeek-R1", - "family": "deepseek-thinking", - "attachment": false, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 163840, "output": 163840 } + "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, + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + }, + "tiers": [ + { + "input": 5, + "output": 22.5, + "cache_read": 0.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, + "openai/gpt-5.5-pro": { + "id": "openai/gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": true, - "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2025-12-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "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, + "context_over_200k": { + "input": 60, + "output": 270 + }, + "tiers": [ + { + "input": 60, + "output": 270, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "meta-llama-3.1-8b-instruct": { - "id": "meta-llama-3.1-8b-instruct", - "name": "Meta-Llama-3.1-8B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.3, "output": 0.61 }, - "limit": { "context": 128000, "output": 32768 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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, + "context_over_200k": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + }, + "tiers": [ + { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "deepseek-v3-0324": { - "id": "deepseek-v3-0324", - "name": "DeepSeek-V3-0324", - "family": "deepseek", - "attachment": false, - "reasoning": false, + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Claude Opus 4", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.14, "output": 4.56 }, - "limit": { "context": 131072, "output": 131072 } - }, - "gpt-3.5-turbo-0613": { - "id": "gpt-3.5-turbo-0613", - "name": "GPT-3.5 Turbo 0613", - "family": "gpt", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2021-08", - "release_date": "2023-06-13", - "last_updated": "2023-06-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 4 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "GPT-5 Pro", - "family": "gpt-pro", + "anthropic/claude-3.5-haiku": { + "id": "anthropic/claude-3.5-haiku", + "name": "Claude Haiku 3.5", + "family": "claude-haiku", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "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, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 272000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "o3-mini", - "family": "o-mini", + "xiaomi/mimo-v2.5-pro": { + "id": "xiaomi/mimo-v2.5-pro", + "name": "Xiaomi: MiMo-V2.5-Pro", + "family": "mimo", "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } - }, - "cohere-embed-v3-english": { - "id": "cohere-embed-v3-english", - "name": "Embed v3 English", - "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"] }, + "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, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 512, "output": 1024 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "gpt-5.4-pro": { - "id": "gpt-5.4-pro", - "name": "GPT-5.4 Pro", - "family": "gpt-pro", + "xiaomi/mimo-v2-omni": { + "id": "xiaomi/mimo-v2-omni", + "name": "Xiaomi: MiMo-V2-Omni", + "family": "mimo", "attachment": true, "reasoning": true, "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"] }, + "interleaved": { + "field": "reasoning_details" + }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 180 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } - }, - "cohere-embed-v3-multilingual": { - "id": "cohere-embed-v3-multilingual", - "name": "Embed v3 Multilingual", - "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, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 512, "output": 1024 } - }, - "phi-4-multimodal": { - "id": "phi-4-multimodal", - "name": "Phi-4-multimodal", - "family": "phi", + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08 + } + }, + "xiaomi/mimo-v2.5": { + "id": "xiaomi/mimo-v2.5", + "name": "Xiaomi: MiMo-V2.5", + "family": "mimo", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.32, "input_audio": 4 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08, + "context_over_200k": { + "input": 0.8, + "output": 4, + "cache_read": 0.16 + }, + "tiers": [ + { + "input": 0.8, + "output": 4, + "cache_read": 0.16, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex Mini", - "family": "gpt-codex", + "xiaomi/mimo-v2-pro": { + "id": "xiaomi/mimo-v2-pro", + "name": "Xiaomi: MiMo-V2-Pro", + "family": "mimo", "attachment": false, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 128000 } - }, - "text-embedding-3-large": { - "id": "text-embedding-3-large", - "name": "text-embedding-3-large", - "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"] }, + "interleaved": { + "field": "reasoning_details" + }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.13, "output": 0 }, - "limit": { "context": 8191, "output": 3072 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", + "xiaomi/mimo-v2-flash": { + "id": "xiaomi/mimo-v2-flash", + "name": "Xiaomi: MiMo-V2-Flash", + "family": "mimo", "attachment": false, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "interleaved": { + "field": "reasoning_details" + }, + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01 + } } } }, - "zai": { - "id": "zai", - "env": ["ZHIPU_API_KEY"], + "fireworks-ai": { + "id": "fireworks-ai", + "env": ["FIREWORKS_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", + "api": "https://api.fireworks.ai/inference/v1/", + "name": "Fireworks AI", + "doc": "https://fireworks.ai/docs/", "models": { - "glm-4.7-flash": { - "id": "glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", + "accounts/fireworks/models/glm-5p1": { + "id": "accounts/fireworks/models/glm-5p1", + "name": "GLM 5.1", + "family": "glm", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 202800, + "output": 131072 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } }, - "glm-5-turbo": { - "id": "glm-5-turbo", - "name": "GLM-5-Turbo", - "family": "glm", + "accounts/fireworks/models/deepseek-v3p2": { + "id": "accounts/fireworks/models/deepseek-v3p2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-03-16", - "last_updated": "2026-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.2, "output": 4, "cache_read": 0.24, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "knowledge": "2025-09", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 160000, + "output": 160000 + }, + "cost": { + "input": 0.56, + "output": 1.68, + "cache_read": 0.28 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM-4.5", - "family": "glm", + "accounts/fireworks/models/minimax-m2p5": { + "id": "accounts/fireworks/models/minimax-m2p5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "glm-4.7-flashx": { - "id": "glm-4.7-flashx", - "name": "GLM-4.7-FlashX", - "family": "glm-flash", + "accounts/fireworks/models/glm-4p5-air": { + "id": "accounts/fireworks/models/glm-4p5-air", + "name": "GLM 4.5 Air", + "family": "glm-air", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.4, "cache_read": 0.01, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.22, + "output": 0.88 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", + "accounts/fireworks/models/glm-5": { + "id": "accounts/fireworks/models/glm-5", + "name": "GLM 5", "family": "glm", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.5 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", - "attachment": true, + "accounts/fireworks/models/deepseek-v3p1": { + "id": "accounts/fireworks/models/deepseek-v3p1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2025-07", + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.56, + "output": 1.68 + } }, - "glm-4.5-flash": { - "id": "glm-4.5-flash", - "name": "GLM-4.5-Flash", - "family": "glm-flash", + "accounts/fireworks/models/kimi-k2p6": { + "id": "accounts/fireworks/models/kimi-k2p6", + "name": "Kimi K2.6", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-04-17", + "last_updated": "2026-04-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", + "accounts/fireworks/models/kimi-k2-instruct": { + "id": "accounts/fireworks/models/kimi-k2-instruct", + "name": "Kimi K2 Instruct", + "family": "kimi", + "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": 128000, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 3 + } + }, + "accounts/fireworks/models/qwen3p6-plus": { + "id": "accounts/fireworks/models/qwen3p6-plus", + "name": "Qwen 3.6 Plus", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-04-04", + "last_updated": "2026-04-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.1 + } + }, + "accounts/fireworks/models/minimax-m2p1": { + "id": "accounts/fireworks/models/minimax-m2p1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 200000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM-4.5-Air", - "family": "glm-air", + "accounts/fireworks/models/minimax-m2p7": { + "id": "accounts/fireworks/models/minimax-m2p7", + "name": "MiniMax-M2.7", + "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-04-12", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.1, "cache_read": 0.03, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "glm-4.5v": { - "id": "glm-4.5v", - "name": "GLM-4.5V", + "accounts/fireworks/models/glm-4p7": { + "id": "accounts/fireworks/models/glm-4p7", + "name": "GLM 4.7", "family": "glm", - "attachment": true, + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.8 }, - "limit": { "context": 64000, "output": 16384 } + "limit": { + "context": 198000, + "output": 198000 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.3 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", + "accounts/fireworks/models/glm-4p5": { + "id": "accounts/fireworks/models/glm-4p5", + "name": "GLM 4.5", "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "xai": { - "id": "xai", - "env": ["XAI_API_KEY"], - "npm": "@ai-sdk/xai", - "name": "xAI", - "doc": "https://docs.x.ai/docs/models", - "models": { - "grok-2-vision-1212": { - "id": "grok-2-vision-1212", - "name": "Grok 2 Vision (1212)", - "family": "grok", - "attachment": true, - "reasoning": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } + }, + "accounts/fireworks/models/kimi-k2p5": { + "id": "accounts/fireworks/models/kimi-k2p5", + "name": "Kimi K2.5", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-20", - "last_updated": "2024-12-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 8192, "output": 4096 } + "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 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "grok-4-fast": { - "id": "grok-4-fast", - "name": "Grok 4 Fast", - "family": "grok", - "attachment": true, + "accounts/fireworks/models/gpt-oss-20b": { + "id": "accounts/fireworks/models/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "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.2 + } }, - "grok-2-latest": { - "id": "grok-2-latest", - "name": "Grok 2 Latest", - "family": "grok", + "accounts/fireworks/models/gpt-oss-120b": { + "id": "accounts/fireworks/models/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-20", - "last_updated": "2024-12-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "Grok 4 Fast (Non-Reasoning)", - "family": "grok", - "attachment": true, - "reasoning": false, + "accounts/fireworks/models/kimi-k2-thinking": { + "id": "accounts/fireworks/models/kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.3 + } }, - "grok-4": { - "id": "grok-4", - "name": "Grok 4", - "family": "grok", + "accounts/fireworks/routers/kimi-k2p5-turbo": { + "id": "accounts/fireworks/routers/kimi-k2p5-turbo", + "name": "Kimi K2.5 Turbo", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "reasoning": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 64000 } + "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, + "output": 0, + "cache_read": 0 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "accounts/fireworks/models/deepseek-v4-pro": { + "id": "accounts/fireworks/models/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "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.15 + } + } + } + }, + "kimi-for-coding": { + "id": "kimi-for-coding", + "env": ["KIMI_API_KEY"], + "npm": "@ai-sdk/anthropic", + "api": "https://api.kimi.com/coding/v1", + "name": "Kimi For Coding", + "doc": "https://www.kimi.com/coding/docs/en/third-party-agents.html", + "models": { + "k2p6": { + "id": "k2p6", + "name": "Kimi K2.6", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-04", + "last_updated": "2026-04", + "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 + } }, - "grok-3-mini-fast": { - "id": "grok-3-mini-fast", - "name": "Grok 3 Mini Fast", - "family": "grok", + "k2p5": { + "id": "k2p5", + "name": "Kimi K2.5", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "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 + } + }, + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-11", + "last_updated": "2025-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "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": { + "GLM-4.7": { + "id": "GLM-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 4, "reasoning": 4, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 8192 } + "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": 3.5, + "output": 14 + } }, - "grok-beta": { - "id": "grok-beta", - "name": "Grok Beta", - "family": "grok-beta", + "MiniMax-M2.1": { + "id": "MiniMax-M2.1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 15, "cache_read": 5 }, - "limit": { "context": 131072, "output": 4096 } - }, - "grok-2-vision-latest": { - "id": "grok-2-vision-latest", - "name": "Grok 2 Vision Latest", - "family": "grok", - "attachment": true, - "reasoning": false, + "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": 2.1, + "output": 8.4 + } + } + } + }, + "opencode-go": { + "id": "opencode-go", + "env": ["OPENCODE_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://opencode.ai/zen/go/v1", + "name": "OpenCode Go", + "doc": "https://opencode.ai/docs/zen", + "models": { + "minimax-m2.7": { + "id": "minimax-m2.7", + "name": "MiniMax M2.7", + "family": "minimax-m2.7", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-20", - "last_updated": "2024-12-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 8192, "output": 4096 } + "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": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "Grok 4.1 Fast (Non-Reasoning)", - "family": "grok", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi-k2.5", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "knowledge": "2024-10", + "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 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "grok-2": { - "id": "grok-2", - "name": "Grok 2", - "family": "grok", - "attachment": false, - "reasoning": false, + "mimo-v2.5-pro": { + "id": "mimo-v2.5-pro", + "name": "MiMo V2.5 Pro", + "family": "mimo-v2.5-pro", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 131072, "output": 8192 } + "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 + }, + "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 + } + } }, - "grok-3-fast-latest": { - "id": "grok-3-fast-latest", - "name": "Grok 3 Fast Latest", - "family": "grok", + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 1.25 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-04", + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 32768 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "grok-2-1212": { - "id": "grok-2-1212", - "name": "Grok 2 (1212)", - "family": "grok", - "attachment": false, - "reasoning": false, + "mimo-v2-omni": { + "id": "mimo-v2-omni", + "name": "MiMo V2 Omni", + "family": "mimo-v2-omni", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-12-12", - "last_updated": "2024-12-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "pdf"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 128000 + }, + "status": "deprecated", + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08 + } }, - "grok-3-mini": { - "id": "grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": false, + "mimo-v2.5": { + "id": "mimo-v2.5", + "name": "MiMo V2.5", + "family": "mimo-v2.5", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "reasoning": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 8192 } + "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.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 + } + } }, - "grok-2-vision": { - "id": "grok-2-vision", - "name": "Grok 2 Vision", - "family": "grok", + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen3.6", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 8192, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "cache_write": 0.625 + } }, - "grok-3-latest": { - "id": "grok-3-latest", - "name": "Grok 3 Latest", - "family": "grok", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 8192 } - }, - "grok-4.20-multi-agent-0309": { - "id": "grok-4.20-multi-agent-0309", - "name": "Grok 4.20 Multi-Agent", - "family": "grok", - "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 2, - "output": 6, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 12, "cache_read": 0.4 } + "knowledge": "2025-04", + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 2000000, "output": 30000 } + "open_weights": true, + "limit": { + "context": 202752, + "output": 32768 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } }, - "grok-3-fast": { - "id": "grok-3-fast", - "name": "Grok 3 Fast", - "family": "grok", + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 1.25 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "grok-3-mini-fast-latest": { - "id": "grok-3-mini-fast-latest", - "name": "Grok 3 Mini Fast Latest", - "family": "grok", - "attachment": false, + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 4, "reasoning": 4, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2024-10", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "grok-3": { - "id": "grok-3", - "name": "Grok 3", - "family": "grok", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 8192 } + "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.0145 + } }, - "grok-3-mini-latest": { - "id": "grok-3-mini-latest", - "name": "Grok 3 Mini Latest", - "family": "grok", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax-m2.5", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "reasoning": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 8192 } + "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": 65536 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "grok-4.20-0309-reasoning": { - "id": "grok-4.20-0309-reasoning", - "name": "Grok 4.20 (Reasoning)", - "family": "grok", + "mimo-v2-pro": { + "id": "mimo-v2-pro", + "name": "MiMo V2 Pro", + "family": "mimo-v2-pro", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1048576, + "output": 128000 + }, + "status": "deprecated", "cost": { - "input": 2, - "output": 6, + "input": 1, + "output": 3, "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 12, "cache_read": 0.4 } - }, - "limit": { "context": 2000000, "output": 30000 } + "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 + } + } }, - "grok-4.20-0309-non-reasoning": { - "id": "grok-4.20-0309-non-reasoning", - "name": "Grok 4.20 (Non-Reasoning)", - "family": "grok", + "qwen3.5-plus": { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "family": "qwen3.5", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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" + }, "cost": { - "input": 2, - "output": 6, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 12, "cache_read": 0.4 } + "input": 0.2, + "output": 1.2, + "cache_read": 0.02, + "cache_write": 0.25 + } + } + } + }, + "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-gpt-oss-120b": { + "id": "databricks-gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, + "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 }, - "limit": { "context": 2000000, "output": 30000 } + "cost": { + "input": 0.072, + "output": 0.28 + } }, - "grok-vision-beta": { - "id": "grok-vision-beta", - "name": "Grok Vision Beta", - "family": "grok-vision", - "attachment": true, - "reasoning": false, + "databricks-gpt-oss-20b": { + "id": "databricks-gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 15, "cache_read": 5 }, - "limit": { "context": 8192, "output": 4096 } + "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.2 + } }, - "grok-4-1-fast": { - "id": "grok-4-1-fast", - "name": "Grok 4.1 Fast", - "family": "grok", + "databricks-claude-haiku-4-5": { + "id": "databricks-claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "family": "claude-haiku", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } - } - } - }, - "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": { - "runwayml/runway": { - "id": "runwayml/runway", - "name": "Runway", - "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"] }, + "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": 256, "output": 0 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "runwayml/runway-gen-4-turbo": { - "id": "runwayml/runway-gen-4-turbo", - "name": "Runway-Gen-4-Turbo", - "family": "runway", + "databricks-claude-sonnet-4-6": { + "id": "databricks-claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-05-09", - "last_updated": "2025-05-09", - "modalities": { "input": ["text", "image"], "output": ["video"] }, + "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": 256, "output": 0 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT-5.2-Codex", + "databricks-gemini-3-pro": { + "id": "databricks-gemini-3-pro", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.6, "output": 13, "cache_read": 0.16 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 18, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "openai/o1-pro": { - "id": "openai/o1-pro", - "name": "o1-pro", - "family": "o-pro", + "databricks-gemini-3-1-pro": { + "id": "databricks-gemini-3-1-pro", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-03-19", - "last_updated": "2025-03-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 140, "output": 540 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 18, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "GPT-5.1-Codex-Mini", - "family": "gpt-codex", + "databricks-gpt-5-4-mini": { + "id": "databricks-gpt-5-4-mini", + "name": "GPT-5.4 mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2025-11-12", - "last_updated": "2025-11-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-03-17", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.22, "output": 1.8, "cache_read": 0.022 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "openai/gpt-5.4-pro": { - "id": "openai/gpt-5.4-pro", - "name": "GPT-5.4-Pro", + "databricks-claude-opus-4-6": { + "id": "databricks-claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-03-05", - "last_updated": "2026-03-05", - "modalities": { "input": ["text", "image"], "output": ["image"] }, + "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, - "cost": { "input": 27, "output": 160 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "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 + } }, - "openai/sora-2": { - "id": "openai/sora-2", - "name": "Sora-2", - "family": "sora", + "databricks-gemini-2-5-pro": { + "id": "databricks-gemini-2-5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-10-06", - "last_updated": "2025-10-06", - "modalities": { "input": ["text", "image"], "output": ["video"] }, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125, + "context_over_200k": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + }, + "tiers": [ + { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "openai/o3-mini": { - "id": "openai/o3-mini", - "name": "o3-mini", - "family": "o-mini", + "databricks-gpt-5-nano": { + "id": "databricks-gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-05-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.99, "output": 4 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "openai/gpt-5.4-mini": { - "id": "openai/gpt-5.4-mini", - "name": "GPT-5.4-Mini", + "databricks-gpt-5-4": { + "id": "databricks-gpt-5-4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2026-03-12", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-03-05", + "last_updated": "2026-03-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.68, "output": 4, "cache_read": 0.068 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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, + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + }, + "tiers": [ + { + "input": 5, + "output": 22.5, + "cache_read": 0.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "openai/gpt-5-pro": { - "id": "openai/gpt-5-pro", - "name": "GPT-5-Pro", - "family": "gpt-pro", + "databricks-gemini-3-1-flash-lite": { + "id": "databricks-gemini-3-1-flash-lite", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-10-06", - "last_updated": "2025-10-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 14, "output": 110 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "input_audio": 0.5 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", + "databricks-gpt-5": { + "id": "databricks-gpt-5", "name": "GPT-5", "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "openai/chatgpt-4o-latest": { - "id": "openai/chatgpt-4o-latest", - "name": "ChatGPT-4o-Latest", - "family": "gpt", + "databricks-claude-opus-4-1": { + "id": "databricks-claude-opus-4-1", + "name": "Claude Opus 4.1 (latest)", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2024-08-14", - "last_updated": "2024-08-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 4.5, "output": 14 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "openai/gpt-4-turbo": { - "id": "openai/gpt-4-turbo", - "name": "GPT-4-Turbo", + "databricks-gpt-5-2": { + "id": "databricks-gpt-5-2", + "name": "GPT-5.2", "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2023-09-13", - "last_updated": "2023-09-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 9, "output": 27 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "openai/gpt-4o": { - "id": "openai/gpt-4o", - "name": "GPT-4o", + "databricks-gpt-5-5": { + "id": "databricks-gpt-5-5", + "name": "GPT-5.5", "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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": 128000, "output": 8192 } + "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, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "GPT-5.3-Codex", + "databricks-gemini-3-flash": { + "id": "databricks-gemini-3-flash", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-02-10", - "last_updated": "2026-02-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.6, "output": 13, "cache_read": 0.16 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "input_audio": 1 + } }, - "openai/o3-mini-high": { - "id": "openai/o3-mini-high", - "name": "o3-mini-high", - "family": "o-mini", + "databricks-claude-opus-4-5": { + "id": "databricks-claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.99, "output": 4 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT-5-mini", + "databricks-gpt-5-mini": { + "id": "databricks-gpt-5-mini", + "name": "GPT-5 Mini", "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2025-06-25", - "last_updated": "2025-06-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.22, "output": 1.8, "cache_read": 0.022 }, - "limit": { "context": 400000, "output": 128000 } - }, - "openai/gpt-image-1.5": { - "id": "openai/gpt-image-1.5", - "name": "gpt-image-1.5", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text", "image"], "output": ["image"] }, + "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, "output": 0 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "GPT-4o-mini", - "family": "gpt-mini", + "databricks-claude-sonnet-4": { + "id": "databricks-claude-sonnet-4", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.14, "output": 0.54, "cache_read": 0.068 }, - "limit": { "context": 124096, "output": 4096 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "openai/gpt-image-1-mini": { - "id": "openai/gpt-image-1-mini", - "name": "GPT-Image-1-Mini", + "databricks-gpt-5-1": { + "id": "databricks-gpt-5-1", + "name": "GPT-5.1", "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["image"] }, + "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": 0, "output": 0 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "openai/gpt-5.1-codex-max": { - "id": "openai/gpt-5.1-codex-max", - "name": "GPT 5.1 Codex Max", + "databricks-claude-opus-4-7": { + "id": "databricks-claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, "temperature": false, - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2026-01-31", + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", + "databricks-gemini-2-5-flash": { + "id": "databricks-gemini-2-5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.8, "output": 7.2, "cache_read": 0.45 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.03, + "input_audio": 1 + } }, - "openai/gpt-3.5-turbo": { - "id": "openai/gpt-3.5-turbo", - "name": "GPT-3.5-Turbo", - "family": "gpt", + "databricks-gpt-5-4-nano": { + "id": "databricks-gpt-5-4-nano", + "name": "GPT-5.4 nano", + "family": "gpt-nano", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2023-09-13", - "last_updated": "2023-09-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-03-17", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.45, "output": 1.4 }, - "limit": { "context": 16384, "output": 2048 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "openai/gpt-3.5-turbo-instruct": { - "id": "openai/gpt-3.5-turbo-instruct", - "name": "GPT-3.5-Turbo-Instruct", - "family": "gpt", + "databricks-claude-sonnet-4-5": { + "id": "databricks-claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2023-09-20", - "last_updated": "2023-09-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.4, "output": 1.8 }, - "limit": { "context": 3500, "output": 1024 } - }, - "openai/dall-e-3": { - "id": "openai/dall-e-3", - "name": "DALL-E-3", - "family": "dall-e", - "attachment": true, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + } + } + }, + "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": { + "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar": { + "id": "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar", + "name": "Qwen 3 Coder 480B", + "family": "qwen", + "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 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-01-15", + "last_updated": "2025-01-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 106000, + "output": 4096 + }, + "cost": { + "input": 0.22, + "output": 0.95, + "cache_read": 0.11, + "cache_write": 0.44 + } }, - "openai/gpt-4-classic": { - "id": "openai/gpt-4-classic", - "name": "GPT-4-Classic", - "family": "gpt", - "attachment": true, + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "name": "Qwen 3 Next 80B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-03-25", - "last_updated": "2024-03-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 27, "output": 54 }, - "limit": { "context": 8192, "output": 4096 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-01-10", + "last_updated": "2025-01-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 4096 + }, + "cost": { + "input": 0.1, + "output": 0.8, + "cache_read": 0.05, + "cache_write": 0.2 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT-5.4", - "attachment": true, + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen 3 235B Thinking", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-02-26", - "last_updated": "2026-02-26", - "modalities": { "input": ["text", "image", "pdf"], "output": ["image"] }, - "open_weights": false, - "cost": { "input": 2.2, "output": 14, "cache_read": 0.22 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 4096 + }, + "cost": { + "input": 0.11, + "output": 0.6, + "cache_read": 0.055, + "cache_write": 0.22 + } }, - "openai/o1": { - "id": "openai/o1", - "name": "o1", - "family": "o", - "attachment": true, - "reasoning": true, + "Qwen/Qwen2.5-VL-32B-Instruct": { + "id": "Qwen/Qwen2.5-VL-32B-Instruct", + "name": "Qwen 2.5 VL 32B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-12-18", - "last_updated": "2024-12-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14, "output": 54 }, - "limit": { "context": 200000, "output": 100000 } + "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 + }, + "cost": { + "input": 0.05, + "output": 0.22, + "cache_read": 0.025, + "cache_write": 0.1 + } }, - "openai/gpt-4o-aug": { - "id": "openai/gpt-4o-aug", - "name": "GPT-4o-Aug", - "family": "gpt", - "attachment": true, + "zai-org/GLM-4.6": { + "id": "zai-org/GLM-4.6", + "name": "GLM 4.6", + "family": "glm", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-11-21", - "last_updated": "2024-11-21", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-11-15", + "last_updated": "2024-11-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.2, "output": 9, "cache_read": 1.1 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 0.4, + "output": 1.75, + "cache_read": 0.2, + "cache_write": 0.8 + } }, - "openai/o3": { - "id": "openai/o3", - "name": "o3", - "family": "o", - "attachment": true, - "reasoning": true, + "mistralai/Magistral-Small-2506": { + "id": "mistralai/Magistral-Small-2506", + "name": "Magistral Small 2506", + "family": "magistral-small", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-06-01", + "last_updated": "2025-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.8, "output": 7.2, "cache_read": 0.45 }, - "limit": { "context": 200000, "output": 100000 } - }, - "openai/gpt-5-chat": { - "id": "openai/gpt-5-chat", - "name": "GPT-5-Chat", - "family": "gpt-codex", - "attachment": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 1.5, + "cache_read": 0.25, + "cache_write": 1 + } + }, + "mistralai/Mistral-Large-Instruct-2411": { + "id": "mistralai/Mistral-Large-Instruct-2411", + "name": "Mistral Large Instruct 2411", + "family": "mistral-large", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 1, + "cache_write": 4 + } }, - "openai/gpt-4o-mini-search": { - "id": "openai/gpt-4o-mini-search", - "name": "GPT-4o-mini-Search", - "family": "gpt-mini", - "attachment": true, + "mistralai/Mistral-Nemo-Instruct-2407": { + "id": "mistralai/Mistral-Nemo-Instruct-2407", + "name": "Mistral Nemo Instruct 2407", + "family": "mistral-nemo", + "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, - "cost": { "input": 0.14, "output": 0.54 }, - "limit": { "context": 128000, "output": 8192 } + "temperature": true, + "knowledge": "2024-05", + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.02, + "output": 0.04, + "cache_read": 0.01, + "cache_write": 0.04 + } }, - "openai/gpt-3.5-turbo-raw": { - "id": "openai/gpt-3.5-turbo-raw", - "name": "GPT-3.5-Turbo-Raw", - "family": "gpt", - "attachment": true, + "mistralai/Devstral-Small-2505": { + "id": "mistralai/Devstral-Small-2505", + "name": "Devstral Small 2505", + "family": "devstral", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2023-09-27", - "last_updated": "2023-09-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-05-01", + "last_updated": "2025-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.45, "output": 1.4 }, - "limit": { "context": 4524, "output": 2048 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.05, + "output": 0.22, + "cache_read": 0.025, + "cache_write": 0.1 + } }, - "openai/gpt-5.4-nano": { - "id": "openai/gpt-5.4-nano", - "name": "GPT-5.4-Nano", - "attachment": true, - "reasoning": true, + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 1.1, "cache_read": 0.018 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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.13, + "output": 0.38, + "cache_read": 0.065, + "cache_write": 0.26 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", - "attachment": true, - "reasoning": true, + "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", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.6, "output": 13, "cache_read": 0.16 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-01-15", + "last_updated": "2025-01-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 430000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.075, + "cache_write": 0.3 + } }, - "openai/o4-mini-deep-research": { - "id": "openai/o4-mini-deep-research", - "name": "o4-mini-deep-research", - "family": "o-mini", - "attachment": true, - "reasoning": true, + "meta-llama/Llama-3.2-90B-Vision-Instruct": { + "id": "meta-llama/Llama-3.2-90B-Vision-Instruct", + "name": "Llama 3.2 90B Vision Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-06-27", - "last_updated": "2025-06-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.8, "output": 7.2, "cache_read": 0.45 }, - "limit": { "context": 200000, "output": 100000 } + "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 + }, + "cost": { + "input": 0.35, + "output": 0.4, + "cache_read": 0.175, + "cache_write": 0.7 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", - "attachment": true, + "deepseek-ai/DeepSeek-R1-0528": { + "id": "deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek R1", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-12", - "last_updated": "2025-11-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 8.75, + "cache_read": 1, + "cache_write": 4 + } }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "GPT-4.1-mini", - "family": "gpt-mini", - "attachment": true, + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT-OSS 20B", + "family": "gpt-oss", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.36, "output": 1.4, "cache_read": 0.09 }, - "limit": { "context": 1047576, "output": 32768 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 4096 + }, + "cost": { + "input": 0.03, + "output": 0.14, + "cache_read": 0.015, + "cache_write": 0.06 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "GPT-5-nano", - "family": "gpt-nano", - "attachment": true, - "reasoning": true, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT-OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.045, "output": 0.36, "cache_read": 0.0045 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 4096 + }, + "cost": { + "input": 0.04, + "output": 0.4, + "cache_read": 0.02, + "cache_write": 0.08 + } }, - "openai/gpt-5.1-instant": { - "id": "openai/gpt-5.1-instant", - "name": "GPT-5.1-Instant", - "family": "gpt", - "attachment": true, + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-12", - "last_updated": "2025-11-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "output": 4096 + }, + "cost": { + "input": 0.55, + "output": 2.25, + "cache_read": 0.275, + "cache_write": 1.1 + } }, - "openai/gpt-5.2-instant": { - "id": "openai/gpt-5.2-instant", - "name": "GPT-5.2-Instant", - "attachment": true, + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi K2 Instruct", + "family": "kimi", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2024-09-05", + "last_updated": "2024-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.6, "output": 13, "cache_read": 0.16 }, - "limit": { "context": 128000, "output": 16384 } - }, - "openai/gpt-4-classic-0314": { - "id": "openai/gpt-4-classic-0314", - "name": "GPT-4-Classic-0314", - "family": "gpt", - "attachment": true, - "reasoning": false, + "limit": { + "context": 32768, + "output": 4096 + }, + "cost": { + "input": 0.39, + "output": 1.9, + "cache_read": 0.195, + "cache_write": 0.78 + } + } + } + }, + "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-235b-a22b": { + "id": "qwen3-235b-a22b", + "name": "Qwen3 235B-A22B", + "family": "qwen", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2024-08-26", - "last_updated": "2024-08-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 27, "output": 54 }, - "limit": { "context": 8192, "output": 4096 } + "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 + }, + "cost": { + "input": 0.287, + "output": 1.147, + "reasoning": 2.868 + } }, - "openai/gpt-4o-search": { - "id": "openai/gpt-4o-search", - "name": "GPT-4o-Search", - "family": "gpt", - "attachment": true, + "qwen-plus-character": { + "id": "qwen-plus-character", + "name": "Qwen Plus Character", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-03-11", - "last_updated": "2025-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-01", + "last_updated": "2024-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.2, "output": 9 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 32768, + "output": 4096 + }, + "cost": { + "input": 0.115, + "output": 0.287 + } }, - "openai/gpt-image-1": { - "id": "openai/gpt-image-1", - "name": "GPT-Image-1", - "family": "gpt", - "attachment": true, + "qwen2-5-math-7b-instruct": { + "id": "qwen2-5-math-7b-instruct", + "name": "Qwen2.5-Math 7B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-03-31", - "last_updated": "2025-03-31", - "modalities": { "input": ["text", "image"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 128000, "output": 0 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 3072 + }, + "cost": { + "input": 0.144, + "output": 0.287 + } }, - "openai/o3-pro": { - "id": "openai/o3-pro", - "name": "o3-pro", - "family": "o-pro", - "attachment": true, + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Moonshot Kimi K2.5", + "family": "kimi", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-06-10", - "last_updated": "2025-06-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 18, "output": 72 }, - "limit": { "context": 200000, "output": 100000 } + "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": 2.411 + } }, - "openai/gpt-4.1-nano": { - "id": "openai/gpt-4.1-nano", - "name": "GPT-4.1-nano", - "family": "gpt-nano", - "attachment": true, + "qwen-doc-turbo": { + "id": "qwen-doc-turbo", + "name": "Qwen Doc Turbo", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-01", + "last_updated": "2024-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.09, "output": 0.36, "cache_read": 0.022 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.087, + "output": 0.144 + } }, - "openai/gpt-5.3-instant": { - "id": "openai/gpt-5.3-instant", - "name": "GPT-5.3-Instant", - "attachment": true, + "qwen-vl-ocr": { + "id": "qwen-vl-ocr", + "name": "Qwen-VL OCR", + "family": "qwen", + "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.6, "output": 13, "cache_read": 0.16 }, - "limit": { "context": 128000, "input": 111616, "output": 16384 } - }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "GPT-5-Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.1, "output": 9 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 34096, + "output": 4096 + }, + "cost": { + "input": 0.717, + "output": 0.717 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "o4-mini", - "family": "o-mini", - "attachment": true, - "reasoning": true, + "qwen-omni-turbo-realtime": { + "id": "qwen-omni-turbo-realtime", + "name": "Qwen-Omni Turbo Realtime", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.99, "output": 4, "cache_read": 0.25 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0.23, + "output": 0.918, + "input_audio": 3.584, + "output_audio": 7.168 + } }, - "openai/o3-deep-research": { - "id": "openai/o3-deep-research", - "name": "o3-deep-research", - "family": "o", - "attachment": true, + "qwen3-8b": { + "id": "qwen3-8b", + "name": "Qwen3 8B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-06-27", - "last_updated": "2025-06-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 9, "output": 36, "cache_read": 2.2 }, - "limit": { "context": 200000, "output": 100000 } + "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 + }, + "cost": { + "input": 0.072, + "output": 0.287, + "reasoning": 0.717 + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT-5.1-Codex", - "family": "gpt-codex", - "attachment": true, + "qwen3.5-397b-a17b": { + "id": "qwen3.5-397b-a17b", + "name": "Qwen3.5 397B-A17B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-12", - "last_updated": "2025-11-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 400000, "output": 128000 } + "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.43, + "output": 2.58, + "reasoning": 2.58 + } }, - "openai/sora-2-pro": { - "id": "openai/sora-2-pro", - "name": "Sora-2-Pro", - "family": "sora", - "attachment": true, + "qwen-math-turbo": { + "id": "qwen-math-turbo", + "name": "Qwen Math Turbo", + "family": "qwen", + "attachment": false, "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 } - }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "GPT-5.2-Pro", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 19, "output": 150 }, - "limit": { "context": 400000, "output": 128000 } - }, - "anthropic/claude-opus-4.6": { - "id": "anthropic/claude-opus-4.6", - "name": "Claude-Opus-4.6", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2026-02-04", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09-19", + "last_updated": "2024-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 4.3, "output": 21, "cache_read": 0.43, "cache_write": 5.3 }, - "limit": { "context": 983040, "output": 128000 } + "limit": { + "context": 4096, + "output": 3072 + }, + "cost": { + "input": 0.287, + "output": 0.861 + } }, - "anthropic/claude-haiku-4.5": { - "id": "anthropic/claude-haiku-4.5", - "name": "Claude-Haiku-4.5", - "family": "claude-haiku", - "attachment": true, + "qwq-plus": { + "id": "qwq-plus", + "name": "QwQ Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2025-03-05", + "last_updated": "2025-03-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.85, "output": 4.3, "cache_read": 0.085, "cache_write": 1.1 }, - "limit": { "context": 192000, "output": 64000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.23, + "output": 0.574 + } }, - "anthropic/claude-haiku-3.5": { - "id": "anthropic/claude-haiku-3.5", - "name": "Claude-Haiku-3.5", - "family": "claude-haiku", - "attachment": true, + "qwen-vl-plus": { + "id": "qwen-vl-plus", + "name": "Qwen-VL Plus", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-01-25", + "last_updated": "2025-08-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.68, "output": 3.4, "cache_read": 0.068, "cache_write": 0.85 }, - "limit": { "context": 189096, "output": 8192 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.115, + "output": 0.287 + } }, - "anthropic/claude-haiku-3": { - "id": "anthropic/claude-haiku-3", - "name": "Claude-Haiku-3", - "family": "claude-haiku", - "attachment": true, - "reasoning": false, + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2024-03-09", - "last_updated": "2024-03-09", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.21, "output": 1.1, "cache_read": 0.021, "cache_write": 0.26 }, - "limit": { "context": 189096, "output": 8192 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 0.86, + "output": 3.15 + } }, - "anthropic/claude-sonnet-3.7": { - "id": "anthropic/claude-sonnet-3.7", - "name": "Claude-Sonnet-3.7", - "family": "claude-sonnet", - "attachment": true, + "deepseek-r1-distill-llama-70b": { + "id": "deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.6, "output": 13, "cache_read": 0.26, "cache_write": 3.2 }, - "limit": { "context": 196608, "output": 128000 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.287, + "output": 0.861 + } }, - "anthropic/claude-opus-4.1": { - "id": "anthropic/claude-opus-4.1", - "name": "Claude-Opus-4.1", - "family": "claude-opus", - "attachment": true, + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3 32B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 13, "output": 64, "cache_read": 1.3, "cache_write": 16 }, - "limit": { "context": 196608, "output": 32000 } + "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 + }, + "cost": { + "input": 0.287, + "output": 1.147, + "reasoning": 2.868 + } }, - "anthropic/claude-sonnet-4.6": { - "id": "anthropic/claude-sonnet-4.6", - "name": "Claude-Sonnet-4.6", - "attachment": true, + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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 + } + }, + "qwen-max": { + "id": "qwen-max", + "name": "Qwen Max", + "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, - "cost": { "input": 2.6, "output": 13, "cache_read": 0.26, "cache_write": 3.2 }, - "limit": { "context": 983040, "output": 128000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.345, + "output": 1.377 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude-Sonnet-4", - "family": "claude-sonnet", - "attachment": true, + "qwen-plus": { + "id": "qwen-plus", + "name": "Qwen Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-05-21", - "last_updated": "2025-05-21", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-01-25", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.6, "output": 13, "cache_read": 0.26, "cache_write": 3.2 }, - "limit": { "context": 983040, "output": 64000 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.115, + "output": 0.287, + "reasoning": 1.147 + } }, - "anthropic/claude-sonnet-3.5-june": { - "id": "anthropic/claude-sonnet-3.5-june", - "name": "Claude-Sonnet-3.5-June", - "family": "claude-sonnet", - "attachment": true, + "qwen-omni-turbo": { + "id": "qwen-omni-turbo", + "name": "Qwen-Omni Turbo", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-11-18", - "last_updated": "2024-11-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2.6, "output": 13, "cache_read": 0.26, "cache_write": 3.2 }, - "limit": { "context": 189096, "output": 8192 } + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0.058, + "output": 0.23, + "input_audio": 3.584, + "output_audio": 7.168 + } }, - "anthropic/claude-opus-4.5": { - "id": "anthropic/claude-opus-4.5", - "name": "Claude-Opus-4.5", - "family": "claude-opus", - "attachment": true, + "qwen-flash": { + "id": "qwen-flash", + "name": "Qwen Flash", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-21", - "last_updated": "2025-11-21", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 4.3, "output": 21, "cache_read": 0.43, "cache_write": 5.3 }, - "limit": { "context": 196608, "output": 64000 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.022, + "output": 0.216 + } }, - "anthropic/claude-sonnet-3.5": { - "id": "anthropic/claude-sonnet-3.5", - "name": "Claude-Sonnet-3.5", - "family": "claude-sonnet", - "attachment": true, + "qwen2-5-vl-7b-instruct": { + "id": "qwen2-5-vl-7b-instruct", + "name": "Qwen2.5-VL 7B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-06-05", - "last_updated": "2024-06-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.287, + "output": 0.717 + } + }, + "deepseek-r1": { + "id": "deepseek-r1", + "name": "DeepSeek R1", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.6, "output": 13, "cache_read": 0.26, "cache_write": 3.2 }, - "limit": { "context": 189096, "output": 8192 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.574, + "output": 2.294 + } }, - "anthropic/claude-sonnet-4.5": { - "id": "anthropic/claude-sonnet-4.5", - "name": "Claude-Sonnet-4.5", - "family": "claude-sonnet", + "qwen3.5-flash": { + "id": "qwen3.5-flash", + "name": "Qwen3.5 Flash", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-09-26", - "last_updated": "2025-09-26", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "structured_output": 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": false, - "cost": { "input": 2.6, "output": 13, "cache_read": 0.26, "cache_write": 3.2 }, - "limit": { "context": 983040, "output": 32768 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.172, + "output": 1.72, + "reasoning": 1.72 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Claude-Opus-4", - "family": "claude-opus", - "attachment": true, + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-05-21", - "last_updated": "2025-05-21", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 13, "output": 64, "cache_read": 1.3, "cache_write": 16 }, - "limit": { "context": 192512, "output": 28672 } + "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 + } + } }, - "xai/grok-4-fast-non-reasoning": { - "id": "xai/grok-4-fast-non-reasoning", - "name": "Grok-4-Fast-Non-Reasoning", - "family": "grok", - "attachment": true, + "qwen3-max": { + "id": "qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-09-16", - "last_updated": "2025-09-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 128000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.861, + "output": 3.441 + } }, - "xai/grok-4": { - "id": "xai/grok-4", - "name": "Grok-4", - "family": "grok", - "attachment": true, + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-07-10", - "last_updated": "2025-07-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 128000 } + "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.87, + "output": 3.48, + "cache_read": 0.17 + } }, - "xai/grok-code-fast-1": { - "id": "xai/grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", - "attachment": true, + "qwen3-omni-flash": { + "id": "qwen3-omni-flash", + "name": "Qwen3-Omni Flash", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-08-22", - "last_updated": "2025-08-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 128000 } + "limit": { + "context": 65536, + "output": 16384 + }, + "cost": { + "input": 0.058, + "output": 0.23, + "input_audio": 3.584, + "output_audio": 7.168 + } }, - "xai/grok-4.1-fast-non-reasoning": { - "id": "xai/grok-4.1-fast-non-reasoning", - "name": "Grok-4.1-Fast-Non-Reasoning", - "family": "grok", - "attachment": true, + "deepseek-v3-1": { + "id": "deepseek-v3-1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.574, + "output": 1.721 + } }, - "xai/grok-4.1-fast-reasoning": { - "id": "xai/grok-4.1-fast-reasoning", - "name": "Grok-4.1-Fast-Reasoning", - "family": "grok", - "attachment": true, - "reasoning": true, + "qwen2-5-72b-instruct": { + "id": "qwen2-5-72b-instruct", + "name": "Qwen2.5 72B Instruct", + "family": "qwen", + "attachment": false, + "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 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.574, + "output": 1.721 + } }, - "xai/grok-3-mini": { - "id": "xai/grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": true, + "qwen3-vl-235b-a22b": { + "id": "qwen3-vl-235b-a22b", + "name": "Qwen3-VL 235B-A22B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 8192 } + "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.286705, + "output": 1.14682, + "reasoning": 2.867051 + } }, - "xai/grok-4.20-multi-agent": { - "id": "xai/grok-4.20-multi-agent", - "name": "Grok-4.20-Multi-Agent", - "attachment": true, + "qwen-math-plus": { + "id": "qwen-math-plus", + "name": "Qwen Math Plus", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2026-03-13", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-08-16", + "last_updated": "2024-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 0.2 }, - "limit": { "context": 128000, "output": 0 } + "limit": { + "context": 4096, + "output": 3072 + }, + "cost": { + "input": 0.574, + "output": 1.721 + } }, - "xai/grok-4-fast-reasoning": { - "id": "xai/grok-4-fast-reasoning", - "name": "Grok-4-Fast-Reasoning", - "family": "grok", - "attachment": true, - "reasoning": true, + "qwen2-5-coder-32b-instruct": { + "id": "qwen2-5-coder-32b-instruct", + "name": "Qwen2.5-Coder 32B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-11", + "last_updated": "2024-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.287, + "output": 0.861 + } + }, + "qwen3-asr-flash": { + "id": "qwen3-asr-flash", + "name": "Qwen3-ASR Flash", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": false, - "release_date": "2025-09-16", - "last_updated": "2025-09-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-09-08", + "last_updated": "2025-09-08", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 128000 } + "limit": { + "context": 53248, + "output": 4096 + }, + "cost": { + "input": 0.032, + "output": 0.032 + } }, - "xai/grok-3": { - "id": "xai/grok-3", - "name": "Grok 3", - "family": "grok", - "attachment": true, + "qwen-deep-research": { + "id": "qwen-deep-research", + "name": "Qwen Deep Research", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-01", + "last_updated": "2024-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 7.742, + "output": 23.367 + } }, - "stabilityai/stablediffusionxl": { - "id": "stabilityai/stablediffusionxl", - "name": "StableDiffusionXL", - "family": "stable-diffusion", - "attachment": true, - "reasoning": false, + "qwen3-next-80b-a3b-thinking": { + "id": "qwen3-next-80b-a3b-thinking", + "name": "Qwen3-Next 80B-A3B (Thinking)", + "family": "qwen", + "attachment": false, + "reasoning": true, "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 } + "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.144, + "output": 1.434 + } }, - "trytako/tako": { - "id": "trytako/tako", - "name": "Tako", - "family": "tako", - "attachment": true, + "qwen-mt-plus": { + "id": "qwen-mt-plus", + "name": "Qwen-MT Plus", + "family": "qwen", + "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 2048, "output": 0 } + "limit": { + "context": 16384, + "output": 8192 + }, + "cost": { + "input": 0.259, + "output": 0.775 + } }, - "google/gemini-2.5-flash-lite": { - "id": "google/gemini-2.5-flash-lite", - "name": "Gemini-2.5-Flash-Lite", - "family": "gemini-flash-lite", - "attachment": true, + "deepseek-r1-distill-qwen-32b": { + "id": "deepseek-r1-distill-qwen-32b", + "name": "DeepSeek R1 Distill Qwen 32B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-06-19", - "last_updated": "2025-06-19", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 1024000, "output": 64000 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.287, + "output": 0.861 + } }, - "google/lyria": { - "id": "google/lyria", - "name": "Lyria", - "family": "lyria", - "attachment": true, + "qwen-vl-max": { + "id": "qwen-vl-max", + "name": "Qwen-VL Max", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-06-04", - "last_updated": "2025-06-04", - "modalities": { "input": ["text"], "output": ["audio"] }, + "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": 0, "output": 0 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.23, + "output": 0.574 + } }, - "google/imagen-4-ultra": { - "id": "google/imagen-4-ultra", - "name": "Imagen-4-Ultra", - "family": "imagen", - "attachment": true, + "qwen3-coder-flash": { + "id": "qwen3-coder-flash", + "name": "Qwen3 Coder Flash", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-05-24", - "last_updated": "2025-05-24", - "modalities": { "input": ["text"], "output": ["image"] }, + "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": 480, "output": 0 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.144, + "output": 0.574 + } }, - "google/nano-banana-pro": { - "id": "google/nano-banana-pro", - "name": "Nano-Banana-Pro", - "family": "nano-banana", - "attachment": true, - "reasoning": false, + "deepseek-r1-distill-qwen-7b": { + "id": "deepseek-r1-distill-qwen-7b", + "name": "DeepSeek R1 Distill Qwen 7B", + "family": "qwen", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["image"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 65536, "output": 0 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.072, + "output": 0.144 + } }, - "google/imagen-3-fast": { - "id": "google/imagen-3-fast", - "name": "Imagen-3-Fast", - "family": "imagen", - "attachment": true, + "qwen2-5-7b-instruct": { + "id": "qwen2-5-7b-instruct", + "name": "Qwen2.5 7B Instruct", + "family": "qwen", + "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 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.072, + "output": 0.144 + } }, - "google/imagen-3": { - "id": "google/imagen-3", - "name": "Imagen-3", - "family": "imagen", - "attachment": true, + "qwen2-5-14b-instruct": { + "id": "qwen2-5-14b-instruct", + "name": "Qwen2.5 14B Instruct", + "family": "qwen", + "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 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.144, + "output": 0.431 + } }, - "google/gemini-2.0-flash-lite": { - "id": "google/gemini-2.0-flash-lite", - "name": "Gemini-2.0-Flash-Lite", - "family": "gemini-flash-lite", - "attachment": true, + "tongyi-intent-detect-v3": { + "id": "tongyi-intent-detect-v3", + "name": "Tongyi Intent Detect V3", + "family": "yi", + "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2025-02-05", - "last_updated": "2025-02-05", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "tool_call": false, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-01", + "last_updated": "2024-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.052, "output": 0.21 }, - "limit": { "context": 990000, "output": 8192 } + "limit": { + "context": 8192, + "output": 1024 + }, + "cost": { + "input": 0.058, + "output": 0.144 + } }, - "google/veo-3.1-fast": { - "id": "google/veo-3.1-fast", - "name": "Veo-3.1-Fast", - "family": "veo", - "attachment": true, - "reasoning": false, + "qwq-32b": { + "id": "qwq-32b", + "name": "QwQ 32B", + "family": "qwen", + "attachment": false, + "reasoning": true, "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 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-12", + "last_updated": "2024-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.287, + "output": 0.861 + } }, - "google/veo-3-fast": { - "id": "google/veo-3-fast", - "name": "Veo-3-Fast", - "family": "veo", - "attachment": true, + "moonshot-kimi-k2-instruct": { + "id": "moonshot-kimi-k2-instruct", + "name": "Moonshot Kimi K2 Instruct", + "family": "kimi", + "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 } + "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 + }, + "cost": { + "input": 0.574, + "output": 2.294 + } }, - "google/imagen-4-fast": { - "id": "google/imagen-4-fast", - "name": "Imagen-4-Fast", - "family": "imagen", - "attachment": true, + "qwen2-5-32b-instruct": { + "id": "qwen2-5-32b-instruct", + "name": "Qwen2.5 32B Instruct", + "family": "qwen", + "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 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.287, + "output": 0.861 + } }, - "google/veo-3.1": { - "id": "google/veo-3.1", - "name": "Veo-3.1", - "family": "veo", - "attachment": true, + "qwen3-next-80b-a3b-instruct": { + "id": "qwen3-next-80b-a3b-instruct", + "name": "Qwen3-Next 80B-A3B Instruct", + "family": "qwen", + "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 } + "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.144, + "output": 0.574 + } }, - "google/imagen-4": { - "id": "google/imagen-4", - "name": "Imagen-4", - "family": "imagen", - "attachment": true, + "qwen3-omni-flash-realtime": { + "id": "qwen3-omni-flash-realtime", + "name": "Qwen3-Omni Flash Realtime", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text"], "output": ["image"] }, + "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": 480, "output": 0 } + "limit": { + "context": 65536, + "output": 16384 + }, + "cost": { + "input": 0.23, + "output": 0.918, + "input_audio": 3.584, + "output_audio": 7.168 + } }, - "google/veo-3": { - "id": "google/veo-3", - "name": "Veo-3", - "family": "veo", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Moonshot Kimi K2.6", + "family": "kimi", "attachment": true, - "reasoning": false, + "reasoning": true, "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 } + "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 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini-2.5-Pro", - "family": "gemini-pro", - "attachment": true, + "qwen3-vl-30b-a3b": { + "id": "qwen3-vl-30b-a3b", + "name": "Qwen3-VL 30B-A3B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-02-05", - "last_updated": "2025-02-05", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.87, "output": 7, "cache_read": 0.087 }, - "limit": { "context": 1065535, "output": 65535 } + "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.108, + "output": 0.431, + "reasoning": 1.076 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini-2.5-Flash", - "family": "gemini-flash", - "attachment": true, + "qwen3-vl-plus": { + "id": "qwen3-vl-plus", + "name": "Qwen3-VL Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-04-26", - "last_updated": "2025-04-26", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.21, "output": 1.8, "cache_read": 0.021 }, - "limit": { "context": 1065535, "output": 65535 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.143353, + "output": 1.433525, + "reasoning": 4.300576 + } }, - "google/gemini-2.0-flash": { - "id": "google/gemini-2.0-flash", - "name": "Gemini-2.0-Flash", - "family": "gemini-flash", - "attachment": true, + "deepseek-v3-2-exp": { + "id": "deepseek-v3-2-exp", + "name": "DeepSeek V3.2 Exp", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.42 }, - "limit": { "context": 990000, "output": 8192 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.287, + "output": 0.431 + } }, - "google/gemini-3-pro": { - "id": "google/gemini-3-pro", - "name": "Gemini-3-Pro", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, + "qwen3-coder-480b-a35b-instruct": { + "id": "qwen3-coder-480b-a35b-instruct", + "name": "Qwen3-Coder 480B-A35B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-10-22", - "last_updated": "2025-10-22", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.6, "output": 9.6, "cache_read": 0.16 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + }, + "cost": { + "input": 0.861, + "output": 3.441 + } }, - "google/gemini-deep-research": { - "id": "google/gemini-deep-research", - "name": "gemini-deep-research", - "attachment": true, + "deepseek-r1-distill-qwen-1-5b": { + "id": "deepseek-r1-distill-qwen-1-5b", + "name": "DeepSeek R1 Distill Qwen 1.5B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.6, "output": 9.6 }, - "limit": { "context": 1048576, "output": 0 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "google/veo-2": { - "id": "google/veo-2", - "name": "Veo-2", - "family": "veo", - "attachment": true, + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3-Coder 30B-A3B Instruct", + "family": "qwen", + "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 } - }, - "google/gemini-3.1-pro": { - "id": "google/gemini-3.1-pro", - "name": "Gemini-3.1-Pro", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2026-02-19", - "last_updated": "2026-02-19", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + }, + "cost": { + "input": 0.216, + "output": 0.861 + } }, - "google/nano-banana": { - "id": "google/nano-banana", - "name": "Nano-Banana", - "family": "nano-banana", - "attachment": true, + "qwen2-5-coder-7b-instruct": { + "id": "qwen2-5-coder-7b-instruct", + "name": "Qwen2.5-Coder 7B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.21, "output": 1.8, "cache_read": 0.021 }, - "limit": { "context": 65536, "output": 0 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-11", + "last_updated": "2024-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.144, + "output": 0.287 + } }, - "google/gemini-3-flash": { - "id": "google/gemini-3-flash", - "name": "Gemini-3-Flash", - "attachment": true, + "qwen-turbo": { + "id": "qwen-turbo", + "name": "Qwen Turbo", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-10-07", - "last_updated": "2025-10-07", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-11-01", + "last_updated": "2025-07-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2.4, "cache_read": 0.04 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.044, + "output": 0.087, + "reasoning": 0.431 + } }, - "google/gemini-3.1-flash-lite": { - "id": "google/gemini-3.1-flash-lite", - "name": "Gemini-3.1-Flash-Lite", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2026-02-18", - "last_updated": "2026-02-18", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, + "qwen-mt-turbo": { + "id": "qwen-mt-turbo", + "name": "Qwen-MT Turbo", + "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, - "cost": { "input": 0.25, "output": 1.5 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 16384, + "output": 8192 + }, + "cost": { + "input": 0.101, + "output": 0.28 + } }, - "poetools/claude-code": { - "id": "poetools/claude-code", - "name": "claude-code", - "attachment": true, - "reasoning": true, + "qwen2-5-math-72b-instruct": { + "id": "qwen2-5-math-72b-instruct", + "name": "Qwen2.5-Math 72B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "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 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 3072 + }, + "cost": { + "input": 0.574, + "output": 1.721 + } }, - "novita/glm-4.7-n": { - "id": "novita/glm-4.7-n", - "name": "glm-4.7-n", - "attachment": true, + "qwen3.6-max-preview": { + "id": "qwen3.6-max-preview", + "name": "Qwen3.6 Max Preview", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 205000, "output": 131072 } + "limit": { + "context": 245800, + "output": 65536 + }, + "cost": { + "input": 1.32, + "output": 7.9, + "cache_read": 0.132 + } }, - "novita/kimi-k2-thinking": { - "id": "novita/kimi-k2-thinking", - "name": "kimi-k2-thinking", - "family": "kimi", - "attachment": true, - "reasoning": true, + "qwen2-5-omni-7b": { + "id": "qwen2-5-omni-7b", + "name": "Qwen2.5-Omni 7B", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-11-07", - "last_updated": "2025-11-07", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 256000, "output": 0 } + "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 + }, + "cost": { + "input": 0.087, + "output": 0.345, + "input_audio": 5.448 + } }, - "novita/kimi-k2.5": { - "id": "novita/kimi-k2.5", - "name": "kimi-k2.5", - "attachment": true, + "qwen3.5-plus": { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "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": 256000, "output": 262144 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.573, + "output": 3.44, + "reasoning": 3.44 + } }, - "novita/glm-4.7-flash": { - "id": "novita/glm-4.7-flash", - "name": "glm-4.7-flash", - "attachment": true, + "deepseek-r1-distill-qwen-14b": { + "id": "deepseek-r1-distill-qwen-14b", + "name": "DeepSeek R1 Distill Qwen 14B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 200000, "output": 65500 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.144, + "output": 0.431 + } }, - "novita/minimax-m2.1": { - "id": "novita/minimax-m2.1", - "name": "minimax-m2.1", - "attachment": true, - "reasoning": true, + "qwen2-5-vl-72b-instruct": { + "id": "qwen2-5-vl-72b-instruct", + "name": "Qwen2.5-VL 72B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-12-26", - "last_updated": "2025-12-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 205000, "output": 131072 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 2.294, + "output": 6.881 + } }, - "novita/glm-4.6": { - "id": "novita/glm-4.6", - "name": "GLM-4.6", - "family": "glm", - "attachment": true, + "deepseek-v3": { + "id": "deepseek-v3", + "name": "DeepSeek V3", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 65536, + "output": 8192 + }, + "cost": { + "input": 0.287, + "output": 1.147 + } }, - "novita/glm-4.6v": { - "id": "novita/glm-4.6v", - "name": "glm-4.6v", - "attachment": true, + "deepseek-r1-0528": { + "id": "deepseek-r1-0528", + "name": "DeepSeek R1 0528", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-12-09", - "last_updated": "2025-12-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 131000, "output": 32768 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.574, + "output": 2.294 + } }, - "novita/glm-4.7": { - "id": "novita/glm-4.7", - "name": "glm-4.7", - "attachment": true, + "qvq-max": { + "id": "qvq-max", + "name": "QVQ Max", + "family": "qvq", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 205000, "output": 131072 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 1.147, + "output": 4.588 + } }, - "novita/deepseek-v3.2": { - "id": "novita/deepseek-v3.2", - "name": "DeepSeek-V3.2", - "attachment": true, + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Moonshot Kimi K2 Thinking", + "family": "kimi", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 0.4, "cache_read": 0.13 }, - "limit": { "context": 128000, "output": 0 } - }, - "topazlabs-co/topazlabs": { - "id": "topazlabs-co/topazlabs", - "name": "TopazLabs", - "family": "topazlabs", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 204, "output": 0 } - }, - "elevenlabs/elevenlabs-v3": { - "id": "elevenlabs/elevenlabs-v3", - "name": "ElevenLabs-v3", - "family": "elevenlabs", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text"], "output": ["audio"] }, - "open_weights": false, - "limit": { "context": 128000, "output": 0 } + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.574, + "output": 2.294 + } }, - "elevenlabs/elevenlabs-music": { - "id": "elevenlabs/elevenlabs-music", - "name": "ElevenLabs-Music", - "family": "elevenlabs", - "attachment": true, - "reasoning": false, + "qwen3-14b": { + "id": "qwen3-14b", + "name": "Qwen3 14B", + "family": "qwen", + "attachment": false, + "reasoning": true, "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 } + "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 + }, + "cost": { + "input": 0.144, + "output": 0.574, + "reasoning": 1.434 + } }, - "elevenlabs/elevenlabs-v2.5-turbo": { - "id": "elevenlabs/elevenlabs-v2.5-turbo", - "name": "ElevenLabs-v2.5-Turbo", - "family": "elevenlabs", - "attachment": true, - "reasoning": false, + "deepseek-r1-distill-llama-8b": { + "id": "deepseek-r1-distill-llama-8b", + "name": "DeepSeek R1 Distill Llama 8B", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2024-10-28", - "last_updated": "2024-10-28", - "modalities": { "input": ["text"], "output": ["audio"] }, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 0 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "lumalabs/ray2": { - "id": "lumalabs/ray2", - "name": "Ray2", - "family": "ray", - "attachment": true, + "qwen-long": { + "id": "qwen-long", + "name": "Qwen Long", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-02-20", - "last_updated": "2025-02-20", - "modalities": { "input": ["text", "image"], "output": ["video"] }, + "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": 5000, "output": 0 } + "limit": { + "context": 10000000, + "output": 8192 + }, + "cost": { + "input": 0.072, + "output": 0.287 + } }, - "cerebras/gpt-oss-120b-cs": { - "id": "cerebras/gpt-oss-120b-cs", - "name": "gpt-oss-120b-cs", - "attachment": true, + "kimi/kimi-k2.5": { + "id": "kimi/kimi-k2.5", + "name": "kimi/kimi-k2.5", + "family": "kimi", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": false, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } - }, - "cerebras/llama-3.3-70b-cs": { - "id": "cerebras/llama-3.3-70b-cs", - "name": "llama-3.3-70b-cs", - "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-05-13", - "last_updated": "2025-05-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } + "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 + } }, - "cerebras/qwen3-235b-2507-cs": { - "id": "cerebras/qwen3-235b-2507-cs", - "name": "qwen3-235b-2507-cs", - "attachment": true, + "MiniMax/MiniMax-M2.7": { + "id": "MiniMax/MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } + "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 + } }, - "cerebras/llama-3.1-8b-cs": { - "id": "cerebras/llama-3.1-8b-cs", - "name": "llama-3.1-8b-cs", - "attachment": true, + "siliconflow/deepseek-v3-0324": { + "id": "siliconflow/deepseek-v3-0324", + "name": "siliconflow/deepseek-v3-0324", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-05-13", - "last_updated": "2025-05-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 0, "output": 0 } + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.25, + "output": 1 + } }, - "cerebras/qwen3-32b-cs": { - "id": "cerebras/qwen3-32b-cs", - "name": "qwen3-32b-cs", - "attachment": true, + "siliconflow/deepseek-v3.2": { + "id": "siliconflow/deepseek-v3.2", + "name": "siliconflow/deepseek-v3.2", + "family": "deepseek", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-05-15", - "last_updated": "2025-05-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } - }, - "ideogramai/ideogram-v2": { - "id": "ideogramai/ideogram-v2", - "name": "Ideogram-v2", - "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"] }, + "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": 150, "output": 0 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 0.42 + } }, - "ideogramai/ideogram-v2a": { - "id": "ideogramai/ideogram-v2a", - "name": "Ideogram-v2a", - "family": "ideogram", - "attachment": true, - "reasoning": false, + "siliconflow/deepseek-r1-0528": { + "id": "siliconflow/deepseek-r1-0528", + "name": "siliconflow/deepseek-r1-0528", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-02-27", - "last_updated": "2025-02-27", - "modalities": { "input": ["text"], "output": ["image"] }, + "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": 150, "output": 0 } + "limit": { + "context": 163840, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 2.18 + } }, - "ideogramai/ideogram-v2a-turbo": { - "id": "ideogramai/ideogram-v2a-turbo", - "name": "Ideogram-v2a-Turbo", - "family": "ideogram", - "attachment": true, - "reasoning": false, + "siliconflow/deepseek-v3.1-terminus": { + "id": "siliconflow/deepseek-v3.1-terminus", + "name": "siliconflow/deepseek-v3.1-terminus", + "family": "deepseek", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-02-27", - "last_updated": "2025-02-27", - "modalities": { "input": ["text"], "output": ["image"] }, + "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": 150, "output": 0 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "ideogramai/ideogram": { - "id": "ideogramai/ideogram", - "name": "Ideogram", - "family": "ideogram", - "attachment": true, + "qwen3-coder-plus": { + "id": "qwen3-coder-plus", + "name": "Qwen3 Coder Plus", + "family": "qwen", + "attachment": false, "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 } - } - } - }, - "v0": { - "id": "v0", - "env": ["V0_API_KEY"], - "npm": "@ai-sdk/vercel", - "name": "v0", - "doc": "https://sdk.vercel.ai/providers/ai-sdk-providers/vercel", - "models": { - "v0-1.5-lg": { - "id": "v0-1.5-lg", - "name": "v0-1.5-lg", - "family": "v0", - "attachment": true, - "reasoning": true, - "tool_call": true, "temperature": true, - "release_date": "2025-06-09", - "last_updated": "2025-06-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75 }, - "limit": { "context": 512000, "output": 32000 } + "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 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "v0-1.0-md": { - "id": "v0-1.0-md", - "name": "v0-1.0-md", - "family": "v0", - "attachment": true, + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "output": 32000 } + "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.028 + } }, - "v0-1.5-md": { - "id": "v0-1.5-md", - "name": "v0-1.5-md", - "family": "v0", - "attachment": true, + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-06-09", - "last_updated": "2025-06-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "output": 32000 } + "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 + } } } }, - "opencode": { - "id": "opencode", - "env": ["OPENCODE_API_KEY"], + "firepass": { + "id": "firepass", + "env": ["FIREPASS_API_KEY"], "npm": "@ai-sdk/openai-compatible", - "api": "https://opencode.ai/zen/v1", - "name": "OpenCode Zen", - "doc": "https://opencode.ai/docs/zen", + "api": "https://api.fireworks.ai/inference/v1/", + "name": "Fireworks (Firepass)", + "doc": "https://docs.fireworks.ai/firepass", "models": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } - }, - "mimo-v2-flash-free": { - "id": "mimo-v2-flash-free", - "name": "MiMo V2 Flash Free", - "family": "mimo-flash-free", + "accounts/fireworks/routers/kimi-k2p6-turbo": { + "id": "accounts/fireworks/routers/kimi-k2p6-turbo", + "name": "Kimi K2.6 Turbo", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-17", + "last_updated": "2026-04-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 262144, "output": 65536 }, - "status": "deprecated" - }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex Mini", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } - }, - "gpt-5.4-pro": { - "id": "gpt-5.4-pro", - "name": "GPT-5.4 Pro", - "family": "gpt-pro", - "attachment": true, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } + } + } + }, + "minimax-cn-coding-plan": { + "id": "minimax-cn-coding-plan", + "env": ["MINIMAX_API_KEY"], + "npm": "@ai-sdk/anthropic", + "api": "https://api.minimaxi.com/anthropic/v1", + "name": "MiniMax Coding Plan (minimaxi.com)", + "doc": "https://platform.minimaxi.com/docs/coding-plan/intro", + "models": { + "MiniMax-M2": { + "id": "MiniMax-M2", + "name": "MiniMax-M2", + "family": "minimax", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 30, "output": 180, "cache_read": 30 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "temperature": true, + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "big-pickle": { - "id": "big-pickle", - "name": "Big Pickle", - "family": "big-pickle", + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-10-17", - "last_updated": "2025-10-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "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, + "cache_write": 0 + } }, - "gpt-5.4-mini": { - "id": "gpt-5.4-mini", - "name": "GPT-5.4 Mini", - "family": "gpt-mini", - "attachment": true, + "MiniMax-M2.7": { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.75, "output": 4.5, "cache_read": 0.075 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "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, + "cache_write": 0 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "MiniMax-M2.7-highspeed": { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 2.5, "cache_read": 0.4 }, - "limit": { "context": 262144, "output": 262144 }, - "status": "deprecated" + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "minimax-m2.1-free": { - "id": "minimax-m2.1-free", - "name": "MiniMax M2.1 Free", - "family": "minimax-free", + "MiniMax-M2.1": { + "id": "MiniMax-M2.1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", "release_date": "2025-12-23", "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 204800, "output": 131072 }, - "status": "deprecated", - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", + "MiniMax-M2.5-highspeed": { + "id": "MiniMax-M2.5-highspeed", + "name": "MiniMax-M2.5-highspeed", + "family": "minimax", + "attachment": false, + "reasoning": true, + "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, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "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": { + "gpt-5.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "gpt-5.1-codex-max", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.07, "output": 8.5, "cache_read": 0.107 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "claude-opus-4-5": { - "id": "claude-opus-4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "grok-4-1-fast-reasoning": { + "id": "grok-4-1-fast-reasoning", + "name": "grok-4-1-fast-reasoning", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 0.18, + "output": 0.45 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "claude-opus-4-5-20251101", + "family": "claude-opus", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.08 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 65536 + }, + "cost": { + "input": 4.5, + "output": 22.5 + } }, - "mimo-v2-omni-free": { - "id": "mimo-v2-omni-free", - "name": "MiMo V2 Omni Free", - "family": "mimo-omni-free", + "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", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "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": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 262144, "output": 64000 } + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.09, + "output": 0.36 + } }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt-codex", + "gpt-5.2-pro": { + "id": "gpt-5.2-pro", + "name": "gpt-5.2-pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 18.9, + "output": 151.2 + } }, - "qwen3.6-plus-free": { - "id": "qwen3.6-plus-free", - "name": "Qwen3.6 Plus Free", - "family": "qwen-free", - "attachment": false, - "reasoning": true, + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "gemini-3-flash-preview", + "family": "gemini-flash", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2026-03-30", - "last_updated": "2026-03-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 1048576, "output": 64000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } }, - "gpt-5.3-codex-spark": { - "id": "gpt-5.3-codex-spark", - "name": "GPT-5.3 Codex Spark", - "family": "gpt-codex-spark", - "attachment": false, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "gpt-5-mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": false, - "knowledge": "2025-08-31", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "input": 128000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.225, + "output": 1.8 + } }, - "kimi-k2": { - "id": "kimi-k2", - "name": "Kimi K2", - "family": "kimi", - "attachment": false, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "gpt-5-nano", + "family": "gpt-nano", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2.5, "cache_read": 0.4 }, - "limit": { "context": 262144, "output": 262144 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.045, + "output": 0.36 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "gemini-3-pro-preview", + "family": "gemini-pro", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.8, + "output": 10.8 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1 Codex Max", - "family": "gpt-codex", + "gemini-2.5-flash-preview-05-20": { + "id": "gemini-2.5-flash-preview-05-20", + "name": "gemini-2.5-flash-preview-05-20", + "family": "gemini-flash", "attachment": true, - "reasoning": 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"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 1048576, + "output": 200000 + }, + "cost": { + "input": 0.135, + "output": 3.15 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "claude-sonnet-4-5-20250929", "family": "claude-sonnet", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07-31", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 2.7, + "output": 13.5 + } }, - "grok-code": { - "id": "grok-code", - "name": "Grok Code Fast 1", - "family": "grok", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "gemini-2.5-pro", + "family": "gemini-pro", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-20", - "last_updated": "2025-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 256000, "output": 256000 }, - "status": "deprecated" + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "grok-4-1-fast-non-reasoning", + "family": "grok", "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } - }, - "qwen3-coder": { - "id": "qwen3-coder", - "name": "Qwen3 Coder", - "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": true, - "cost": { "input": 0.45, "output": 1.8 }, - "limit": { "context": 262144, "output": 65536 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 0.18, + "output": 0.45 + } }, - "minimax-m2.1": { - "id": "minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", - "attachment": false, - "reasoning": true, + "gpt-5.2": { + "id": "gpt-5.2", + "name": "gpt-5.2", + "family": "gpt", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.1 }, - "limit": { "context": 204800, "output": 131072 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.575, + "output": 12.6 + } }, - "kimi-k2.5-free": { - "id": "kimi-k2.5-free", - "name": "Kimi K2.5 Free", - "family": "kimi-free", + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 262144, "output": 262144 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4 + } }, - "glm-5-free": { - "id": "glm-5-free", - "name": "GLM-5 Free", - "family": "glm-free", - "attachment": false, - "reasoning": true, + "gemini-2.5-pro-preview-06-05": { + "id": "gemini-2.5-pro-preview-06-05", + "name": "gemini-2.5-pro-preview-06-05", + "family": "gemini-pro", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 204800, "output": 131072 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 200000 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "claude-opus-4-1": { - "id": "claude-opus-4-1", - "name": "Claude Opus 4.1", - "family": "claude-opus", + "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", + "family": "gemini-flash-lite", "attachment": true, - "reasoning": 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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "video", "image", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.09, + "output": 0.36 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", - "family": "glm", - "attachment": false, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "gpt-5.2-codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.1 }, - "limit": { "context": 204800, "output": 131072 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } }, - "gpt-5.4-nano": { - "id": "gpt-5.4-nano", - "name": "GPT-5.4 Nano", - "family": "gpt-nano", + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "gemini-2.5-flash", + "family": "gemini-flash", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.25, "cache_read": 0.02 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.27, + "output": 2.25 + } }, - "claude-sonnet-4": { - "id": "claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "gpt-5.1-codex-mini", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 400000, + "output": 128000 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "cost": { + "input": 0.225, + "output": 1.8 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "grok-code-fast-1", + "family": "grok", "attachment": true, - "reasoning": 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"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.18, + "output": 1.35 + } }, "gpt-5.1": { "id": "gpt-5.1", - "name": "GPT-5.1", + "name": "gpt-5.1", "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2026-02", + "last_updated": "2026-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.07, "output": 8.5, "cache_read": 0.107 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "gemini-3-pro": { - "id": "gemini-3-pro", - "name": "Gemini 3 Pro", - "family": "gemini-pro", + "grok-4-fast-reasoning": { + "id": "grok-4-fast-reasoning", + "name": "grok-4-fast-reasoning", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "limit": { + "context": 2000000, + "output": 2000000 }, - "limit": { "context": 1048576, "output": 65536 }, - "status": "deprecated", - "provider": { "npm": "@ai-sdk/google" } + "cost": { + "input": 0.18, + "output": 0.45 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, + "o3-mini": { + "id": "o3-mini", + "name": "o3-mini", + "family": "o", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 1.1, + "output": 4.4 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", + "grok-4-0709": { + "id": "grok-4-0709", + "name": "grok-4-0709", + "family": "grok", "attachment": true, - "reasoning": 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"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 2.7, + "output": 13.5 + } }, - "nemotron-3-super-free": { - "id": "nemotron-3-super-free", - "name": "Nemotron 3 Super Free", - "family": "nemotron-free", - "attachment": false, - "reasoning": true, + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "gpt-5-codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2026-02", - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 1000000, "output": 128000 } + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "claude-3-5-haiku": { - "id": "claude-3-5-haiku", - "name": "Claude Haiku 3.5", - "family": "claude-haiku", + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "claude-opus-4-1-20250805", + "family": "claude-opus", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07-31", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 13.5, + "output": 67.5 + } }, - "minimax-m2.5-free": { - "id": "minimax-m2.5-free", - "name": "MiniMax M2.5 Free", - "family": "minimax-free", - "attachment": false, - "reasoning": true, + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "claude-haiku-4-5-20251001", + "family": "claude-haiku", + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 204800, "output": 131072 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 20000, + "output": 64000 + }, + "cost": { + "input": 0.9, + "output": 4.5 + } }, - "trinity-large-preview-free": { - "id": "trinity-large-preview-free", - "name": "Trinity Large Preview", - "family": "trinity", - "attachment": false, + "claude-sonnet-4-20250514": { + "id": "claude-sonnet-4-20250514", + "name": "claude-sonnet-4-20250514", + "family": "claude-sonnet", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2026-01-28", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 2.7, + "output": 13.5 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "claude-opus-4-6", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.1 }, - "limit": { "context": 204800, "output": 131072 }, - "status": "deprecated" + "knowledge": "2025-05-31", + "release_date": "2026-02", + "last_updated": "2026-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25 + } }, - "gemini-3.1-pro": { - "id": "gemini-3.1-pro", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", + "o3": { + "id": "o3", + "name": "o3", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "limit": { + "context": 131072, + "output": 131072 }, - "limit": { "context": 1048576, "output": 65536 }, - "provider": { "npm": "@ai-sdk/google" } + "cost": { + "input": 10, + "output": 40 + } }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "gpt-5-pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": 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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 400000, + "output": 272000 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "cost": { + "input": 13.5, + "output": 108 + } }, - "glm-4.7-free": { - "id": "glm-4.7-free", - "name": "GLM-4.7 Free", - "family": "glm-free", - "attachment": false, - "reasoning": true, + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "gemini-2.5-flash-lite", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 204800, "output": 131072 }, - "status": "deprecated" + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.09, + "output": 0.36 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "GPT-5 Codex", - "family": "gpt-codex", + "gpt-5-chat-latest": { + "id": "gpt-5-chat-latest", + "name": "gpt-5-chat-latest", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.07, "output": 8.5, "cache_read": 0.107 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", + "claude-opus-4-20250514": { + "id": "claude-opus-4-20250514", + "name": "claude-opus-4-20250514", + "family": "claude-opus", "attachment": true, - "reasoning": 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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 13.5, + "output": 67.5 + } }, "gpt-5.1-codex": { "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", + "name": "gpt-5.1-codex", "family": "gpt-codex", "attachment": true, "reasoning": true, "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, - "cost": { "input": 1.07, "output": 8.5, "cache_read": 0.107 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai" } - }, - "minimax-m2.5": { - "id": "minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.125, + "output": 9 + } }, - "gemini-3-flash": { - "id": "gemini-3-flash", - "name": "Gemini 3 Flash", - "family": "gemini-flash", + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "grok-4-fast-non-reasoning", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05 }, - "limit": { "context": 1048576, "output": 65536 }, - "provider": { "npm": "@ai-sdk/google" } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 0.18, + "output": 0.45 + } }, - "mimo-v2-pro-free": { - "id": "mimo-v2-pro-free", - "name": "MiMo V2 Pro Free", - "family": "mimo-pro-free", - "attachment": true, - "reasoning": true, + "deepseek/deepseek-v3-0324": { + "id": "deepseek/deepseek-v3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", + "attachment": false, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 1048576, "output": 64000 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT-OSS-120B", - "family": "gpt-oss", + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.28, + "output": 1.14 + } + }, + "deepseek/deepseek-v3.1": { + "id": "deepseek/deepseek-v3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 163840, + "output": 32768 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "GLM 4.7", - "family": "glm", + "deepseek/deepseek-r1-0528": { + "id": "deepseek/deepseek-r1-0528", + "name": "DeepSeek R1 0528", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.7, "output": 2.3 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 163840, + "output": 32768 + }, + "cost": { + "input": 0.7, + "output": 2.5 + } }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "zai-org/glm-4.7": { + "id": "zai-org/glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2025-04-27", - "last_updated": "2025-04-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.9, "output": 0.9 }, - "limit": { "context": 128000, "output": 8192 } - }, - "intfloat/multilingual-e5-large-instruct": { - "id": "intfloat/multilingual-e5-large-instruct", - "name": "Multilingual-E5-large-instruct", - "family": "text-embedding", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-04", - "release_date": "2025-04-27", - "last_updated": "2025-04-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 512, "output": 1024 } - }, - "intfloat/multilingual-e5-large": { - "id": "intfloat/multilingual-e5-large", - "name": "Multilingual-E5-large", - "family": "text-embedding", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-09", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 512, "output": 1024 } - }, - "KBLab/kb-whisper-large": { - "id": "KBLab/kb-whisper-large", - "name": "KB-Whisper-Large", - "family": "whisper", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-04", - "release_date": "2025-04-27", - "last_updated": "2025-04-27", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 3, "output": 3 }, - "limit": { "context": 480000, "output": 4800 } - }, - "BAAI/bge-reranker-v2-m3": { - "id": "BAAI/bge-reranker-v2-m3", - "name": "bge-reranker-v2-m3", - "family": "bge", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-04", - "release_date": "2025-04-23", - "last_updated": "2025-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 512, "output": 512 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "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", - "family": "mistral-small", + "zai-org/glm-4.5": { + "id": "zai-org/glm-4.5", + "name": "GLM-4.5", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-10-01", - "last_updated": "2025-10-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 32000, "output": 8192 } - } - } - }, - "lucidquery": { - "id": "lucidquery", - "env": ["LUCIDQUERY_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://lucidquery.com/api/v1", - "name": "LucidQuery AI", - "doc": "https://lucidquery.com/api/docs", - "models": { - "lucidquery-nexus-coder": { - "id": "lucidquery-nexus-coder", - "name": "LucidQuery Nexus Coder", - "family": "lucid", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 2, "output": 5 }, - "limit": { "context": 250000, "output": 60000 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "lucidnova-rf1-100b": { - "id": "lucidnova-rf1-100b", - "name": "LucidNova RF1 100B", - "family": "nova", + "zai-org/glm-4.5v": { + "id": "zai-org/glm-4.5v", + "name": "GLM 4.5V", + "family": "glmv", "attachment": true, "reasoning": true, "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, - "cost": { "input": 2, "output": 5 }, - "limit": { "context": 120000, "output": 8000 } - } - } - }, - "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.z.ai/guides/overview/pricing", - "models": { - "glm-5": { - "id": "glm-5", - "name": "GLM-5", + "structured_output": true, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 1.8 + } + }, + "zai-org/glm-4.7-flash": { + "id": "zai-org/glm-4.7-flash", + "name": "GLM-4.7-Flash", "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.07, + "output": 0.4 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", + "minimaxai/minimax-m1-80k": { + "id": "minimaxai/minimax-m1-80k", + "name": "MiniMax M1", + "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 1000000, + "output": 40000 + }, + "cost": { + "input": 0.55, + "output": 2.2 + } }, - "glm-4.5v": { - "id": "glm-4.5v", - "name": "GLM-4.5V", - "family": "glm", - "attachment": true, + "xiaomimimo/mimo-v2-flash": { + "id": "xiaomimimo/mimo-v2-flash", + "name": "XiaomiMiMo/MiMo-V2-Flash", + "family": "mimo", + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.8 }, - "limit": { "context": 64000, "output": 16384 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM-4.5-Air", - "family": "glm-air", - "attachment": false, + "baidu/ernie-4.5-vl-424b-a47b": { + "id": "baidu/ernie-4.5-vl-424b-a47b", + "name": "ERNIE 4.5 VL 424B A47B", + "family": "ernie", + "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.1, "cache_read": 0.03, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 123000, + "output": 16000 + }, + "cost": { + "input": 0.42, + "output": 1.25 + } }, - "glm-4.5-flash": { - "id": "glm-4.5-flash", - "name": "GLM-4.5-Flash", - "family": "glm-flash", + "baidu/ernie-4.5-300b-a47b-paddle": { + "id": "baidu/ernie-4.5-300b-a47b-paddle", + "name": "ERNIE 4.5 300B A47B", + "family": "ernie", "attachment": false, - "reasoning": true, + "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 123000, + "output": 12000 + }, + "cost": { + "input": 0.28, + "output": 1.1 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", - "attachment": true, + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "Minimax M2.1", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, + "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", - "family": "glm", + "qwen/qwen3-235b-a22b-instruct-2507": { + "id": "qwen/qwen3-235b-a22b-instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.8 + } }, - "glm-4.7-flashx": { - "id": "glm-4.7-flashx", - "name": "GLM-4.7-FlashX", - "family": "glm-flash", + "qwen/qwen3-32b-fp8": { + "id": "qwen/qwen3-32b-fp8", + "name": "Qwen3 32B", + "family": "qwen", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.4, "cache_read": 0.01, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 40960, + "output": 20000 + }, + "cost": { + "input": 0.1, + "output": 0.45 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM-4.5", - "family": "glm", + "qwen/qwen3-235b-a22b-thinking-2507": { + "id": "qwen/qwen3-235b-a22b-thinking-2507", + "name": "Qwen3 235B A22b Thinking 2507", + "family": "qwen", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 3 + } }, - "glm-4.7-flash": { - "id": "glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", + "qwen/qwen3-next-80b-a3b-thinking": { + "id": "qwen/qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", + "family": "qwen", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT-OSS-120B", - "family": "gpt-oss", - "attachment": true, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-04", - "last_updated": "2025-08-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 1.5 + } }, - "openai/whisper-large-v3": { - "id": "openai/whisper-large-v3", - "name": "Whisper Large v3", - "family": "whisper", + "qwen/qwen3-next-80b-a3b-instruct": { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2023-09-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 0, "output": 4096 } - }, - "microsoft/phi-3-small-8k-instruct": { - "id": "microsoft/phi-3-small-8k-instruct", - "name": "Phi 3 Small 8k Instruct", - "attachment": true, - "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-05-07", - "last_updated": "2024-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8000, "output": 4096 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 1.5 + } }, - "microsoft/phi-3-vision-128k-instruct": { - "id": "microsoft/phi-3-vision-128k-instruct", - "name": "Phi 3 Vision 128k Instruct", + "qwen/qwen3-30b-a3b-fp8": { + "id": "qwen/qwen3-30b-a3b-fp8", + "name": "Qwen3 30B A3B", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, + "reasoning": true, + "tool_call": false, + "structured_output": false, "temperature": true, - "release_date": "2024-05-19", - "last_updated": "2024-05-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 40960, + "output": 20000 + }, + "cost": { + "input": 0.09, + "output": 0.45 + } }, - "microsoft/phi-3-medium-4k-instruct": { - "id": "microsoft/phi-3-medium-4k-instruct", - "name": "Phi 3 Medium 4k Instruct", - "attachment": true, + "qwen/qwen3-coder-next": { + "id": "qwen/qwen3-coder-next", + "name": "qwen/qwen3-coder-next", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-05-07", - "last_updated": "2024-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02", + "last_updated": "2026-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4000, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } }, - "microsoft/phi-3.5-vision-instruct": { - "id": "microsoft/phi-3.5-vision-instruct", - "name": "Phi 3.5 Vision Instruct", + "qwen/qwen3-coder-480b-a35b-instruct": { + "id": "qwen/qwen3-coder-480b-a35b-instruct", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2024-08-16", - "last_updated": "2024-08-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.29, + "output": 1.2 + } + }, + "qwen/qwen3-235b-a22b-fp8": { + "id": "qwen/qwen3-235b-a22b-fp8", + "name": "Qwen3 235B A22B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": false, + "structured_output": false, + "temperature": true, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 40960, + "output": 20000 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "microsoft/phi-3-medium-128k-instruct": { - "id": "microsoft/phi-3-medium-128k-instruct", - "name": "Phi 3 Medium 128k Instruct", + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-05-07", - "last_updated": "2024-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 3 + } }, - "microsoft/phi-3.5-moe-instruct": { - "id": "microsoft/phi-3.5-moe-instruct", - "name": "Phi 3.5 Moe Instruct", + "moonshotai/kimi-k2-instruct": { + "id": "moonshotai/kimi-k2-instruct", + "name": "Kimi K2 Instruct", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2024-08-17", - "last_updated": "2024-08-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.57, + "output": 2.3 + } }, - "microsoft/phi-3-small-128k-instruct": { - "id": "microsoft/phi-3-small-128k-instruct", - "name": "Phi 3 Small 128k Instruct", - "attachment": true, + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "Kimi K2 0905", + "family": "kimi", + "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-05-07", - "last_updated": "2024-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - }, - "microsoft/phi-4-mini-instruct": { - "id": "microsoft/phi-4-mini-instruct", - "name": "Phi-4-Mini", - "family": "phi", - "attachment": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5 + } + } + } + }, + "bailing": { + "id": "bailing", + "env": ["BAILING_API_TOKEN"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.tbox.cn/api/llm/v1/chat/completions", + "name": "Bailing", + "doc": "https://alipaytbox.yuque.com/sxs0ba/ling/intro", + "models": { + "Ring-1T": { + "id": "Ring-1T", + "name": "Ring-1T", + "family": "ring", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "nvidia/llama3-chatqa-1.5-70b": { - "id": "nvidia/llama3-chatqa-1.5-70b", - "name": "Llama3 Chatqa 1.5 70b", + "Ling-1T": { + "id": "Ling-1T", + "name": "Ling-1T", + "family": "ling", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-04-28", - "last_updated": "2024-04-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - }, - "nvidia/llama-3.1-nemotron-70b-instruct": { - "id": "nvidia/llama-3.1-nemotron-70b-instruct", - "name": "Llama 3.1 Nemotron 70b Instruct", + "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 + } + } + } + }, + "iflowcn": { + "id": "iflowcn", + "env": ["IFLOW_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://apis.iflow.cn/v1", + "name": "iFlow", + "doc": "https://platform.iflow.cn/en/docs", + "models": { + "qwen3-coder-plus": { + "id": "qwen3-coder-plus", + "name": "Qwen3-Coder-Plus", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-10-12", - "last_updated": "2024-10-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "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", + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3-32B", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-16", - "last_updated": "2025-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/nemotron-4-340b-instruct": { - "id": "nvidia/nemotron-4-340b-instruct", - "name": "Nemotron 4 340b Instruct", + "deepseek-r1": { + "id": "deepseek-r1", + "name": "DeepSeek-R1", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-06-13", - "last_updated": "2024-06-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-12", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/cosmos-nemotron-34b": { - "id": "nvidia/cosmos-nemotron-34b", - "name": "Cosmos Nemotron 34B", - "family": "nemotron", + "qwen3-max": { + "id": "qwen3-max", + "name": "Qwen3-Max", + "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": false, + "reasoning": false, + "tool_call": true, "temperature": true, - "knowledge": "2024-01", - "release_date": "2024-01-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/nemotron-3-super-120b-a12b": { - "id": "nvidia/nemotron-3-super-120b-a12b", - "name": "Nemotron 3 Super", - "family": "nemotron", + "qwen3-235b-a22b-instruct": { + "id": "qwen3-235b-a22b-instruct", + "name": "Qwen3-235B-A22B-Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/nvidia-nemotron-nano-9b-v2": { - "id": "nvidia/nvidia-nemotron-nano-9b-v2", - "name": "nvidia-nemotron-nano-9b-v2", - "family": "nemotron", + "qwen3-235b-a22b-thinking-2507": { + "id": "qwen3-235b-a22b-thinking-2507", + "name": "Qwen3-235B-A22B-Thinking", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2025-08-18", - "last_updated": "2025-08-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/llama-3.1-nemotron-51b-instruct": { - "id": "nvidia/llama-3.1-nemotron-51b-instruct", - "name": "Llama 3.1 Nemotron 51b Instruct", + "kimi-k2-0905": { + "id": "kimi-k2-0905", + "name": "Kimi-K2-0905", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-09-22", - "last_updated": "2024-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - }, - "nvidia/nemoretriever-ocr-v1": { - "id": "nvidia/nemoretriever-ocr-v1", - "name": "NeMo Retriever OCR v1", - "family": "nemoretriever", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2024-01", - "release_date": "2024-01-01", + "knowledge": "2024-12", + "release_date": "2025-09-05", "last_updated": "2025-09-05", - "modalities": { "input": ["image"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 0, "output": 4096 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/llama-embed-nemotron-8b": { - "id": "nvidia/llama-embed-nemotron-8b", - "name": "Llama Embed Nemotron 8B", - "family": "llama", + "glm-4.6": { + "id": "glm-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-03", - "release_date": "2025-03-18", - "last_updated": "2025-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 2048 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/llama-3.3-nemotron-super-49b-v1": { - "id": "nvidia/llama-3.3-nemotron-super-49b-v1", - "name": "Llama 3.3 Nemotron Super 49b V1", - "attachment": false, + "qwen3-vl-plus": { + "id": "qwen3-vl-plus", + "name": "Qwen3-VL-Plus", + "family": "qwen", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-16", - "last_updated": "2025-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/parakeet-tdt-0.6b-v2": { - "id": "nvidia/parakeet-tdt-0.6b-v2", - "name": "Parakeet TDT 0.6B v2", - "family": "parakeet", + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek-V3.2-Exp", + "family": "deepseek", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2024-01", - "release_date": "2024-01-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 0, "output": 4096 } + "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": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/nemotron-3-nano-30b-a3b": { - "id": "nvidia/nemotron-3-nano-30b-a3b", - "name": "nemotron-3-nano-30b-a3b", - "family": "nemotron", + "qwen3-235b": { + "id": "qwen3-235b", + "name": "Qwen3-235B-A22B", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-12", - "last_updated": "2024-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 128000, + "output": 32000 + }, + "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-v1", - "family": "llama", + "kimi-k2": { + "id": "kimi-k2", + "name": "Kimi-K2", + "family": "kimi", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "z-ai/glm5": { - "id": "z-ai/glm5", - "name": "GLM5", - "family": "glm", + "qwen3-max-preview": { + "id": "qwen3-max-preview", + "name": "Qwen3-Max-Preview", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 202752, "output": 131000 } + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "z-ai/glm4.7": { - "id": "z-ai/glm4.7", - "name": "GLM-4.7", - "family": "glm", + "deepseek-v3": { + "id": "deepseek-v3", + "name": "DeepSeek-V3", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "knowledge": "2024-10", + "release_date": "2024-12-26", + "last_updated": "2024-12-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } - }, - "stepfun-ai/step-3.5-flash": { - "id": "stepfun-ai/step-3.5-flash", - "name": "Step 3.5 Flash", - "attachment": false, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } + } + } + }, + "v0": { + "id": "v0", + "env": ["V0_API_KEY"], + "npm": "@ai-sdk/vercel", + "name": "v0", + "doc": "https://sdk.vercel.ai/providers/ai-sdk-providers/vercel", + "models": { + "v0-1.5-lg": { + "id": "v0-1.5-lg", + "name": "v0-1.5-lg", + "family": "v0", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-02", - "last_updated": "2026-02-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 16384 } + "release_date": "2025-06-09", + "last_updated": "2025-06-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 512000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75 + } }, - "google/gemma-3-1b-it": { - "id": "google/gemma-3-1b-it", - "name": "Gemma 3 1b It", + "v0-1.0-md": { + "id": "v0-1.0-md", + "name": "v0-1.0-md", + "family": "v0", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "google/gemma-3n-e2b-it": { - "id": "google/gemma-3n-e2b-it", - "name": "Gemma 3n E2b It", + "v0-1.5-md": { + "id": "v0-1.5-md", + "name": "v0-1.5-md", + "family": "v0", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-06-12", - "last_updated": "2025-06-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - }, - "google/gemma-3-27b-it": { - "id": "google/gemma-3-27b-it", - "name": "Gemma-3-27B-IT", - "family": "gemma", + "release_date": "2025-06-09", + "last_updated": "2025-06-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 3, + "output": 15 + } + } + } + }, + "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": { + "Qwen/Qwen3.5-397B-A17B": { + "id": "Qwen/Qwen3.5-397B-A17B", + "name": "Qwen3.5-397B-A17B", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-04", + "release_date": "2026-02-01", + "last_updated": "2026-02-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "google/gemma-3n-e4b-it": { - "id": "google/gemma-3n-e4b-it", - "name": "Gemma 3n E4b It", - "attachment": true, + "Qwen/Qwen3-Coder-Next": { + "id": "Qwen/Qwen3-Coder-Next", + "name": "Qwen3-Coder-Next", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-06-03", - "last_updated": "2025-06-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-02-03", + "last_updated": "2026-02-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } }, - "google/codegemma-1.1-7b": { - "id": "google/codegemma-1.1-7b", - "name": "Codegemma 1.1 7b", + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "name": "Qwen3-Next-80B-A3B-Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2024-04-30", - "last_updated": "2024-04-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-11", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 0.25, + "output": 1 + } }, - "google/codegemma-7b": { - "id": "google/codegemma-7b", - "name": "Codegemma 7b", + "Qwen/Qwen3-Embedding-8B": { + "id": "Qwen/Qwen3-Embedding-8B", + "name": "Qwen 3 Embedding 8B", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2024-03-21", - "last_updated": "2024-03-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 32000, + "output": 4096 + }, + "cost": { + "input": 0.01, + "output": 0 + } }, - "google/gemma-2-2b-it": { - "id": "google/gemma-2-2b-it", - "name": "Gemma 2 2b It", + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen3-235B-A22B-Thinking-2507", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-07-16", - "last_updated": "2024-07-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 3 + } }, - "google/gemma-2-27b-it": { - "id": "google/gemma-2-27b-it", - "name": "Gemma 2 27b It", + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", + "name": "Qwen3-Next-80B-A3B-Thinking", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-06-24", - "last_updated": "2024-06-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-11", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 2 + } }, - "google/gemma-3-12b-it": { - "id": "google/gemma-3-12b-it", - "name": "Gemma 3 12b It", + "Qwen/Qwen3-Embedding-4B": { + "id": "Qwen/Qwen3-Embedding-4B", + "name": "Qwen 3 Embedding 4B", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 32000, + "output": 2048 + }, + "cost": { + "input": 0.01, + "output": 0 + } }, - "minimaxai/minimax-m2.1": { - "id": "minimaxai/minimax-m2.1", - "name": "MiniMax-M2.1", - "family": "minimax", + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "name": "Qwen3-Coder-480B-A35B-Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 2, + "output": 2 + } }, - "minimaxai/minimax-m2.5": { - "id": "minimaxai/minimax-m2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "zai-org/GLM-4.7-Flash": { + "id": "zai-org/GLM-4.7-Flash", + "name": "GLM-4.7-Flash", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/deepseek-v3.1-terminus": { - "id": "deepseek-ai/deepseek-v3.1-terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", + "zai-org/GLM-4.7": { + "id": "zai-org/GLM-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "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 + } }, - "deepseek-ai/deepseek-r1": { - "id": "deepseek-ai/deepseek-r1", - "name": "Deepseek R1", + "zai-org/GLM-5.1": { + "id": "zai-org/GLM-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-03", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "deepseek-ai/deepseek-coder-6.7b-instruct": { - "id": "deepseek-ai/deepseek-coder-6.7b-instruct", - "name": "Deepseek Coder 6.7b Instruct", + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2023-10-29", - "last_updated": "2023-10-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "deepseek-ai/deepseek-v3.1": { - "id": "deepseek-ai/deepseek-v3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "XiaomiMiMo/MiMo-V2-Flash": { + "id": "XiaomiMiMo/MiMo-V2-Flash", + "name": "MiMo-V2-Flash", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-08-20", - "last_updated": "2025-08-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2024-12", + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 4096 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "deepseek-ai/deepseek-r1-0528": { - "id": "deepseek-ai/deepseek-r1-0528", - "name": "Deepseek R1 0528", + "deepseek-ai/DeepSeek-R1-0528": { + "id": "deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek-R1-0528", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, + "knowledge": "2025-05", "release_date": "2025-05-28", "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 3, + "output": 5 + } }, - "deepseek-ai/deepseek-v3.2": { - "id": "deepseek-ai/deepseek-v3.2", - "name": "DeepSeek V3.2", + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek-V3.2", "family": "deepseek", "attachment": false, "reasoning": true, @@ -13260,22361 +34498,34924 @@ "knowledge": "2024-07", "release_date": "2025-12-01", "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 163840, "output": 65536 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.28, + "output": 0.4 + } }, - "qwen/qwq-32b": { - "id": "qwen/qwq-32b", - "name": "Qwq 32b", + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "Kimi-K2-Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-03-05", - "last_updated": "2025-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "qwen/qwen2.5-coder-7b-instruct": { - "id": "qwen/qwen2.5-coder-7b-instruct", - "name": "Qwen2.5 Coder 7b Instruct", - "attachment": false, - "reasoning": false, + "moonshotai/Kimi-K2.6": { + "id": "moonshotai/Kimi-K2.6", + "name": "Kimi-K2.6", + "family": "kimi", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-09-17", - "last_updated": "2024-09-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "qwen/qwen2.5-coder-32b-instruct": { - "id": "qwen/qwen2.5-coder-32b-instruct", - "name": "Qwen2.5 Coder 32b Instruct", + "moonshotai/Kimi-K2-Instruct": { + "id": "moonshotai/Kimi-K2-Instruct", + "name": "Kimi-K2-Instruct", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-11-06", - "last_updated": "2024-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-07-14", + "last_updated": "2025-07-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 3 + } }, - "qwen/qwen3-coder-480b-a35b-instruct": { - "id": "qwen/qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi-K2-Instruct-0905", + "family": "kimi", "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 66536 } + "knowledge": "2024-10", + "release_date": "2025-09-04", + "last_updated": "2025-09-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 3 + } }, - "qwen/qwen3-next-80b-a3b-thinking": { - "id": "qwen/qwen3-next-80b-a3b-thinking", - "name": "Qwen3-Next-80B-A3B-Thinking", - "family": "qwen", + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi-K2.5", + "family": "kimi", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-01-01", + "last_updated": "2026-01-01", + "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 + } + }, + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 16384 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "qwen/qwen3-next-80b-a3b-instruct": { - "id": "qwen/qwen3-next-80b-a3b-instruct", - "name": "Qwen3-Next-80B-A3B-Instruct", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.7": { + "id": "MiniMaxAI/MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 16384 } + "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 + } }, - "qwen/qwen3-235b-a22b": { - "id": "qwen/qwen3-235b-a22b", - "name": "Qwen3-235B-A22B", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.1": { + "id": "MiniMaxAI/MiniMax-M2.1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "qwen/qwen3.5-397b-a17b": { - "id": "qwen/qwen3.5-397b-a17b", - "name": "Qwen3.5-397B-A17B", - "family": "qwen", - "attachment": true, + "deepseek-ai/DeepSeek-V4-Pro": { + "id": "deepseek-ai/DeepSeek-V4-Pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-02-16", - "last_updated": "2026-02-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 8192 } - }, - "black-forest-labs/flux.1-dev": { - "id": "black-forest-labs/flux.1-dev", - "name": "FLUX.1-dev", - "family": "flux", + "limit": { + "context": 1048576, + "output": 393216 + }, + "cost": { + "input": 1.74, + "output": 3.48, + "cache_read": 0.145 + } + } + } + }, + "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": { + "deepseek/deepseek-chat": { + "id": "deepseek/deepseek-chat", + "name": "DeepSeek-V3.2 (Non-thinking Mode)", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["image"] }, + "knowledge": "2025-01-01", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4096, "output": 0 } + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.28, + "output": 0.42, + "cache_read": 0.03 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "deepseek/deepseek-v3.2-exp": { + "id": "deepseek/deepseek-v3.2-exp", + "name": "DeepSeek-V3.2-Exp", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-11", - "last_updated": "2025-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 262144 } + "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 + }, + "cost": { + "input": 0.22, + "output": 0.33 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": true, + "deepseek/deepseek-v3.2": { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek V3.2", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-07", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01-01", + "release_date": "2025-12-05", + "last_updated": "2025-12-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.28, + "output": 0.43 + } }, - "moonshotai/kimi-k2-instruct-0905": { - "id": "moonshotai/kimi-k2-instruct-0905", - "name": "Kimi K2 0905", - "family": "kimi", + "inclusionai/ring-1t": { + "id": "inclusionai/ring-1t", + "name": "Ring-1T", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01-01", + "release_date": "2025-10-12", + "last_updated": "2025-10-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.56, + "output": 2.24, + "cache_read": 0.11 + } + }, + "inclusionai/ling-1t": { + "id": "inclusionai/ling-1t", + "name": "Ling-1T", "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01-01", + "release_date": "2025-10-09", + "last_updated": "2025-10-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.56, + "output": 2.24, + "cache_read": 0.11 + } }, - "moonshotai/kimi-k2-instruct": { - "id": "moonshotai/kimi-k2-instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", + "stepfun/step-3.5-flash-free": { + "id": "stepfun/step-3.5-flash-free", + "name": "Step 3.5 Flash (Free)", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-01", - "release_date": "2025-01-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2026-02-02", + "last_updated": "2026-02-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "meta/codellama-70b": { - "id": "meta/codellama-70b", - "name": "Codellama 70b", + "stepfun/step-3.5-flash": { + "id": "stepfun/step-3.5-flash", + "name": "Step 3.5 Flash", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2024-01-29", - "last_updated": "2024-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2026-02-02", + "last_updated": "2026-02-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "meta/llama-3.3-70b-instruct": { - "id": "meta/llama-3.3-70b-instruct", - "name": "Llama 3.3 70b Instruct", - "attachment": false, - "reasoning": false, + "stepfun/step-3": { + "id": "stepfun/step-3", + "name": "Step-3", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-11-26", - "last_updated": "2024-11-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-07-31", + "last_updated": "2025-07-31", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "output": 64000 + }, + "cost": { + "input": 0.21, + "output": 0.57 + } }, - "meta/llama-3.2-1b-instruct": { - "id": "meta/llama-3.2-1b-instruct", - "name": "Llama 3.2 1b Instruct", + "kuaishou/kat-coder-pro-v2": { + "id": "kuaishou/kat-coder-pro-v2", + "name": "KAT-Coder-Pro-V2", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-18", - "last_updated": "2024-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2026-03-30", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 80000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "meta/llama-3.1-405b-instruct": { - "id": "meta/llama-3.1-405b-instruct", - "name": "Llama 3.1 405b Instruct", - "attachment": false, - "reasoning": false, + "x-ai/grok-4-fast": { + "id": "x-ai/grok-4-fast", + "name": "Grok 4 Fast", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-07-16", - "last_updated": "2024-07-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 64000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "meta/llama3-8b-instruct": { - "id": "meta/llama3-8b-instruct", - "name": "Llama3 8b Instruct", + "x-ai/grok-code-fast-1": { + "id": "x-ai/grok-code-fast-1", + "name": "Grok Code Fast 1", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-04-17", - "last_updated": "2024-04-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "meta/llama-4-scout-17b-16e-instruct": { - "id": "meta/llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17b 16e Instruct", + "x-ai/grok-4.1-fast-non-reasoning": { + "id": "x-ai/grok-4.1-fast-non-reasoning", + "name": "Grok 4.1 Fast Non Reasoning", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-02", - "release_date": "2025-04-02", - "last_updated": "2025-04-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 64000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "meta/llama-3.2-11b-vision-instruct": { - "id": "meta/llama-3.2-11b-vision-instruct", - "name": "Llama 3.2 11b Vision Instruct", + "x-ai/grok-4": { + "id": "x-ai/grok-4", + "name": "Grok 4", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-18", - "last_updated": "2024-09-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "meta/llama3-70b-instruct": { - "id": "meta/llama3-70b-instruct", - "name": "Llama3 70b Instruct", - "attachment": false, - "reasoning": false, + "x-ai/grok-4.1-fast": { + "id": "x-ai/grok-4.1-fast", + "name": "Grok 4.1 Fast", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-04-17", - "last_updated": "2024-04-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 64000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "meta/llama-4-maverick-17b-128e-instruct": { - "id": "meta/llama-4-maverick-17b-128e-instruct", - "name": "Llama 4 Maverick 17b 128e Instruct", + "x-ai/grok-4.2-fast": { + "id": "x-ai/grok-4.2-fast", + "name": "Grok 4.2 Fast", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 3, + "output": 9 + } + }, + "x-ai/grok-4.2-fast-non-reasoning": { + "id": "x-ai/grok-4.2-fast-non-reasoning", + "name": "Grok 4.2 Fast Non Reasoning", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-02", - "release_date": "2025-04-01", - "last_updated": "2025-04-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 3, + "output": 9 + } }, - "meta/llama-3.1-70b-instruct": { - "id": "meta/llama-3.1-70b-instruct", - "name": "Llama 3.1 70b Instruct", - "attachment": false, + "openai/gpt-5.3-chat": { + "id": "openai/gpt-5.3-chat", + "name": "GPT-5.3 Chat", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-07-16", - "last_updated": "2024-07-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16380 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.75, + "output": 14 + } }, - "mistralai/devstral-2-123b-instruct-2512": { - "id": "mistralai/devstral-2-123b-instruct-2512", - "name": "Devstral-2-123B-Instruct-2512", - "family": "devstral", + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "GPT-5.2-Pro", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-12", - "release_date": "2025-12-08", - "last_updated": "2025-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "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 + } }, - "mistralai/mistral-large-3-675b-instruct-2512": { - "id": "mistralai/mistral-large-3-675b-instruct-2512", - "name": "Mistral Large 3 675B Instruct 2512", - "family": "mistral-large", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "GPT-5.3 Codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "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 + } }, - "mistralai/mistral-large-2-instruct": { - "id": "mistralai/mistral-large-2-instruct", - "name": "Mistral Large 2 Instruct", - "attachment": false, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2025-01-01", + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["image", "text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.17 + } + }, + "openai/gpt-5.4-mini": { + "id": "openai/gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-07-24", - "last_updated": "2024-07-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "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 + } }, - "mistralai/ministral-14b-instruct-2512": { - "id": "mistralai/ministral-14b-instruct-2512", - "name": "Ministral 3 14B Instruct 2512", - "family": "ministral", + "openai/gpt-5.1-chat": { + "id": "openai/gpt-5.1-chat", + "name": "GPT-5.1 Chat", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2025-12-01", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01-01", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["pdf", "image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12 + } }, - "mistralai/mamba-codestral-7b-v0.1": { - "id": "mistralai/mamba-codestral-7b-v0.1", - "name": "Mamba Codestral 7b V0.1", + "openai/gpt-5.4-nano": { + "id": "openai/gpt-5.4-nano", + "name": "GPT-5.4 Nano", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2024-07-16", - "last_updated": "2024-07-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "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 + } }, - "mistralai/codestral-22b-instruct-v0.1": { - "id": "mistralai/codestral-22b-instruct-v0.1", - "name": "Codestral 22b Instruct V0.1", - "attachment": false, - "reasoning": false, + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT-5.2-Codex", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2025-01-01", + "release_date": "2026-01-15", + "last_updated": "2026-01-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.17 + } + }, + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT-5.1-Codex-Mini", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-05-29", - "last_updated": "2024-05-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.03 + } }, - "mistralai/mistral-small-3.1-24b-instruct-2503": { - "id": "mistralai/mistral-small-3.1-24b-instruct-2503", - "name": "Mistral Small 3.1 24b Instruct 2503", - "attachment": false, - "reasoning": false, + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT-5.1", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-03-11", - "last_updated": "2025-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "gpt-oss-120b", - "attachment": false, + "knowledge": "2025-01-01", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["image", "text", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12 + } + }, + "openai/gpt-5.4-pro": { + "id": "openai/gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2026-01-10", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6, "reasoning": 0.6, "cache_read": 0.015, "cache_write": 0.18 }, - "limit": { "context": 128000, "input": 124000, "output": 8192 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 45, + "output": 225 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "gpt-oss-20b", - "attachment": false, - "reasoning": false, + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "GPT-5 Codex", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2026-01-10", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.2, "cache_read": 0.005, "cache_write": 0.06 }, - "limit": { "context": 128000, "input": 124000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12 + } }, - "NousResearch/Hermes-4-405B": { - "id": "NousResearch/Hermes-4-405B", - "name": "Hermes-4-405B", - "attachment": false, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT-5.4", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2026-01-30", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3, "reasoning": 3, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-08-31", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 3.75, + "output": 18.75 + } }, - "NousResearch/Hermes-4-70B": { - "id": "NousResearch/Hermes-4-70B", - "name": "Hermes-4-70B", - "attachment": false, + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT-5", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2026-01-30", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.4, "reasoning": 0.4, "cache_read": 0.013, "cache_write": 0.16 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12 + } }, - "zai-org/GLM-4.5-Air": { - "id": "zai-org/GLM-4.5-Air", - "name": "GLM-4.5-Air", - "attachment": false, - "reasoning": false, + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.2, "cache_read": 0.02, "cache_write": 0.25 }, - "limit": { "context": 128000, "input": 124000, "output": 4096 } + "limit": { + "context": 400000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/openai", + "api": "https://zenmux.ai/api/v1" + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12 + } }, - "zai-org/GLM-4.5": { - "id": "zai-org/GLM-4.5", - "name": "GLM-4.5", + "z-ai/glm-4.7-flash-free": { + "id": "z-ai/glm-4.7-flash-free", + "name": "GLM 4.7 Flash (Free)", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.06, "cache_write": 0.75 }, - "limit": { "context": 128000, "input": 124000, "output": 4096 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM-5", - "attachment": false, + "z-ai/glm-5v-turbo": { + "id": "z-ai/glm-5v-turbo", + "name": "GLM 5V Turbo", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-03-01", - "last_updated": "2026-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.1, "cache_write": 1 }, - "limit": { "context": 200000, "input": 200000, "output": 16384 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.726, + "output": 3.1946, + "cache_read": 0.1743 + } }, - "zai-org/GLM-4.7-FP8": { - "id": "zai-org/GLM-4.7-FP8", - "name": "GLM-4.7 (FP8)", + "z-ai/glm-4.7": { + "id": "z-ai/glm-4.7", + "name": "GLM 4.7", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2, "cache_read": 0.04, "cache_write": 0.5 }, - "limit": { "context": 128000, "input": 124000, "output": 4096 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.28, + "output": 1.14, + "cache_read": 0.06 + } }, - "nvidia/Nemotron-Nano-V2-12b": { - "id": "nvidia/Nemotron-Nano-V2-12b", - "name": "Nemotron-Nano-V2-12b", + "z-ai/glm-5": { + "id": "z-ai/glm-5", + "name": "GLM 5", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.2, "cache_read": 0.007, "cache_write": 0.08 }, - "limit": { "context": 32000, "input": 30000, "output": 4096 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.58, + "output": 2.6, + "cache_read": 0.14 + } }, - "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B": { - "id": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B", - "name": "Nemotron-3-Nano-30B-A3B", + "z-ai/glm-4.7-flashx": { + "id": "z-ai/glm-4.7-flashx", + "name": "GLM 4.7 FlashX", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-08-10", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.24, "cache_read": 0.006, "cache_write": 0.075 }, - "limit": { "context": 32000, "input": 30000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.07, + "output": 0.42, + "cache_read": 0.01 + } }, - "nvidia/nemotron-3-super-120b-a12b": { - "id": "nvidia/nemotron-3-super-120b-a12b", - "name": "Nemotron-3-Super-120B-A12B", - "attachment": false, + "z-ai/glm-4.6v-flash-free": { + "id": "z-ai/glm-4.6v-flash-free", + "name": "GLM 4.6V Flash (Free)", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2026-02", - "release_date": "2026-03-11", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "knowledge": "2025-01-01", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "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-v1", + "z-ai/glm-5.1": { + "id": "z-ai/glm-5.1", + "name": "GLM-5.1", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 1.8, "cache_read": 0.06, "cache_write": 0.75 }, - "limit": { "context": 128000, "input": 120000, "output": 4096 } - }, - "google/gemma-3-27b-it": { - "id": "google/gemma-3-27b-it", - "name": "Gemma-3-27b-it", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2026-01-20", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01, "cache_write": 0.125 }, - "limit": { "context": 110000, "input": 100000, "output": 8192 } + "release_date": "2026-04-03", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.8781, + "output": 3.5126, + "cache_read": 0.1903 + } }, - "google/gemma-3-27b-it-fast": { - "id": "google/gemma-3-27b-it-fast", - "name": "Gemma-3-27b-it (Fast)", + "z-ai/glm-4.6v-flash": { + "id": "z-ai/glm-4.6v-flash", + "name": "GLM 4.6V FlashX", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-10", - "release_date": "2026-01-20", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6, "cache_read": 0.02, "cache_write": 0.25 }, - "limit": { "context": 110000, "input": 100000, "output": 8192 } - }, - "google/gemma-2-2b-it": { - "id": "google/gemma-2-2b-it", - "name": "Gemma-2-2b-it", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-07-31", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.06, "cache_read": 0.002, "cache_write": 0.025 }, - "limit": { "context": 8192, "input": 8000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.02, + "output": 0.21, + "cache_read": 0.0043 + } }, - "google/gemma-2-9b-it-fast": { - "id": "google/gemma-2-9b-it-fast", - "name": "Gemma-2-9b-it (Fast)", + "z-ai/glm-4.5": { + "id": "z-ai/glm-4.5", + "name": "GLM 4.5", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-06-27", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.09, "cache_read": 0.003, "cache_write": 0.0375 }, - "limit": { "context": 8192, "input": 8000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.35, + "output": 1.54, + "cache_read": 0.07 + } }, - "PrimeIntellect/INTELLECT-3": { - "id": "PrimeIntellect/INTELLECT-3", - "name": "INTELLECT-3", + "z-ai/glm-4.5-air": { + "id": "z-ai/glm-4.5-air", + "name": "GLM 4.5 Air", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2026-01-25", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1.1, "cache_read": 0.02, "cache_write": 0.25 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } - }, - "meta-llama/Llama-Guard-3-8B": { - "id": "meta-llama/Llama-Guard-3-8B", - "name": "Llama-Guard-3-8B", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": false, - "knowledge": "2024-04", - "release_date": "2024-04-18", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.06, "cache_read": 0.002, "cache_write": 0.025 }, - "limit": { "context": 8192, "input": 8000, "output": 1024 } + "knowledge": "2025-01-01", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.11, + "output": 0.56, + "cache_read": 0.02 + } }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama-3.3-70B-Instruct", - "attachment": false, - "reasoning": false, + "z-ai/glm-5-turbo": { + "id": "z-ai/glm-5-turbo", + "name": "GLM 5 Turbo", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-12-05", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.4, "cache_read": 0.013, "cache_write": 0.16 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.88, + "output": 3.48 + } }, - "meta-llama/Meta-Llama-3.1-8B-Instruct": { - "id": "meta-llama/Meta-Llama-3.1-8B-Instruct", - "name": "Meta-Llama-3.1-8B-Instruct", + "z-ai/glm-4.6": { + "id": "z-ai/glm-4.6", + "name": "GLM 4.6", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-07-23", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.06, "cache_read": 0.002, "cache_write": 0.025 }, - "limit": { "context": 128000, "input": 120000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.35, + "output": 1.54, + "cache_read": 0.07 + } }, - "meta-llama/Meta-Llama-3.1-8B-Instruct-fast": { - "id": "meta-llama/Meta-Llama-3.1-8B-Instruct-fast", - "name": "Meta-Llama-3.1-8B-Instruct (Fast)", - "attachment": false, - "reasoning": false, + "z-ai/glm-4.6v": { + "id": "z-ai/glm-4.6v", + "name": "GLM 4.6V", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-07-23", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.09, "cache_read": 0.003, "cache_write": 0.03 }, - "limit": { "context": 128000, "input": 120000, "output": 4096 } + "knowledge": "2025-01-01", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.14, + "output": 0.42, + "cache_read": 0.03 + } }, - "meta-llama/Llama-3.3-70B-Instruct-fast": { - "id": "meta-llama/Llama-3.3-70B-Instruct-fast", - "name": "Llama-3.3-70B-Instruct (Fast)", - "attachment": false, + "volcengine/doubao-seed-2.0-code": { + "id": "volcengine/doubao-seed-2.0-code", + "name": "Doubao Seed 2.0 Code", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-12-05", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025, "cache_write": 0.31 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.9, + "output": 4.48 + } }, - "MiniMaxAI/MiniMax-M2.1": { - "id": "MiniMaxAI/MiniMax-M2.1", - "name": "MiniMax-M2.1", - "attachment": false, + "volcengine/doubao-seed-code": { + "id": "volcengine/doubao-seed-code", + "name": "Doubao-Seed-Code", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": true, - "knowledge": "2025-10", - "release_date": "2026-02-01", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "reasoning": 1.2, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } - }, - "deepseek-ai/DeepSeek-V3-0324": { - "id": "deepseek-ai/DeepSeek-V3-0324", - "name": "DeepSeek-V3-0324", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-03-24", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 1.5, "cache_read": 0.05, "cache_write": 0.1875 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "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 + }, + "cost": { + "input": 0.17, + "output": 1.12, + "cache_read": 0.03 + } }, - "deepseek-ai/DeepSeek-R1-0528-fast": { - "id": "deepseek-ai/DeepSeek-R1-0528-fast", - "name": "DeepSeek R1 0528 Fast", - "family": "deepseek", - "attachment": false, + "volcengine/doubao-seed-2.0-mini": { + "id": "volcengine/doubao-seed-2.0-mini", + "name": "Doubao-Seed-2.0-mini", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 131072, "output": 8192 } + "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 + }, + "cost": { + "input": 0.03, + "output": 0.28, + "cache_read": 0.01, + "cache_write": 0.0024 + } }, - "deepseek-ai/DeepSeek-V3-0324-fast": { - "id": "deepseek-ai/DeepSeek-V3-0324-fast", - "name": "DeepSeek-V3-0324 (Fast)", - "attachment": false, - "reasoning": false, + "volcengine/doubao-seed-2.0-lite": { + "id": "volcengine/doubao-seed-2.0-lite", + "name": "Doubao-Seed-2.0-lite", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-03-24", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.75, "output": 2.25, "cache_read": 0.075, "cache_write": 0.28125 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "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 + }, + "cost": { + "input": 0.09, + "output": 0.51, + "cache_read": 0.02, + "cache_write": 0.0024 + } }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek-R1-0528", - "attachment": false, + "volcengine/doubao-seed-1.8": { + "id": "volcengine/doubao-seed-1.8", + "name": "Doubao-Seed-1.8", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2026-01-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.8, "output": 2.4, "reasoning": 2.4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 128000, "input": 120000, "output": 32768 } + "knowledge": "2025-01-01", + "release_date": "2025-12-18", + "last_updated": "2025-12-18", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0.11, + "output": 0.28, + "cache_read": 0.02, + "cache_write": 0.0024 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek-V3.2", - "attachment": false, + "volcengine/doubao-seed-2.0-pro": { + "id": "volcengine/doubao-seed-2.0-pro", + "name": "Doubao-Seed-2.0-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2026-01-20", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.45, "reasoning": 0.45, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 163000, "input": 160000, "output": 16384 } - }, - "intfloat/e5-mistral-7b-instruct": { - "id": "intfloat/e5-mistral-7b-instruct", - "name": "e5-mistral-7b-instruct", - "family": "text-embedding", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": false, - "knowledge": "2023-12", - "release_date": "2024-01-01", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32768, "input": 32768, "output": 0 } - }, - "black-forest-labs/flux-dev": { - "id": "black-forest-labs/flux-dev", - "name": "FLUX.1-dev", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": false, - "knowledge": "2024-07", - "release_date": "2024-08-01", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 77, "input": 77, "output": 0 } - }, - "black-forest-labs/flux-schnell": { - "id": "black-forest-labs/flux-schnell", - "name": "FLUX.1-schnell", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": false, - "knowledge": "2024-07", - "release_date": "2024-08-01", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 77, "input": 77, "output": 0 } + "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 + }, + "cost": { + "input": 0.45, + "output": 2.24, + "cache_read": 0.09, + "cache_write": 0.0024 + } }, - "Qwen/Qwen3-Next-80B-A3B-Thinking": { - "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", - "name": "Qwen3-Next-80B-A3B-Thinking", - "attachment": false, + "baidu/ernie-5.0-thinking-preview": { + "id": "baidu/ernie-5.0-thinking-preview", + "name": "ERNIE 5.0", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-28", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 1.2, "reasoning": 1.2, "cache_read": 0.015, "cache_write": 0.18 }, - "limit": { "context": 128000, "input": 120000, "output": 16384 } + "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 + } }, - "Qwen/Qwen3-30B-A3B-Thinking-2507": { - "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", - "name": "Qwen3-30B-A3B-Thinking-2507", - "attachment": false, + "minimax/minimax-m2.7": { + "id": "minimax/minimax-m2.7", + "name": "MiniMax M2.7", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-28", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "reasoning": 0.3, "cache_read": 0.01, "cache_write": 0.125 }, - "limit": { "context": 128000, "input": 120000, "output": 16384 } + "knowledge": "2025-01-01", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131070 + }, + "provider": { + "npm": "@ai-sdk/anthropic", + "api": "https://zenmux.ai/api/anthropic/v1" + }, + "cost": { + "input": 0.3055, + "output": 1.2219 + } }, - "Qwen/Qwen3-32B": { - "id": "Qwen/Qwen3-32B", - "name": "Qwen3-32B", - "attachment": false, - "reasoning": false, + "minimax/minimax-m2.7-highspeed": { + "id": "minimax/minimax-m2.7-highspeed", + "name": "MiniMax M2.7 highspeed", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-28", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01, "cache_write": 0.125 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131070 + }, + "provider": { + "npm": "@ai-sdk/anthropic", + "api": "https://zenmux.ai/api/anthropic/v1" + }, + "cost": { + "input": 0.611, + "output": 2.4439 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", + "minimax/minimax-m2": { + "id": "minimax/minimax-m2", + "name": "MiniMax M2", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-25", - "last_updated": "2025-10-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262144, "output": 8192 } + "limit": { + "context": 204000, + "output": 64000 + }, + "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.38 + } }, - "Qwen/Qwen2.5-Coder-7B-fast": { - "id": "Qwen/Qwen2.5-Coder-7B-fast", - "name": "Qwen2.5-Coder-7B (Fast)", + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "MiniMax M2.1", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-09-19", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.09, "cache_read": 0.003, "cache_write": 0.03 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } - }, - "Qwen/Qwen2.5-VL-72B-Instruct": { - "id": "Qwen/Qwen2.5-VL-72B-Instruct", - "name": "Qwen2.5-VL-72B-Instruct", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-20", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025, "cache_write": 0.31 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204000, + "output": 64000 + }, + "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.38 + } }, - "Qwen/Qwen3-32B-fast": { - "id": "Qwen/Qwen3-32B-fast", - "name": "Qwen3-32B (Fast)", + "minimax/minimax-m2.5-lightning": { + "id": "minimax/minimax-m2.5-lightning", + "name": "MiniMax M2.5 highspeed", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-28", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6, "cache_read": 0.02, "cache_write": 0.25 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-02-13", + "last_updated": "2026-02-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131072 + }, + "provider": { + "npm": "@ai-sdk/anthropic", + "api": "https://zenmux.ai/api/anthropic/v1" + }, + "cost": { + "input": 0.6, + "output": 4.8, + "cache_read": 0.06, + "cache_write": 0.75 + } }, - "Qwen/Qwen3-Coder-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", - "name": "Qwen3-Coder-30B-A3B-Instruct", + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "MiniMax M2.5", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-28", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01, "cache_write": 0.125 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-02-13", + "last_updated": "2026-02-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "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 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "qwen/qwen3-coder-plus": { + "id": "qwen/qwen3-coder-plus", + "name": "Qwen3-Coder-Plus", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", + "knowledge": "2025-01-01", "release_date": "2025-07-23", - "last_updated": "2025-10-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.8 }, - "limit": { "context": 262144, "output": 66536 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "Qwen/Qwen3-30B-A3B-Instruct-2507": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen3-30B-A3B-Instruct-2507", - "attachment": false, + "qwen/qwen3.5-flash": { + "id": "qwen/qwen3.5-flash", + "name": "Qwen3.5 Flash", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-28", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01, "cache_write": 0.125 }, - "limit": { "context": 128000, "input": 120000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1020000, + "output": 1020000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", + "qwen/qwen3.6-plus": { + "id": "qwen/qwen3.6-plus", + "name": "Qwen3.6-Plus", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-25", - "last_updated": "2025-10-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-30", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262144, "output": 8192 } - }, - "Qwen/Qwen3-Embedding-8B": { - "id": "Qwen/Qwen3-Embedding-8B", - "name": "Qwen3-Embedding-8B", - "family": "text-embedding", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": false, - "knowledge": "2025-10", - "release_date": "2026-01-10", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32768, "input": 32768, "output": 0 } - }, - "BAAI/bge-en-icl": { - "id": "BAAI/bge-en-icl", - "name": "BGE-ICL", - "family": "text-embedding", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": false, - "knowledge": "2024-06", - "release_date": "2024-07-30", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32768, "input": 32768, "output": 0 } + "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 + } + } }, - "BAAI/bge-multilingual-gemma2": { - "id": "BAAI/bge-multilingual-gemma2", - "name": "bge-multilingual-gemma2", - "family": "text-embedding", + "qwen/qwen3-max": { + "id": "qwen/qwen3-max", + "name": "Qwen3-Max-Thinking", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": false, - "knowledge": "2024-06", - "release_date": "2024-07-30", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 8192, "input": 8192, "output": 0 } - }, - "moonshotai/Kimi-K2-Instruct": { - "id": "moonshotai/Kimi-K2-Instruct", - "name": "Kimi-K2-Instruct", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2026-01-05", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2026-01-23", + "last_updated": "2026-01-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2.4, "cache_read": 0.05, "cache_write": 0.625 }, - "limit": { "context": 200000, "input": 190000, "output": 8192 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 1.2, + "output": 6 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi-K2.5", - "family": "kimi", + "qwen/qwen3.5-plus": { + "id": "qwen/qwen3.5-plus", + "name": "Qwen3.5 Plus", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2.5, "reasoning": 2.5, "cache_read": 0.05, "cache_write": 0.625 }, - "limit": { "context": 256000, "input": 256000, "output": 8192 } + "knowledge": "2025-01-01", + "release_date": "2026-03-20", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0.8, + "output": 4.8 + } }, - "moonshotai/Kimi-K2.5-fast": { - "id": "moonshotai/Kimi-K2.5-fast", - "name": "Kimi-K2.5-fast", - "family": "kimi", + "google/gemini-3.1-flash-lite-preview": { + "id": "google/gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-15", - "last_updated": "2026-02-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2.5, "cache_read": 0.05, "cache_write": 0.625 }, - "limit": { "context": 256000, "input": 256000, "output": 8192 } + "release_date": "2025-03-20", + "last_updated": "2025-03-20", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "output": 65530 + }, + "cost": { + "input": 0.25, + "output": 1.5 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "Kimi-K2-Thinking", + "google/gemini-3.1-pro-preview": { + "id": "google/gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": true, - "knowledge": "2025-10", - "release_date": "2026-01-05", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "reasoning": 2.5, "cache_read": 0.06, "cache_write": 0.75 }, - "limit": { "context": 128000, "input": 120000, "output": 16384 } - } - } - }, - "togetherai": { - "id": "togetherai", - "env": ["TOGETHER_API_KEY"], - "npm": "@ai-sdk/togetherai", - "name": "Together AI", - "doc": "https://docs.together.ai/docs/serverless-models", - "models": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, - "reasoning": true, - "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2026-02-19", + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "pdf", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "cache_write": 4.5 + } }, - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "google/gemini-3-flash-preview": { + "id": "google/gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.45, "output": 2 }, - "limit": { "context": 200000, "output": 200000 } + "knowledge": "2025-01-01", + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text", "image", "pdf", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048000, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "cache_write": 1 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-11", - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 202752, "output": 131072 } - }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "GLM 4.6", - "family": "glm", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 200000, "output": 200000 } - }, - "meta-llama/Llama-3.3-70B-Instruct-Turbo": { - "id": "meta-llama/Llama-3.3-70B-Instruct-Turbo", - "name": "Llama 3.3 70B", - "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, - "cost": { "input": 0.88, "output": 0.88 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2025-01-01", + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["pdf", "image", "text", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048000, + "output": 64000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31, + "cache_write": 4.5 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 204800, "output": 131072 } + "knowledge": "2025-01-01", + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["pdf", "image", "text", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048000, + "output": 64000 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.07, + "cache_write": 1 + } }, - "essentialai/Rnj-1-Instruct": { - "id": "essentialai/Rnj-1-Instruct", - "name": "Rnj-1 Instruct", - "family": "rnj", - "attachment": false, + "google/gemini-2.5-flash-lite": { + "id": "google/gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-05", - "last_updated": "2025-12-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 32768, "output": 32768 } - }, - "deepseek-ai/DeepSeek-R1": { - "id": "deepseek-ai/DeepSeek-R1", - "name": "DeepSeek R1", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-12-26", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 3, "output": 7 }, - "limit": { "context": 163839, "output": 163839 } - }, - "deepseek-ai/DeepSeek-V3-1": { - "id": "deepseek-ai/DeepSeek-V3-1", - "name": "DeepSeek V3.1", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 1.7 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2025-01-01", + "release_date": "2025-07-22", + "last_updated": "2025-07-22", + "modalities": { + "input": ["pdf", "image", "text", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048000, + "output": 64000 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.03, + "cache_write": 1 + } }, - "deepseek-ai/DeepSeek-V3": { - "id": "deepseek-ai/DeepSeek-V3", - "name": "DeepSeek V3", - "family": "deepseek", - "attachment": false, - "reasoning": true, + "sapiens-ai/agnes-1.5-lite": { + "id": "sapiens-ai/agnes-1.5-lite", + "name": "Agnes 1.5 Lite", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 1.25, "output": 1.25 }, - "limit": { "context": 131072, "output": 131072 } + "release_date": "2026-03-26", + "last_updated": "2026-03-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.12, + "output": 0.6 + } }, - "Qwen/Qwen3-Coder-Next-FP8": { - "id": "Qwen/Qwen3-Coder-Next-FP8", - "name": "Qwen3 Coder Next FP8", - "family": "qwen", + "sapiens-ai/agnes-1.5-pro": { + "id": "sapiens-ai/agnes-1.5-pro", + "name": "Agnes 1.5 Pro", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2026-02-03", - "release_date": "2026-02-03", - "last_updated": "2026-02-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 1.2 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2026-03-21", + "last_updated": "2026-03-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.16, + "output": 0.8 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507-tput": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507-tput", - "name": "Qwen3 235B A22B Instruct 2507 FP8", - "family": "qwen", - "attachment": false, + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "interleaved": { + "field": "reasoning_content" + }, + "temperature": false, + "knowledge": "2025-01-01", + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 64000 + }, + "cost": { + "input": 0.58, + "output": 3.02, + "cache_read": 0.1 + } }, - "Qwen/Qwen3.5-397B-A17B": { - "id": "Qwen/Qwen3.5-397B-A17B", - "name": "Qwen3.5 397B A17B", - "family": "qwen", + "moonshotai/kimi-k2-thinking-turbo": { + "id": "moonshotai/kimi-k2-thinking-turbo", + "name": "Kimi K2 Thinking Turbo", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-16", - "last_updated": "2026-02-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 262144, "output": 130000 } - }, - "Qwen/Qwen3-Next-80B-A3B-Instruct": { - "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "name": "Qwen3-Next-80B-A3B-Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01-01", + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 64000 + }, + "cost": { + "input": 1.15, + "output": 8, + "cache_read": 0.15 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "Kimi K2 0905", "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, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01-01", + "release_date": "2025-09-04", + "last_updated": "2025-09-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 64000 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "moonshotai/Kimi-K2-Instruct": { - "id": "moonshotai/Kimi-K2-Instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", - "attachment": false, - "reasoning": false, + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-14", - "last_updated": "2025-07-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": false, + "knowledge": "2025-01-01", + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262140, + "output": 262140 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2.8 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "firmware": { - "id": "firmware", - "env": ["FIRMWARE_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://app.frogbot.ai/api/v1", - "name": "Firmware", - "doc": "https://docs.frogbot.ai", - "models": { - "claude-opus-4-5": { - "id": "claude-opus-4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "knowledge": "2025-01-01", + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 64000 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } + }, + "anthropic/claude-opus-4.1": { + "id": "anthropic/claude-opus-4.1", + "name": "Claude Opus 4.1", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-01-01", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["image", "text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "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 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi-K2.5", - "attachment": false, + "anthropic/claude-3.7-sonnet": { + "id": "anthropic/claude-3.7-sonnet", + "name": "Claude 3.7 Sonnet", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "1970-01-01", - "last_updated": "1970-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 256000, "output": 128000 } + "limit": { + "context": 200000, + "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 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "anthropic/claude-opus-4.6": { + "id": "anthropic/claude-opus-4.6", + "name": "Claude Opus 4.6", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-06", + "last_updated": "2026-02-06", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 1000000, "output": 64000 } + "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 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", + "anthropic/claude-opus-4.7": { + "id": "anthropic/claude-opus-4.7", + "name": "Claude Opus 4.7", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "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, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "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 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok 4.1 Fast (Reasoning)", - "family": "grok", - "attachment": false, + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude Sonnet 4", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["image", "text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 128000 } + "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 + } }, - "zai-glm-5": { - "id": "zai-glm-5", - "name": "GLM-5", - "family": "glm", + "anthropic/claude-sonnet-4.5": { + "id": "anthropic/claude-sonnet-4.5", + "name": "Claude Sonnet 4.5", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-01-20", - "last_updated": "2025-02-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 198000, "output": 8192 } + "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 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", + "anthropic/claude-opus-4.5": { + "id": "anthropic/claude-opus-4.5", + "name": "Claude Opus 4.5", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-01-01", + "release_date": "2025-11-24", + "last_updated": "2025-11-24", + "modalities": { + "input": ["pdf", "image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "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 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Claude Opus 4", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-05-31", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["image", "text", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 128000 } + "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 + } }, - "deepseek-v3-2": { - "id": "deepseek-v3-2", - "name": "DeepSeek v3.2", - "family": "deepseek", + "anthropic/claude-3.5-haiku": { + "id": "anthropic/claude-3.5-haiku", + "name": "Claude 3.5 Haiku", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-12-26", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2024-11-04", + "last_updated": "2024-11-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.58, "output": 1.68, "cache_read": 0.28 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/anthropic", + "api": "https://zenmux.ai/api/anthropic/v1" + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", + "anthropic/claude-haiku-4.5": { + "id": "anthropic/claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01-01", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["image", "text"], + "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 + } + }, + "anthropic/claude-sonnet-4.6": { + "id": "anthropic/claude-sonnet-4.6", "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2026-02-17", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-18", + "last_updated": "2026-02-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "deepseek/deepseek-v4-flash": { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "1970-01-01", - "last_updated": "1970-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "minimax-m2-5": { - "id": "minimax-m2-5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-v4-pro": { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2025-01-15", - "last_updated": "2025-02-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 192000, "output": 8192 } + "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 + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "Grok 4.1 Fast (Non-Reasoning)", - "family": "grok", - "attachment": true, - "reasoning": false, + "tencent/hy3-preview": { + "id": "tencent/hy3-preview", + "name": "Hy3 preview", + "family": "Hy", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 128000 } + "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.172, + "output": 0.572, + "cache_read": 0.058, + "cache_write": 0 + } }, - "gpt-5-4": { - "id": "gpt-5-4", - "name": "GPT-5.4", + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "GPT-5.5", "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-12-01", + "release_date": "2026-04-23", + "last_updated": "2026-04-23", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 272000, "output": 128000 } + "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, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", + "openai/gpt-5.5-pro": { + "id": "openai/gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180, + "context_over_200k": { + "input": 60, + "output": 270 + }, + "tiers": [ + { + "input": 60, + "output": 270, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "gemini-3-1-pro-preview": { - "id": "gemini-3-1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", - "attachment": true, + "xiaomi/mimo-v2.5-pro": { + "id": "xiaomi/mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-02-18", - "last_updated": "2026-02-18", - "modalities": { "input": ["text", "image", "video", "audio", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 1000000, "output": 64000 } + "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, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", + "xiaomi/mimo-v2-omni": { + "id": "xiaomi/mimo-v2-omni", + "name": "MiMo V2 Omni", + "family": "mimo", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 265000, + "output": 265000 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", + "xiaomi/mimo-v2.5": { + "id": "xiaomi/mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-07-17", - "last_updated": "2025-07-17", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075 }, - "limit": { "context": 1048576, "output": 65536 } + "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.4, + "output": 2, + "cache_read": 0.08, + "context_over_200k": { + "input": 0.8, + "output": 4, + "cache_read": 0.16 + }, + "tiers": [ + { + "input": 0.8, + "output": 4, + "cache_read": 0.16, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "grok-4-1-fast-reasoning": { - "id": "grok-4-1-fast-reasoning", - "name": "Grok 4.1 Fast (Reasoning)", - "family": "grok", - "attachment": true, + "xiaomi/mimo-v2-pro": { + "id": "xiaomi/mimo-v2-pro", + "name": "MiMo V2 Pro", + "family": "mimo", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 128000 } - }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", - "attachment": true, - "reasoning": true, - "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"] }, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 256000 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "gpt-5-3-codex": { - "id": "gpt-5-3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt", - "attachment": true, + "xiaomi/mimo-v2-flash": { + "id": "xiaomi/mimo-v2-flash", + "name": "MiMo-V2-Flash", + "family": "mimo", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2026-01-31", - "release_date": "2026-02-15", - "last_updated": "2026-02-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } - }, - "gpt-oss-20b": { - "id": "gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01 + } + } + } + }, + "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-pro2": { + "id": "solar-pro2", + "name": "solar-pro2", + "family": "solar-pro", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "1970-01-01", - "last_updated": "1970-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.2 }, - "limit": { "context": 131072, "output": 32768 } + "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 + } }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "solar-mini": { + "id": "solar-mini", + "name": "solar-mini", + "family": "solar-mini", + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2024-09", + "release_date": "2024-06-12", + "last_updated": "2025-04-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 32768, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, + "solar-pro3": { + "id": "solar-pro3", + "name": "solar-pro3", + "family": "solar-pro", + "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2025-03", + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.25 + } } } }, - "google": { - "id": "google", - "env": ["GOOGLE_GENERATIVE_AI_API_KEY", "GEMINI_API_KEY"], - "npm": "@ai-sdk/google", - "name": "Google", - "doc": "https://ai.google.dev/gemini-api/docs/pricing", + "novita-ai": { + "id": "novita-ai", + "env": ["NOVITA_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.novita.ai/openai", + "name": "NovitaAI", + "doc": "https://novita.ai/docs/guides/introduction", "models": { - "gemini-2.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "family": "gemini-flash-lite", - "attachment": true, + "deepseek/deepseek-r1-turbo": { + "id": "deepseek/deepseek-r1-turbo", + "name": "DeepSeek R1 (Turbo)\t", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-03-05", + "last_updated": "2025-03-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 16000 + }, + "cost": { + "input": 0.7, + "output": 2.5 + } }, - "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-25", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": true, + "deepseek/deepseek-v3-0324": { + "id": "deepseek/deepseek-v3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", + "attachment": false, + "reasoning": false, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2024-07", + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.27, + "output": 1.12, + "cache_read": 0.135 + } }, - "gemini-2.5-flash-preview-04-17": { - "id": "gemini-2.5-flash-preview-04-17", - "name": "Gemini 2.5 Flash Preview 04-17", - "family": "gemini-flash", + "deepseek/deepseek-ocr-2": { + "id": "deepseek/deepseek-ocr-2", + "name": "deepseek/deepseek-ocr-2", "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-04-17", - "last_updated": "2025-04-17", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.0375 }, - "limit": { "context": 1048576, "output": 65536 } + "reasoning": false, + "tool_call": false, + "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 + } }, - "gemini-3.1-pro-preview": { - "id": "gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", + "deepseek/deepseek-ocr": { + "id": "deepseek/deepseek-ocr", + "name": "DeepSeek-OCR", "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-24", + "last_updated": "2025-10-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.03, + "output": 0.03 + } + }, + "deepseek/deepseek-r1-distill-llama-70b": { + "id": "deepseek/deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill LLama 70B", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "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, + "release_date": "2025-01-27", + "last_updated": "2025-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "input": 0.8, + "output": 0.8 + } + }, + "deepseek/deepseek-prover-v2-671b": { + "id": "deepseek/deepseek-prover-v2-671b", + "name": "Deepseek Prover V2 671B", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2025-04-30", + "last_updated": "2025-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 160000, + "output": 160000 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.7, + "output": 2.5 + } }, - "gemma-3n-e2b-it": { - "id": "gemma-3n-e2b-it", - "name": "Gemma 3n 2B", - "family": "gemma", - "attachment": true, + "deepseek/deepseek-r1-0528-qwen3-8b": { + "id": "deepseek/deepseek-r1-0528-qwen3-8b", + "name": "DeepSeek R1 0528 Qwen3 8B", + "attachment": false, + "reasoning": true, + "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 + } + }, + "deepseek/deepseek-r1-distill-qwen-32b": { + "id": "deepseek/deepseek-r1-distill-qwen-32b", + "name": "DeepSeek R1 Distill Qwen 32B", + "family": "deepseek-thinking", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2000 } + "limit": { + "context": 64000, + "output": 32000 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } }, - "gemini-2.5-flash-preview-05-20": { - "id": "gemini-2.5-flash-preview-05-20", - "name": "Gemini 2.5 Flash Preview 05-20", - "family": "gemini-flash", - "attachment": true, + "deepseek/deepseek-v3.2-exp": { + "id": "deepseek/deepseek-v3.2-exp", + "name": "Deepseek V3.2 Exp", + "attachment": false, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.0375 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 0.41 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", - "attachment": true, + "deepseek/deepseek-v3.1": { + "id": "deepseek/deepseek-v3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 }, - "limit": { "context": 1000000, "output": 64000 } + "cost": { + "input": 0.27, + "output": 1, + "cache_read": 0.135 + } }, - "gemma-3-27b-it": { - "id": "gemma-3-27b-it", - "name": "Gemma 3 27B", - "family": "gemma", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-v3.2": { + "id": "deepseek/deepseek-v3.2", + "name": "Deepseek V3.2", + "family": "deepseek", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.269, + "output": 0.4, + "cache_read": 0.1345 + } }, - "gemma-3-4b-it": { - "id": "gemma-3-4b-it", - "name": "Gemma 3 4B", - "family": "gemma", - "attachment": true, + "deepseek/deepseek-v3-turbo": { + "id": "deepseek/deepseek-v3-turbo", + "name": "DeepSeek V3 (Turbo)\t", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-03-05", + "last_updated": "2025-03-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 64000, + "output": 16000 + }, + "cost": { + "input": 0.4, + "output": 1.3 + } }, - "gemma-3n-e4b-it": { - "id": "gemma-3n-e4b-it", - "name": "Gemma 3n 4B", - "family": "gemma", - "attachment": true, + "deepseek/deepseek-r1-distill-qwen-14b": { + "id": "deepseek/deepseek-r1-distill-qwen-14b", + "name": "DeepSeek R1 Distill Qwen 14B", + "family": "deepseek-thinking", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2000 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "gemini-2.5-pro-preview-06-05": { - "id": "gemini-2.5-pro-preview-06-05", - "name": "Gemini 2.5 Pro Preview 06-05", - "family": "gemini-pro", - "attachment": true, + "deepseek/deepseek-r1-0528": { + "id": "deepseek/deepseek-r1-0528", + "name": "DeepSeek R1 0528", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "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": 32768 + }, + "cost": { + "input": 0.7, + "output": 2.5, + "cache_read": 0.35 + } }, - "gemini-2.5-pro-preview-05-06": { - "id": "gemini-2.5-pro-preview-05-06", - "name": "Gemini 2.5 Pro Preview 05-06", - "family": "gemini-pro", - "attachment": true, + "deepseek/deepseek-v3.1-terminus": { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "Deepseek V3.1 Terminus", + "family": "deepseek", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-05-06", - "last_updated": "2025-05-06", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.27, + "output": 1, + "cache_read": 0.135 + } }, - "gemini-2.0-flash-lite": { - "id": "gemini-2.0-flash-lite", - "name": "Gemini 2.0 Flash Lite", - "family": "gemini-flash-lite", - "attachment": true, + "inclusionai/ling-2.6-1t": { + "id": "inclusionai/ling-2.6-1t", + "name": "Ling-2.6-1T", + "family": "ling", + "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 1048576, "output": 8192 } + "release_date": "2026-04-23", + "last_updated": "2026-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-1.5-flash-8b": { - "id": "gemini-1.5-flash-8b", - "name": "Gemini 1.5 Flash-8B", - "family": "gemini-flash", - "attachment": true, + "inclusionai/ling-2.6-flash": { + "id": "inclusionai/ling-2.6-flash", + "name": "Ling-2.6-flash", + "family": "ling", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-10-03", - "last_updated": "2024-10-03", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0375, "output": 0.15, "cache_read": 0.01 }, - "limit": { "context": 1000000, "output": 8192 } + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.02 + } }, - "gemini-1.5-flash": { - "id": "gemini-1.5-flash", - "name": "Gemini 1.5 Flash", - "family": "gemini-flash", + "paddlepaddle/paddleocr-vl": { + "id": "paddlepaddle/paddleocr-vl", + "name": "PaddleOCR-VL", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-05-14", - "last_updated": "2024-05-14", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3, "cache_read": 0.01875 }, - "limit": { "context": 1000000, "output": 8192 } + "release_date": "2025-10-22", + "last_updated": "2025-10-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0.02 + } }, - "gemini-2.5-pro-preview-tts": { - "id": "gemini-2.5-pro-preview-tts", - "name": "Gemini 2.5 Pro Preview TTS", - "family": "gemini-flash", + "nousresearch/hermes-2-pro-llama-3-8b": { + "id": "nousresearch/hermes-2-pro-llama-3-8b", + "name": "Hermes 2 Pro Llama 3 8B", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-05-01", - "last_updated": "2025-05-01", - "modalities": { "input": ["text"], "output": ["audio"] }, - "open_weights": false, - "cost": { "input": 1, "output": 20 }, - "limit": { "context": 8000, "output": 16000 } + "structured_output": true, + "temperature": true, + "release_date": "2024-06-27", + "last_updated": "2024-06-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.14, + "output": 0.14 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", - "attachment": true, + "zai-org/glm-4.7": { + "id": "zai-org/glm-4.7", + "name": "GLM-4.7", + "family": "glm", + "attachment": false, "reasoning": true, "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, + "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.5, - "output": 3, - "cache_read": 0.05, - "context_over_200k": { "input": 0.5, "output": 3, "cache_read": 0.05 } + "input": 0.6, + "output": 2.2, + "cache_read": 0.11 + } + }, + "zai-org/glm-5": { + "id": "zai-org/glm-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2026-02-11", + "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 + } + }, + "zai-org/glm-5.1": { + "id": "zai-org/glm-5.1", + "name": "GLM-5.1", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } + }, + "zai-org/glm-4.5": { + "id": "zai-org/glm-4.5", + "name": "GLM-4.5", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 98304 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", - "attachment": true, + "zai-org/glm-4.5-air": { + "id": "zai-org/glm-4.5-air", + "name": "GLM 4.5 Air", + "family": "glm-air", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2025-04", + "release_date": "2025-10-13", + "last_updated": "2025-10-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.13, + "output": 0.85 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", + "zai-org/glm-4.5v": { + "id": "zai-org/glm-4.5v", + "name": "GLM 4.5V", + "family": "glmv", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "input_audio": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2025-04", + "release_date": "2025-08-11", + "last_updated": "2025-08-11", + "modalities": { + "input": ["text", "video", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 1.8, + "cache_read": 0.11 + } }, - "gemini-3.1-pro-preview-customtools": { - "id": "gemini-3.1-pro-preview-customtools", - "name": "Gemini 3.1 Pro Preview Custom Tools", - "family": "gemini-pro", - "attachment": true, + "zai-org/glm-4.6": { + "id": "zai-org/glm-4.6", + "name": "GLM 4.6", + "family": "glm", + "attachment": false, "reasoning": true, "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, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.55, + "output": 2.2, + "cache_read": 0.11 + } }, - "gemini-2.5-flash-preview-09-2025": { - "id": "gemini-2.5-flash-preview-09-2025", - "name": "Gemini 2.5 Flash Preview 09-25", - "family": "gemini-flash", + "zai-org/glm-4.6v": { + "id": "zai-org/glm-4.6v", + "name": "GLM 4.6V", + "family": "glmv", "attachment": true, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "input_audio": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2025-04", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "video", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.9, + "cache_read": 0.055 + } }, - "gemini-2.0-flash": { - "id": "gemini-2.0-flash", - "name": "Gemini 2.0 Flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": false, + "zai-org/glm-4.7-flash": { + "id": "zai-org/glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 8192 } + "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 + } }, - "gemini-1.5-pro": { - "id": "gemini-1.5-pro", - "name": "Gemini 1.5 Pro", - "family": "gemini-pro", + "zai-org/autoglm-phone-9b-multilingual": { + "id": "zai-org/autoglm-phone-9b-multilingual", + "name": "AutoGLM-Phone-9B-Multilingual", "attachment": true, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-02-15", - "last_updated": "2024-02-15", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 5, "cache_read": 0.3125 }, - "limit": { "context": 1000000, "output": 8192 } - }, - "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", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": true, - "tool_call": true, + "tool_call": false, "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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025, "input_audio": 0.3 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "gemini-2.5-flash-preview-tts": { - "id": "gemini-2.5-flash-preview-tts", - "name": "Gemini 2.5 Flash Preview TTS", - "family": "gemini-flash", + "mistralai/mistral-nemo": { + "id": "mistralai/mistral-nemo", + "name": "Mistral Nemo", + "family": "mistral-nemo", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-05-01", - "last_updated": "2025-05-01", - "modalities": { "input": ["text"], "output": ["audio"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 10 }, - "limit": { "context": 8000, "output": 16000 } - }, - "gemini-3.1-flash-lite-preview": { - "id": "gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite Preview", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 0.25, "output": 1.5, "cache_read": 0.025, "cache_write": 1 }, - "limit": { "context": 1048576, "output": 65536 } - }, - "gemini-flash-lite-latest": { - "id": "gemini-flash-lite-latest", - "name": "Gemini Flash-Lite Latest", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": true, - "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2024-07-30", + "last_updated": "2024-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 60288, + "output": 16000 + }, + "cost": { + "input": 0.04, + "output": 0.17 + } }, - "gemini-3.1-flash-image-preview": { - "id": "gemini-3.1-flash-image-preview", - "name": "Gemini 3.1 Flash Image (Preview)", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "baichuan/baichuan-m2-32b": { + "id": "baichuan/baichuan-m2-32b", + "name": "baichuan-m2-32b", + "family": "baichuan", + "attachment": false, + "reasoning": false, "tool_call": false, + "structured_output": 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, - "cost": { "input": 0.25, "output": 60 }, - "limit": { "context": 131072, "output": 32768 } + "knowledge": "2024-12", + "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 + } }, - "gemini-2.5-flash-image": { - "id": "gemini-2.5-flash-image", - "name": "Gemini 2.5 Flash Image", - "family": "gemini-flash", + "meta-llama/llama-4-scout-17b-16e-instruct": { + "id": "meta-llama/llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout Instruct", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 30, "cache_read": 0.075 }, - "limit": { "context": 32768, "output": 32768 } + "release_date": "2025-04-06", + "last_updated": "2025-04-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.18, + "output": 0.59 + } }, - "gemini-flash-latest": { - "id": "gemini-flash-latest", - "name": "Gemini Flash Latest", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "meta-llama/llama-3.3-70b-instruct": { + "id": "meta-llama/llama-3.3-70b-instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "input_audio": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2023-12", + "release_date": "2024-12-07", + "last_updated": "2024-12-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 120000 + }, + "cost": { + "input": 0.135, + "output": 0.4 + } }, - "gemma-3-12b-it": { - "id": "gemma-3-12b-it", - "name": "Gemma 3 12B", - "family": "gemma", - "attachment": true, + "meta-llama/llama-3.2-3b-instruct": { + "id": "meta-llama/llama-3.2-3b-instruct", + "name": "Llama 3.2 3B Instruct", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 32768, + "output": 32000 + }, + "cost": { + "input": 0.03, + "output": 0.05 + } }, - "gemini-live-2.5-flash-preview-native-audio": { - "id": "gemini-live-2.5-flash-preview-native-audio", - "name": "Gemini Live 2.5 Flash Preview Native Audio", - "family": "gemini-flash", + "meta-llama/llama-3-8b-instruct": { + "id": "meta-llama/llama-3-8b-instruct", + "name": "Llama 3 8B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-06-17", - "last_updated": "2025-09-18", - "modalities": { "input": ["text", "audio", "video"], "output": ["text", "audio"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 2, "input_audio": 3, "output_audio": 12 }, - "limit": { "context": 131072, "output": 65536 } + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2024-04-25", + "last_updated": "2024-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "gemini-embedding-001": { - "id": "gemini-embedding-001", - "name": "Gemini Embedding 001", - "family": "gemini", + "meta-llama/llama-3.1-8b-instruct": { + "id": "meta-llama/llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "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, - "cost": { "input": 0.15, "output": 0 }, - "limit": { "context": 2048, "output": 3072 } + "temperature": true, + "release_date": "2024-07-24", + "last_updated": "2024-07-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0.05 + } }, - "gemini-live-2.5-flash": { - "id": "gemini-live-2.5-flash", - "name": "Gemini Live 2.5 Flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, - "tool_call": true, + "meta-llama/llama-3-70b-instruct": { + "id": "meta-llama/llama-3-70b-instruct", + "name": "Llama3 70B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text", "audio"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 2, "input_audio": 3, "output_audio": 12 }, - "limit": { "context": 128000, "output": 8000 } + "release_date": "2024-04-25", + "last_updated": "2024-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8000 + }, + "cost": { + "input": 0.51, + "output": 0.74 + } }, - "gemini-2.5-flash-image-preview": { - "id": "gemini-2.5-flash-image-preview", - "name": "Gemini 2.5 Flash Image (Preview)", - "family": "gemini-flash", + "meta-llama/llama-4-maverick-17b-128e-instruct-fp8": { + "id": "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", + "name": "Llama 4 Maverick Instruct", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 30, "cache_read": 0.075 }, - "limit": { "context": 32768, "output": 32768 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "OpenAI GPT OSS 120B", - "family": "gpt-oss", + "release_date": "2025-04-06", + "last_updated": "2025-04-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.27, + "output": 0.85 + } + }, + "gryphe/mythomax-l2-13b": { + "id": "gryphe/mythomax-l2-13b", + "name": "Mythomax L2 13B", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-04-25", + "last_updated": "2024-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.92, "output": 2.92 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 4096, + "output": 3200 + }, + "cost": { + "input": 0.09, + "output": 0.09 + } }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "sao10k/l31-70b-euryale-v2.2": { + "id": "sao10k/l31-70b-euryale-v2.2", + "name": "L31 70B Euryale V2.2", "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"] }, + "release_date": "2024-09-19", + "last_updated": "2024-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.92, "output": 2.92 }, - "limit": { "context": 70000, "output": 70000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 1.48, + "output": 1.48 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "sao10k/l3-70b-euryale-v2.1": { + "id": "sao10k/l3-70b-euryale-v2.1", + "name": "L3 70B Euryale V2.1\t", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-03-05", - "last_updated": "2026-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-06-18", + "last_updated": "2024-06-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196000, "output": 196000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 1.48, + "output": 1.48 + } }, - "speakleash/Bielik-11B-v3.0-Instruct": { - "id": "speakleash/Bielik-11B-v3.0-Instruct", - "name": "Bielik 11B v3.0 Instruct", + "sao10k/l3-8b-lunaris": { + "id": "sao10k/l3-8b-lunaris", + "name": "Sao10k L3 8B Lunaris\t", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-11-28", + "last_updated": "2024-11-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.67, "output": 0.67 }, - "limit": { "context": 32000, "output": 32000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.05, + "output": 0.05 + } }, - "speakleash/Bielik-11B-v2.6-Instruct": { - "id": "speakleash/Bielik-11B-v2.6-Instruct", - "name": "Bielik 11B v2.6 Instruct", + "microsoft/wizardlm-2-8x22b": { + "id": "microsoft/wizardlm-2-8x22b", + "name": "Wizardlm 2 8x22B", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-04-24", + "last_updated": "2024-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.67, "output": 0.67 }, - "limit": { "context": 32000, "output": 32000 } - } - } - }, - "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-5@20251101": { - "id": "claude-opus-4-5@20251101", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "limit": { + "context": 65535, + "output": 8000 + }, + "cost": { + "input": 0.62, + "output": 0.62 + } + }, + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "OpenAI: GPT OSS 20B", + "attachment": true, + "reasoning": true, + "tool_call": false, + "structured_output": true, + "temperature": true, + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.04, + "output": 0.15 + } + }, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "OpenAI GPT OSS 120B", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": 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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0.25 + } }, - "claude-haiku-4-5@20251001": { - "id": "claude-haiku-4-5@20251001", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, + "minimaxai/minimax-m1-80k": { + "id": "minimaxai/minimax-m1-80k", + "name": "MiniMax M1", + "family": "minimax", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } }, - "claude-3-5-sonnet@20241022": { - "id": "claude-3-5-sonnet@20241022", - "name": "Claude Sonnet 3.5 v2", - "family": "claude-sonnet", - "attachment": true, + "Sao10K/L3-8B-Stheno-v3.2": { + "id": "Sao10K/L3-8B-Stheno-v3.2", + "name": "L3 8B Stheno V3.2", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04-30", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2024-11-29", + "last_updated": "2024-11-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 32000 + }, + "cost": { + "input": 0.05, + "output": 0.05 + } }, - "claude-3-7-sonnet@20250219": { - "id": "claude-3-7-sonnet@20250219", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", - "attachment": true, + "xiaomimimo/mimo-v2-flash": { + "id": "xiaomimimo/mimo-v2-flash", + "name": "XiaomiMiMo/MiMo-V2-Flash", + "family": "mimo", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": 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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2024-12", + "release_date": "2025-12-19", + "last_updated": "2025-12-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32000 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.3 + } }, - "claude-opus-4-1@20250805": { - "id": "claude-opus-4-1@20250805", - "name": "Claude Opus 4.1", - "family": "claude-opus", + "baidu/ernie-4.5-vl-28b-a3b-thinking": { + "id": "baidu/ernie-4.5-vl-28b-a3b-thinking", + "name": "ERNIE-4.5-VL-28B-A3B-Thinking", "attachment": true, "reasoning": true, "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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } - }, - "claude-3-5-haiku@20241022": { - "id": "claude-3-5-haiku@20241022", - "name": "Claude Haiku 3.5", - "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, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2025-11-26", + "last_updated": "2025-11-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.39, + "output": 0.39 + } }, - "claude-opus-4@20250514": { - "id": "claude-opus-4@20250514", - "name": "Claude Opus 4", - "family": "claude-opus", + "baidu/ernie-4.5-vl-424b-a47b": { + "id": "baidu/ernie-4.5-vl-424b-a47b", + "name": "ERNIE 4.5 VL 424B A47B", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": 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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "release_date": "2025-06-30", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 123000, + "output": 16000 + }, + "cost": { + "input": 0.42, + "output": 1.25 + } }, - "claude-sonnet-4-6@default": { - "id": "claude-sonnet-4-6@default", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "baidu/ernie-4.5-21B-a3b": { + "id": "baidu/ernie-4.5-21B-a3b", + "name": "ERNIE 4.5 21B A3B", + "family": "ernie", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, + "knowledge": "2025-03", + "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": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "input": 0.07, + "output": 0.28 + } + }, + "baidu/ernie-4.5-300b-a47b-paddle": { + "id": "baidu/ernie-4.5-300b-a47b-paddle", + "name": "ERNIE 4.5 300B A47B", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": true, + "temperature": true, + "release_date": "2025-06-30", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 200000, "output": 64000 } + "open_weights": true, + "limit": { + "context": 123000, + "output": 12000 + }, + "cost": { + "input": 0.28, + "output": 1.1 + } }, - "claude-sonnet-4@20250514": { - "id": "claude-sonnet-4@20250514", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", - "attachment": true, + "baidu/ernie-4.5-21B-a3b-thinking": { + "id": "baidu/ernie-4.5-21B-a3b-thinking", + "name": "ERNIE-4.5-21B-A3B-Thinking", + "family": "ernie", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": 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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-03", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "claude-sonnet-4-5@20250929": { - "id": "claude-sonnet-4-5@20250929", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", + "baidu/ernie-4.5-vl-28b-a3b": { + "id": "baidu/ernie-4.5-vl-28b-a3b", + "name": "ERNIE 4.5 VL 28B A3B", "attachment": true, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-06-30", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 30000, + "output": 8000 + }, + "cost": { + "input": 1.4, + "output": 5.6 + } }, - "claude-opus-4-6@default": { - "id": "claude-opus-4-6@default", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "minimax/minimax-m2.7": { + "id": "minimax/minimax-m2.7", + "name": "MiniMax M2.7", + "family": "minimax-m2.7", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 5, - "output": 25, - "cache_read": 0.5, - "cache_write": 6.25, - "context_over_200k": { "input": 10, "output": 37.5, "cache_read": 1, "cache_write": 12.5 } + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 1000000, "output": 128000 } - } - } - }, - "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-lite": { - "id": "gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "family": "gemini-flash-lite", - "attachment": true, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } + }, + "minimax/minimax-m2": { + "id": "minimax/minimax-m2", + "name": "MiniMax-M2", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "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-25", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": true, + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "Minimax M2.1", + "family": "minimax", + "attachment": false, + "reasoning": false, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "gemini-2.5-flash-preview-04-17": { - "id": "gemini-2.5-flash-preview-04-17", - "name": "Gemini 2.5 Flash Preview 04-17", - "family": "gemini-flash", - "attachment": true, + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-04-17", - "last_updated": "2025-04-17", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.0375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 204800, + "output": 131100 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "gemini-3.1-pro-preview": { - "id": "gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", - "attachment": true, + "minimax/minimax-m2.5-highspeed": { + "id": "minimax/minimax-m2.5-highspeed", + "name": "MiniMax M2.5 Highspeed", + "family": "minimax-m2.5", + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "limit": { + "context": 204800, + "output": 131100 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.6, + "output": 2.4, + "cache_read": 0.03 + } }, - "gemini-2.5-flash-preview-05-20": { - "id": "gemini-2.5-flash-preview-05-20", - "name": "Gemini 2.5 Flash Preview 05-20", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "qwen/qwen2.5-7b-instruct": { + "id": "qwen/qwen2.5-7b-instruct", + "name": "Qwen2.5 7B Instruct", + "attachment": false, + "reasoning": false, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.0375 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-04-16", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.07, + "output": 0.07 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "qwen/qwen3.5-122b-a10b": { + "id": "qwen/qwen3.5-122b-a10b", + "name": "Qwen3.5-122B-A10B", + "family": "qwen", "attachment": true, "reasoning": true, "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, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.4, + "output": 3.2 + } }, - "gemini-2.5-pro-preview-06-05": { - "id": "gemini-2.5-pro-preview-06-05", - "name": "Gemini 2.5 Pro Preview 06-05", - "family": "gemini-pro", + "qwen/qwen3.5-27b": { + "id": "qwen/qwen3.5-27b", + "name": "Qwen3.5-27B", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.4 + } }, - "gemini-2.5-pro-preview-05-06": { - "id": "gemini-2.5-pro-preview-05-06", - "name": "Gemini 2.5 Pro Preview 05-06", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, + "qwen/qwen3-235b-a22b-instruct-2507": { + "id": "qwen/qwen3-235b-a22b-instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-05-06", - "last_updated": "2025-05-06", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "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": 16384 + }, + "cost": { + "input": 0.09, + "output": 0.58 + } }, - "gemini-2.0-flash-lite": { - "id": "gemini-2.0-flash-lite", - "name": "Gemini 2.0 Flash Lite", - "family": "gemini-flash-lite", + "qwen/qwen3-omni-30b-a3b-instruct": { + "id": "qwen/qwen3-omni-30b-a3b-instruct", + "name": "Qwen3 Omni 30B A3B Instruct", + "family": "qwen", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 1048576, "output": 8192 } + "knowledge": "2024-04", + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text", "video", "audio", "image"], + "output": ["text", "audio"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 16384 + }, + "cost": { + "input": 0.25, + "output": 0.97, + "input_audio": 2.2, + "output_audio": 1.788 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", + "qwen/qwen3.5-397b-a17b": { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen3.5-397B-A17B", + "family": "qwen", "attachment": true, "reasoning": true, "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, + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 64000 + }, "cost": { - "input": 0.5, - "output": 3, - "cache_read": 0.05, - "context_over_200k": { "input": 0.5, "output": 3, "cache_read": 0.05 } + "input": 0.6, + "output": 3.6 + } + }, + "qwen/qwen2.5-vl-72b-instruct": { + "id": "qwen/qwen2.5-vl-72b-instruct", + "name": "Qwen2.5 VL 72B Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.8, + "output": 0.8 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", + "qwen/qwen3-vl-235b-a22b-thinking": { + "id": "qwen/qwen3-vl-235b-a22b-thinking", + "name": "Qwen3 VL 235B A22B Thinking", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.98, + "output": 3.95 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", + "qwen/qwen3-vl-30b-a3b-thinking": { + "id": "qwen/qwen3-vl-30b-a3b-thinking", + "name": "qwen/qwen3-vl-30b-a3b-thinking", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "cache_write": 0.383 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-10-11", + "last_updated": "2025-10-11", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 1 + } }, - "gemini-3.1-pro-preview-customtools": { - "id": "gemini-3.1-pro-preview-customtools", - "name": "Gemini 3.1 Pro Preview Custom Tools", - "family": "gemini-pro", + "qwen/qwen3-omni-30b-a3b-thinking": { + "id": "qwen/qwen3-omni-30b-a3b-thinking", + "name": "Qwen3 Omni 30B A3B Thinking", "attachment": true, "reasoning": true, "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, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text", "audio", "video", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 16384 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.25, + "output": 0.97, + "input_audio": 2.2, + "output_audio": 1.788 + } }, - "gemini-2.5-flash-preview-09-2025": { - "id": "gemini-2.5-flash-preview-09-2025", - "name": "Gemini 2.5 Flash Preview 09-25", - "family": "gemini-flash", + "qwen/qwen3-vl-8b-instruct": { + "id": "qwen/qwen3-vl-8b-instruct", + "name": "qwen/qwen3-vl-8b-instruct", "attachment": true, - "reasoning": true, + "reasoning": false, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "cache_write": 0.383 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-10-17", + "last_updated": "2025-10-17", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.08, + "output": 0.5 + } }, - "gemini-2.0-flash": { - "id": "gemini-2.0-flash", - "name": "Gemini 2.0 Flash", - "family": "gemini-flash", - "attachment": true, + "qwen/qwen3-max": { + "id": "qwen/qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 8192 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 2.11, + "output": 8.45 + } }, - "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", - "family": "gemini-flash-lite", - "attachment": true, + "qwen/qwen3-32b-fp8": { + "id": "qwen/qwen3-32b-fp8", + "name": "Qwen3 32B", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 65536, "output": 65536 } + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 20000 + }, + "cost": { + "input": 0.1, + "output": 0.45 + } }, - "gemini-flash-lite-latest": { - "id": "gemini-flash-lite-latest", - "name": "Gemini Flash-Lite Latest", - "family": "gemini-flash-lite", - "attachment": true, + "qwen/qwen3-4b-fp8": { + "id": "qwen/qwen3-4b-fp8", + "name": "Qwen3 4B", + "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 20000 + }, + "cost": { + "input": 0.03, + "output": 0.03 + } + }, + "qwen/qwen3-235b-a22b-thinking-2507": { + "id": "qwen/qwen3-235b-a22b-thinking-2507", + "name": "Qwen3 235B A22b Thinking 2507", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2025-04", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 3 + } }, - "gemini-flash-latest": { - "id": "gemini-flash-latest", - "name": "Gemini Flash Latest", - "family": "gemini-flash", - "attachment": true, + "qwen/qwen3-next-80b-a3b-thinking": { + "id": "qwen/qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", + "attachment": false, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "cache_write": 0.383 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-09-10", + "last_updated": "2025-09-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 1.5 + } }, - "gemini-embedding-001": { - "id": "gemini-embedding-001", - "name": "Gemini Embedding 001", - "family": "gemini", + "qwen/qwen-mt-plus": { + "id": "qwen/qwen-mt-plus", + "name": "Qwen MT Plus", "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, - "cost": { "input": 0.15, "output": 0 }, - "limit": { "context": 2048, "output": 3072 } + "temperature": true, + "release_date": "2025-09-03", + "last_updated": "2025-09-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.75 + } }, - "openai/gpt-oss-20b-maas": { - "id": "openai/gpt-oss-20b-maas", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "qwen/qwen3-next-80b-a3b-instruct": { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", "attachment": false, - "reasoning": true, + "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"] }, + "release_date": "2025-09-10", + "last_updated": "2025-09-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.25 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 1.5 + } }, - "openai/gpt-oss-120b-maas": { - "id": "openai/gpt-oss-120b-maas", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "qwen/qwen3-30b-a3b-fp8": { + "id": "qwen/qwen3-30b-a3b-fp8", + "name": "Qwen3 30B A3B", "attachment": false, "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 20000 + }, + "cost": { + "input": 0.09, + "output": 0.45 + } + }, + "qwen/qwen3-coder-next": { + "id": "qwen/qwen3-coder-next", + "name": "Qwen3 Coder Next", + "family": "qwen", + "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"] }, + "release_date": "2026-02-03", + "last_updated": "2026-02-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.36 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } }, - "zai-org/glm-4.7-maas": { - "id": "zai-org/glm-4.7-maas", - "name": "GLM-4.7", - "family": "glm", + "qwen/qwen3-coder-480b-a35b-instruct": { + "id": "qwen/qwen3-coder-480b-a35b-instruct", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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", "pdf"], "output": ["text"] }, + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 200000, "output": 128000 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi" + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1.3 } }, - "zai-org/glm-5-maas": { - "id": "zai-org/glm-5-maas", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, + "qwen/qwen3-vl-30b-a3b-instruct": { + "id": "qwen/qwen3-vl-30b-a3b-instruct", + "name": "qwen/qwen3-vl-30b-a3b-instruct", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-11", + "last_updated": "2025-10-11", + "modalities": { + "input": ["text", "video", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.1 }, - "limit": { "context": 202752, "output": 131072 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi" + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.7 } }, - "deepseek-ai/deepseek-v3.1-maas": { - "id": "deepseek-ai/deepseek-v3.1-maas", - "name": "DeepSeek V3.1", - "family": "deepseek", + "qwen/qwen3-coder-30b-a3b-instruct": { + "id": "qwen/qwen3-coder-30b-a3b-instruct", + "name": "Qwen3 Coder 30b A3B Instruct", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "release_date": "2025-10-09", + "last_updated": "2025-10-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.7 }, - "limit": { "context": 163840, "output": 32768 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi" + "limit": { + "context": 160000, + "output": 32768 + }, + "cost": { + "input": 0.07, + "output": 0.27 } }, - "qwen/qwen3-235b-a22b-instruct-2507-maas": { - "id": "qwen/qwen3-235b-a22b-instruct-2507-maas", - "name": "Qwen3 235B A22B Instruct", - "family": "qwen", + "qwen/qwen3-235b-a22b-fp8": { + "id": "qwen/qwen3-235b-a22b-fp8", + "name": "Qwen3 235B A22B", "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-08-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.22, "output": 0.88 }, - "limit": { "context": 262144, "output": 16384 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi" + "limit": { + "context": 40960, + "output": 20000 + }, + "cost": { + "input": 0.2, + "output": 0.8 } }, - "meta/llama-3.3-70b-instruct-maas": { - "id": "meta/llama-3.3-70b-instruct-maas", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "qwen/qwen3-8b-fp8": { + "id": "qwen/qwen3-8b-fp8", + "name": "Qwen3 8B", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "knowledge": "2023-12", "release_date": "2025-04-29", "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 128000, "output": 8192 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi" + "limit": { + "context": 128000, + "output": 20000 + }, + "cost": { + "input": 0.035, + "output": 0.138 } }, - "meta/llama-4-maverick-17b-128e-instruct-maas": { - "id": "meta/llama-4-maverick-17b-128e-instruct-maas", - "name": "Llama 4 Maverick 17B 128E Instruct", - "family": "llama", + "qwen/qwen3-vl-235b-a22b-instruct": { + "id": "qwen/qwen3-vl-235b-a22b-instruct", + "name": "Qwen3 VL 235B A22B Instruct", "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"] }, + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.35, "output": 1.15 }, - "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" + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 1.5 } - } - } - }, - "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": { - "unsloth/gemma-3-27b-it": { - "id": "unsloth/gemma-3-27b-it", - "name": "gemma 3 27b it", - "family": "unsloth", + }, + "qwen/qwen-2.5-72b-instruct": { + "id": "qwen/qwen-2.5-72b-instruct", + "name": "Qwen 2.5 72B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-10-15", + "last_updated": "2024-10-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.04, "output": 0.15, "cache_read": 0.02 }, - "limit": { "context": 128000, "output": 65536 } + "limit": { + "context": 32000, + "output": 8192 + }, + "cost": { + "input": 0.38, + "output": 0.4 + } }, - "unsloth/gemma-3-4b-it": { - "id": "unsloth/gemma-3-4b-it", - "name": "gemma 3 4b it", - "family": "unsloth", - "attachment": false, - "reasoning": false, - "tool_call": false, + "qwen/qwen3.5-35b-a3b": { + "id": "qwen/qwen3.5-35b-a3b", + "name": "Qwen3.5-35B-A3B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.03 }, - "limit": { "context": 96000, "output": 96000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 2 + } }, - "unsloth/Mistral-Nemo-Instruct-2407": { - "id": "unsloth/Mistral-Nemo-Instruct-2407", - "name": "Mistral Nemo Instruct 2407", - "family": "unsloth", + "kwaipilot/kat-coder-pro": { + "id": "kwaipilot/kat-coder-pro", + "name": "Kat Coder Pro", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-05", + "last_updated": "2026-01-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.04, "cache_read": 0.01 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "unsloth/Llama-3.2-3B-Instruct": { - "id": "unsloth/Llama-3.2-3B-Instruct", - "name": "Llama 3.2 3B Instruct", - "family": "unsloth", - "attachment": false, + "google/gemma-4-31b-it": { + "id": "google/gemma-4-31b-it", + "name": "Gemma 4 31B", + "family": "gemma", + "attachment": true, + "reasoning": true, + "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": 131072 + }, + "cost": { + "input": 0.14, + "output": 0.4 + } + }, + "google/gemma-3-12b-it": { + "id": "google/gemma-3-12b-it", + "name": "Gemma 3 12B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-02-12", - "last_updated": "2025-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.01, "cache_read": 0.005 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.05, + "output": 0.1 + } }, - "unsloth/Llama-3.2-1B-Instruct": { - "id": "unsloth/Llama-3.2-1B-Instruct", - "name": "Llama 3.2 1B Instruct", - "attachment": false, + "google/gemma-3-27b-it": { + "id": "google/gemma-3-27b-it", + "name": "Gemma 3 27B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, + "release_date": "2025-03-25", + "last_updated": "2025-03-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 98304, + "output": 16384 + }, + "cost": { + "input": 0.119, + "output": 0.2 + } + }, + "google/gemma-4-26b-a4b-it": { + "id": "google/gemma-4-26b-a4b-it", + "name": "Gemma 4 26B A4B", + "family": "gemma", + "attachment": true, + "reasoning": true, + "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": 131072 + }, + "cost": { + "input": 0.13, + "output": 0.4 + } + }, + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, + "reasoning": true, + "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"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.01, "cache_read": 0.005 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "unsloth/Mistral-Small-24B-Instruct-2501": { - "id": "unsloth/Mistral-Small-24B-Instruct-2501", - "name": "Mistral Small 24B Instruct 2501", - "family": "unsloth", + "moonshotai/kimi-k2-instruct": { + "id": "moonshotai/kimi-k2-instruct", + "name": "Kimi K2 Instruct", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-07-11", + "last_updated": "2025-07-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.11 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.57, + "output": 2.3 + } }, - "unsloth/gemma-3-12b-it": { - "id": "unsloth/gemma-3-12b-it", - "name": "gemma 3 12b it", - "family": "unsloth", + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "Kimi K2 0905", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.1 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5 + } }, - "openai/gpt-oss-120b-TEE": { - "id": "openai/gpt-oss-120b-TEE", - "name": "gpt oss 120b TEE", - "family": "gpt-oss", + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-07", + "last_updated": "2025-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.04, "output": 0.18 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "gpt oss 20b", - "family": "gpt-oss", + "deepseek/deepseek-v4-flash": { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.1 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 1048576, + "output": 393216 + }, + "cost": { + "input": 0.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "NousResearch/Hermes-4-405B-FP8-TEE": { - "id": "NousResearch/Hermes-4-405B-FP8-TEE", - "name": "Hermes 4 405B FP8 TEE", - "family": "nousresearch", + "deepseek/deepseek-v4-pro": { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 1048576, + "output": 393216 + }, + "cost": { + "input": 1.69, + "output": 3.38, + "cache_read": 0.13 + } }, - "NousResearch/Hermes-4-14B": { - "id": "NousResearch/Hermes-4-14B", - "name": "Hermes 4 14B", - "family": "nousresearch", - "attachment": false, + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.05 }, - "limit": { "context": 40960, "output": 40960 } - }, - "NousResearch/Hermes-4.3-36B": { - "id": "NousResearch/Hermes-4.3-36B", - "name": "Hermes 4.3 36B", - "family": "nousresearch", + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } + } + } + }, + "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-tts": { + "id": "mimo-v2-tts", + "name": "MiMo-V2-TTS", + "family": "mimo", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.39 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 8192, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "NousResearch/DeepHermes-3-Mistral-24B-Preview": { - "id": "NousResearch/DeepHermes-3-Mistral-24B-Preview", - "name": "DeepHermes 3 Mistral 24B Preview", - "family": "nousresearch", + "mimo-v2.5-pro": { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.1 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "NousResearch/Hermes-4-70B": { - "id": "NousResearch/Hermes-4-70B", - "name": "Hermes 4 70B", - "family": "nousresearch", - "attachment": false, + "mimo-v2-omni": { + "id": "mimo-v2-omni", + "name": "MiMo-V2-Omni", + "family": "mimo", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.11, "output": 0.38 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "zai-org/GLM-4.6-TEE": { - "id": "zai-org/GLM-4.6-TEE", - "name": "GLM 4.6 TEE", - "family": "glm", - "attachment": false, + "mimo-v2.5": { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 1.7, "cache_read": 0.2 }, - "limit": { "context": 202752, "output": 65536 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "zai-org/GLM-4.5-Air": { - "id": "zai-org/GLM-4.5-Air", - "name": "GLM 4.5 Air", - "family": "glm", + "mimo-v2-pro": { + "id": "mimo-v2-pro", + "name": "MiMo-V2-Pro", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.22 }, - "limit": { "context": 131072, "output": 131072 } + "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": 0, + "output": 0, + "cache_read": 0 + } }, - "zai-org/GLM-4.6V": { - "id": "zai-org/GLM-4.6V", - "name": "GLM 4.6V", - "family": "glm", + "mimo-v2-flash": { + "id": "mimo-v2-flash", + "name": "MiMo-V2-Flash", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "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 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } + } + } + }, + "wandb": { + "id": "wandb", + "env": ["WANDB_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.inference.wandb.ai/v1", + "name": "Weights & Biases", + "doc": "https://docs.wandb.ai/guides/integrations/inference/", + "models": { + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", + "name": "Qwen3 30B A3B Instruct 2507", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-07-29", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "zai-org/GLM-4.7-TEE": { - "id": "zai-org/GLM-4.7-TEE", - "name": "GLM 4.7 TEE", - "family": "glm", + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04-28", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 1.5 }, - "limit": { "context": 202752, "output": 65535 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "zai-org/GLM-4.6-FP8": { - "id": "zai-org/GLM-4.6-FP8", - "name": "GLM 4.6 FP8", + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen3-235B-A22B-Thinking-2507", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-25", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 202752, "output": 65535 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "zai-org/GLM-4.7-Flash": { - "id": "zai-org/GLM-4.7-Flash", - "name": "GLM 4.7 Flash", + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "name": "Qwen3-Coder-480B-A35B-Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.35 }, - "limit": { "context": 202752, "output": 65535 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 1, + "output": 1.5 + } }, - "zai-org/GLM-4.5-TEE": { - "id": "zai-org/GLM-4.5-TEE", - "name": "GLM 4.5 TEE", + "zai-org/GLM-5-FP8": { + "id": "zai-org/GLM-5-FP8", + "name": "GLM 5", "family": "glm", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.35, "output": 1.55 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 200000, + "output": 200000 + }, + "cost": { + "input": 1, + "output": 3.2 + } }, - "zai-org/GLM-4.5-FP8": { - "id": "zai-org/GLM-4.5-FP8", - "name": "GLM 4.5 FP8", + "meta-llama/Llama-4-Scout-17B-16E-Instruct": { + "id": "meta-llama/Llama-4-Scout-17B-16E-Instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2025-01-31", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 64000, + "output": 64000 + }, + "cost": { + "input": 0.17, + "output": 0.66 + } }, - "zai-org/GLM-5-TEE": { - "id": "zai-org/GLM-5-TEE", - "name": "GLM 5 TEE", - "family": "glm", + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "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"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-12-06", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.95, "output": 3.15, "cache_read": 0.475 }, - "limit": { "context": 202752, "output": 65535 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.71, + "output": 0.71 + } }, - "zai-org/GLM-5-Turbo": { - "id": "zai-org/GLM-5-Turbo", - "name": "GLM 5 Turbo", - "family": "glm", + "meta-llama/Llama-3.1-8B-Instruct": { + "id": "meta-llama/Llama-3.1-8B-Instruct", + "name": "Meta-Llama-3.1-8B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-07-23", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.49, "output": 1.96, "cache_read": 0.245 }, - "limit": { "context": 202752, "output": 65535 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.22, + "output": 0.22 + } }, - "zai-org/GLM-4.7-FP8": { - "id": "zai-org/GLM-4.7-FP8", - "name": "GLM 4.7 FP8", + "meta-llama/Llama-3.1-70B-Instruct": { + "id": "meta-llama/Llama-3.1-70B-Instruct", + "name": "Llama 3.1 70B", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-23", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 202752, "output": 65535 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.8, + "output": 0.8 + } }, - "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16": { - "id": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16", - "name": "NVIDIA Nemotron 3 Nano 30B A3B BF16", - "family": "nemotron", + "OpenPipe/Qwen3-14B-Instruct": { + "id": "OpenPipe/Qwen3-14B-Instruct", + "name": "OpenPipe Qwen3 14B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-29", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.24 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0.22 + } }, - "rednote-hilab/dots.ocr": { - "id": "rednote-hilab/dots.ocr", - "name": "dots.ocr", - "family": "rednote", + "microsoft/Phi-4-mini-instruct": { + "id": "microsoft/Phi-4-mini-instruct", + "name": "Phi-4-mini-instruct", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-10", + "release_date": "2024-12-11", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.01, "cache_read": 0.005 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.08, + "output": 0.35 + } }, - "miromind-ai/MiroThinker-v1.5-235B": { - "id": "miromind-ai/MiroThinker-v1.5-235B", - "name": "MiroThinker V1.5 235B", + "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8": { + "id": "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8", + "name": "NVIDIA Nemotron 3 Super 120B", + "family": "nemotron", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2026-01-10", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-11", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 8192 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "MiniMaxAI/MiniMax-M2.5-TEE": { - "id": "MiniMaxAI/MiniMax-M2.5-TEE", - "name": "MiniMax M2.5 TEE", - "family": "minimax", + "deepseek-ai/DeepSeek-V3.1": { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "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"], "output": ["text"] }, + "release_date": "2025-08-21", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.1, "cache_read": 0.15 }, - "limit": { "context": 196608, "output": 65536 } + "limit": { + "context": 161000, + "output": 161000 + }, + "cost": { + "input": 0.55, + "output": 1.65 + } }, - "MiniMaxAI/MiniMax-M2.1-TEE": { - "id": "MiniMaxAI/MiniMax-M2.1-TEE", - "name": "MiniMax M2.1 TEE", - "family": "minimax", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "gpt-oss-20b", + "family": "gpt-oss", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 1.12 }, - "limit": { "context": 196608, "output": 65536 } + "release_date": "2025-08-05", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.2 + } }, - "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": { - "id": "deepseek-ai/DeepSeek-R1-Distill-Llama-70B", - "name": "DeepSeek R1 Distill Llama 70B", - "family": "deepseek-thinking", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "gpt-oss-120b", + "family": "gpt-oss", "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } + }, + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.11 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.5, + "output": 2.85 + } }, - "deepseek-ai/DeepSeek-V3.1-Terminus-TEE": { - "id": "deepseek-ai/DeepSeek-V3.1-Terminus-TEE", - "name": "DeepSeek V3.1 Terminus TEE", - "family": "deepseek", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.23, "output": 0.9 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "deepseek-ai/DeepSeek-R1-0528-TEE": { - "id": "deepseek-ai/DeepSeek-R1-0528-TEE", - "name": "DeepSeek R1 0528 TEE", - "family": "deepseek-thinking", + "zai-org/GLM-5.1": { + "id": "zai-org/GLM-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 1.75 }, - "limit": { "context": 163840, "output": 65536 } - }, - "deepseek-ai/DeepSeek-V3-0324-TEE": { - "id": "deepseek-ai/DeepSeek-V3-0324-TEE", - "name": "DeepSeek V3 0324 TEE", - "family": "deepseek", + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26, + "cache_write": 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": { + "NousResearch/DeepHermes-3-Mistral-24B-Preview": { + "id": "NousResearch/DeepHermes-3-Mistral-24B-Preview", + "name": "DeepHermes 3 Mistral 24B Preview", + "family": "nousresearch", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.19, "output": 0.87, "cache_read": 0.095 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.0245, + "output": 0.0978, + "cache_read": 0.01225 + } }, - "deepseek-ai/DeepSeek-V3.2-TEE": { - "id": "deepseek-ai/DeepSeek-V3.2-TEE", - "name": "DeepSeek V3.2 TEE", - "family": "deepseek", + "NousResearch/Hermes-4-14B": { + "id": "NousResearch/Hermes-4-14B", + "name": "Hermes 4 14B", + "family": "nousresearch", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 0.42, "cache_read": 0.14 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.0136, + "output": 0.0543, + "cache_read": 0.0068 + } }, - "deepseek-ai/DeepSeek-V3.2-Speciale-TEE": { - "id": "deepseek-ai/DeepSeek-V3.2-Speciale-TEE", - "name": "DeepSeek V3.2 Speciale TEE", - "family": "deepseek", + "Qwen/Qwen3-30B-A3B": { + "id": "Qwen/Qwen3-30B-A3B", + "name": "Qwen3 30B A3B", + "family": "qwen", "attachment": false, "reasoning": true, - "tool_call": false, - "interleaved": { "field": "reasoning_content" }, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 0.41 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.06, + "output": 0.22, + "cache_read": 0.03 + } }, - "deepseek-ai/DeepSeek-R1-TEE": { - "id": "deepseek-ai/DeepSeek-R1-TEE", - "name": "DeepSeek R1 TEE", - "family": "deepseek-thinking", + "Qwen/Qwen3-32B-TEE": { + "id": "Qwen/Qwen3-32B-TEE", + "name": "Qwen3 32B TEE", + "family": "qwen", "attachment": false, "reasoning": true, - "tool_call": false, - "interleaved": { "field": "reasoning_content" }, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-25", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.08, + "output": 0.24, + "cache_read": 0.04 + } }, - "deepseek-ai/DeepSeek-V3.1-TEE": { - "id": "deepseek-ai/DeepSeek-V3.1-TEE", - "name": "DeepSeek V3.1 TEE", - "family": "deepseek", - "attachment": false, + "Qwen/Qwen3.6-27B-TEE": { + "id": "Qwen/Qwen3.6-27B-TEE", + "name": "Qwen3.6 27B TEE", + "family": "qwen", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-25", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.195, + "output": 1.56, + "cache_read": 0.0975 + } }, - "deepseek-ai/DeepSeek-V3": { - "id": "deepseek-ai/DeepSeek-V3", - "name": "DeepSeek V3", - "family": "deepseek", + "Qwen/Qwen2.5-Coder-32B-Instruct": { + "id": "Qwen/Qwen2.5-Coder-32B-Instruct", + "name": "Qwen2.5 Coder 32B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.0272, + "output": 0.1087, + "cache_read": 0.0136 + } }, - "Qwen/Qwen3-30B-A3B": { - "id": "Qwen/Qwen3-30B-A3B", - "name": "Qwen3 30B A3B", + "Qwen/Qwen3Guard-Gen-0.6B": { + "id": "Qwen/Qwen3Guard-Gen-0.6B", + "name": "Qwen3Guard Gen 0.6B", "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.22 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0.01, + "output": 0.0109, + "cache_read": 0.005 + } }, - "Qwen/Qwen2.5-Coder-32B-Instruct": { - "id": "Qwen/Qwen2.5-Coder-32B-Instruct", - "name": "Qwen2.5 Coder 32B Instruct", + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "name": "Qwen3 Next 80B A3B Instruct", "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.11 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.1, + "output": 0.8, + "cache_read": 0.05 + } }, - "Qwen/Qwen2.5-VL-72B-Instruct-TEE": { - "id": "Qwen/Qwen2.5-VL-72B-Instruct-TEE", - "name": "Qwen2.5 VL 72B Instruct TEE", + "Qwen/Qwen3-235B-A22B-Instruct-2507-TEE": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507-TEE", + "name": "Qwen3 235B A22B Instruct 2507 TEE", "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.6, + "cache_read": 0.05 + } }, - "Qwen/Qwen3Guard-Gen-0.6B": { - "id": "Qwen/Qwen3Guard-Gen-0.6B", - "name": "Qwen3Guard Gen 0.6B", + "Qwen/Qwen3-Coder-Next-TEE": { + "id": "Qwen/Qwen3-Coder-Next-TEE", + "name": "Qwen3 Coder Next TEE", "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-25", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.01, "cache_read": 0.005 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.12, + "output": 0.75, + "cache_read": 0.06 + } }, - "Qwen/Qwen3-32B": { - "id": "Qwen/Qwen3-32B", - "name": "Qwen3 32B", + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen3 235B A22B Thinking 2507", "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.24, "cache_read": 0.04 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.11, + "output": 0.6, + "cache_read": 0.055 + } }, - "Qwen/Qwen3-14B": { - "id": "Qwen/Qwen3-14B", - "name": "Qwen3 14B", + "Qwen/Qwen2.5-VL-32B-Instruct": { + "id": "Qwen/Qwen2.5-VL-32B-Instruct", + "name": "Qwen2.5 VL 32B Instruct", "family": "qwen", - "attachment": false, + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": true, + "temperature": true, + "release_date": "2025-12-29", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.0543, + "output": 0.2174, + "cache_read": 0.02715 + } + }, + "Qwen/Qwen3.5-397B-A17B-TEE": { + "id": "Qwen/Qwen3.5-397B-A17B-TEE", + "name": "Qwen3.5 397B A17B TEE", + "family": "qwen", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-18", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.22 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.39, + "output": 2.34, + "cache_read": 0.195 + } }, - "Qwen/Qwen3-Coder-Next": { - "id": "Qwen/Qwen3-Coder-Next", - "name": "Qwen3 Coder Next", + "Qwen/Qwen2.5-72B-Instruct": { + "id": "Qwen/Qwen2.5-72B-Instruct", + "name": "Qwen2.5 72B Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-29", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.3 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.2989, + "output": 1.1957, + "cache_read": 0.14945 + } }, - "Qwen/Qwen3-235B-A22B": { - "id": "Qwen/Qwen3-235B-A22B", - "name": "Qwen3 235B A22B", - "family": "qwen", + "zai-org/GLM-5.1-TEE": { + "id": "zai-org/GLM-5.1-TEE", + "name": "GLM 5.1 TEE", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-08", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 202752, + "output": 65535 + }, + "cost": { + "input": 1.05, + "output": 3.5, + "cache_read": 0.525 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", + "zai-org/GLM-4.7-FP8": { + "id": "zai-org/GLM-4.7-FP8", + "name": "GLM 4.7 FP8", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.11, "output": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 202752, + "output": 65535 + }, + "cost": { + "input": 0.2989, + "output": 1.1957, + "cache_read": 0.14945 + } }, - "Qwen/Qwen3-Next-80B-A3B-Instruct": { - "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "name": "Qwen3 Next 80B A3B Instruct", - "family": "qwen", + "zai-org/GLM-5-TEE": { + "id": "zai-org/GLM-5-TEE", + "name": "GLM 5 TEE", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.8 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 202752, + "output": 65535 + }, + "cost": { + "input": 0.95, + "output": 2.55, + "cache_read": 0.475 + } }, - "Qwen/Qwen3.5-397B-A17B-TEE": { - "id": "Qwen/Qwen3.5-397B-A17B-TEE", - "name": "Qwen3.5 397B A17B TEE", - "family": "qwen", - "attachment": true, + "zai-org/GLM-4.7-TEE": { + "id": "zai-org/GLM-4.7-TEE", + "name": "GLM 4.7 TEE", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2026-02-18", - "last_updated": "2026-02-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-29", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.39, "output": 2.34, "cache_read": 0.195 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 202752, + "output": 65535 + }, + "cost": { + "input": 0.39, + "output": 1.75, + "cache_read": 0.195 + } }, - "Qwen/Qwen2.5-VL-32B-Instruct": { - "id": "Qwen/Qwen2.5-VL-32B-Instruct", - "name": "Qwen2.5 VL 32B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, + "zai-org/GLM-4.6V": { + "id": "zai-org/GLM-4.6V", + "name": "GLM 4.6V", + "family": "glm", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.22 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 0.9, + "cache_read": 0.15 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8-TEE": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8-TEE", - "name": "Qwen3 Coder 480B A35B Instruct FP8 TEE", - "family": "qwen", + "zai-org/GLM-5-Turbo": { + "id": "zai-org/GLM-5-Turbo", + "name": "GLM 5 Turbo", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-11", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.22, "output": 0.95, "cache_read": 0.11 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 202752, + "output": 65535 + }, + "cost": { + "input": 0.4891, + "output": 1.9565, + "cache_read": 0.24455 + } }, - "Qwen/Qwen3-30B-A3B-Instruct-2507": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", - "family": "qwen", + "XiaomiMiMo/MiMo-V2-Flash-TEE": { + "id": "XiaomiMiMo/MiMo-V2-Flash-TEE", + "name": "MiMo V2 Flash TEE", + "family": "mimo", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-25", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.33 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.09, + "output": 0.29, + "cache_read": 0.045 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507-TEE": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507-TEE", - "name": "Qwen3 235B A22B Instruct 2507 TEE", - "family": "qwen", + "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": { + "id": "deepseek-ai/DeepSeek-R1-Distill-Llama-70B", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.55, "cache_read": 0.04 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.0272, + "output": 0.1087, + "cache_read": 0.0136 + } }, - "Qwen/Qwen3-VL-235B-A22B-Instruct": { - "id": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "name": "Qwen3 VL 235B A22B Instruct", - "family": "qwen", + "deepseek-ai/DeepSeek-V3.1-TEE": { + "id": "deepseek-ai/DeepSeek-V3.1-TEE", + "name": "DeepSeek V3.1 TEE", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 1, + "cache_read": 0.135 + } }, - "Qwen/Qwen2.5-72B-Instruct": { - "id": "Qwen/Qwen2.5-72B-Instruct", - "name": "Qwen2.5 72B Instruct", - "family": "qwen", + "deepseek-ai/DeepSeek-V3-0324-TEE": { + "id": "deepseek-ai/DeepSeek-V3-0324-TEE", + "name": "DeepSeek V3 0324 TEE", + "family": "deepseek", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1, + "cache_read": 0.125 + } }, - "chutesai/Mistral-Small-3.2-24B-Instruct-2506": { - "id": "chutesai/Mistral-Small-3.2-24B-Instruct-2506", - "name": "Mistral Small 3.2 24B Instruct 2506", - "family": "chutesai", + "deepseek-ai/DeepSeek-R1-0528-TEE": { + "id": "deepseek-ai/DeepSeek-R1-0528-TEE", + "name": "DeepSeek R1 0528 TEE", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.18 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.45, + "output": 2.15, + "cache_read": 0.225 + } }, - "chutesai/Mistral-Small-3.1-24B-Instruct-2503": { - "id": "chutesai/Mistral-Small-3.1-24B-Instruct-2503", - "name": "Mistral Small 3.1 24B Instruct 2503", - "family": "chutesai", + "deepseek-ai/DeepSeek-V3.2-TEE": { + "id": "deepseek-ai/DeepSeek-V3.2-TEE", + "name": "DeepSeek V3.2 TEE", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.11, "cache_read": 0.015 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.28, + "output": 0.42, + "cache_read": 0.14 + } }, - "moonshotai/Kimi-K2-Thinking-TEE": { - "id": "moonshotai/Kimi-K2-Thinking-TEE", - "name": "Kimi K2 Thinking TEE", - "family": "kimi-thinking", + "openai/gpt-oss-120b-TEE": { + "id": "openai/gpt-oss-120b-TEE", + "name": "gpt oss 120b TEE", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 1.75 }, - "limit": { "context": 262144, "output": 65535 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.09, + "output": 0.36, + "cache_read": 0.045 + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi K2 Instruct 0905", - "family": "kimi", + "unsloth/gemma-3-12b-it": { + "id": "unsloth/gemma-3-12b-it", + "name": "gemma 3 12b it", + "family": "unsloth", + "attachment": true, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2025-12-29", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.03, + "output": 0.1, + "cache_read": 0.015 + } + }, + "unsloth/Llama-3.2-3B-Instruct": { + "id": "unsloth/Llama-3.2-3B-Instruct", + "name": "Llama 3.2 3B Instruct", + "family": "unsloth", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, + "temperature": true, + "release_date": "2025-02-12", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.01, + "output": 0.0136, + "cache_read": 0.005 + } + }, + "unsloth/gemma-3-4b-it": { + "id": "unsloth/gemma-3-4b-it", + "name": "gemma 3 4b it", + "family": "unsloth", + "attachment": true, + "reasoning": false, + "tool_call": false, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.39, "output": 1.9, "cache_read": 0.195 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 96000, + "output": 96000 + }, + "cost": { + "input": 0.01, + "output": 0.0272, + "cache_read": 0.005 + } }, - "moonshotai/Kimi-K2.5-TEE": { - "id": "moonshotai/Kimi-K2.5-TEE", - "name": "Kimi K2.5 TEE", - "family": "kimi", + "unsloth/Llama-3.2-1B-Instruct": { + "id": "unsloth/Llama-3.2-1B-Instruct", + "name": "Llama 3.2 1B Instruct", + "family": "unsloth", "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 262144, "output": 65535 } + "limit": { + "context": 16384, + "output": 8192 + }, + "cost": { + "input": 0.01, + "output": 0.0109, + "cache_read": 0.005 + } }, - "OpenGVLab/InternVL3-78B-TEE": { - "id": "OpenGVLab/InternVL3-78B-TEE", - "name": "InternVL3 78B TEE", - "family": "opengvlab", + "unsloth/Mistral-Nemo-Instruct-2407": { + "id": "unsloth/Mistral-Nemo-Instruct-2407", + "name": "Mistral Nemo Instruct 2407", + "family": "unsloth", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": true, "temperature": true, - "release_date": "2025-01-06", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-29", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.39 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.02, + "output": 0.04, + "cache_read": 0.01 + } }, - "XiaomiMiMo/MiMo-V2-Flash": { - "id": "XiaomiMiMo/MiMo-V2-Flash", - "name": "MiMo V2 Flash", - "family": "mimo", - "attachment": false, - "reasoning": true, + "unsloth/gemma-3-27b-it": { + "id": "unsloth/gemma-3-27b-it", + "name": "gemma 3 27b it", + "family": "unsloth", + "attachment": true, + "reasoning": false, "tool_call": true, - "structured_output": false, + "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.29 }, - "limit": { "context": 262144, "output": 32000 } + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 0.0272, + "output": 0.1087, + "cache_read": 0.0136 + } }, - "tngtech/TNG-R1T-Chimera-TEE": { - "id": "tngtech/TNG-R1T-Chimera-TEE", - "name": "TNG R1T Chimera TEE", - "family": "tngtech", - "attachment": false, + "google/gemma-4-31B-turbo-TEE": { + "id": "google/gemma-4-31B-turbo-TEE", + "name": "gemma 4 31B turbo TEE", + "family": "gemma", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-25", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.13, + "output": 0.38, + "cache_read": 0.065 + } + }, + "moonshotai/Kimi-K2.6-TEE": { + "id": "moonshotai/Kimi-K2.6-TEE", + "name": "Kimi K2.6 TEE", + "family": "kimi", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "knowledge": "2025-12", + "release_date": "2026-04-20", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65535 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.475 + } + }, + "moonshotai/Kimi-K2.5-TEE": { + "id": "moonshotai/Kimi-K2.5-TEE", + "name": "Kimi K2.5 TEE", + "family": "kimi", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2026-01-27", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.25, "output": 0.85 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 262144, + "output": 65535 + }, + "cost": { + "input": 0.44, + "output": 2, + "cache_read": 0.22 + } }, - "tngtech/TNG-R1T-Chimera-Turbo": { - "id": "tngtech/TNG-R1T-Chimera-Turbo", - "name": "TNG R1T Chimera Turbo", + "MiniMaxAI/MiniMax-M2.5-TEE": { + "id": "MiniMaxAI/MiniMax-M2.5-TEE", + "name": "MiniMax M2.5 TEE", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-15", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.22, "output": 0.6 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 196608, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 1.2, + "cache_read": 0.075 + } }, - "tngtech/DeepSeek-R1T-Chimera": { - "id": "tngtech/DeepSeek-R1T-Chimera", - "name": "DeepSeek R1T Chimera", - "family": "tngtech", - "attachment": false, - "reasoning": true, + "rednote-hilab/dots.ocr": { + "id": "rednote-hilab/dots.ocr", + "name": "dots.ocr", + "family": "rednote", + "attachment": true, + "reasoning": false, "tool_call": false, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.01, + "output": 0.0109, + "cache_read": 0.005 + } }, - "tngtech/DeepSeek-TNG-R1T2-Chimera": { - "id": "tngtech/DeepSeek-TNG-R1T2-Chimera", - "name": "DeepSeek TNG R1T2 Chimera", - "family": "tngtech", + "tngtech/DeepSeek-TNG-R1T2-Chimera-TEE": { + "id": "tngtech/DeepSeek-TNG-R1T2-Chimera-TEE", + "name": "DeepSeek TNG R1T2 Chimera TEE", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 0.85 }, - "limit": { "context": 163840, "output": 163840 } - }, - "mistralai/Devstral-2-123B-Instruct-2512-TEE": { - "id": "mistralai/Devstral-2-123B-Instruct-2512-TEE", - "name": "Devstral 2 123B Instruct 2512 TEE", - "attachment": false, - "reasoning": false, - "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01-10", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-25", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.22 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.3, + "output": 1.1, + "cache_read": 0.15 + } } } }, - "lmstudio": { - "id": "lmstudio", - "env": ["LMSTUDIO_API_KEY"], + "dinference": { + "id": "dinference", + "env": ["DINFERENCE_API_KEY"], "npm": "@ai-sdk/openai-compatible", - "api": "http://127.0.0.1:1234/v1", - "name": "LMStudio", - "doc": "https://lmstudio.ai/models", + "api": "https://api.dinference.com/v1", + "name": "DInference", + "doc": "https://dinference.com", "models": { - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT OSS 120B", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08", + "last_updated": "2025-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.0675, + "output": 0.27 + } }, - "qwen/qwen3-coder-30b": { - "id": "qwen/qwen3-coder-30b", - "name": "Qwen3 Coder 30B", - "family": "qwen", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.45, + "output": 1.65 + } }, - "qwen/qwen3-30b-a3b-2507": { - "id": "qwen/qwen3-30b-a3b-2507", - "name": "Qwen3 30B A3B 2507", - "family": "qwen", + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 16384 } - } - } - }, - "kimi-for-coding": { - "id": "kimi-for-coding", - "env": ["KIMI_API_KEY"], - "npm": "@ai-sdk/anthropic", - "api": "https://api.kimi.com/coding/v1", - "name": "Kimi For Coding", - "doc": "https://www.kimi.com/coding/docs/en/third-party-agents.html", - "models": { - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 2.4 + } + }, + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-11", - "last_updated": "2025-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 3.89 + } }, - "k2p5": { - "id": "k2p5", - "name": "Kimi K2.5", - "family": "kimi-thinking", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 0.22, + "output": 0.88 + } } } }, - "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", + "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": { - "qwen-math-plus": { - "id": "qwen-math-plus", - "name": "Qwen Math Plus", - "family": "qwen", + "gpt-5.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "family": "gpt-codex", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-08-16", - "last_updated": "2024-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.574, "output": 1.721 }, - "limit": { "context": 4096, "output": 3072 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "qwen2-5-72b-instruct": { - "id": "qwen2-5-72b-instruct", - "name": "Qwen2.5 72B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "gemini-3.1-flash-lite-preview": { + "id": "gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.574, "output": 1.721 }, - "limit": { "context": 131072, "output": 8192 } + "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 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible" + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "cache_write": 1 + } }, - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3-Coder 30B-A3B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.216, "output": 0.861 }, - "limit": { "context": 262144, "output": 65536 } + "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/openai-compatible" + }, + "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 + } + } }, - "qwen3-8b": { - "id": "qwen3-8b", - "name": "Qwen3 8B", - "family": "qwen", - "attachment": false, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.072, "output": 0.287, "reasoning": 0.717 }, - "limit": { "context": 131072, "output": 8192 } + "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 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible" + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.03 + } }, - "qwen-mt-plus": { - "id": "qwen-mt-plus", - "name": "Qwen-MT Plus", - "family": "qwen", + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "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"] }, + "reasoning": true, + "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"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.259, "output": 0.775 }, - "limit": { "context": 16384, "output": 8192 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "qwen3.5-plus": { - "id": "qwen3.5-plus", - "name": "Qwen3.5 Plus", - "family": "qwen", + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible" + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } + }, + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible" + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } + }, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, "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"] }, + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.573, "output": 3.44, "reasoning": 3.44 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "deepseek-v3-2-exp": { - "id": "deepseek-v3-2-exp", - "name": "DeepSeek V3.2 Exp", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible" + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + } + }, + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek-V3.2", "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": { + "npm": "@ai-sdk/openai-compatible" + }, + "cost": { + "input": 0.28, + "output": 0.42 + } + }, + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt-codex", + "attachment": false, + "reasoning": true, + "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, - "cost": { "input": 0.287, "output": 0.431 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "deepseek-r1-distill-llama-70b": { - "id": "deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill Llama 70B", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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" + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } + }, + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.287, "output": 0.861 }, - "limit": { "context": 32768, "output": 16384 } + "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.145 + } + } + } + }, + "deepinfra": { + "id": "deepinfra", + "env": ["DEEPINFRA_API_KEY"], + "npm": "@ai-sdk/deepinfra", + "name": "Deep Infra", + "doc": "https://deepinfra.com/models", + "models": { + "Qwen/Qwen3.5-397B-A17B": { + "id": "Qwen/Qwen3.5-397B-A17B", + "name": "Qwen 3.5 397B A17B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-02-01", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 81920 + }, + "cost": { + "input": 0.54, + "output": 3.4 + } }, - "qwen2-5-omni-7b": { - "id": "qwen2-5-omni-7b", - "name": "Qwen2.5-Omni 7B", + "Qwen/Qwen3.5-35B-A3B": { + "id": "Qwen/Qwen3.5-35B-A3B", + "name": "Qwen 3.5 35B A3B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-02-01", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 81920 + }, + "cost": { + "input": 0.2, + "output": 0.95 + } + }, + "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo", + "name": "Qwen3 Coder 480B A35B Instruct Turbo", "family": "qwen", "attachment": false, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.087, "output": 0.345, "input_audio": 5.448 }, - "limit": { "context": 32768, "output": 2048 } + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "qwen-plus-character": { - "id": "qwen-plus-character", - "name": "Qwen Plus Character", + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "name": "Qwen3 Coder 480B A35B Instruct", "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, - "cost": { "input": 0.115, "output": 0.287 }, - "limit": { "context": 32768, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 0.4, + "output": 1.6 + } }, - "qwen-turbo": { - "id": "qwen-turbo", - "name": "Qwen Turbo", + "Qwen/Qwen3.6-35B-A3B": { + "id": "Qwen/Qwen3.6-35B-A3B", + "name": "Qwen3.6 35B A3B", "family": "qwen", - "attachment": false, + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.044, "output": 0.087, "reasoning": 0.431 }, - "limit": { "context": 1000000, "output": 16384 } + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 81920 + }, + "cost": { + "input": 0.2, + "output": 1 + } }, - "qwen-vl-max": { - "id": "qwen-vl-max", - "name": "Qwen-VL Max", - "family": "qwen", + "zai-org/GLM-4.7-Flash": { + "id": "zai-org/GLM-4.7-Flash", + "name": "GLM-4.7-Flash", + "family": "glm-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-04-08", - "last_updated": "2025-08-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.23, "output": 0.574 }, - "limit": { "context": 131072, "output": 8192 } + "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.06, + "output": 0.4 + } }, - "qwen-doc-turbo": { - "id": "qwen-doc-turbo", - "name": "Qwen Doc Turbo", - "family": "qwen", + "zai-org/GLM-4.5": { + "id": "zai-org/GLM-4.5", + "name": "GLM-4.5", + "family": "glm", "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, - "cost": { "input": 0.087, "output": 0.144 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "qwq-32b": { - "id": "qwq-32b", - "name": "QwQ 32B", - "family": "qwen", + "zai-org/GLM-4.7": { + "id": "zai-org/GLM-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-12", - "last_updated": "2024-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.287, "output": 0.861 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 0.43, + "output": 1.75, + "cache_read": 0.08 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Moonshot Kimi K2 Thinking", - "family": "kimi", + "zai-org/GLM-5.1": { + "id": "zai-org/GLM-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.574, "output": 2.294 }, - "limit": { "context": 262144, "output": 16384 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } }, - "qwen-omni-turbo-realtime": { - "id": "qwen-omni-turbo-realtime", - "name": "Qwen-Omni Turbo Realtime", - "family": "qwen", + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 0.23, "output": 0.918, "input_audio": 3.584, "output_audio": 7.168 }, - "limit": { "context": 32768, "output": 2048 } + "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 + }, + "cost": { + "input": 0.8, + "output": 2.56, + "cache_read": 0.16 + } }, - "deepseek-r1": { - "id": "deepseek-r1", - "name": "DeepSeek R1", - "family": "deepseek-thinking", - "attachment": false, + "zai-org/GLM-4.6V": { + "id": "zai-org/GLM-4.6V", + "name": "GLM-4.6V", + "family": "glm", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.574, "output": 2.294 }, - "limit": { "context": 131072, "output": 16384 } + "knowledge": "2025-04", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "qwen-vl-plus": { - "id": "qwen-vl-plus", - "name": "Qwen-VL Plus", - "family": "qwen", + "zai-org/GLM-4.6": { + "id": "zai-org/GLM-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-01-25", - "last_updated": "2025-08-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.115, "output": 0.287 }, - "limit": { "context": 131072, "output": 8192 } + "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.43, + "output": 1.74, + "cache_read": 0.08 + } }, - "qwen-max": { - "id": "qwen-max", - "name": "Qwen Max", - "family": "qwen", + "meta-llama/Llama-4-Scout-17B-16E-Instruct": { + "id": "meta-llama/Llama-4-Scout-17B-16E-Instruct", + "name": "Llama 4 Scout 17B", + "family": "llama", "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, - "cost": { "input": 0.345, "output": 1.377 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 10000000, + "output": 16384 + }, + "cost": { + "input": 0.08, + "output": 0.3 + } }, - "qvq-max": { - "id": "qvq-max", - "name": "QVQ Max", - "family": "qvq", + "meta-llama/Llama-3.1-8B-Instruct": { + "id": "meta-llama/Llama-3.1-8B-Instruct", + "name": "Llama 3.1 8B", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 1.147, "output": 4.588 }, - "limit": { "context": 131072, "output": 8192 } + "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.05 + } }, - "qwen-long": { - "id": "qwen-long", - "name": "Qwen Long", - "family": "qwen", + "meta-llama/Llama-3.1-70B-Instruct": { + "id": "meta-llama/Llama-3.1-70B-Instruct", + "name": "Llama 3.1 70B", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-01-25", - "last_updated": "2025-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.072, "output": 0.287 }, - "limit": { "context": 10000000, "output": 8192 } + "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.4, + "output": 0.4 + } }, - "qwen-deep-research": { - "id": "qwen-deep-research", - "name": "Qwen Deep Research", - "family": "qwen", + "meta-llama/Llama-3.1-8B-Instruct-Turbo": { + "id": "meta-llama/Llama-3.1-8B-Instruct-Turbo", + "name": "Llama 3.1 8B Turbo", + "family": "llama", "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, - "cost": { "input": 7.742, "output": 23.367 }, - "limit": { "context": 1000000, "output": 32768 } + "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.03 + } }, - "moonshot-kimi-k2-instruct": { - "id": "moonshot-kimi-k2-instruct", - "name": "Moonshot Kimi K2 Instruct", - "family": "kimi", + "meta-llama/Llama-3.3-70B-Instruct-Turbo": { + "id": "meta-llama/Llama-3.3-70B-Instruct-Turbo", + "name": "Llama 3.3 70B Turbo", + "family": "llama", "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"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.574, "output": 2.294 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.32 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Moonshot Kimi K2.5", - "family": "kimi", + "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", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.574, "output": 2.411 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "qwen2-5-coder-32b-instruct": { - "id": "qwen2-5-coder-32b-instruct", - "name": "Qwen2.5-Coder 32B Instruct", - "family": "qwen", + "meta-llama/Llama-3.1-70B-Instruct-Turbo": { + "id": "meta-llama/Llama-3.1-70B-Instruct-Turbo", + "name": "Llama 3.1 70B Turbo", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-11", - "last_updated": "2024-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.287, "output": 0.861 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } }, - "deepseek-v3": { - "id": "deepseek-v3", - "name": "DeepSeek V3", - "family": "deepseek", + "deepseek-ai/DeepSeek-R1-0528": { + "id": "deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek-R1-0528", "attachment": false, - "reasoning": false, - "tool_call": true, + "reasoning": true, + "tool_call": false, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.287, "output": 1.147 }, - "limit": { "context": 65536, "output": 8192 } + "limit": { + "context": 163840, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 2.15, + "cache_read": 0.35 + } }, - "qwq-plus": { - "id": "qwq-plus", - "name": "QwQ Plus", - "family": "qwen", + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek-V3.2", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-03-05", - "last_updated": "2025-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.23, "output": 0.574 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 163840, + "output": 64000 + }, + "cost": { + "input": 0.26, + "output": 0.38, + "cache_read": 0.13 + } }, - "qwen3-omni-flash": { - "id": "qwen3-omni-flash", - "name": "Qwen3-Omni Flash", - "family": "qwen", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.058, "output": 0.23, "input_audio": 3.584, "output_audio": 7.168 }, - "limit": { "context": 65536, "output": 16384 } + "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 + } }, - "qwen2-5-coder-7b-instruct": { - "id": "qwen2-5-coder-7b-instruct", - "name": "Qwen2.5-Coder 7B Instruct", - "family": "qwen", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-11", - "last_updated": "2024-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.144, "output": 0.287 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.24 + } }, - "deepseek-r1-distill-qwen-1-5b": { - "id": "deepseek-r1-distill-qwen-1-5b", - "name": "DeepSeek R1 Distill Qwen 1.5B", - "family": "qwen", + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2025-11-06", + "last_updated": "2025-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.47, + "output": 2 + } }, - "deepseek-r1-distill-qwen-14b": { - "id": "deepseek-r1-distill-qwen-14b", - "name": "DeepSeek R1 Distill Qwen 14B", - "family": "qwen", - "attachment": false, + "moonshotai/Kimi-K2.6": { + "id": "moonshotai/Kimi-K2.6", + "name": "Kimi K2.6", + "family": "kimi", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.144, "output": 0.431 }, - "limit": { "context": 32768, "output": 16384 } + "knowledge": "2024-04", + "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.75, + "output": 3.5, + "cache_read": 0.15 + } }, - "qwen3-14b": { - "id": "qwen3-14b", - "name": "Qwen3 14B", - "family": "qwen", + "moonshotai/Kimi-K2-Instruct": { + "id": "moonshotai/Kimi-K2-Instruct", + "name": "Kimi K2", + "family": "kimi", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-07-11", + "last_updated": "2025-07-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.144, "output": 0.574, "reasoning": 1.434 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 2 + } }, - "qwen-plus": { - "id": "qwen-plus", - "name": "Qwen Plus", - "family": "qwen", + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi K2 0905", + "family": "kimi", "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 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.15 + } + }, + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "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, - "cost": { "input": 0.115, "output": 0.287, "reasoning": 1.147 }, - "limit": { "context": 1000000, "output": 32768 } + "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.5, + "output": 2.8 + } }, - "deepseek-r1-distill-qwen-7b": { - "id": "deepseek-r1-distill-qwen-7b", - "name": "DeepSeek R1 Distill Qwen 7B", - "family": "qwen", + "MiniMaxAI/MiniMax-M2": { + "id": "MiniMaxAI/MiniMax-M2", + "name": "MiniMax M2", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.072, "output": 0.144 }, - "limit": { "context": 32768, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.254, + "output": 1.02 + } }, - "qwen2-5-7b-instruct": { - "id": "qwen2-5-7b-instruct", - "name": "Qwen2.5 7B Instruct", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.072, "output": 0.144 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.27, + "output": 0.95, + "cache_read": 0.03, + "cache_write": 0.375 + } }, - "qwen2-5-32b-instruct": { - "id": "qwen2-5-32b-instruct", - "name": "Qwen2.5 32B Instruct", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.1": { + "id": "MiniMaxAI/MiniMax-M2.1", + "name": "MiniMax M2.1", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.287, "output": 0.861 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.28, + "output": 1.2 + } }, - "qwen3-omni-flash-realtime": { - "id": "qwen3-omni-flash-realtime", - "name": "Qwen3-Omni Flash Realtime", - "family": "qwen", - "attachment": false, - "reasoning": false, + "anthropic/claude-3-7-sonnet-latest": { + "id": "anthropic/claude-3-7-sonnet-latest", + "name": "Claude Sonnet 3.7 (Latest)", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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"] }, + "knowledge": "2024-10-31", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.23, "output": 0.918, "input_audio": 3.584, "output_audio": 7.168 }, - "limit": { "context": 65536, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3.3, + "output": 16.5, + "cache_read": 0.33 + } }, - "qwen-math-turbo": { - "id": "qwen-math-turbo", - "name": "Qwen Math Turbo", - "family": "qwen", - "attachment": false, - "reasoning": false, + "anthropic/claude-4-opus": { + "id": "anthropic/claude-4-opus", + "name": "Claude Opus 4", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.287, "output": 0.861 }, - "limit": { "context": 4096, "output": 3072 } - }, - "tongyi-intent-detect-v3": { - "id": "tongyi-intent-detect-v3", - "name": "Tongyi Intent Detect V3", - "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"] }, + "knowledge": "2025-03-31", + "release_date": "2025-06-12", + "last_updated": "2025-06-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.058, "output": 0.144 }, - "limit": { "context": 8192, "output": 1024 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 16.5, + "output": 82.5 + } }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen3-Coder 480B-A35B Instruct", - "family": "qwen", + "deepseek-ai/DeepSeek-V4-Flash": { + "id": "deepseek-ai/DeepSeek-V4-Flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.861, "output": 3.441 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "qwen3-next-80b-a3b-thinking": { - "id": "qwen3-next-80b-a3b-thinking", - "name": "Qwen3-Next 80B-A3B (Thinking)", - "family": "qwen", + "deepseek-ai/DeepSeek-V4-Pro": { + "id": "deepseek-ai/DeepSeek-V4-Pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.144, "output": 1.434 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 1.74, + "output": 3.48, + "cache_read": 0.145 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "google/gemma-4-26B-A4B-it": { + "id": "google/gemma-4-26B-A4B-it", + "name": "Gemma 4 26B", + "family": "gemma", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.07, + "output": 0.34 + } }, - "qwen3-vl-30b-a3b": { - "id": "qwen3-vl-30b-a3b", - "name": "Qwen3-VL 30B-A3B", - "family": "qwen", + "google/gemma-4-31B-it": { + "id": "google/gemma-4-31B-it", + "name": "Gemma 4 31B", + "family": "gemma", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.108, "output": 0.431, "reasoning": 1.076 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.13, + "output": 0.38 + } }, - "qwen3-next-80b-a3b-instruct": { - "id": "qwen3-next-80b-a3b-instruct", - "name": "Qwen3-Next 80B-A3B Instruct", - "family": "qwen", + "xiaomi/mimo-v2.5-pro": { + "id": "xiaomi/mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09", - "last_updated": "2025-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.144, "output": 0.574 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1048576, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "deepseek-r1-distill-qwen-32b": { - "id": "deepseek-r1-distill-qwen-32b", - "name": "DeepSeek R1 Distill Qwen 32B", - "family": "qwen", - "attachment": false, + "xiaomi/mimo-v2.5": { + "id": "xiaomi/mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.287, "output": 0.861 }, - "limit": { "context": 32768, "output": 16384 } - }, - "qwen-mt-turbo": { - "id": "qwen-mt-turbo", - "name": "Qwen-MT Turbo", - "family": "qwen", + "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 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08, + "context_over_200k": { + "input": 0.8, + "output": 4, + "cache_read": 0.16 + }, + "tiers": [ + { + "input": 0.8, + "output": 4, + "cache_read": 0.16, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } + } + } + }, + "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": { + "qwen3-235b-a22b": { + "id": "qwen3-235b-a22b", + "name": "Qwen 3 235B A22B", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.101, "output": 0.28 }, - "limit": { "context": 16384, "output": 8192 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "qwen3-vl-plus": { - "id": "qwen3-vl-plus", - "name": "Qwen3-VL Plus", - "family": "qwen", - "attachment": false, + "doubao-seed-1.6-flash": { + "id": "doubao-seed-1.6-flash", + "name": "Doubao-Seed 1.6 Flash", + "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-08-15", + "last_updated": "2025-08-15", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.143353, "output": 1.433525, "reasoning": 4.300576 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 256000, + "output": 32000 + } }, - "deepseek-v3-1": { - "id": "deepseek-v3-1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "qwen3-235b-a22b-instruct-2507": { + "id": "qwen3-235b-a22b-instruct-2507", + "name": "Qwen3 235b A22B Instruct 2507", "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"] }, + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.574, "output": 1.721 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 262144, + "output": 64000 + } }, - "qwen3-235b-a22b": { - "id": "qwen3-235b-a22b", - "name": "Qwen3 235B-A22B", - "family": "qwen", - "attachment": false, + "doubao-seed-2.0-code": { + "id": "doubao-seed-2.0-code", + "name": "Doubao Seed 2.0 Code", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.287, "output": 1.147, "reasoning": 2.868 }, - "limit": { "context": 131072, "output": 16384 } + "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 + } }, - "qwen2-5-vl-7b-instruct": { - "id": "qwen2-5-vl-7b-instruct", - "name": "Qwen2.5-VL 7B Instruct", - "family": "qwen", + "deepseek-v3-0324": { + "id": "deepseek-v3-0324", + "name": "DeepSeek-V3-0324", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.287, "output": 0.717 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16000 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", + "doubao-1.5-thinking-pro": { + "id": "doubao-1.5-thinking-pro", + "name": "Doubao 1.5 Thinking Pro", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.86, "output": 3.15 }, - "limit": { "context": 202752, "output": 16384 } - }, - "qwen-vl-ocr": { - "id": "qwen-vl-ocr", - "name": "Qwen-VL OCR", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-10-28", - "last_updated": "2025-04-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.717, "output": 0.717 }, - "limit": { "context": 34096, "output": 4096 } + "limit": { + "context": 128000, + "output": 16000 + } }, - "qwen-omni-turbo": { - "id": "qwen-omni-turbo", - "name": "Qwen-Omni Turbo", - "family": "qwen", - "attachment": false, - "reasoning": false, + "claude-3.7-sonnet": { + "id": "claude-3.7-sonnet", + "name": "Claude 3.7 Sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-01-19", - "last_updated": "2025-03-26", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text", "audio"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.058, "output": 0.23, "input_audio": 3.584, "output_audio": 7.168 }, - "limit": { "context": 32768, "output": 2048 } + "limit": { + "context": 200000, + "output": 128000 + } }, "qwen3.5-397b-a17b": { "id": "qwen3.5-397b-a17b", - "name": "Qwen3.5 397B-A17B", - "family": "qwen", - "attachment": false, - "reasoning": true, - "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": true, - "cost": { "input": 0.43, "output": 2.58, "reasoning": 2.58 }, - "limit": { "context": 262144, "output": 65536 } - }, - "qwen-flash": { - "id": "qwen-flash", - "name": "Qwen Flash", - "family": "qwen", - "attachment": false, + "name": "Qwen3.5 397B A17B", + "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-02-22", + "last_updated": "2026-02-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.022, "output": 0.216 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 256000, + "output": 64000 + } }, - "qwen2-5-math-7b-instruct": { - "id": "qwen2-5-math-7b-instruct", - "name": "Qwen2.5-Math 7B Instruct", - "family": "qwen", - "attachment": false, + "qwen-vl-max-2025-01-25": { + "id": "qwen-vl-max-2025-01-25", + "name": "Qwen VL-MAX-2025-01-25", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.144, "output": 0.287 }, - "limit": { "context": 4096, "output": 3072 } + "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 + } }, - "deepseek-r1-0528": { - "id": "deepseek-r1-0528", - "name": "DeepSeek R1 0528", - "family": "deepseek-thinking", + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3 32B", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.574, "output": 2.294 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 40000, + "output": 4096 + } }, - "qwen3-max": { - "id": "qwen3-max", - "name": "Qwen3 Max", - "family": "qwen", + "doubao-1.5-pro-32k": { + "id": "doubao-1.5-pro-32k", + "name": "Doubao 1.5 Pro 32k", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.861, "output": 3.441 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 128000, + "output": 12000 + } }, - "qwen2-5-vl-72b-instruct": { - "id": "qwen2-5-vl-72b-instruct", - "name": "Qwen2.5-VL 72B Instruct", - "family": "qwen", - "attachment": false, + "qwen2.5-vl-72b-instruct": { + "id": "qwen2.5-vl-72b-instruct", + "name": "Qwen 2.5 VL 72B Instruct", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2.294, "output": 6.881 }, - "limit": { "context": 131072, "output": 8192 } - }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3 32B", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.287, "output": 1.147, "reasoning": 2.868 }, - "limit": { "context": 131072, "output": 16384 } + "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": 8192 + } }, - "qwen2-5-math-72b-instruct": { - "id": "qwen2-5-math-72b-instruct", - "name": "Qwen2.5-Math 72B Instruct", - "family": "qwen", - "attachment": false, + "gemini-2.0-flash": { + "id": "gemini-2.0-flash", + "name": "Gemini 2.0 Flash", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.574, "output": 1.721 }, - "limit": { "context": 4096, "output": 3072 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 8192 + } }, - "deepseek-r1-distill-llama-8b": { - "id": "deepseek-r1-distill-llama-8b", - "name": "DeepSeek R1 Distill Llama 8B", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, + "qwen3-vl-30b-a3b-thinking": { + "id": "qwen3-vl-30b-a3b-thinking", + "name": "Qwen3-Vl 30b A3b Thinking", + "attachment": true, + "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"] }, + "release_date": "2026-02-09", + "last_updated": "2026-02-09", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 16384 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "qwen3-asr-flash": { - "id": "qwen3-asr-flash", - "name": "Qwen3-ASR Flash", - "family": "qwen", - "attachment": false, + "gemini-3.0-pro-image-preview": { + "id": "gemini-3.0-pro-image-preview", + "name": "Gemini 3.0 Pro Image Preview", + "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"] }, + "structured_output": false, + "temperature": true, + "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 + } + }, + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.032, "output": 0.032 }, - "limit": { "context": 53248, "output": 4096 } + "limit": { + "context": 1048576, + "output": 65536 + } }, - "qwen3-coder-flash": { - "id": "qwen3-coder-flash", - "name": "Qwen3 Coder Flash", - "family": "qwen", - "attachment": false, - "reasoning": false, + "claude-4.5-opus": { + "id": "claude-4.5-opus", + "name": "Claude 4.5 Opus", + "attachment": true, + "reasoning": true, "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"] }, + "release_date": "2025-11-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.144, "output": 0.574 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 200000, + "output": 200000 + } }, - "qwen2-5-14b-instruct": { - "id": "qwen2-5-14b-instruct", - "name": "Qwen2.5 14B Instruct", - "family": "qwen", + "deepseek-r1": { + "id": "deepseek-r1", + "name": "DeepSeek-R1", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.144, "output": 0.431 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32000 + } }, - "qwen3-vl-235b-a22b": { - "id": "qwen3-vl-235b-a22b", - "name": "Qwen3-VL 235B-A22B", - "family": "qwen", - "attachment": false, + "claude-4.0-opus": { + "id": "claude-4.0-opus", + "name": "Claude 4.0 Opus", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.286705, "output": 1.14682, "reasoning": 2.867051 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 32000 + } }, - "qwen3.5-flash": { - "id": "qwen3.5-flash", - "name": "Qwen3.5 Flash", - "family": "qwen", + "claude-4.5-haiku": { + "id": "claude-4.5-haiku", + "name": "Claude 4.5 Haiku", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-23", - "last_updated": "2026-02-23", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-10-16", + "last_updated": "2025-10-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.172, "output": 1.72, "reasoning": 1.72 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 200000, + "output": 64000 + } }, - "qwen3-coder-plus": { - "id": "qwen3-coder-plus", - "name": "Qwen3 Coder Plus", - "family": "qwen", + "qwen3-max": { + "id": "qwen3-max", + "name": "Qwen3 Max", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 65536 + } }, - "MiniMax/MiniMax-M2.5": { - "id": "MiniMax/MiniMax-M2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "gemini-3.0-flash-preview": { + "id": "gemini-3.0-flash-preview", + "name": "Gemini 3.0 Flash Preview", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.301, "output": 1.205 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2025-12-18", + "last_updated": "2025-12-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 64000 + } }, - "kimi/kimi-k2.5": { - "id": "kimi/kimi-k2.5", - "name": "kimi/kimi-k2.5", - "family": "kimi", + "gemini-2.5-flash-image": { + "id": "gemini-2.5-flash-image", + "name": "Gemini 2.5 Flash Image", + "attachment": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "temperature": true, + "release_date": "2025-10-22", + "last_updated": "2025-10-22", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "output": 8192 + } + }, + "glm-4.5": { + "id": "glm-4.5", + "name": "GLM 4.5", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "structured_output": false, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 98304 + } }, - "siliconflow/deepseek-v3.1-terminus": { - "id": "siliconflow/deepseek-v3.1-terminus", - "name": "siliconflow/deepseek-v3.1-terminus", - "family": "deepseek", - "attachment": false, + "claude-3.5-sonnet": { + "id": "claude-3.5-sonnet", + "name": "Claude 3.5 Sonnet", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-09-09", + "last_updated": "2025-09-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 200000, + "output": 8200 + } }, - "siliconflow/deepseek-v3-0324": { - "id": "siliconflow/deepseek-v3-0324", - "name": "siliconflow/deepseek-v3-0324", - "family": "deepseek", - "attachment": false, - "reasoning": false, + "claude-4.0-sonnet": { + "id": "claude-4.0-sonnet", + "name": "Claude 4.0 Sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2024-12-26", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 200000, + "output": 64000 + } }, - "siliconflow/deepseek-r1-0528": { - "id": "siliconflow/deepseek-r1-0528", - "name": "siliconflow/deepseek-r1-0528", - "family": "deepseek-thinking", + "qwen3-30b-a3b-instruct-2507": { + "id": "qwen3-30b-a3b-instruct-2507", + "name": "Qwen3 30b A3b Instruct 2507", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-04", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2.18 }, - "limit": { "context": 163840, "output": 32768 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "siliconflow/deepseek-v3.2": { - "id": "siliconflow/deepseek-v3.2", - "name": "siliconflow/deepseek-v3.2", - "family": "deepseek", - "attachment": false, + "doubao-seed-1.6-thinking": { + "id": "doubao-seed-1.6-thinking", + "name": "Doubao-Seed 1.6 Thinking", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2025-12-03", - "last_updated": "2025-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-15", + "last_updated": "2025-08-15", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.42 }, - "limit": { "context": 163840, "output": 65536 } - } - } - }, - "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": { - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT-5.2-Codex", - "family": "gpt-codex", + "limit": { + "context": 256000, + "output": 32000 + } + }, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 64000 + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "GPT-5.1-Codex-Mini", - "family": "gpt-codex", - "attachment": true, + "qwen3-235b-a22b-thinking-2507": { + "id": "qwen3-235b-a22b-thinking-2507", + "name": "Qwen3 235B A22B Thinking 2507", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 100000 } + "limit": { + "context": 262144, + "output": 4096 + } }, - "openai/gpt-5.4-pro": { - "id": "openai/gpt-5.4-pro", - "name": "GPT-5.4 Pro", - "family": "gpt-pro", - "attachment": true, + "qwen3-next-80b-a3b-thinking": { + "id": "qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", + "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2025-09-12", + "last_updated": "2025-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 180, "cache_read": 30 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "limit": { + "context": 131072, + "output": 32768 + } }, - "openai/gpt-5-pro": { - "id": "openai/gpt-5-pro", - "name": "GPT-5 Pro", - "family": "gpt-pro", - "attachment": true, + "qwen3-30b-a3b-thinking-2507": { + "id": "qwen3-30b-a3b-thinking-2507", + "name": "Qwen3 30b A3b Thinking 2507", + "attachment": false, "reasoning": true, "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"] }, + "structured_output": false, + "temperature": true, + "release_date": "2026-02-04", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 272000 } + "limit": { + "context": 126000, + "output": 32000 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "GPT-5", - "family": "gpt", - "attachment": true, + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM 4.5 Air", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-09-30", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "audio", "image", "video"], "output": ["text", "audio", "image"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 131000, + "output": 4096 + } }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "GPT-5.3-Codex", - "family": "gpt-codex", - "attachment": true, + "deepseek-v3.1": { + "id": "deepseek-v3.1", + "name": "DeepSeek-V3.1", + "attachment": false, "reasoning": true, "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"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", - "attachment": true, + "qwen3-30b-a3b": { + "id": "qwen3-30b-a3b", + "name": "Qwen3 30B A3B", + "attachment": false, "reasoning": true, "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"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 40000, + "output": 4096 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "GPT-4o Mini", - "family": "gpt-mini", + "claude-4.1-opus": { + "id": "claude-4.1-opus", + "name": "Claude 4.1 Opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 32000 + } }, - "openai/gpt-5.1-codex-max": { - "id": "openai/gpt-5.1-codex-max", - "name": "GPT-5.1-Codex-Max", - "family": "gpt-codex", + "doubao-seed-2.0-mini": { + "id": "doubao-seed-2.0-mini", + "name": "Doubao Seed 2.0 Mini", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "output": 32000 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", - "attachment": true, + "qwen3-next-80b-a3b-instruct": { + "id": "qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", + "attachment": false, "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"], "output": ["text"] }, + "release_date": "2025-09-12", + "last_updated": "2025-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 131072, + "output": 32768 + } }, - "openai/gpt-5.1-chat": { - "id": "openai/gpt-5.1-chat", - "name": "GPT-5.1 Chat", - "family": "gpt-codex", + "doubao-seed-1.6": { + "id": "doubao-seed-1.6", + "name": "Doubao-Seed 1.6", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-15", + "last_updated": "2025-08-15", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "output": 32000 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "qwen2.5-vl-7b-instruct": { + "id": "qwen2.5-vl-7b-instruct", + "name": "Qwen 2.5 VL 7B Instruct", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { - "input": 2.5, - "output": 15, - "cache_read": 0.25, - "context_over_200k": { "input": 5, "output": 22.5, "cache_read": 0.5 } + "structured_output": false, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + } }, - "openai/gpt-5-chat": { - "id": "openai/gpt-5-chat", - "name": "GPT-5 Chat (latest)", - "family": "gpt-codex", + "kling-v2-6": { + "id": "kling-v2-6", + "name": "Kling-V2 6", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": false, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01-13", + "last_updated": "2026-01-13", + "modalities": { + "input": ["text", "image", "video"], + "output": ["video"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 99999999, + "output": 99999999 + } }, - "openai/gpt-5.2-chat": { - "id": "openai/gpt-5.2-chat", - "name": "GPT-5.2 Chat", - "family": "gpt-codex", - "attachment": true, + "MiniMax-M1": { + "id": "MiniMax-M1", + "name": "MiniMax M1", + "attachment": false, "reasoning": true, "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"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 80000 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", + "gemini-3.0-pro-preview": { + "id": "gemini-3.0-pro-preview", + "name": "Gemini 3.0 Pro Preview", "attachment": true, "reasoning": true, "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"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image", "video", "pdf", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } - }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", + "limit": { + "context": 1000000, + "output": 64000 + } + }, + "doubao-seed-2.0-lite": { + "id": "doubao-seed-2.0-lite", + "name": "Doubao Seed 2.0 Lite", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "output": 32000 + } }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "GPT-4.1 Mini", - "family": "gpt-mini", - "attachment": true, + "qwen3-coder-480b-a35b-instruct": { + "id": "qwen3-coder-480b-a35b-instruct", + "name": "Qwen3 Coder 480B A35B Instruct", + "attachment": false, "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"], "output": ["text"] }, + "release_date": "2025-08-14", + "last_updated": "2025-08-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 262000, + "output": 4096 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", + "claude-3.5-haiku": { + "id": "claude-3.5-haiku", + "name": "Claude 3.5 Haiku", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2024-05-30", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 16000, "output": 4000 } + "limit": { + "context": 200000, + "output": 8192 + } }, - "openai/gpt-5-image": { - "id": "openai/gpt-5-image", - "name": "GPT-5 Image", - "family": "gpt", - "attachment": true, + "gpt-oss-20b": { + "id": "gpt-oss-20b", + "name": "gpt-oss-20b", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-10-14", - "last_updated": "2025-10-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text", "image"] }, + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 4096 + } }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "GPT-5 Codex", - "family": "gpt-codex", - "attachment": true, + "qwen-turbo": { + "id": "qwen-turbo", + "name": "Qwen-Turbo", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 4096 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "o4 Mini", - "family": "o-mini", - "attachment": true, - "reasoning": true, + "kimi-k2": { + "id": "kimi-k2", + "name": "Kimi K2", + "attachment": false, + "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 128000, + "output": 128000 + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT-5.1-Codex", - "family": "gpt-codex", + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 64000 + } }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "GPT-5.2 Pro", - "family": "gpt-pro", - "attachment": true, - "reasoning": true, + "qwen3-max-preview": { + "id": "qwen3-max-preview", + "name": "Qwen3 Max Preview", + "attachment": false, + "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"], "output": ["text"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-09-06", + "last_updated": "2025-09-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "output": 64000 + } }, - "anthropic/claude-opus-4-5": { - "id": "anthropic/claude-opus-4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", - "attachment": true, + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "gpt-oss-120b", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 4096 + } }, - "anthropic/claude-opus-4-6": { - "id": "anthropic/claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "doubao-1.5-vision-pro": { + "id": "doubao-1.5-vision-pro", + "name": "Doubao 1.5 Vision Pro", "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, + "structured_output": false, "temperature": true, - "knowledge": "2025-05-30", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 5, - "output": 25, - "cache_read": 0.5, - "cache_write": 6.25, - "context_over_200k": { "input": 10, "output": 37.5, "cache_read": 1, "cache_write": 12.5 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] }, - "limit": { "context": 1000000, "output": 128000 } + "open_weights": false, + "limit": { + "context": 128000, + "output": 16000 + } }, - "anthropic/claude-sonnet-4-6": { - "id": "anthropic/claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", + "claude-4.5-sonnet": { + "id": "claude-4.5-sonnet", + "name": "Claude 4.5 Sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 200000, + "output": 64000 + } + }, + "deepseek-v3": { + "id": "deepseek-v3", + "name": "DeepSeek-V3", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "temperature": true, + "release_date": "2025-08-13", + "last_updated": "2025-08-13", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 1000000, "output": 128000 } + "open_weights": false, + "limit": { + "context": 128000, + "output": 16000 + } }, - "anthropic/claude-opus-4-1": { - "id": "anthropic/claude-opus-4-1", - "name": "Claude Opus 4.1", - "family": "claude-opus", - "attachment": true, + "deepseek-r1-0528": { + "id": "deepseek-r1-0528", + "name": "DeepSeek-R1-0528", + "attachment": false, "reasoning": true, "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"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "gemini-2.0-flash-lite": { + "id": "gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1048576, + "output": 8192 + } }, - "anthropic/claude-sonnet-4-5": { - "id": "anthropic/claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "qwen-max-2025-01-25": { + "id": "qwen-max-2025-01-25", + "name": "Qwen2.5-Max-2025-01-25", + "attachment": false, + "reasoning": false, "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", "pdf"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 128000, + "output": 4096 + } }, - "anthropic/claude-haiku-4-5": { - "id": "anthropic/claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", + "doubao-seed-2.0-pro": { + "id": "doubao-seed-2.0-pro", + "name": "Doubao Seed 2.0 Pro", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-02-01", - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 62000 } + "limit": { + "context": 256000, + "output": 128000 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Claude Opus 4", - "family": "claude-opus", - "attachment": true, + "deepseek/deepseek-v3.2-exp-thinking": { + "id": "deepseek/deepseek-v3.2-exp-thinking", + "name": "DeepSeek/DeepSeek-V3.2-Exp-Thinking", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, + "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"] }, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "anthropic/claude-3-7-sonnet": { - "id": "anthropic/claude-3-7-sonnet", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", - "attachment": true, + "deepseek/deepseek-v3.1-terminus-thinking": { + "id": "deepseek/deepseek-v3.1-terminus-thinking", + "name": "DeepSeek/DeepSeek-V3.1-Terminus-Thinking", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, + "structured_output": false, "temperature": true, - "knowledge": "2024-01", - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "xai/grok-4-fast": { - "id": "xai/grok-4-fast", - "name": "Grok 4 Fast", - "family": "grok", - "attachment": true, - "reasoning": true, + "deepseek/deepseek-v3.2-exp": { + "id": "deepseek/deepseek-v3.2-exp", + "name": "DeepSeek/DeepSeek-V3.2-Exp", + "attachment": false, + "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05, "cache_write": 0.2 }, - "limit": { "context": 2000000, "output": 64000 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "xai/grok-4": { - "id": "xai/grok-4", - "name": "Grok 4", - "family": "grok", - "attachment": true, + "deepseek/deepseek-v3.2-251201": { + "id": "deepseek/deepseek-v3.2-251201", + "name": "Deepseek/DeepSeek-V3.2", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-09", - "last_updated": "2025-09-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75, "cache_write": 3 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "google/gemini-3-pro-preview": { - "id": "google/gemini-3-pro-preview", - "name": "Gemini 3 Pro", - "family": "gemini-pro", - "attachment": true, + "deepseek/deepseek-math-v2": { + "id": "deepseek/deepseek-math-v2", + "name": "Deepseek/Deepseek-Math-V2", + "attachment": false, "reasoning": true, + "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 + } + }, + "deepseek/deepseek-v3.1-terminus": { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "DeepSeek/DeepSeek-V3.1-Terminus", + "attachment": false, + "reasoning": false, "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", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2, "cache_write": 4.5 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 32000 + } }, - "google/gemini-3-flash-preview": { - "id": "google/gemini-3-flash-preview", - "name": "Gemini 3 Flash", + "stepfun-ai/gelab-zero-4b-preview": { + "id": "stepfun-ai/gelab-zero-4b-preview", + "name": "Stepfun-Ai/Gelab Zero 4b Preview", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05, "cache_write": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 8192, + "output": 4096 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", + "stepfun/step-3.5-flash": { + "id": "stepfun/step-3.5-flash", + "name": "Stepfun/Step-3.5 Flash", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "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", "video", "pdf"], "output": ["text"] }, + "release_date": "2026-02-02", + "last_updated": "2026-02-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31, "cache_write": 2.375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 64000, + "output": 4096 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", + "x-ai/grok-4-fast": { + "id": "x-ai/grok-4-fast", + "name": "x-AI/Grok-4-Fast", "attachment": true, "reasoning": true, "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", "pdf"], "output": ["text"] }, + "release_date": "2025-09-20", + "last_updated": "2025-09-20", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "cache_write": 0.55 }, - "limit": { "context": 1048576, "output": 65536 } - } - } - }, - "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": { - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "GLM 4.7", - "family": "glm", + "limit": { + "context": 2000000, + "output": 2000000 + } + }, + "x-ai/grok-code-fast-1": { + "id": "x-ai/grok-code-fast-1", + "name": "x-AI/Grok-Code-Fast 1", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "limit": { "context": 202752, "output": 202752 } + "release_date": "2025-09-02", + "last_updated": "2025-09-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 10000 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM 5", - "family": "glm", - "attachment": false, + "x-ai/grok-4-fast-reasoning": { + "id": "x-ai/grok-4-fast-reasoning", + "name": "X-Ai/Grok-4-Fast-Reasoning", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 202752, "output": 202752 } + "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 + } }, - "meta-llama/Llama-3.1-8B-Instruct": { - "id": "meta-llama/Llama-3.1-8B-Instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "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", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2024-08-01", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131072, "output": 8000 } - }, - "meta-llama/Llama-3.3-70B-Instruct": { - "id": "meta-llama/Llama-3.3-70B-Instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "release_date": "2025-12-19", + "last_updated": "2025-12-19", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + } + }, + "x-ai/grok-4.1-fast": { + "id": "x-ai/grok-4.1-fast", + "name": "x-AI/Grok-4.1-Fast", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2024-08-01", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 0.6 }, - "limit": { "context": 131072, "output": 131072 } + "release_date": "2025-11-20", + "last_updated": "2025-11-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + } }, - "MiniMaxAI/MiniMax-M2.1": { - "id": "MiniMaxAI/MiniMax-M2.1", - "name": "MiniMax M2.1", - "attachment": false, + "x-ai/grok-4-fast-non-reasoning": { + "id": "x-ai/grok-4-fast-non-reasoning", + "name": "X-Ai/Grok-4-Fast-Non-Reasoning", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2026-01-13", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196608, "output": 196608 } + "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 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "x-ai/grok-4.1-fast-reasoning": { + "id": "x-ai/grok-4.1-fast-reasoning", + "name": "X-Ai/Grok 4.1 Fast Reasoning", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196608, "output": 196608 } + "release_date": "2025-12-19", + "last_updated": "2025-12-19", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 20000000, + "output": 2000000 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "OpenAI/GPT-5.2", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, + "structured_output": false, "temperature": true, - "release_date": "2025-07-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "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-235b-a22b-instruct-2507": { - "id": "qwen3-235b-a22b-instruct-2507", - "name": "qwen3-235b-a22b-instruct-2507", + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + } + }, + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "OpenAI/GPT-5", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 1.143 }, - "limit": { "context": 128000, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + } }, - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "claude-opus-4-5-20251101", - "attachment": true, - "reasoning": false, + "z-ai/glm-4.7": { + "id": "z-ai/glm-4.7", + "name": "Z-Ai/GLM 4.7", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-11-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 200000 + } }, - "deepseek-v3.2-thinking": { - "id": "deepseek-v3.2-thinking", - "name": "DeepSeek-V3.2-Thinking", + "z-ai/glm-5": { + "id": "z-ai/glm-5", + "name": "Z-Ai/GLM 5", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 0.43 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 200000, + "output": 128000 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "gpt-5-pro", + "z-ai/autoglm-phone-9b": { + "id": "z-ai/autoglm-phone-9b", + "name": "Z-Ai/Autoglm Phone 9b", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-10-08", - "last_updated": "2025-10-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 272000 } + "limit": { + "context": 12800, + "output": 4096 + } }, - "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", - "attachment": true, + "z-ai/glm-4.6": { + "id": "z-ai/glm-4.6", + "name": "Z-AI/GLM 4.6", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-26", - "last_updated": "2025-09-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-11", + "last_updated": "2025-10-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 200000, + "output": 200000 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "kimi-k2-thinking", + "minimax/minimax-m2": { + "id": "minimax/minimax-m2", + "name": "Minimax/Minimax-M2", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-28", + "last_updated": "2025-10-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.575, "output": 2.3 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 200000, + "output": 128000 + } }, - "qwen-max-latest": { - "id": "qwen-max-latest", - "name": "Qwen-Max-Latest", - "family": "qwen", + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "Minimax/Minimax-M2.1", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-11", - "release_date": "2024-04-03", - "last_updated": "2025-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.343, "output": 1.372 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 204800, + "output": 128000 + } }, - "gpt-5.2-chat-latest": { - "id": "gpt-5.2-chat-latest", - "name": "gpt-5.2-chat-latest", - "attachment": true, - "reasoning": false, + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "Minimax/Minimax-M2.5", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-12", - "last_updated": "2025-12-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 204800, + "output": 128000 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "gpt-5", - "attachment": true, - "reasoning": false, + "minimax/minimax-m2.5-highspeed": { + "id": "minimax/minimax-m2.5-highspeed", + "name": "Minimax/Minimax-M2.5 Highspeed", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-08", - "last_updated": "2025-08-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-14", + "last_updated": "2026-02-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 204800, + "output": 128000 + } }, - "grok-4.1": { - "id": "grok-4.1", - "name": "grok-4.1", + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Moonshotai/Kimi-K2.5", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 10 }, - "limit": { "context": 200000, "output": 64000 } - }, - "chatgpt-4o-latest": { - "id": "chatgpt-4o-latest", - "name": "chatgpt-4o-latest", - "family": "gpt", - "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2023-09", - "release_date": "2024-08-08", - "last_updated": "2024-08-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01-28", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 15 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "output": 256000 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "gemini-3-pro-preview", - "attachment": true, + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "Kimi K2 0905", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09-08", + "last_updated": "2025-09-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 256000, + "output": 100000 + } }, - "MiniMax-M1": { - "id": "MiniMax-M1", - "name": "MiniMax-M1", - "family": "minimax", + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "release_date": "2025-06-16", - "last_updated": "2025-06-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-07", + "last_updated": "2025-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.132, "output": 1.254 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 256000, + "output": 100000 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "gpt-4o", - "family": "gpt", - "attachment": true, + "meituan/longcat-flash-chat": { + "id": "meituan/longcat-flash-chat", + "name": "Meituan/Longcat-Flash-Chat", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, + "structured_output": false, "temperature": true, - "knowledge": "2023-09", - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-11-05", + "last_updated": "2025-11-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 131072, + "output": 131072 + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "grok-4-fast-non-reasoning", - "attachment": true, + "meituan/longcat-flash-lite": { + "id": "meituan/longcat-flash-lite", + "name": "Meituan/Longcat-Flash-Lite", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-06", + "last_updated": "2026-02-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 256000, + "output": 320000 + } }, - "kimi-k2-thinking-turbo": { - "id": "kimi-k2-thinking-turbo", - "name": "kimi-k2-thinking-turbo", + "mimo-v2-flash": { + "id": "mimo-v2-flash", + "name": "Mimo-V2-Flash", + "family": "mimo", "attachment": false, "reasoning": true, "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": false, - "cost": { "input": 1.265, "output": 9.119 }, - "limit": { "context": 262144, "output": 262144 } + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01 + } }, - "kimi-k2-0905-preview": { - "id": "kimi-k2-0905-preview", - "name": "kimi-k2-0905-preview", + "xiaomi/mimo-v2-flash": { + "id": "xiaomi/mimo-v2-flash", + "name": "Xiaomi/Mimo-V2-Flash", + "family": "mimo", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.632, "output": 2.53 }, - "limit": { "context": 262144, "output": 262144 } - }, - "ministral-14b-2512": { - "id": "ministral-14b-2512", - "name": "ministral-14b-2512", + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01 + } + } + } + }, + "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": { + "rekaai/reka-edge": { + "id": "rekaai/reka-edge", + "name": "Reka Edge", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.33, "output": 0.33 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2026-03-20", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "gpt-5-mini", - "attachment": true, + "rekaai/reka-flash-3": { + "id": "rekaai/reka-flash-3", + "name": "Reka Flash 3", + "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2025-03-12", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.2 + } + }, + "ai21/jamba-large-1.7": { + "id": "ai21/jamba-large-1.7", + "name": "AI21: Jamba Large 1.7", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-08", - "last_updated": "2025-08-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-09", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 8 + } }, - "deepseek-chat": { - "id": "deepseek-chat", - "name": "Deepseek-Chat", - "family": "deepseek", + "alibaba/tongyi-deepresearch-30b-a3b": { + "id": "alibaba/tongyi-deepresearch-30b-a3b", + "name": "Tongyi DeepResearch 30B A3B", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-11-29", - "last_updated": "2024-11-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-09-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 0.43 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.09, + "output": 0.45 + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "claude-sonnet-4-5-20250929", - "attachment": true, + "inflection/inflection-3-pi": { + "id": "inflection/inflection-3-pi", + "name": "Inflection: Inflection 3 Pi", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-10-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 8000, + "output": 1024 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "doubao-seed-1-6-thinking-250715": { - "id": "doubao-seed-1-6-thinking-250715", - "name": "doubao-seed-1-6-thinking-250715", - "attachment": true, - "reasoning": true, - "tool_call": true, + "inflection/inflection-3-productivity": { + "id": "inflection/inflection-3-productivity", + "name": "Inflection: Inflection 3 Productivity", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-07-15", - "last_updated": "2025-07-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-10-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.121, "output": 1.21 }, - "limit": { "context": 256000, "output": 16000 } + "limit": { + "context": 8000, + "output": 1024 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "qwen3-30b-a3b": { - "id": "qwen3-30b-a3b", - "name": "Qwen3-30B-A3B", - "family": "qwen", + "liquid/lfm-2-24b-a2b": { + "id": "liquid/lfm-2-24b-a2b", + "name": "LiquidAI: LFM2-24B-A2B", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.11, "output": 1.08 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2026-02-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.03, + "output": 0.12 + } }, - "qwen-plus": { - "id": "qwen-plus", - "name": "Qwen-Plus", - "family": "qwen", + "writer/palmyra-x5": { + "id": "writer/palmyra-x5", + "name": "Writer: Palmyra X5", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-28", + "last_updated": "2025-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 1.2 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 1040000, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 6 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "gpt-4.1", - "family": "gpt", - "attachment": true, + "ibm-granite/granite-4.1-8b": { + "id": "ibm-granite/granite-4.1-8b", + "name": "IBM: Granite 4.1 8B", + "attachment": false, "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"] }, + "release_date": "2026-04-30", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.1, + "cache_read": 0.05 + } }, - "qwen3-max-2025-09-23": { - "id": "qwen3-max-2025-09-23", - "name": "qwen3-max-2025-09-23", + "ibm-granite/granite-4.0-h-micro": { + "id": "ibm-granite/granite-4.0-h-micro", + "name": "IBM: Granite 4.0 Micro", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2025-10-20", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131000, + "output": 32768 + }, + "cost": { + "input": 0.017, + "output": 0.11 + } + }, + "essentialai/rnj-1-instruct": { + "id": "essentialai/rnj-1-instruct", + "name": "EssentialAI: Rnj 1 Instruct", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.86, "output": 3.43 }, - "limit": { "context": 258048, "output": 65536 } + "release_date": "2025-12-05", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 6554 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "gpt-5.1-chat-latest": { - "id": "gpt-5.1-chat-latest", - "name": "gpt-5.1-chat-latest", + "perplexity/sonar-pro": { + "id": "perplexity/sonar-pro", + "name": "Perplexity: Sonar Pro", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 8000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "gemini-2.0-flash-lite": { - "id": "gemini-2.0-flash-lite", - "name": "gemini-2.0-flash-lite", - "family": "gemini-flash-lite", + "perplexity/sonar-deep-research": { + "id": "perplexity/sonar-deep-research", + "name": "Perplexity: Sonar Deep Research", + "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2025-01-27", + "last_updated": "2025-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 25600 + }, + "cost": { + "input": 2, + "output": 8 + } + }, + "perplexity/sonar": { + "id": "perplexity/sonar", + "name": "Perplexity: Sonar", "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-06-16", - "last_updated": "2025-06-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 2000000, "output": 8192 } + "limit": { + "context": 127072, + "output": 25415 + }, + "cost": { + "input": 1, + "output": 1 + } }, - "claude-sonnet-4-5-20250929-thinking": { - "id": "claude-sonnet-4-5-20250929-thinking", - "name": "claude-sonnet-4-5-20250929-thinking", + "perplexity/sonar-pro-search": { + "id": "perplexity/sonar-pro-search", + "name": "Perplexity: Sonar Pro Search", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-31", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 8000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "grok-4-1-fast-non-reasoning", + "perplexity/sonar-reasoning-pro": { + "id": "perplexity/sonar-reasoning-pro", + "name": "Perplexity: Sonar Reasoning Pro", "attachment": true, - "reasoning": false, - "tool_call": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 128000, + "output": 25600 + }, + "cost": { + "input": 2, + "output": 8 + } }, - "gemini-2.5-flash-nothink": { - "id": "gemini-2.5-flash-nothink", - "name": "gemini-2.5-flash-nothink", - "family": "gemini-flash", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-chat-v3.1": { + "id": "deepseek/deepseek-chat-v3.1", + "name": "DeepSeek: DeepSeek V3.1", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-06-24", - "last_updated": "2025-06-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1000000, "output": 65536 } + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 7168 + }, + "cost": { + "input": 0.15, + "output": 0.75 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM-4.5", + "deepseek/deepseek-chat": { + "id": "deepseek/deepseek-chat", + "name": "DeepSeek: DeepSeek V3", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.286, "output": 1.142 }, - "limit": { "context": 128000, "output": 98304 } + "release_date": "2024-12-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.32, + "output": 0.89, + "cache_read": 0.15 + } }, - "gpt-5-thinking": { - "id": "gpt-5-thinking", - "name": "gpt-5-thinking", - "attachment": true, + "deepseek/deepseek-r1-distill-llama-70b": { + "id": "deepseek/deepseek-r1-distill-llama-70b", + "name": "DeepSeek: R1 Distill Llama 70B", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-08", - "last_updated": "2025-08-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2025-01-23", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.7, + "output": 0.8, + "cache_read": 0.015 + } }, - "deepseek-reasoner": { - "id": "deepseek-reasoner", - "name": "Deepseek-Reasoner", - "family": "deepseek-thinking", + "deepseek/deepseek-r1": { + "id": "deepseek/deepseek-r1", + "name": "DeepSeek: R1", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", "release_date": "2025-01-20", "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.29, "output": 0.43 }, - "limit": { "context": 128000, "output": 128000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 16000 + }, + "cost": { + "input": 0.7, + "output": 2.5 + } }, - "MiniMax-M2.1": { - "id": "MiniMax-M2.1", - "name": "MiniMax-M2.1", + "deepseek/deepseek-v3.2-speciale": { + "id": "deepseek/deepseek-v3.2-speciale", + "name": "DeepSeek: DeepSeek V3.2 Speciale", "attachment": false, - "reasoning": false, - "tool_call": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "release_date": "2025-12-19", - "last_updated": "2025-12-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 1000000, "output": 131072 } + "release_date": "2025-12-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.4, + "output": 1.2, + "cache_read": 0.135 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "glm-4.6", + "deepseek/deepseek-r1-distill-qwen-32b": { + "id": "deepseek/deepseek-r1-distill-qwen-32b", + "name": "DeepSeek: R1 Distill Qwen 32B", "attachment": false, - "reasoning": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.29, + "output": 0.29 + } + }, + "deepseek/deepseek-v3.2-exp": { + "id": "deepseek/deepseek-v3.2-exp", + "name": "DeepSeek: DeepSeek V3.2 Exp", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.286, "output": 1.142 }, - "limit": { "context": 200000, "output": 131072 } + "release_date": "2025-01-01", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 0.41 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "gemini-3-flash-preview", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-v4-flash": { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek: DeepSeek V4 Flash", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 1048576, + "output": 384000 + }, + "cost": { + "input": 0.14, + "output": 0.28, + "cache_read": 0.0028 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-v4-pro": { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek: DeepSeek V4 Pro", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.145, "output": 0.43 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 384000 + }, + "cost": { + "input": 0.435, + "output": 0.87, + "cache_read": 0.003625 + } }, - "claude-opus-4-5-20251101-thinking": { - "id": "claude-opus-4-5-20251101-thinking", - "name": "claude-opus-4-5-20251101-thinking", - "attachment": true, + "deepseek/deepseek-v3.2": { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek: DeepSeek V3.2", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-11-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-12-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.26, + "output": 0.38, + "cache_read": 0.125 + } }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "qwen3-coder-480b-a35b-instruct", + "deepseek/deepseek-chat-v3-0324": { + "id": "deepseek/deepseek-chat-v3-0324", + "name": "DeepSeek: DeepSeek V3 0324", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.86, "output": 3.43 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2025-03-24", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.2, + "output": 0.77, + "cache_read": 0.095 + } }, - "doubao-seed-code-preview-251028": { - "id": "doubao-seed-code-preview-251028", - "name": "doubao-seed-code-preview-251028", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-r1-0528": { + "id": "deepseek/deepseek-r1-0528", + "name": "DeepSeek: R1 0528", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-11-11", - "last_updated": "2025-11-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.17, "output": 1.14 }, - "limit": { "context": 256000, "output": 32000 } + "release_date": "2025-05-28", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.45, + "output": 2.15, + "cache_read": 0.2 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "gemini-2.5-pro", - "family": "gemini-pro", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-v3.1-terminus": { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "DeepSeek: DeepSeek V3.1 Terminus", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 1000000, "output": 65536 } + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 32768 + }, + "cost": { + "input": 0.21, + "output": 0.79, + "cache_read": 0.13 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "claude-opus-4-1-20250805", + "openrouter/auto": { + "id": "openrouter/auto", + "name": "Auto Router", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["image", "text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 2000000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "gemini-2.5-flash", - "family": "gemini-flash", - "attachment": true, + "openrouter/bodybuilder": { + "id": "openrouter/bodybuilder", + "name": "Body Builder (beta)", + "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 + } + }, + "openrouter/owl-alpha": { + "id": "openrouter/owl-alpha", + "name": "Owl Alpha", + "attachment": false, + "reasoning": true, "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"], "output": ["text"] }, + "release_date": "2026-04-28", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 1048756, + "output": 262144 + }, + "status": "alpha", + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "gpt-5.2", - "attachment": true, + "openrouter/pareto-code": { + "id": "openrouter/pareto-code", + "name": "Pareto Code Router", + "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-12", - "last_updated": "2025-12-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "release_date": "2026-04-21", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "grok-4-1-fast-reasoning": { - "id": "grok-4-1-fast-reasoning", - "name": "grok-4-1-fast-reasoning", + "openrouter/free": { + "id": "openrouter/free", + "name": "Free Models Router", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 200000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "gpt-5.1", - "attachment": true, + "inclusionai/ling-2.6-1t:free": { + "id": "inclusionai/ling-2.6-1t:free", + "name": "inclusionAI: Ling-2.6-1T (free)", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-23", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-2.5-flash-preview-09-2025": { - "id": "gemini-2.5-flash-preview-09-2025", - "name": "gemini-2.5-flash-preview-09-2025", - "attachment": true, + "inclusionai/ling-2.6-flash": { + "id": "inclusionai/ling-2.6-flash", + "name": "inclusionAI: Ling-2.6 Flash", + "attachment": false, "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"] }, + "release_date": "2026-04-21", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.08, + "output": 0.24, + "cache_read": 0.016 + } }, - "doubao-seed-1-8-251215": { - "id": "doubao-seed-1-8-251215", - "name": "doubao-seed-1-8-251215", - "attachment": true, - "reasoning": false, + "arcee-ai/trinity-mini": { + "id": "arcee-ai/trinity-mini", + "name": "Arcee AI: Trinity Mini", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.114, "output": 0.286 }, - "limit": { "context": 224000, "output": 64000 } + "release_date": "2025-12", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.045, + "output": 0.15 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "gpt-4.1-mini", - "family": "gpt-mini", - "attachment": true, + "arcee-ai/virtuoso-large": { + "id": "arcee-ai/virtuoso-large", + "name": "Arcee AI: Virtuoso Large", + "attachment": false, "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, - "cost": { "input": 0.4, "output": 1.6 }, - "limit": { "context": 1000000, "output": 32768 } - }, - "qwen3-235b-a22b": { - "id": "qwen3-235b-a22b", - "name": "Qwen3-235B-A22B", - "family": "qwen", + "release_date": "2025-05-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 64000 + }, + "cost": { + "input": 0.75, + "output": 1.2 + } + }, + "arcee-ai/trinity-large-thinking": { + "id": "arcee-ai/trinity-large-thinking", + "name": "Arcee AI: Trinity Large Thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.29, "output": 2.86 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2026-04-01", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.22, + "output": 0.85 + } }, - "grok-4-fast-reasoning": { - "id": "grok-4-fast-reasoning", - "name": "grok-4-fast-reasoning", + "arcee-ai/spotlight": { + "id": "arcee-ai/spotlight", + "name": "Arcee AI: Spotlight", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "output": 30000 } + "release_date": "2025-05-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65537 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } }, - "MiniMax-M2": { - "id": "MiniMax-M2", - "name": "MiniMax-M2", + "arcee-ai/maestro-reasoning": { + "id": "arcee-ai/maestro-reasoning", + "name": "Arcee AI: Maestro Reasoning", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-10-26", - "last_updated": "2025-10-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.33, "output": 1.32 }, - "limit": { "context": 1000000, "output": 128000 } + "release_date": "2025-05-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32000 + }, + "cost": { + "input": 0.9, + "output": 3.3 + } }, - "gemini-2.5-flash-image": { - "id": "gemini-2.5-flash-image", - "name": "gemini-2.5-flash-image", - "attachment": true, + "arcee-ai/coder-large": { + "id": "arcee-ai/coder-large", + "name": "Arcee AI: Coder Large", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-10-08", - "last_updated": "2025-10-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 30 }, - "limit": { "context": 32768, "output": 32768 } + "release_date": "2025-05-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 0.8 + } }, - "glm-4.5v": { - "id": "glm-4.5v", - "name": "GLM-4.5V", - "attachment": true, + "arcee-ai/trinity-large-preview": { + "id": "arcee-ai/trinity-large-preview", + "name": "Arcee AI: Trinity Large Preview", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01-28", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 0.86 }, - "limit": { "context": 64000, "output": 16384 } + "limit": { + "context": 131000, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.45 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "claude-haiku-4-5-20251001", - "attachment": true, - "reasoning": false, - "tool_call": true, + "deepcogito/cogito-v2.1-671b": { + "id": "deepcogito/cogito-v2.1-671b", + "name": "Deep Cogito: Cogito v2.1 671B", + "attachment": false, + "reasoning": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-10-16", - "last_updated": "2025-10-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-11-14", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 1.25, + "output": 1.25 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "glm-4.7", + "upstage/solar-pro-3": { + "id": "upstage/solar-pro-3", + "name": "Upstage: Solar Pro 3", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.286, "output": 1.142 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "qwen-flash": { - "id": "qwen-flash", - "name": "Qwen-Flash", + "nex-agi/deepseek-v3.1-nex-n1": { + "id": "nex-agi/deepseek-v3.1-nex-n1", + "name": "Nex AGI: DeepSeek V3.1 Nex N1", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-01", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.022, "output": 0.22 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 131072, + "output": 163840 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "gpt-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "gpt-4.1-nano", - "family": "gpt-nano", + "bytedance-seed/seed-1.6": { + "id": "bytedance-seed/seed-1.6", + "name": "ByteDance Seed: Seed 1.6", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09", + "last_updated": "2025-09", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.25, + "output": 2 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "deepseek-v3.2", - "attachment": false, - "reasoning": false, + "bytedance-seed/seed-2.0-lite": { + "id": "bytedance-seed/seed-2.0-lite", + "name": "ByteDance Seed: Seed-2.0-Lite", + "attachment": true, + "reasoning": true, "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": false, - "cost": { "input": 0.29, "output": 0.43 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2026-03-10", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.25, + "output": 2 + } }, - "doubao-seed-1-6-vision-250815": { - "id": "doubao-seed-1-6-vision-250815", - "name": "doubao-seed-1-6-vision-250815", + "bytedance-seed/seed-1.6-flash": { + "id": "bytedance-seed/seed-1.6-flash", + "name": "ByteDance Seed: Seed 1.6 Flash", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.114, "output": 1.143 }, - "limit": { "context": 256000, "output": 32000 } + "release_date": "2025-12-23", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "claude-opus-4-1-20250805-thinking": { - "id": "claude-opus-4-1-20250805-thinking", - "name": "claude-opus-4-1-20250805-thinking", + "bytedance-seed/seed-2.0-mini": { + "id": "bytedance-seed/seed-2.0-mini", + "name": "ByteDance Seed: Seed-2.0-Mini", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-05-27", - "last_updated": "2025-05-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75 }, - "limit": { "context": 200000, "output": 32000 } + "release_date": "2026-02-27", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "gemini-3-pro-image-preview": { - "id": "gemini-3-pro-image-preview", - "name": "gemini-3-pro-image-preview", - "attachment": true, + "mancer/weaver": { + "id": "mancer/weaver", + "name": "Mancer: Weaver (alpha)", + "attachment": false, "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"] }, + "release_date": "2023-08-02", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 120 }, - "limit": { "context": 32768, "output": 64000 } + "limit": { + "context": 8000, + "output": 2000 + }, + "cost": { + "input": 0.75, + "output": 1 + } }, - "mistral-large-2512": { - "id": "mistral-large-2512", - "name": "mistral-large-2512", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 3.3 }, - "limit": { "context": 128000, "output": 262144 } - } - } - }, - "novita-ai": { - "id": "novita-ai", - "env": ["NOVITA_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://api.novita.ai/openai", - "name": "NovitaAI", - "doc": "https://novita.ai/docs/guides/introduction", - "models": { - "paddlepaddle/paddleocr-vl": { - "id": "paddlepaddle/paddleocr-vl", - "name": "PaddleOCR-VL", - "attachment": true, + "anthracite-org/magnum-v4-72b": { + "id": "anthracite-org/magnum-v4-72b", + "name": "Magnum v4 72B", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-10-22", - "last_updated": "2025-10-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-10-22", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.02 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 16384, + "output": 2048 + }, + "cost": { + "input": 3, + "output": 5 + } }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "OpenAI GPT OSS 120B", + "~google/gemini-pro-latest": { + "id": "~google/gemini-pro-latest", + "name": "Google: Gemini Pro Latest", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.25 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "cache_write": 0.375 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "OpenAI: GPT OSS 20B", + "~google/gemini-flash-latest": { + "id": "~google/gemini-flash-latest", + "name": "Google: Gemini Flash Latest", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2025-08-06", - "last_updated": "2025-08-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.15 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "cache_write": 0.08333333333333334 + } }, - "microsoft/wizardlm-2-8x22b": { - "id": "microsoft/wizardlm-2-8x22b", - "name": "Wizardlm 2 8x22B", + "kilo-auto/balanced": { + "id": "kilo-auto/balanced", + "name": "Kilo Auto Balanced", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2024-04-24", - "last_updated": "2024-04-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.62, "output": 0.62 }, - "limit": { "context": 65535, "output": 8000 } + "release_date": "2026-03-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 3 + } }, - "kwaipilot/kat-coder": { - "id": "kwaipilot/kat-coder", - "name": "KAT-Coder-Pro V1(Free)", - "attachment": false, - "reasoning": false, + "kilo-auto/frontier": { + "id": "kilo-auto/frontier", + "name": "Kilo Auto Frontier", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "release_date": "2026-03-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25 + } }, - "kwaipilot/kat-coder-pro": { - "id": "kwaipilot/kat-coder-pro", - "name": "Kat Coder Pro", - "attachment": false, - "reasoning": false, + "kilo-auto/small": { + "id": "kilo-auto/small", + "name": "Kilo Auto Small", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01-05", - "last_updated": "2026-01-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 256000, "output": 128000 } + "release_date": "2026-03-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4 + } }, - "sao10k/l3-8b-lunaris": { - "id": "sao10k/l3-8b-lunaris", - "name": "Sao10k L3 8B Lunaris\t", + "kilo-auto/free": { + "id": "kilo-auto/free", + "name": "Kilo Auto Free", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2024-11-28", - "last_updated": "2024-11-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.05 }, - "limit": { "context": 8192, "output": 8192 } + "release_date": "2026-03-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "sao10k/l3-70b-euryale-v2.1": { - "id": "sao10k/l3-70b-euryale-v2.1", - "name": "L3 70B Euryale V2.1\t", + "undi95/remm-slerp-l2-13b": { + "id": "undi95/remm-slerp-l2-13b", + "name": "ReMM SLERP 13B", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-06-18", - "last_updated": "2024-06-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-07-22", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.48, "output": 1.48 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 6144, + "output": 4096 + }, + "cost": { + "input": 0.45, + "output": 0.65 + } }, - "sao10k/l31-70b-euryale-v2.2": { - "id": "sao10k/l31-70b-euryale-v2.2", - "name": "L31 70B Euryale V2.2", + "allenai/olmo-3-32b-think": { + "id": "allenai/olmo-3-32b-think", + "name": "AllenAI: Olmo 3 32B Think", "attachment": false, - "reasoning": false, - "tool_call": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "release_date": "2024-09-19", - "last_updated": "2024-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-22", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.48, "output": 1.48 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.5 + } }, - "sao10k/L3-8B-Stheno-v3.2": { - "id": "sao10k/L3-8B-Stheno-v3.2", - "name": "L3 8B Stheno V3.2", + "nousresearch/hermes-2-pro-llama-3-8b": { + "id": "nousresearch/hermes-2-pro-llama-3-8b", + "name": "NousResearch: Hermes 2 Pro - Llama-3 8B", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-11-29", - "last_updated": "2024-11-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-05-27", + "last_updated": "2024-06-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.05 }, - "limit": { "context": 8192, "output": 32000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.14, + "output": 0.14 + } }, - "deepseek/deepseek-r1-turbo": { - "id": "deepseek/deepseek-r1-turbo", - "name": "DeepSeek R1 (Turbo)\t", + "nousresearch/hermes-4-405b": { + "id": "nousresearch/hermes-4-405b", + "name": "Nous: Hermes 4 405B", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-03-05", - "last_updated": "2025-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-25", + "last_updated": "2025-08-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.7, "output": 2.5 }, - "limit": { "context": 64000, "output": 16000 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 1, + "output": 3 + } }, - "deepseek/deepseek-v3.1-terminus": { - "id": "deepseek/deepseek-v3.1-terminus", - "name": "Deepseek V3.1 Terminus", - "family": "deepseek", + "nousresearch/hermes-3-llama-3.1-70b": { + "id": "nousresearch/hermes-3-llama-3.1-70b", + "name": "Nous: Hermes 3 70B Instruct", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-08-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1, "cache_read": 0.135 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } }, - "deepseek/deepseek-r1-distill-llama-70b": { - "id": "deepseek/deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill LLama 70B", - "family": "deepseek-thinking", + "nousresearch/hermes-4-70b": { + "id": "nousresearch/hermes-4-70b", + "name": "Nous: Hermes 4 70B", "attachment": false, "reasoning": true, "tool_call": false, - "structured_output": true, "temperature": true, - "release_date": "2025-01-27", - "last_updated": "2025-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-25", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 0.8 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.13, + "output": 0.4, + "cache_read": 0.055 + } }, - "deepseek/deepseek-v3-0324": { - "id": "deepseek/deepseek-v3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", + "nousresearch/hermes-3-llama-3.1-405b": { + "id": "nousresearch/hermes-3-llama-3.1-405b", + "name": "Nous: Hermes 3 405B Instruct", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-08-16", + "last_updated": "2024-08-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1.12, "cache_read": 0.135 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 1 + } }, - "deepseek/deepseek-prover-v2-671b": { - "id": "deepseek/deepseek-prover-v2-671b", - "name": "Deepseek Prover V2 671B", + "morph/morph-v3-fast": { + "id": "morph/morph-v3-fast", + "name": "Morph: Morph V3 Fast", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-04-30", - "last_updated": "2025-04-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.5 }, - "limit": { "context": 160000, "output": 160000 } + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 81920, + "output": 38000 + }, + "cost": { + "input": 0.8, + "output": 1.2 + } }, - "deepseek/deepseek-r1-0528-qwen3-8b": { - "id": "deepseek/deepseek-r1-0528-qwen3-8b", - "name": "DeepSeek R1 0528 Qwen3 8B", + "morph/morph-v3-large": { + "id": "morph/morph-v3-large", + "name": "Morph: Morph V3 Large", "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-05-29", - "last_updated": "2025-05-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.09 }, - "limit": { "context": 128000, "output": 32000 } - }, - "deepseek/deepseek-ocr-2": { - "id": "deepseek/deepseek-ocr-2", - "name": "deepseek/deepseek-ocr-2", - "attachment": true, "reasoning": false, "tool_call": false, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.03 }, - "limit": { "context": 8192, "output": 8192 } + "temperature": true, + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.9, + "output": 1.9 + } }, - "deepseek/deepseek-v3-turbo": { - "id": "deepseek/deepseek-v3-turbo", - "name": "DeepSeek V3 (Turbo)\t", + "stepfun/step-3.5-flash:free": { + "id": "stepfun/step-3.5-flash:free", + "name": "StepFun: Step 3.5 Flash (free)", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-03-05", - "last_updated": "2025-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 1.3 }, - "limit": { "context": 64000, "output": 16000 } + "release_date": "2025-08-26", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek/deepseek-v3.2-exp": { - "id": "deepseek/deepseek-v3.2-exp", - "name": "Deepseek V3.2 Exp", + "stepfun/step-3.5-flash": { + "id": "stepfun/step-3.5-flash", + "name": "StepFun: Step 3.5 Flash", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 0.41 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.02 + } }, - "deepseek/deepseek-ocr": { - "id": "deepseek/deepseek-ocr", - "name": "DeepSeek-OCR", - "attachment": true, + "alpindale/goliath-120b": { + "id": "alpindale/goliath-120b", + "name": "Goliath 120B", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": true, "temperature": true, - "release_date": "2025-10-24", - "last_updated": "2025-10-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2023-11-10", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.03 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 6144, + "output": 1024 + }, + "cost": { + "input": 3.75, + "output": 7.5 + } }, - "deepseek/deepseek-v3.1": { - "id": "deepseek/deepseek-v3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "mistralai/mistral-nemo": { + "id": "mistralai/mistral-nemo", + "name": "Mistral: Mistral Nemo", "attachment": false, - "reasoning": true, + "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"] }, + "release_date": "2024-07-01", + "last_updated": "2024-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1, "cache_read": 0.135 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0.04 + } }, - "deepseek/deepseek-r1-0528": { - "id": "deepseek/deepseek-r1-0528", - "name": "DeepSeek R1 0528", - "family": "deepseek-thinking", + "mistralai/mistral-saba": { + "id": "mistralai/mistral-saba", + "name": "Mistral: Saba", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-02-17", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.7, "output": 2.5, "cache_read": 0.35 }, - "limit": { "context": 163840, "output": 32768 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "deepseek/deepseek-v3.2": { - "id": "deepseek/deepseek-v3.2", - "name": "Deepseek V3.2", - "family": "deepseek", - "attachment": false, - "reasoning": true, + "mistralai/mistral-large-2512": { + "id": "mistralai/mistral-large-2512", + "name": "Mistral: Mistral Large 3 2512", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-11-01", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.269, "output": 0.4, "cache_read": 0.1345 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 262144, + "output": 52429 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "zai-org/glm-4.7-flash": { - "id": "zai-org/glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm", + "mistralai/devstral-medium": { + "id": "mistralai/devstral-medium", + "name": "Mistral: Devstral Medium", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2025-07-10", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "zai-org/autoglm-phone-9b-multilingual": { - "id": "zai-org/autoglm-phone-9b-multilingual", - "name": "AutoGLM-Phone-9B-Multilingual", + "mistralai/mistral-small-3.1-24b-instruct": { + "id": "mistralai/mistral-small-3.1-24b-instruct", + "name": "Mistral: Mistral Small 3.1 24B", "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, - "cost": { "input": 0.035, "output": 0.138 }, - "limit": { "context": 65536, "output": 65536 } - }, - "zai-org/glm-4.5": { - "id": "zai-org/glm-4.5", - "name": "GLM-4.5", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-17", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 128000, + "output": 131072 + }, + "cost": { + "input": 0.35, + "output": 0.56, + "cache_read": 0.015 + } }, - "zai-org/glm-4.6": { - "id": "zai-org/glm-4.6", - "name": "GLM 4.6", - "family": "glm", - "attachment": false, + "mistralai/mistral-medium-3-5": { + "id": "mistralai/mistral-medium-3-5", + "name": "Mistral: Mistral Medium 3.5", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "structured_output": true, "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-04-30", + "last_updated": "2026-05-07", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 1.5, + "output": 7.5 + } }, - "zai-org/glm-4.6v": { - "id": "zai-org/glm-4.6v", - "name": "GLM 4.6V", - "family": "glmv", + "mistralai/pixtral-large-2411": { + "id": "mistralai/pixtral-large-2411", + "name": "Mistral: Pixtral Large 2411", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "video", "image"], "output": ["text"] }, + "release_date": "2024-11-19", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9, "cache_read": 0.055 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "zai-org/glm-5": { - "id": "zai-org/glm-5", - "name": "GLM-5", - "family": "glm", + "mistralai/devstral-2512": { + "id": "mistralai/devstral-2512", + "name": "Mistral: Devstral 2 2512", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-09-12", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 202800, "output": 131072 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.025 + } }, - "zai-org/glm-4.5-air": { - "id": "zai-org/glm-4.5-air", - "name": "GLM 4.5 Air", - "family": "glm-air", + "mistralai/codestral-2508": { + "id": "mistralai/codestral-2508", + "name": "Mistral: Codestral 2508", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-10-13", - "last_updated": "2025-10-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.85 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 256000, + "output": 51200 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "zai-org/glm-4.5v": { - "id": "zai-org/glm-4.5v", - "name": "GLM 4.5V", - "family": "glmv", - "attachment": true, - "reasoning": true, + "mistralai/mistral-small-24b-instruct-2501": { + "id": "mistralai/mistral-small-24b-instruct-2501", + "name": "Mistral: Mistral Small 3", + "attachment": false, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-08-11", - "last_updated": "2025-08-11", - "modalities": { "input": ["text", "video", "image"], "output": ["text"] }, + "release_date": "2025-12-29", + "last_updated": "2026-01-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.8, "cache_read": 0.11 }, - "limit": { "context": 65536, "output": 16384 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.08 + } }, - "zai-org/glm-4.7": { - "id": "zai-org/glm-4.7", - "name": "GLM-4.7", - "family": "glm", + "mistralai/mistral-large-2411": { + "id": "mistralai/mistral-large-2411", + "name": "Mistral Large 2411", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-24", + "last_updated": "2024-11-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "gryphe/mythomax-l2-13b": { - "id": "gryphe/mythomax-l2-13b", - "name": "Mythomax L2 13B", + "mistralai/mixtral-8x22b-instruct": { + "id": "mistralai/mixtral-8x22b-instruct", + "name": "Mistral: Mixtral 8x22B Instruct", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2024-04-25", - "last_updated": "2024-04-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-04-17", + "last_updated": "2024-04-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.09 }, - "limit": { "context": 4096, "output": 3200 } + "limit": { + "context": 65536, + "output": 13108 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "google/gemma-3-27b-it": { - "id": "google/gemma-3-27b-it", - "name": "Gemma 3 27B", - "family": "gemma", - "attachment": true, + "mistralai/mistral-large-2407": { + "id": "mistralai/mistral-large-2407", + "name": "Mistral Large 2407", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-11-19", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.119, "output": 0.2 }, - "limit": { "context": 98304, "output": 16384 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "skywork/r1v4-lite": { - "id": "skywork/r1v4-lite", - "name": "Skywork R1V4-Lite", - "family": "skywork", + "mistralai/ministral-8b-2512": { + "id": "mistralai/ministral-8b-2512", + "name": "Mistral: Ministral 3 8B 2512", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262144, "output": 65536 } - }, - "baidu/ernie-4.5-21B-a3b-thinking": { - "id": "baidu/ernie-4.5-21B-a3b-thinking", - "name": "ERNIE-4.5-21B-A3B-Thinking", - "family": "ernie", - "attachment": false, - "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-02", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "baidu/ernie-4.5-vl-28b-a3b-thinking": { - "id": "baidu/ernie-4.5-vl-28b-a3b-thinking", - "name": "ERNIE-4.5-VL-28B-A3B-Thinking", + "mistralai/mistral-medium-3.1": { + "id": "mistralai/mistral-medium-3.1", + "name": "Mistral: Mistral Medium 3.1", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-11-26", - "last_updated": "2025-11-26", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.39, "output": 0.39 }, - "limit": { "context": 131072, "output": 65536 } + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "baidu/ernie-4.5-vl-28b-a3b": { - "id": "baidu/ernie-4.5-vl-28b-a3b", - "name": "ERNIE 4.5 VL 28B A3B", + "mistralai/mistral-small-2603": { + "id": "mistralai/mistral-small-2603", + "name": "Mistral: Mistral Small 4", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-16", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.4, "output": 5.6 }, - "limit": { "context": 30000, "output": 8000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.015 + } }, - "baidu/ernie-4.5-21B-a3b": { - "id": "baidu/ernie-4.5-21B-a3b", - "name": "ERNIE 4.5 21B A3B", - "family": "ernie", - "attachment": false, + "mistralai/ministral-3b-2512": { + "id": "mistralai/ministral-3b-2512", + "name": "Mistral: Ministral 3 3B 2512", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-02", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 120000, "output": 8000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "baidu/ernie-4.5-300b-a47b-paddle": { - "id": "baidu/ernie-4.5-300b-a47b-paddle", - "name": "ERNIE 4.5 300B A47B", + "mistralai/voxtral-small-24b-2507": { + "id": "mistralai/voxtral-small-24b-2507", + "name": "Mistral: Voxtral Small 24B 2507", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.28, "output": 1.1 }, - "limit": { "context": 123000, "output": 12000 } - }, - "baidu/ernie-4.5-vl-424b-a47b": { - "id": "baidu/ernie-4.5-vl-424b-a47b", - "name": "ERNIE 4.5 VL 424B A47B", - "attachment": true, - "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.42, "output": 1.25 }, - "limit": { "context": 123000, "output": 16000 } - }, - "minimaxai/minimax-m1-80k": { - "id": "minimaxai/minimax-m1-80k", - "name": "MiniMax M1", - "family": "minimax", - "attachment": false, - "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text", "audio"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.2 }, - "limit": { "context": 1000000, "output": 40000 } + "limit": { + "context": 32000, + "output": 6400 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "meta-llama/llama-3.3-70b-instruct": { - "id": "meta-llama/llama-3.3-70b-instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "mistralai/mixtral-8x7b-instruct": { + "id": "mistralai/mixtral-8x7b-instruct", + "name": "Mistral: Mixtral 8x7B Instruct", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-12-07", - "last_updated": "2024-12-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-12-10", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.135, "output": 0.4 }, - "limit": { "context": 131072, "output": 120000 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.54, + "output": 0.54 + } }, - "meta-llama/llama-3.1-8b-instruct": { - "id": "meta-llama/llama-3.1-8b-instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", - "attachment": false, + "mistralai/mistral-medium-3": { + "id": "mistralai/mistral-medium-3", + "name": "Mistral: Mistral Medium 3", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2024-07-24", - "last_updated": "2024-07-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.05 }, - "limit": { "context": 16384, "output": 16384 } + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "meta-llama/llama-4-scout-17b-16e-instruct": { - "id": "meta-llama/llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout Instruct", + "mistralai/mistral-small-3.2-24b-instruct": { + "id": "mistralai/mistral-small-3.2-24b-instruct", + "name": "Mistral: Mistral Small 3.2 24B", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-04-06", - "last_updated": "2025-04-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-06-20", + "last_updated": "2025-06-20", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.18, "output": 0.59 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.06, + "output": 0.18, + "cache_read": 0.03 + } }, - "meta-llama/llama-3-8b-instruct": { - "id": "meta-llama/llama-3-8b-instruct", - "name": "Llama 3 8B Instruct", - "family": "llama", + "mistralai/devstral-small": { + "id": "mistralai/devstral-small", + "name": "Mistral: Devstral Small 1.1", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2024-04-25", - "last_updated": "2024-04-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-05-07", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "meta-llama/llama-3-70b-instruct": { - "id": "meta-llama/llama-3-70b-instruct", - "name": "Llama3 70B Instruct", - "family": "llama", + "mistralai/mistral-large": { + "id": "mistralai/mistral-large", + "name": "Mistral Large", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2024-04-25", - "last_updated": "2024-04-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-24", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.51, "output": 0.74 }, - "limit": { "context": 8192, "output": 8000 } + "limit": { + "context": 128000, + "output": 25600 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "meta-llama/llama-4-maverick-17b-128e-instruct-fp8": { - "id": "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", - "name": "Llama 4 Maverick Instruct", - "attachment": true, + "mistralai/mistral-7b-instruct-v0.1": { + "id": "mistralai/mistral-7b-instruct-v0.1", + "name": "Mistral: Mistral 7B Instruct v0.1", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-04-06", - "last_updated": "2025-04-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 0.85 }, - "limit": { "context": 1048576, "output": 8192 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2824, + "output": 565 + }, + "cost": { + "input": 0.11, + "output": 0.19 + } }, - "nousresearch/hermes-2-pro-llama-3-8b": { - "id": "nousresearch/hermes-2-pro-llama-3-8b", - "name": "Hermes 2 Pro Llama 3 8B", - "attachment": false, + "mistralai/ministral-14b-2512": { + "id": "mistralai/ministral-14b-2512", + "name": "Mistral: Ministral 3 14B 2512", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2024-06-27", - "last_updated": "2024-06-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.14, "output": 0.14 }, - "limit": { "context": 8192, "output": 8192 } + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 52429 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "minimax/minimax-m2": { - "id": "minimax/minimax-m2", - "name": "MiniMax-M2", - "family": "minimax", - "attachment": false, + "~anthropic/claude-haiku-latest": { + "id": "~anthropic/claude-haiku-latest", + "name": "Anthropic: Claude Haiku Latest", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "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 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "Minimax M2.1", - "family": "minimax", - "attachment": false, - "reasoning": false, + "~anthropic/claude-sonnet-latest": { + "id": "~anthropic/claude-sonnet-latest", + "name": "Anthropic: Claude Sonnet Latest", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "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 + } }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "~anthropic/claude-opus-latest": { + "id": "~anthropic/claude-opus-latest", + "name": "Anthropic: Claude Opus Latest", + "attachment": true, "reasoning": true, "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"] }, + "temperature": false, + "release_date": "2026-04-16", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131100 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "qwen/qwen3-coder-30b-a3b-instruct": { - "id": "qwen/qwen3-coder-30b-a3b-instruct", - "name": "Qwen3 Coder 30b A3B Instruct", + "meta-llama/llama-3.3-70b-instruct": { + "id": "meta-llama/llama-3.3-70b-instruct", + "name": "Meta: Llama 3.3 70B Instruct", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-09", - "last_updated": "2025-10-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-08-01", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.27 }, - "limit": { "context": 160000, "output": 32768 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.32 + } }, - "qwen/qwen3-235b-a22b-instruct-2507": { - "id": "qwen/qwen3-235b-a22b-instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", - "attachment": false, + "meta-llama/llama-4-scout": { + "id": "meta-llama/llama-4-scout", + "name": "Meta: Llama 4 Scout", + "attachment": true, "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"] }, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.58 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 327680, + "output": 16384 + }, + "cost": { + "input": 0.08, + "output": 0.3 + } }, - "qwen/qwen-mt-plus": { - "id": "qwen/qwen-mt-plus", - "name": "Qwen MT Plus", + "meta-llama/llama-guard-3-8b": { + "id": "meta-llama/llama-guard-3-8b", + "name": "Llama Guard 3 8B", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-09-03", - "last_updated": "2025-09-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-04-18", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.25, "output": 0.75 }, - "limit": { "context": 16384, "output": 8192 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.02, + "output": 0.06 + } }, - "qwen/qwen3-vl-235b-a22b-instruct": { - "id": "qwen/qwen3-vl-235b-a22b-instruct", - "name": "Qwen3 VL 235B A22B Instruct", + "meta-llama/llama-4-maverick": { + "id": "meta-llama/llama-4-maverick", + "name": "Meta: Llama 4 Maverick", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-04-05", + "last_updated": "2025-12-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1048576, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "qwen/qwen3-coder-next": { - "id": "qwen/qwen3-coder-next", - "name": "Qwen3 Coder Next", - "family": "qwen", - "attachment": false, + "meta-llama/llama-3.2-11b-vision-instruct": { + "id": "meta-llama/llama-3.2-11b-vision-instruct", + "name": "Meta: Llama 3.2 11B Vision Instruct", + "attachment": true, "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, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 262144, "output": 65536 } - }, - "qwen/qwen3-8b-fp8": { - "id": "qwen/qwen3-8b-fp8", - "name": "Qwen3 8B", - "attachment": false, - "reasoning": true, "tool_call": false, "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.035, "output": 0.138 }, - "limit": { "context": 128000, "output": 20000 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.049, + "output": 0.049 + } }, - "qwen/qwen3-omni-30b-a3b-instruct": { - "id": "qwen/qwen3-omni-30b-a3b-instruct", - "name": "Qwen3 Omni 30B A3B Instruct", - "family": "qwen", + "meta-llama/llama-guard-4-12b": { + "id": "meta-llama/llama-guard-4-12b", + "name": "Meta: Llama Guard 4 12B", "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "video", "audio", "image"], "output": ["text", "audio"] }, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.25, "output": 0.97, "input_audio": 2.2, "output_audio": 1.788 }, - "limit": { "context": 65536, "output": 16384 } + "limit": { + "context": 163840, + "output": 32768 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } }, - "qwen/qwen2.5-7b-instruct": { - "id": "qwen/qwen2.5-7b-instruct", - "name": "Qwen2.5 7B Instruct", + "meta-llama/llama-3.1-70b-instruct": { + "id": "meta-llama/llama-3.1-70b-instruct", + "name": "Meta: Llama 3.1 70B Instruct", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-16", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.07 }, - "limit": { "context": 32000, "output": 32000 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } }, - "qwen/qwen3-30b-a3b-fp8": { - "id": "qwen/qwen3-30b-a3b-fp8", - "name": "Qwen3 30B A3B", + "meta-llama/llama-3.2-1b-instruct": { + "id": "meta-llama/llama-3.2-1b-instruct", + "name": "Meta: Llama 3.2 1B Instruct", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-09-18", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.45 }, - "limit": { "context": 40960, "output": 20000 } + "limit": { + "context": 60000, + "output": 12000 + }, + "cost": { + "input": 0.027, + "output": 0.2 + } }, - "qwen/qwen3-235b-a22b-fp8": { - "id": "qwen/qwen3-235b-a22b-fp8", - "name": "Qwen3 235B A22B", + "meta-llama/llama-3.2-3b-instruct": { + "id": "meta-llama/llama-3.2-3b-instruct", + "name": "Meta: Llama 3.2 3B Instruct", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-09-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 40960, "output": 20000 } + "limit": { + "context": 80000, + "output": 16384 + }, + "cost": { + "input": 0.051, + "output": 0.34 + } }, - "qwen/qwen2.5-vl-72b-instruct": { - "id": "qwen/qwen2.5-vl-72b-instruct", - "name": "Qwen2.5 VL 72B Instruct", - "family": "qwen", - "attachment": true, + "meta-llama/llama-3-8b-instruct": { + "id": "meta-llama/llama-3-8b-instruct", + "name": "Meta: Llama 3 8B Instruct", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2024-04-25", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 0.8 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 8192, + "output": 16384 + }, + "cost": { + "input": 0.03, + "output": 0.04 + } }, - "qwen/qwen3-vl-8b-instruct": { - "id": "qwen/qwen3-vl-8b-instruct", - "name": "qwen/qwen3-vl-8b-instruct", - "attachment": true, + "meta-llama/llama-3.1-8b-instruct": { + "id": "meta-llama/llama-3.1-8b-instruct", + "name": "Meta: Llama 3.1 8B Instruct", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-17", - "last_updated": "2025-10-17", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2024-07-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.5 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0.05 + } }, - "qwen/qwen3-coder-480b-a35b-instruct": { - "id": "qwen/qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "meta-llama/llama-3-70b-instruct": { + "id": "meta-llama/llama-3-70b-instruct", + "name": "Meta: Llama 3 70B Instruct", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.3 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 8192, + "output": 8000 + }, + "cost": { + "input": 0.51, + "output": 0.74 + } }, - "qwen/qwen3-next-80b-a3b-thinking": { - "id": "qwen/qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", + "x-ai/grok-4.20": { + "id": "x-ai/grok-4.20", + "name": "xAI: Grok 4.20", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-31", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2 + } + }, + "x-ai/grok-code-fast-1:optimized:free": { + "id": "x-ai/grok-code-fast-1:optimized:free", + "name": "xAI: Grok Code Fast 1 Optimized (experimental, free)", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-10", - "last_updated": "2025-09-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-08-27", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-vl-30b-a3b-instruct": { - "id": "qwen/qwen3-vl-30b-a3b-instruct", - "name": "qwen/qwen3-vl-30b-a3b-instruct", + "x-ai/grok-4.3": { + "id": "x-ai/grok-4.3", + "name": "xAI: Grok 4.3", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-11", - "last_updated": "2025-10-11", - "modalities": { "input": ["text", "video", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.7 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2026-05-01", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 4096 + }, + "cost": { + "input": 1.25, + "output": 2.5, + "cache_read": 0.2 + } }, - "qwen/qwen3-235b-a22b-thinking-2507": { - "id": "qwen/qwen3-235b-a22b-thinking-2507", - "name": "Qwen3 235B A22b Thinking 2507", - "family": "qwen", + "x-ai/grok-4-fast": { + "id": "x-ai/grok-4-fast", + "name": "xAI: Grok 4 Fast", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-08-19", + "last_updated": "2025-08-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 + } + }, + "x-ai/grok-code-fast-1": { + "id": "x-ai/grok-code-fast-1", + "name": "xAI: Grok Code Fast 1", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.3, "output": 3 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "qwen/qwen3-next-80b-a3b-instruct": { - "id": "qwen/qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", + "x-ai/grok-3-beta": { + "id": "x-ai/grok-3-beta", + "name": "xAI: Grok 3 Beta", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-10", - "last_updated": "2025-09-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "qwen/qwen3-omni-30b-a3b-thinking": { - "id": "qwen/qwen3-omni-30b-a3b-thinking", - "name": "Qwen3 Omni 30B A3B Thinking", + "x-ai/grok-4": { + "id": "x-ai/grok-4", + "name": "xAI: Grok 4", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "audio", "video", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 0.97, "input_audio": 2.2, "output_audio": 1.788 }, - "limit": { "context": 65536, "output": 16384 } + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 51200 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "qwen/qwen3-vl-30b-a3b-thinking": { - "id": "qwen/qwen3-vl-30b-a3b-thinking", - "name": "qwen/qwen3-vl-30b-a3b-thinking", + "x-ai/grok-3-mini": { + "id": "x-ai/grok-3-mini", + "name": "xAI: Grok 3 Mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "cache_read": 0.075 + } + }, + "x-ai/grok-4.1-fast": { + "id": "x-ai/grok-4.1-fast", + "name": "xAI: Grok 4.1 Fast", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-11", - "last_updated": "2025-10-11", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1 }, - "limit": { "context": 131072, "output": 32768 } + "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 + } }, - "qwen/qwen3-32b-fp8": { - "id": "qwen/qwen3-32b-fp8", - "name": "Qwen3 32B", + "x-ai/grok-3-mini-beta": { + "id": "x-ai/grok-3-mini-beta", + "name": "xAI: Grok 3 Mini Beta", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.45 }, - "limit": { "context": 40960, "output": 20000 } + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "cache_read": 0.075 + } }, - "qwen/qwen3.5-397b-a17b": { - "id": "qwen/qwen3.5-397b-a17b", - "name": "Qwen3.5-397B-A17B", - "family": "qwen", + "x-ai/grok-4.20-multi-agent": { + "id": "x-ai/grok-4.20-multi-agent", + "name": "xAI: Grok 4.20 Multi-Agent", "attachment": true, "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2026-03-31", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2 + } + }, + "x-ai/grok-3": { + "id": "x-ai/grok-3", + "name": "xAI: Grok 3", + "attachment": false, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 262144, "output": 64000 } + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "qwen/qwen3-max": { - "id": "qwen/qwen3-max", - "name": "Qwen3 Max", - "family": "qwen", + "tencent/hy3-preview:free": { + "id": "tencent/hy3-preview:free", + "name": "Tencent: Hy3 Preview (free)", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-22", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.11, "output": 8.45 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-4b-fp8": { - "id": "qwen/qwen3-4b-fp8", - "name": "Qwen3 4B", + "tencent/hunyuan-a13b-instruct": { + "id": "tencent/hunyuan-a13b-instruct", + "name": "Tencent: Hunyuan A13B Instruct", "attachment": false, "reasoning": true, "tool_call": false, "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.03 }, - "limit": { "context": 128000, "output": 20000 } + "release_date": "2025-06-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "qwen/qwen3-vl-235b-a22b-thinking": { - "id": "qwen/qwen3-vl-235b-a22b-thinking", - "name": "Qwen3 VL 235B A22B Thinking", - "attachment": true, - "reasoning": true, + "gryphe/mythomax-l2-13b": { + "id": "gryphe/mythomax-l2-13b", + "name": "MythoMax 13B", + "attachment": false, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2024-04-25", + "last_updated": "2024-04-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.98, "output": 3.95 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 0.06, + "output": 0.06 + } }, - "qwen/qwen-2.5-72b-instruct": { - "id": "qwen/qwen-2.5-72b-instruct", - "name": "Qwen 2.5 72B Instruct", - "family": "qwen", + "sao10k/l3-euryale-70b": { + "id": "sao10k/l3-euryale-70b", + "name": "Sao10k: Llama 3 Euryale 70B v2.1", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-10-15", - "last_updated": "2024-10-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-06-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.38, "output": 0.4 }, - "limit": { "context": 32000, "output": 8192 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 1.48, + "output": 1.48 + } }, - "baichuan/baichuan-m2-32b": { - "id": "baichuan/baichuan-m2-32b", - "name": "baichuan-m2-32b", - "family": "baichuan", + "sao10k/l3-lunaris-8b": { + "id": "sao10k/l3-lunaris-8b", + "name": "Sao10K: Llama 3 8B Lunaris", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-08-13", - "last_updated": "2025-08-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-08-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.07 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.04, + "output": 0.05 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi", + "sao10k/l3.3-euryale-70b": { + "id": "sao10k/l3.3-euryale-70b", + "name": "Sao10K: Llama 3.3 Euryale 70B", "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-11-07", - "last_updated": "2025-11-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.65, + "output": 0.75 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": true, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, + "sao10k/l3.1-70b-hanami-x1": { + "id": "sao10k/l3.1-70b-hanami-x1", + "name": "Sao10K: Llama 3.1 70B Hanami x1", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-01-08", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 16000, + "output": 16000 + }, + "cost": { + "input": 3, + "output": 3 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "Kimi K2 0905", - "family": "kimi", + "sao10k/l3.1-euryale-70b": { + "id": "sao10k/l3.1-euryale-70b", + "name": "Sao10K: Llama 3.1 Euryale 70B v2.2", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-08-28", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.85, + "output": 0.85 + } }, - "moonshotai/kimi-k2-instruct": { - "id": "moonshotai/kimi-k2-instruct", - "name": "Kimi K2 Instruct", + "microsoft/wizardlm-2-8x22b": { + "id": "microsoft/wizardlm-2-8x22b", + "name": "WizardLM-2 8x22B", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2025-07-11", - "last_updated": "2025-07-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-04-24", + "last_updated": "2024-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.57, "output": 2.3 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 65535, + "output": 8000 + }, + "cost": { + "input": 0.62, + "output": 0.62 + } }, - "xiaomimimo/mimo-v2-flash": { - "id": "xiaomimimo/mimo-v2-flash", - "name": "XiaomiMiMo/MiMo-V2-Flash", - "family": "mimo", + "microsoft/phi-4-mini-instruct": { + "id": "microsoft/phi-4-mini-instruct", + "name": "Microsoft: Phi 4 Mini Instruct", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-19", - "last_updated": "2025-12-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-17", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.3 }, - "limit": { "context": 262144, "output": 32000 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.08, + "output": 0.35, + "cache_read": 0.08 + } }, - "mistralai/mistral-nemo": { - "id": "mistralai/mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", + "microsoft/phi-4": { + "id": "microsoft/phi-4", + "name": "Microsoft: Phi 4", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": true, "temperature": true, - "release_date": "2024-07-30", - "last_updated": "2024-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.04, "output": 0.17 }, - "limit": { "context": 60288, "output": 16000 } - } - } - }, - "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": { - "claude-4-6-sonnet": { - "id": "claude-4-6-sonnet", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.06, + "output": 0.14 + } + }, + "poolside/laguna-m.1:free": { + "id": "poolside/laguna-m.1:free", + "name": "Poolside: Laguna M.1 (free)", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-04-28", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.59, "output": 17.92 }, - "limit": { "context": 1000000, "output": 1000000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-v3-0324": { - "id": "deepseek-v3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", + "poolside/laguna-xs.2:free": { + "id": "poolside/laguna-xs.2:free", + "name": "Poolside: Laguna XS.2 (free)", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.551, "output": 1.654 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2026-04-28", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "attachment": true, - "reasoning": true, + "cohere/command-r7b-12-2024": { + "id": "cohere/command-r7b-12-2024", + "name": "Cohere: Command R7B (12-2024)", + "attachment": false, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-12", - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-02-27", + "last_updated": "2024-02-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.656, "output": 2.731 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 128000, + "output": 4000 + }, + "cost": { + "input": 0.0375, + "output": 0.15 + } }, - "devstral-2512": { - "id": "devstral-2512", - "name": "Devstral 2 2512", + "cohere/command-a": { + "id": "cohere/command-a", + "name": "Cohere: Command A", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-12", - "release_date": "2025-12-09", - "last_updated": "2025-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi-thinking", + "cohere/command-r-plus-08-2024": { + "id": "cohere/command-r-plus-08-2024", + "name": "Cohere: Command R+ (08-2024)", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2024-08-30", + "last_updated": "2024-08-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.76 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 128000, + "output": 4000 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "llama-3.1-405b-instruct": { - "id": "llama-3.1-405b-instruct", - "name": "Llama 3.1 405B Instruct", - "family": "llama", + "cohere/command-r-08-2024": { + "id": "cohere/command-r-08-2024", + "name": "Cohere: Command R (08-2024)", "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"] }, + "release_date": "2024-08-30", + "last_updated": "2024-08-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 128000, + "output": 4000 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "glm-4.7-flash": { - "id": "glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm", + "prime-intellect/intellect-3": { + "id": "prime-intellect/intellect-3", + "name": "Prime Intellect: INTELLECT-3", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-08-08", - "last_updated": "2025-08-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-26", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.53 }, - "limit": { "context": 203000, "output": 203000 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 1.1 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT 4.1", - "family": "gpt", + "nvidia/llama-3.3-nemotron-super-49b-v1.5": { + "id": "nvidia/llama-3.3-nemotron-super-49b-v1.5", + "name": "NVIDIA: Llama 3.3 Nemotron Super 49B V1.5", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-03-16", + "last_updated": "2025-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.354, "output": 9.417 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "minimax-m2": { - "id": "minimax-m2", - "name": "MiniMax-M2", - "family": "minimax", + "nvidia/nemotron-3-super-120b-a12b": { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "NVIDIA: Nemotron 3 Super", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-11", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.39, "output": 1.57 }, - "limit": { "context": 400000, "output": 400000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.1, + "output": 0.5, + "cache_read": 0.1 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "GPT Oss 120b", - "family": "gpt-oss", + "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)", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-04-28", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "audio", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "nvidia/nemotron-3-nano-30b-a3b": { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "NVIDIA: Nemotron 3 Nano 30B A3B", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-01", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 262144, + "output": 52429 + }, + "cost": { + "input": 0.05, + "output": 0.2 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM 4.5", - "family": "glm", + "nvidia/nemotron-3-super-120b-a12b:free": { + "id": "nvidia/nemotron-3-super-120b-a12b:free", + "name": "NVIDIA: Nemotron 3 Super (free)", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-12", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.67, "output": 2.46 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "minimax-m2.1": { - "id": "minimax-m2.1", - "name": "MiniMax-M2.1", - "family": "minimax", + "nvidia/nemotron-nano-9b-v2": { + "id": "nvidia/nemotron-nano-9b-v2", + "name": "NVIDIA: Nemotron Nano 9B V2", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-18", + "last_updated": "2025-08-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.34, "output": 1.34 }, - "limit": { "context": 196000, "output": 196000 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.04, + "output": 0.16 + } }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "nvidia/llama-3.1-nemotron-70b-instruct": { + "id": "nvidia/llama-3.1-nemotron-70b-instruct", + "name": "NVIDIA: Llama 3.1 Nemotron 70B Instruct", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.441, "output": 1.984 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2024-10-12", + "last_updated": "2024-10-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 1.2, + "output": 1.2 + } }, - "qwen3-next-80b-a3b-thinking": { - "id": "qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", + "inception/mercury-2": { + "id": "inception/mercury-2", + "name": "Inception: Mercury 2", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.164, "output": 1.311 }, - "limit": { "context": 128000, "output": 128000 } + "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 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", - "attachment": false, + "openai/gpt-5.1-codex-max": { + "id": "openai/gpt-5.1-codex-max", + "name": "OpenAI: GPT-5.1-Codex-Max", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "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, + "cache_read": 0.125 + } + }, + "openai/gpt-5.2-chat": { + "id": "openai/gpt-5.2-chat", + "name": "OpenAI: GPT-5.2 Chat", + "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-12-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } + }, + "openai/gpt-4o-mini-search-preview": { + "id": "openai/gpt-4o-mini-search-preview", + "name": "OpenAI: GPT-4o-mini Search Preview", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2025-01", + "last_updated": "2025-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.654, "output": 11.024 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "claude-opus4-5": { - "id": "claude-opus4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "openai/gpt-5-chat": { + "id": "openai/gpt-5-chat", + "name": "OpenAI: GPT-5 Chat", "attachment": true, - "reasoning": true, - "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"] }, + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2025-08-07", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5.98, "output": 29.89 }, - "limit": { "context": 200000, "output": 200000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "nova-pro-v1": { - "id": "nova-pro-v1", - "name": "Nova Pro 1.0", - "family": "nova-pro", - "attachment": false, + "openai/gpt-4o-2024-05-13": { + "id": "openai/gpt-4o-2024-05-13", + "name": "OpenAI: GPT-4o (2024-05-13)", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-05-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.016, "output": 4.061 }, - "limit": { "context": 300000, "output": 5000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 5, + "output": 15 + } }, - "claude-sonnet-4": { - "id": "claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", - "attachment": false, + "openai/gpt-5.3-chat": { + "id": "openai/gpt-5.3-chat", + "name": "OpenAI: GPT-5.3 Chat", + "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-03-04", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.307, "output": 16.536 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14 + } }, - "intellect-3": { - "id": "intellect-3", - "name": "INTELLECT 3", + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "OpenAI: GPT-5.2 Pro", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-26", - "last_updated": "2025-11-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.219, "output": 1.202 }, - "limit": { "context": 128000, "output": 128000 } + "temperature": false, + "release_date": "2025-12-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 21, + "output": 168 + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM 4.5 Air", - "family": "glm-air", + "openai/gpt-4-1106-preview": { + "id": "openai/gpt-4-1106-preview", + "name": "OpenAI: GPT-4 Turbo (older v1106)", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 1.34 }, - "limit": { "context": 131072, "output": 131072 } + "release_date": "2023-11-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM 4.7", - "family": "glm", - "attachment": false, + "openai/gpt-chat-latest": { + "id": "openai/gpt-chat-latest", + "name": "OpenAI: GPT Chat Latest", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.45, "output": 2.23 }, - "limit": { "context": 198000, "output": 198000 } - }, - "devstral-small-2512": { - "id": "devstral-small-2512", - "name": "Devstral Small 2 2512", - "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", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262000, "output": 262000 } + "structured_output": true, + "temperature": false, + "release_date": "2026-05-05", + "last_updated": "2026-05-07", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3 32B", - "family": "qwen", + "openai/gpt-4o-audio-preview": { + "id": "openai/gpt-4o-audio-preview", + "name": "OpenAI: GPT-4o Audio", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.099, "output": 0.33 }, - "limit": { "context": 16384, "output": 16384 } + "release_date": "2025-08-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "text"], + "output": ["audio", "text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "claude-opus4-6": { - "id": "claude-opus4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "OpenAI: GPT-5.5", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-04-24", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5.98, "output": 29.89 }, - "limit": { "context": 1000000, "output": 1000000 } + "limit": { + "context": 1050000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5 + } }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "OpenAI: GPT-5 Mini", "attachment": true, "reasoning": true, "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"] }, + "temperature": false, + "release_date": "2025-08-07", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.09, "output": 5.43 }, - "limit": { "context": 200000, "output": 200000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "minimax-m2.5": { - "id": "minimax-m2.5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "OpenAI: GPT-5 Nano", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.32, "output": 1.18 }, - "limit": { "context": 196608, "output": 196608 } - }, - "kimi-k2-instruct": { - "id": "kimi-k2-instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-07-11", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.551, "output": 2.646 }, - "limit": { "context": 131000, "output": 131000 } + "temperature": false, + "release_date": "2025-08-07", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "claude-4-5-sonnet": { - "id": "claude-4-5-sonnet", - "name": "Claude 4.5 Sonnet", - "family": "claude-sonnet", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "OpenAI: GPT-5.3-Codex", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-02-25", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.259, "output": 16.296 }, - "limit": { "context": 200000, "output": 200000 } - } - } - }, - "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": { - "THUDM/GLM-4-9B-0414": { - "id": "THUDM/GLM-4-9B-0414", - "name": "THUDM/GLM-4-9B-0414", - "family": "glm", + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14 + } + }, + "openai/gpt-3.5-turbo-16k": { + "id": "openai/gpt-3.5-turbo-16k", + "name": "OpenAI: GPT-3.5 Turbo 16k", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-08-28", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.086, "output": 0.086 }, - "limit": { "context": 33000, "output": 33000 } + "limit": { + "context": 16385, + "output": 4096 + }, + "cost": { + "input": 3, + "output": 4 + } }, - "THUDM/GLM-4-32B-0414": { - "id": "THUDM/GLM-4-32B-0414", - "name": "THUDM/GLM-4-32B-0414", - "family": "glm", - "attachment": false, + "openai/gpt-4-turbo": { + "id": "openai/gpt-4-turbo", + "name": "OpenAI: GPT-4 Turbo", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-09-13", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.27 }, - "limit": { "context": 33000, "output": 33000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "THUDM/GLM-Z1-9B-0414": { - "id": "THUDM/GLM-Z1-9B-0414", - "name": "THUDM/GLM-Z1-9B-0414", - "family": "glm-z", - "attachment": false, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "OpenAI: GPT-5.2", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-12-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.086, "output": 0.086 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "THUDM/GLM-Z1-32B-0414": { - "id": "THUDM/GLM-Z1-32B-0414", - "name": "THUDM/GLM-Z1-32B-0414", - "family": "glm-z", - "attachment": false, + "openai/o3-pro": { + "id": "openai/o3-pro", + "name": "OpenAI: o3 Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-04-16", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 20, + "output": 80 + } }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "zai-org/GLM-4.6", - "family": "glm", - "attachment": false, + "openai/o3-mini-high": { + "id": "openai/o3-mini-high", + "name": "OpenAI: o3 Mini High", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-01-31", + "last_updated": "2026-03-15", + "modalities": { + "input": ["pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 1.9 }, - "limit": { "context": 205000, "output": 205000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "zai-org/GLM-4.5V": { - "id": "zai-org/GLM-4.5V", - "name": "zai-org/GLM-4.5V", - "family": "glm", + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "OpenAI: GPT-4o-mini", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-07-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.86 }, - "limit": { "context": 66000, "output": 66000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.075 + } }, - "zai-org/GLM-4.6V": { - "id": "zai-org/GLM-4.6V", - "name": "zai-org/GLM-4.6V", - "family": "glm", + "openai/o4-mini-deep-research": { + "id": "openai/o4-mini-deep-research", + "name": "OpenAI: o4 Mini Deep Research", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2025-12-07", - "last_updated": "2025-12-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-06-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } + }, + "openai/gpt-5.4-mini": { + "id": "openai/gpt-5.4-mini", + "name": "OpenAI: GPT-5.4 Mini", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2026-03-17", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "zai-org/GLM-4.5-Air": { - "id": "zai-org/GLM-4.5-Air", - "name": "zai-org/GLM-4.5-Air", - "family": "glm-air", - "attachment": false, + "openai/gpt-5.1-chat": { + "id": "openai/gpt-5.1-chat", + "name": "OpenAI: GPT-5.1 Chat", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-11-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.86 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "stepfun-ai/Step-3.5-Flash": { - "id": "stepfun-ai/Step-3.5-Flash", - "name": "stepfun-ai/Step-3.5-Flash", - "family": "step", - "attachment": false, + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "OpenAI: o4 Mini", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-04-16", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.275 + } }, - "Pro/zai-org/GLM-4.7": { - "id": "Pro/zai-org/GLM-4.7", - "name": "Pro/zai-org/GLM-4.7", - "family": "glm", - "attachment": false, + "openai/gpt-5.4-nano": { + "id": "openai/gpt-5.4-nano", + "name": "OpenAI: GPT-5.4 Nano", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-03-17", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 205000, "output": 205000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "Pro/zai-org/GLM-5": { - "id": "Pro/zai-org/GLM-5", - "name": "Pro/zai-org/GLM-5", - "family": "glm", - "attachment": false, + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "OpenAI: GPT-5.2-Codex", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 205000, "output": 205000 } + "temperature": false, + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "Pro/MiniMaxAI/MiniMax-M2.1": { - "id": "Pro/MiniMaxAI/MiniMax-M2.1", - "name": "Pro/MiniMaxAI/MiniMax-M2.1", - "family": "minimax", - "attachment": false, + "openai/gpt-4o-mini-2024-07-18": { + "id": "openai/gpt-4o-mini-2024-07-18", + "name": "OpenAI: GPT-4o-mini (2024-07-18)", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-07-18", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 197000, "output": 131000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "Pro/MiniMaxAI/MiniMax-M2.5": { - "id": "Pro/MiniMaxAI/MiniMax-M2.5", - "name": "Pro/MiniMaxAI/MiniMax-M2.5", - "family": "minimax", - "attachment": false, - "reasoning": false, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "OpenAI: GPT-5.1-Codex-Mini", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.22 }, - "limit": { "context": 192000, "output": 131000 } + "limit": { + "context": 400000, + "output": 100000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "Pro/deepseek-ai/DeepSeek-R1": { - "id": "Pro/deepseek-ai/DeepSeek-R1", - "name": "Pro/deepseek-ai/DeepSeek-R1", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, + "openai/gpt-4o-2024-08-06": { + "id": "openai/gpt-4o-2024-08-06", + "name": "OpenAI: GPT-4o (2024-08-06)", + "attachment": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-08-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2.18 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "Pro/deepseek-ai/DeepSeek-V3.1-Terminus": { - "id": "Pro/deepseek-ai/DeepSeek-V3.1-Terminus", - "name": "Pro/deepseek-ai/DeepSeek-V3.1-Terminus", - "family": "deepseek", - "attachment": false, + "openai/gpt-5-image": { + "id": "openai/gpt-5-image", + "name": "OpenAI: GPT-5 Image", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-14", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["image", "text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 10, + "output": 10 + } }, - "Pro/deepseek-ai/DeepSeek-V3.2": { - "id": "Pro/deepseek-ai/DeepSeek-V3.2", - "name": "Pro/deepseek-ai/DeepSeek-V3.2", - "family": "deepseek", - "attachment": false, + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "OpenAI: GPT-5.1", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-03", - "last_updated": "2025-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-11-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.42 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "Pro/deepseek-ai/DeepSeek-V3": { - "id": "Pro/deepseek-ai/DeepSeek-V3", - "name": "Pro/deepseek-ai/DeepSeek-V3", - "family": "deepseek", - "attachment": false, + "openai/o1": { + "id": "openai/o1", + "name": "OpenAI: o1", + "attachment": true, "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"] }, + "temperature": false, + "release_date": "2024-12-05", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } }, - "Pro/moonshotai/Kimi-K2.5": { - "id": "Pro/moonshotai/Kimi-K2.5", - "name": "Pro/moonshotai/Kimi-K2.5", - "family": "kimi", - "attachment": false, + "openai/gpt-5.4-pro": { + "id": "openai/gpt-5.4-pro", + "name": "OpenAI: GPT-5.4 Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.55, "output": 3 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 1050000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180 + } }, - "Pro/moonshotai/Kimi-K2-Instruct-0905": { - "id": "Pro/moonshotai/Kimi-K2-Instruct-0905", - "name": "Pro/moonshotai/Kimi-K2-Instruct-0905", - "family": "kimi", + "openai/gpt-3.5-turbo": { + "id": "openai/gpt-3.5-turbo", + "name": "OpenAI: GPT-3.5 Turbo", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-08", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-03-01", + "last_updated": "2023-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 16385, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "Pro/moonshotai/Kimi-K2-Thinking": { - "id": "Pro/moonshotai/Kimi-K2-Thinking", - "name": "Pro/moonshotai/Kimi-K2-Thinking", - "family": "kimi-thinking", - "attachment": false, + "openai/o3-deep-research": { + "id": "openai/o3-deep-research", + "name": "OpenAI: o3 Deep Research", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-11-07", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-06-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.55, "output": 2.5 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 10, + "output": 40, + "cache_read": 2.5 + } }, - "baidu/ERNIE-4.5-300B-A47B": { - "id": "baidu/ERNIE-4.5-300B-A47B", - "name": "baidu/ERNIE-4.5-300B-A47B", - "family": "ernie", - "attachment": false, + "openai/o3-mini": { + "id": "openai/o3-mini", + "name": "OpenAI: o3 Mini", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-07-02", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-12-20", + "last_updated": "2026-03-15", + "modalities": { + "input": ["pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 1.1 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "PaddlePaddle/PaddleOCR-VL-1.5": { - "id": "PaddlePaddle/PaddleOCR-VL-1.5", - "name": "PaddlePaddle/PaddleOCR-VL-1.5", - "attachment": true, + "openai/gpt-4-turbo-preview": { + "id": "openai/gpt-4-turbo-preview", + "name": "OpenAI: GPT-4 Turbo Preview", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 16384, "output": 16384 } + "release_date": "2024-01-25", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "PaddlePaddle/PaddleOCR-VL": { - "id": "PaddlePaddle/PaddleOCR-VL", - "name": "PaddlePaddle/PaddleOCR-VL", + "openai/o1-pro": { + "id": "openai/o1-pro", + "name": "OpenAI: o1-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": false, - "temperature": true, - "release_date": "2025-10-16", - "last_updated": "2025-10-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 16384, "output": 16384 } + "temperature": false, + "release_date": "2025-03-19", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 150, + "output": 600 + } }, - "deepseek-ai/DeepSeek-OCR": { - "id": "deepseek-ai/DeepSeek-OCR", - "name": "deepseek-ai/DeepSeek-OCR", + "openai/gpt-5.4-image-2": { + "id": "openai/gpt-5.4-image-2", + "name": "OpenAI: GPT-5.4 Image 2", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": false, - "temperature": true, - "release_date": "2025-10-20", - "last_updated": "2025-10-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 8192 } + "temperature": false, + "release_date": "2026-04-21", + "last_updated": "2026-05-01", + "modalities": { + "input": ["image", "text", "pdf"], + "output": ["image", "text"] + }, + "open_weights": false, + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 8, + "output": 15, + "cache_read": 2 + } }, - "deepseek-ai/DeepSeek-V3": { - "id": "deepseek-ai/DeepSeek-V3", - "name": "deepseek-ai/DeepSeek-V3", - "family": "deepseek", + "openai/gpt-4": { + "id": "openai/gpt-4", + "name": "OpenAI: GPT-4", "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"] }, + "release_date": "2023-03-14", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 8191, + "output": 4096 + }, + "cost": { + "input": 30, + "output": 60 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "deepseek-ai/DeepSeek-V3.2", - "family": "deepseek", + "openai/gpt-4-0314": { + "id": "openai/gpt-4-0314", + "name": "OpenAI: GPT-4 (older v0314)", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-12-03", - "last_updated": "2025-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-05-28", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.42 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 8191, + "output": 4096 + }, + "cost": { + "input": 30, + "output": 60 + } }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { - "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", - "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", - "family": "qwen", - "attachment": false, + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "OpenAI: GPT-5 Codex", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "deepseek-ai/DeepSeek-V3.1-Terminus": { - "id": "deepseek-ai/DeepSeek-V3.1-Terminus", - "name": "deepseek-ai/DeepSeek-V3.1-Terminus", - "family": "deepseek", - "attachment": false, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "OpenAI: GPT-5.4", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 1050000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15 + } }, - "deepseek-ai/DeepSeek-R1": { - "id": "deepseek-ai/DeepSeek-R1", - "name": "deepseek-ai/DeepSeek-R1", - "family": "deepseek-thinking", + "openai/gpt-audio": { + "id": "openai/gpt-audio", + "name": "OpenAI: GPT Audio", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-20", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "text"], + "output": ["audio", "text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2.18 }, - "limit": { "context": 164000, "output": 164000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { - "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", - "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", - "family": "qwen", + "openai/gpt-4o-search-preview": { + "id": "openai/gpt-4o-search-preview", + "name": "OpenAI: GPT-4o Search Preview", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 131000, "output": 131000 } - }, - "deepseek-ai/deepseek-vl2": { - "id": "deepseek-ai/deepseek-vl2", - "name": "deepseek-ai/deepseek-vl2", - "family": "deepseek", - "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-12-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": false, + "release_date": "2025-03-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 4000, "output": 4000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "ByteDance-Seed/Seed-OSS-36B-Instruct": { - "id": "ByteDance-Seed/Seed-OSS-36B-Instruct", - "name": "ByteDance-Seed/Seed-OSS-36B-Instruct", - "family": "seed", - "attachment": false, + "openai/gpt-4.1-nano": { + "id": "openai/gpt-4.1-nano", + "name": "OpenAI: GPT-4.1 Nano", + "attachment": true, "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"] }, + "release_date": "2025-04-14", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.21, "output": 0.57 }, - "limit": { "context": 262000, "output": 262000 } - }, - "Qwen/Qwen3.5-35B-A3B": { - "id": "Qwen/Qwen3.5-35B-A3B", - "name": "Qwen/Qwen3.5-35B-A3B", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-25", - "last_updated": "2026-02-25", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.23, "output": 1.86 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "Qwen/Qwen3.5-397B-A17B": { - "id": "Qwen/Qwen3.5-397B-A17B", - "name": "Qwen/Qwen3.5-397B-A17B", - "family": "qwen", - "attachment": false, + "openai/o4-mini-high": { + "id": "openai/o4-mini-high", + "name": "OpenAI: o4 Mini High", + "attachment": true, "reasoning": true, "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": true, - "cost": { "input": 0.29, "output": 1.74 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2025-04-17", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4 + } }, - "Qwen/Qwen3.5-122B-A10B": { - "id": "Qwen/Qwen3.5-122B-A10B", - "name": "Qwen/Qwen3.5-122B-A10B", - "family": "qwen", - "attachment": false, + "openai/o3": { + "id": "openai/o3", + "name": "OpenAI: o3", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-26", - "last_updated": "2026-02-26", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.29, "output": 2.32 }, - "limit": { "context": 262144, "output": 65536 } + "temperature": false, + "release_date": "2025-04-16", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "Qwen/Qwen3.5-9B": { - "id": "Qwen/Qwen3.5-9B", - "name": "Qwen/Qwen3.5-9B", - "family": "qwen", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "OpenAI: gpt-oss-20b", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.22, "output": 1.74 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.03, + "output": 0.14 + } }, - "Qwen/Qwen3.5-27B": { - "id": "Qwen/Qwen3.5-27B", - "name": "Qwen/Qwen3.5-27B", - "family": "qwen", - "attachment": false, + "openai/gpt-5-pro": { + "id": "openai/gpt-5-pro", + "name": "OpenAI: GPT-5 Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-25", - "last_updated": "2026-02-25", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.26, "output": 2.09 }, - "limit": { "context": 262144, "output": 65536 } + "temperature": false, + "release_date": "2025-10-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "Qwen/Qwen3.5-4B": { - "id": "Qwen/Qwen3.5-4B", - "name": "Qwen/Qwen3.5-4B", - "family": "qwen", + "openai/gpt-audio-mini": { + "id": "openai/gpt-audio-mini", + "name": "OpenAI: GPT Audio Mini", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2026-01-20", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "text"], + "output": ["audio", "text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.4 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "family": "qwen", - "attachment": false, + "openai/gpt-4o": { + "id": "openai/gpt-4o", + "name": "OpenAI: GPT-4o", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-23", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-05-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.09, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "Qwen/Qwen2.5-32B-Instruct": { - "id": "Qwen/Qwen2.5-32B-Instruct", - "name": "Qwen/Qwen2.5-32B-Instruct", - "family": "qwen", + "openai/gpt-3.5-turbo-0613": { + "id": "openai/gpt-3.5-turbo-0613", + "name": "OpenAI: GPT-3.5 Turbo (older v0613)", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-09-19", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-06-13", + "last_updated": "2023-06-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 33000, "output": 4000 } + "limit": { + "context": 4095, + "output": 4096 + }, + "cost": { + "input": 1, + "output": 2 + } }, - "Qwen/Qwen3-VL-32B-Thinking": { - "id": "Qwen/Qwen3-VL-32B-Thinking", - "name": "Qwen/Qwen3-VL-32B-Thinking", - "family": "qwen", + "openai/gpt-5-image-mini": { + "id": "openai/gpt-5-image-mini", + "name": "OpenAI: GPT-5 Image Mini", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-21", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-16", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["image", "text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 2 + } }, - "Qwen/Qwen2.5-72B-Instruct": { - "id": "Qwen/Qwen2.5-72B-Instruct", - "name": "Qwen/Qwen2.5-72B-Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "OpenAI: GPT-5", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-09-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-08-07", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.59, "output": 0.59 }, - "limit": { "context": 33000, "output": 4000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "Qwen/Qwen3-VL-235B-A22B-Instruct": { - "id": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "name": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "family": "qwen", - "attachment": true, - "reasoning": false, + "openai/gpt-oss-safeguard-20b": { + "id": "openai/gpt-oss-safeguard-20b", + "name": "OpenAI: gpt-oss-safeguard-20b", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-29", + "last_updated": "2025-10-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.075, + "output": 0.3, + "cache_read": 0.037 + } }, - "Qwen/Qwen2.5-7B-Instruct": { - "id": "Qwen/Qwen2.5-7B-Instruct", - "name": "Qwen/Qwen2.5-7B-Instruct", - "family": "qwen", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "OpenAI: gpt-oss-120b", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.05, "output": 0.05 }, - "limit": { "context": 33000, "output": 4000 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.039, + "output": 0.19 + } }, - "Qwen/Qwen3-Omni-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-Omni-30B-A3B-Instruct", - "name": "Qwen/Qwen3-Omni-30B-A3B-Instruct", - "family": "qwen", + "openai/gpt-5.5-pro": { + "id": "openai/gpt-5.5-pro", + "name": "OpenAI: GPT-5.5 Pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-04-24", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 66000, "output": 66000 } + "limit": { + "context": 1050000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180 + } }, - "Qwen/Qwen3-30B-A3B-Instruct-2507": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "family": "qwen", + "openai/gpt-3.5-turbo-instruct": { + "id": "openai/gpt-3.5-turbo-instruct", + "name": "OpenAI: GPT-3.5 Turbo Instruct", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2025-07-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2023-03-01", + "last_updated": "2023-09-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.09, "output": 0.3 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 4095, + "output": 4096 + }, + "cost": { + "input": 1.5, + "output": 2 + } }, - "Qwen/Qwen3-VL-32B-Instruct": { - "id": "Qwen/Qwen3-VL-32B-Instruct", - "name": "Qwen/Qwen3-VL-32B-Instruct", - "family": "qwen", + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "OpenAI: GPT-4.1", "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"] }, + "release_date": "2025-04-14", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "name": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "family": "qwen", - "attachment": false, + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "OpenAI: GPT-4.1 Mini", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-31", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-14", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "Qwen/QwQ-32B": { - "id": "Qwen/QwQ-32B", - "name": "Qwen/QwQ-32B", - "family": "qwen", - "attachment": false, + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "OpenAI: GPT-5.1-Codex", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-03-06", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.58 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "Qwen/Qwen3-8B": { - "id": "Qwen/Qwen3-8B", - "name": "Qwen/Qwen3-8B", - "family": "qwen", - "attachment": false, + "openai/gpt-4o-2024-11-20": { + "id": "openai/gpt-4o-2024-11-20", + "name": "OpenAI: GPT-4o (2024-11-20)", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-11-20", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0.06 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "Qwen/Qwen3-VL-8B-Instruct": { - "id": "Qwen/Qwen3-VL-8B-Instruct", - "name": "Qwen/Qwen3-VL-8B-Instruct", - "family": "qwen", + "amazon/nova-lite-v1": { + "id": "amazon/nova-lite-v1", + "name": "Amazon: Nova Lite 1.0", "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"] }, + "release_date": "2024-12-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.18, "output": 0.68 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 300000, + "output": 5120 + }, + "cost": { + "input": 0.06, + "output": 0.24 + } }, - "Qwen/Qwen3-Coder-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", - "name": "Qwen/Qwen3-Coder-30B-A3B-Instruct", - "family": "qwen", - "attachment": false, + "amazon/nova-pro-v1": { + "id": "amazon/nova-pro-v1", + "name": "Amazon: Nova Pro 1.0", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 300000, + "output": 5120 + }, + "cost": { + "input": 0.8, + "output": 3.2 + } }, - "Qwen/Qwen2.5-VL-32B-Instruct": { - "id": "Qwen/Qwen2.5-VL-32B-Instruct", - "name": "Qwen/Qwen2.5-VL-32B-Instruct", - "family": "qwen", + "amazon/nova-premier-v1": { + "id": "amazon/nova-premier-v1", + "name": "Amazon: Nova Premier 1.0", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-03-24", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-11-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.27 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 1000000, + "output": 32000 + }, + "cost": { + "input": 2.5, + "output": 12.5 + } }, - "Qwen/Qwen3-VL-30B-A3B-Thinking": { - "id": "Qwen/Qwen3-VL-30B-A3B-Thinking", - "name": "Qwen/Qwen3-VL-30B-A3B-Thinking", - "family": "qwen", + "amazon/nova-2-lite-v1": { + "id": "amazon/nova-2-lite-v1", + "name": "Amazon: Nova 2 Lite", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-11", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 1 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 1000000, + "output": 65535 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "Qwen/Qwen3-Omni-30B-A3B-Captioner": { - "id": "Qwen/Qwen3-Omni-30B-A3B-Captioner", - "name": "Qwen/Qwen3-Omni-30B-A3B-Captioner", - "family": "qwen", - "attachment": true, + "amazon/nova-micro-v1": { + "id": "amazon/nova-micro-v1", + "name": "Amazon: Nova Micro 1.0", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["audio"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 66000, "output": 66000 } + "limit": { + "context": 128000, + "output": 5120 + }, + "cost": { + "input": 0.035, + "output": 0.14 + } }, - "Qwen/Qwen3-VL-8B-Thinking": { - "id": "Qwen/Qwen3-VL-8B-Thinking", - "name": "Qwen/Qwen3-VL-8B-Thinking", - "family": "qwen", + "z-ai/glm-5v-turbo": { + "id": "z-ai/glm-5v-turbo", + "name": "Z.ai: GLM 5V Turbo", "attachment": true, "reasoning": true, "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": false, - "cost": { "input": 0.18, "output": 2 }, - "limit": { "context": 262000, "output": 262000 } - }, - "Qwen/Qwen2.5-VL-72B-Instruct": { - "id": "Qwen/Qwen2.5-VL-72B-Instruct", - "name": "Qwen/Qwen2.5-VL-72B-Instruct", - "family": "qwen", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-01-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.59, "output": 0.59 }, - "limit": { "context": 131000, "output": 4000 } + "release_date": "2026-04-01", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24 + } }, - "Qwen/Qwen3-Next-80B-A3B-Instruct": { - "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "name": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "family": "qwen", + "z-ai/glm-4.7": { + "id": "z-ai/glm-4.7", + "name": "Z.ai: GLM 4.7", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.14, "output": 1.4 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2025-12-22", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 65535 + }, + "cost": { + "input": 0.38, + "output": 1.98, + "cache_read": 0.2 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "family": "qwen", + "z-ai/glm-5": { + "id": "z-ai/glm-5", + "name": "Z.ai: GLM 5", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.13, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-02-12", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 0.72, + "output": 2.3 + } }, - "Qwen/Qwen2.5-72B-Instruct-128K": { - "id": "Qwen/Qwen2.5-72B-Instruct-128K", - "name": "Qwen/Qwen2.5-72B-Instruct-128K", - "family": "qwen", + "z-ai/glm-4-32b": { + "id": "z-ai/glm-4-32b", + "name": "Z.ai: GLM 4 32B ", "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": false, - "cost": { "input": 0.59, "output": 0.59 }, - "limit": { "context": 131000, "output": 4000 } + "release_date": "2025-07-25", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "Qwen/Qwen3-14B": { - "id": "Qwen/Qwen3-14B", - "name": "Qwen/Qwen3-14B", - "family": "qwen", + "z-ai/glm-5.1": { + "id": "z-ai/glm-5.1", + "name": "Z.ai: GLM 5.1", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 131000, "output": 131000 } + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 1.26, + "output": 3.96 + } }, - "Qwen/Qwen3-32B": { - "id": "Qwen/Qwen3-32B", - "name": "Qwen/Qwen3-32B", - "family": "qwen", + "z-ai/glm-4.5": { + "id": "z-ai/glm-4.5", + "name": "Z.ai: GLM 4.5", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "release_date": "2025-07-28", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.175 + } }, - "Qwen/Qwen2.5-14B-Instruct": { - "id": "Qwen/Qwen2.5-14B-Instruct", - "name": "Qwen/Qwen2.5-14B-Instruct", - "family": "qwen", + "z-ai/glm-4.5-air": { + "id": "z-ai/glm-4.5-air", + "name": "Z.ai: GLM 4.5 Air", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 33000, "output": 4000 } + "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 + } }, - "Qwen/Qwen3-30B-A3B-Thinking-2507": { - "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", - "name": "Qwen/Qwen3-30B-A3B-Thinking-2507", - "family": "qwen", + "z-ai/glm-5-turbo": { + "id": "z-ai/glm-5-turbo", + "name": "Z.ai: GLM 5 Turbo", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-31", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09, "output": 0.3 }, - "limit": { "context": 262000, "output": 131000 } + "release_date": "2026-03-15", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24 + } }, - "Qwen/Qwen3-VL-235B-A22B-Thinking": { - "id": "Qwen/Qwen3-VL-235B-A22B-Thinking", - "name": "Qwen/Qwen3-VL-235B-A22B-Thinking", - "family": "qwen", + "z-ai/glm-4.5v": { + "id": "z-ai/glm-4.5v", + "name": "Z.ai: GLM 4.5V", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.45, "output": 3.5 }, - "limit": { "context": 262000, "output": 262000 } + "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 + } }, - "Qwen/Qwen3-VL-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", - "name": "Qwen/Qwen3-VL-30B-A3B-Instruct", - "family": "qwen", - "attachment": true, - "reasoning": false, + "z-ai/glm-4.6": { + "id": "z-ai/glm-4.6", + "name": "Z.ai: GLM 4.6", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-05", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.29, "output": 1 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2025-09-30", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 204800 + }, + "cost": { + "input": 0.39, + "output": 1.9, + "cache_read": 0.175 + } }, - "Qwen/Qwen3-Next-80B-A3B-Thinking": { - "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", - "name": "Qwen/Qwen3-Next-80B-A3B-Thinking", - "family": "qwen", - "attachment": false, + "z-ai/glm-4.6v": { + "id": "z-ai/glm-4.6v", + "name": "Z.ai: GLM 4.6V", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2025-09-30", + "last_updated": "2026-01-10", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "Qwen/Qwen3-Omni-30B-A3B-Thinking": { - "id": "Qwen/Qwen3-Omni-30B-A3B-Thinking", - "name": "Qwen/Qwen3-Omni-30B-A3B-Thinking", - "family": "qwen", - "attachment": true, + "z-ai/glm-4.7-flash": { + "id": "z-ai/glm-4.7-flash", + "name": "Z.ai: GLM 4.7 Flash", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 66000, "output": 66000 } + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 40551 + }, + "cost": { + "input": 0.06, + "output": 0.4, + "cache_read": 0.01 + } }, - "Qwen/Qwen2.5-Coder-32B-Instruct": { - "id": "Qwen/Qwen2.5-Coder-32B-Instruct", - "name": "Qwen/Qwen2.5-Coder-32B-Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, + "baidu/ernie-4.5-vl-424b-a47b": { + "id": "baidu/ernie-4.5-vl-424b-a47b", + "name": "Baidu: ERNIE 4.5 VL 424B A47B ", + "attachment": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "release_date": "2024-11-11", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 33000, "output": 4000 } + "release_date": "2025-06-30", + "last_updated": "2026-01", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 123000, + "output": 16000 + }, + "cost": { + "input": 0.42, + "output": 1.25 + } }, - "ascend-tribe/pangu-pro-moe": { - "id": "ascend-tribe/pangu-pro-moe", - "name": "ascend-tribe/pangu-pro-moe", - "family": "pangu", - "attachment": false, + "baidu/qianfan-ocr-fast:free": { + "id": "baidu/qianfan-ocr-fast:free", + "name": "Baidu: Qianfan-OCR-Fast (free)", + "attachment": true, "reasoning": true, "tool_call": false, - "structured_output": true, "temperature": true, - "release_date": "2025-07-02", - "last_updated": "2026-01-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-20", + "last_updated": "2026-05-01", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 65536, + "output": 28672 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "inclusionAI/Ling-mini-2.0": { - "id": "inclusionAI/Ling-mini-2.0", - "name": "inclusionAI/Ling-mini-2.0", - "family": "ling", + "baidu/cobuddy:free": { + "id": "baidu/cobuddy:free", + "name": "Baidu: CoBuddy (free)", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-09-10", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-05-06", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "inclusionAI/Ring-flash-2.0": { - "id": "inclusionAI/Ring-flash-2.0", - "name": "inclusionAI/Ring-flash-2.0", - "family": "ring", - "attachment": false, + "baidu/ernie-4.5-vl-28b-a3b": { + "id": "baidu/ernie-4.5-vl-28b-a3b", + "name": "Baidu: ERNIE 4.5 VL 28B A3B", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "release_date": "2025-06-30", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 30000, + "output": 8000 + }, + "cost": { + "input": 0.14, + "output": 0.56 + } }, - "inclusionAI/Ling-flash-2.0": { - "id": "inclusionAI/Ling-flash-2.0", - "name": "inclusionAI/Ling-flash-2.0", - "family": "ling", + "baidu/ernie-4.5-21b-a3b": { + "id": "baidu/ernie-4.5-21b-a3b", + "name": "Baidu: ERNIE 4.5 21B A3B", "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": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "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 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "moonshotai/Kimi-K2-Thinking", - "family": "kimi-thinking", + "baidu/ernie-4.5-300b-a47b": { + "id": "baidu/ernie-4.5-300b-a47b", + "name": "Baidu: ERNIE 4.5 300B A47B ", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-11-07", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.55, "output": 2.5 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2025-06-30", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 123000, + "output": 12000 + }, + "cost": { + "input": 0.28, + "output": 1.1 + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "moonshotai/Kimi-K2-Instruct-0905", - "family": "kimi", + "baidu/ernie-4.5-21b-a3b-thinking": { + "id": "baidu/ernie-4.5-21b-a3b-thinking", + "name": "Baidu: ERNIE 4.5 21B A3B Thinking", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "release_date": "2025-09-08", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "tencent/Hunyuan-A13B-Instruct": { - "id": "tencent/Hunyuan-A13B-Instruct", - "name": "tencent/Hunyuan-A13B-Instruct", - "family": "hunyuan", + "relace/relace-apply-3": { + "id": "relace/relace-apply-3", + "name": "Relace: Relace Apply 3", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "release_date": "2025-09-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 0.85, + "output": 1.25 + } }, - "tencent/Hunyuan-MT-7B": { - "id": "tencent/Hunyuan-MT-7B", - "name": "tencent/Hunyuan-MT-7B", - "family": "hunyuan", + "relace/relace-search": { + "id": "relace/relace-search", + "name": "Relace: Relace Search", "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"] }, + "release_date": "2025-12-09", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 33000, "output": 33000 } + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 1, + "output": 3 + } }, - "Kwaipilot/KAT-Dev": { - "id": "Kwaipilot/KAT-Dev", - "name": "Kwaipilot/KAT-Dev", - "family": "kat-coder", + "minimax/minimax-m2.7": { + "id": "minimax/minimax-m2.7", + "name": "MiniMax: MiniMax M2.7", + "family": "minimax-m2.7", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-27", - "last_updated": "2026-01-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 128000, "output": 128000 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "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 + } + }, + "minimax/minimax-m2": { + "id": "minimax/minimax-m2", + "name": "MiniMax: MiniMax M2", "attachment": false, "reasoning": true, "tool_call": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-10-23", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.24, "output": 0.94 }, - "limit": { "context": 65536, "output": 65536 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.255, + "output": 1, + "cache_read": 0.03 + } }, - "openai/whisper-large-v3": { - "id": "openai/whisper-large-v3", - "name": "Whisper 3 Large", - "family": "whisper", - "attachment": false, + "minimax/minimax-01": { + "id": "minimax/minimax-01", + "name": "MiniMax: MiniMax-01", + "attachment": true, "reasoning": false, "tool_call": false, - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["audio"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-01-15", + "last_updated": "2025-01-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.00236, "output": 0.00236, "output_audio": 2.36 }, - "limit": { "context": 448, "output": 4096 } + "limit": { + "context": 1000192, + "output": 1000192 + }, + "cost": { + "input": 0.2, + "output": 1.1 + } }, - "microsoft/Phi-4-multimodal-instruct": { - "id": "microsoft/Phi-4-multimodal-instruct", - "name": "Phi-4 15B", - "family": "phi", + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "MiniMax: MiniMax M2.1", "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.24, "output": 0.47 }, - "limit": { "context": 32000, "output": 32000 } + "limit": { + "context": 196608, + "output": 39322 + }, + "cost": { + "input": 0.27, + "output": 0.95, + "cache_read": 0.03 + } }, - "nvidia/Llama-3.3-70B-Instruct-FP8": { - "id": "nvidia/Llama-3.3-70B-Instruct-FP8", - "name": "Llama 3.3 70B", - "family": "llama", + "minimax/minimax-m1": { + "id": "minimax/minimax-m1", + "name": "MiniMax: MiniMax M1", "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.18, "output": 1.18 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1000000, + "output": 40000 + }, + "cost": { + "input": 0.4, + "output": 2.2 + } }, - "intfloat/multilingual-e5-large-instruct": { - "id": "intfloat/multilingual-e5-large-instruct", - "name": "E5 Multi-Lingual Large Embeddings 0.6B", - "family": "text-embedding", + "minimax/minimax-m2-her": { + "id": "minimax/minimax-m2-her", + "name": "MiniMax: MiniMax M2-her", "attachment": false, "reasoning": false, "tool_call": false, - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-01-23", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.12, "output": 0.12 }, - "limit": { "context": 512, "output": 512 } + "limit": { + "context": 65536, + "output": 2048 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "KBLab/kb-whisper-large": { - "id": "KBLab/kb-whisper-large", - "name": "KB Whisper", - "family": "whisper", + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "MiniMax: MiniMax M2.5", "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["audio"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-02-12", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.00236, "output": 0.00236, "output_audio": 2.36 }, - "limit": { "context": 448, "output": 448 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.25, + "output": 1.2, + "cache_read": 0.029 + } }, - "Qwen/Qwen3-VL-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", - "name": "Qwen3 VL 30B", - "family": "qwen", + "~openai/gpt-latest": { + "id": "~openai/gpt-latest", + "name": "OpenAI: GPT Latest", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5 + } + }, + "~openai/gpt-mini-latest": { + "id": "~openai/gpt-mini-latest", + "name": "OpenAI: GPT Mini Latest", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } + }, + "qwen/qwen3-235b-a22b": { + "id": "qwen/qwen3-235b-a22b", + "name": "Qwen: Qwen3 235B A22B", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-12-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.24, "output": 0.94 }, - "limit": { "context": 100000, "output": 100000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.455, + "output": 1.82, + "cache_read": 0.15 + } }, - "Qwen/Qwen3-30B-A3B-Instruct-2507-FP8": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507-FP8", - "name": "Qwen3 30B 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, + "qwen/qwen3.5-122b-a10b": { + "id": "qwen/qwen3.5-122b-a10b", + "name": "Qwen: Qwen3.5-122B-A10B", + "attachment": true, + "reasoning": true, "tool_call": true, - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-02-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.35, "output": 1.42 }, - "limit": { "context": 64000, "output": 64000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.26, + "output": 2.08 + } }, - "Qwen/Qwen3-Embedding-8B": { - "id": "Qwen/Qwen3-Embedding-8B", - "name": "Qwen3 Embedding 8B", - "family": "text-embedding", + "qwen/qwen3-coder-plus": { + "id": "qwen/qwen3-coder-plus", + "name": "Qwen: Qwen3 Coder Plus", "attachment": false, "reasoning": false, - "tool_call": false, - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2025-07-01", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.12, "output": 0.12 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.65, + "output": 3.25, + "cache_read": 0.2 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": false, + "qwen/qwen3.6-27b": { + "id": "qwen/qwen3.6-27b", + "name": "Qwen: Qwen3.6 27B", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.47, "output": 5.9 }, - "limit": { "context": 262144, "output": 262144 } + "temperature": true, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.325, + "output": 3.25 + } }, - "mistralai/devstral-small-2-24b-instruct-2512": { - "id": "mistralai/devstral-small-2-24b-instruct-2512", - "name": "Devstral Small 2 24B Instruct 2512", - "family": "devstral", - "attachment": false, - "reasoning": false, + "qwen/qwen3.5-27b": { + "id": "qwen/qwen3.5-27b", + "name": "Qwen: Qwen3.5-27B", + "attachment": true, + "reasoning": true, "tool_call": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-02-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.12, "output": 0.47 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.195, + "output": 1.56 + } }, - "mistralai/Magistral-Small-2509": { - "id": "mistralai/Magistral-Small-2509", - "name": "Magistral Small 1.2 24B", - "family": "magistral-small", + "qwen/qwen3-235b-a22b-2507": { + "id": "qwen/qwen3-235b-a22b-2507", + "name": "Qwen: Qwen3 235B A22B Instruct 2507", "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-04", + "last_updated": "2026-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.59, "output": 2.36 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 52429 + }, + "cost": { + "input": 0.071, + "output": 0.1 + } }, - "mistralai/Voxtral-Small-24B-2507": { - "id": "mistralai/Voxtral-Small-24B-2507", - "name": "Voxtral Small 24B", - "family": "voxtral", + "qwen/qwen3-8b": { + "id": "qwen/qwen3-8b", + "name": "Qwen: Qwen3 8B", "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["audio", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.00236, "output": 0.00236, "output_audio": 2.36 }, - "limit": { "context": 32000, "output": 32000 } - } - } - }, - "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": { - "giga-potato": { - "id": "giga-potato", - "name": "Giga Potato (free)", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-27", + "release_date": "2025-04", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 8192 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.05 + } }, - "corethink:free": { - "id": "corethink:free", - "name": "CoreThink (free)", - "attachment": false, - "reasoning": false, + "qwen/qwen3.5-397b-a17b": { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen: Qwen3.5 397B A17B", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-27", + "release_date": "2026-02-15", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 78000, "output": 8192 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.39, + "output": 2.34 + } }, - "giga-potato-thinking": { - "id": "giga-potato-thinking", - "name": "Giga Potato Thinking (free)", + "qwen/qwen-vl-plus": { + "id": "qwen/qwen-vl-plus", + "name": "Qwen: Qwen VL Plus", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-08-27", + "release_date": "2024-01-25", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.1365, + "output": 0.4095, + "cache_read": 0.042 + } }, - "morph-warp-grep-v2": { - "id": "morph-warp-grep-v2", - "name": "Morph: WarpGrep V2", + "qwen/qwen3-32b": { + "id": "qwen/qwen3-32b", + "name": "Qwen: Qwen3 32B", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-27", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "release_date": "2024-12-01", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.08, + "output": 0.24, + "cache_read": 0.04 + } }, - "eleutherai/llemma_7b": { - "id": "eleutherai/llemma_7b", - "name": "EleutherAI: Llemma 7b", - "attachment": false, + "qwen/qwen2.5-vl-72b-instruct": { + "id": "qwen/qwen2.5-vl-72b-instruct", + "name": "Qwen: Qwen2.5 VL 72B Instruct", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-04-14", + "release_date": "2025-02-01", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 1.2 }, - "limit": { "context": 4096, "output": 4096 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.8, + "output": 0.8, + "cache_read": 0.075 + } }, - "meituan/longcat-flash-chat": { - "id": "meituan/longcat-flash-chat", - "name": "Meituan: LongCat Flash Chat", + "qwen/qwen-max": { + "id": "qwen/qwen-max", + "name": "Qwen: Qwen-Max ", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-08-30", + "release_date": "2024-04-03", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.8, "cache_read": 0.2 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 1.04, + "output": 4.16, + "cache_read": 0.32 + } }, - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "OpenAI: GPT-5.2-Codex", - "attachment": true, - "reasoning": true, + "qwen/qwen-plus": { + "id": "qwen/qwen-plus", + "name": "Qwen: Qwen-Plus", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-01-25", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.2, + "cache_read": 0.08 + } }, - "openai/o1-pro": { - "id": "openai/o1-pro", - "name": "OpenAI: o1-pro", + "qwen/qwen3.6-35b-a3b": { + "id": "qwen/qwen3.6-35b-a3b", + "name": "Qwen: Qwen3.6 35B A3B", "attachment": true, "reasoning": true, "tool_call": false, - "temperature": false, - "release_date": "2025-03-19", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 150, "output": 600 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.1612, + "output": 0.96525, + "cache_read": 0.1612 + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "OpenAI: GPT-5.1-Codex-Mini", + "qwen/qwen3-vl-235b-a22b-thinking": { + "id": "qwen/qwen3-vl-235b-a22b-thinking", + "name": "Qwen: Qwen3 VL 235B A22B Thinking", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 100000 } + "temperature": true, + "release_date": "2025-09-24", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.26, + "output": 2.6 + } }, - "openai/gpt-5.4-pro": { - "id": "openai/gpt-5.4-pro", - "name": "OpenAI: GPT-5.4 Pro", + "qwen/qwen3-vl-30b-a3b-thinking": { + "id": "qwen/qwen3-vl-30b-a3b-thinking", + "name": "Qwen: Qwen3 VL 30B A3B Thinking", "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2026-03-06", + "temperature": true, + "release_date": "2025-10-11", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 30, "output": 180 }, - "limit": { "context": 1050000, "output": 128000 } + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.13, + "output": 1.56 + } }, - "openai/gpt-3.5-turbo-16k": { - "id": "openai/gpt-3.5-turbo-16k", - "name": "OpenAI: GPT-3.5 Turbo 16k", - "attachment": false, + "qwen/qwen3-vl-8b-instruct": { + "id": "qwen/qwen3-vl-8b-instruct", + "name": "Qwen: Qwen3 VL 8B Instruct", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2023-08-28", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 4 }, - "limit": { "context": 16385, "output": 4096 } + "release_date": "2025-10-15", + "last_updated": "2025-11-25", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.08, + "output": 0.5 + } }, - "openai/gpt-4o:extended": { - "id": "openai/gpt-4o:extended", - "name": "OpenAI: GPT-4o (extended)", + "qwen/qwen3.5-flash-02-23": { + "id": "qwen/qwen3.5-flash-02-23", + "name": "Qwen: Qwen3.5-Flash", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-05-13", + "release_date": "2026-02-26", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 6, "output": 18 }, - "limit": { "context": 128000, "output": 64000 } + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "openai/o3-mini": { - "id": "openai/o3-mini", - "name": "OpenAI: o3 Mini", + "qwen/qwen3.6-plus": { + "id": "qwen/qwen3.6-plus", + "name": "Qwen: Qwen3.6 Plus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2024-12-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["pdf", "text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-08-26", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.325, + "output": 1.95, + "cache_read": 0.0325, + "cache_write": 0.40625 + } }, - "openai/gpt-4-1106-preview": { - "id": "openai/gpt-4-1106-preview", - "name": "OpenAI: GPT-4 Turbo (older v1106)", + "qwen/qwen3-max": { + "id": "qwen/qwen3-max", + "name": "Qwen: Qwen3 Max", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2023-11-06", + "release_date": "2025-09-05", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 1.2, + "output": 6, + "cache_read": 0.24 + } }, - "openai/gpt-5-pro": { - "id": "openai/gpt-5-pro", - "name": "OpenAI: GPT-5 Pro", - "attachment": true, - "reasoning": true, + "qwen/qwen-plus-2025-07-28": { + "id": "qwen/qwen-plus-2025-07-28", + "name": "Qwen: Qwen Plus 0728", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-10-06", + "temperature": true, + "release_date": "2025-09-09", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 128000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.26, + "output": 0.78 + } }, - "openai/gpt-3.5-turbo-0613": { - "id": "openai/gpt-3.5-turbo-0613", - "name": "OpenAI: GPT-3.5 Turbo (older v0613)", + "qwen/qwen3-30b-a3b-instruct-2507": { + "id": "qwen/qwen3-30b-a3b-instruct-2507", + "name": "Qwen: Qwen3 30B A3B Instruct 2507", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2023-06-13", - "last_updated": "2023-06-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 2 }, - "limit": { "context": 4095, "output": 4096 } + "release_date": "2025-07-29", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.09, + "output": 0.3, + "cache_read": 0.04 + } }, - "openai/gpt-5-image-mini": { - "id": "openai/gpt-5-image-mini", - "name": "OpenAI: GPT-5 Image Mini", + "qwen/qwen3-vl-32b-instruct": { + "id": "qwen/qwen3-vl-32b-instruct", + "name": "Qwen: Qwen3 VL 32B Instruct", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-10-16", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["image", "text"] }, + "release_date": "2025-10-21", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 2 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.104, + "output": 0.416 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "OpenAI: GPT-5", - "attachment": true, + "qwen/qwen3-235b-a22b-thinking-2507": { + "id": "qwen/qwen3-235b-a22b-thinking-2507", + "name": "Qwen: Qwen3 235B A22B Thinking 2507", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-08-07", + "temperature": true, + "release_date": "2025-07-25", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.11, + "output": 0.6 + } }, - "openai/gpt-4-0314": { - "id": "openai/gpt-4-0314", - "name": "OpenAI: GPT-4 (older v0314)", + "qwen/qwen3-next-80b-a3b-thinking": { + "id": "qwen/qwen3-next-80b-a3b-thinking", + "name": "Qwen: Qwen3 Next 80B A3B Thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2023-05-28", + "release_date": "2025-09-11", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 30, "output": 60 }, - "limit": { "context": 8191, "output": 4096 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.0975, + "output": 0.78 + } }, - "openai/gpt-audio": { - "id": "openai/gpt-audio", - "name": "OpenAI: GPT Audio", + "qwen/qwen3-30b-a3b-thinking-2507": { + "id": "qwen/qwen3-30b-a3b-thinking-2507", + "name": "Qwen: Qwen3 30B A3B Thinking 2507", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2026-01-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "text"], "output": ["audio", "text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 6554 + }, + "cost": { + "input": 0.051, + "output": 0.34 + } }, - "openai/gpt-4-turbo": { - "id": "openai/gpt-4-turbo", - "name": "OpenAI: GPT-4 Turbo", - "attachment": true, + "qwen/qwen-2.5-7b-instruct": { + "id": "qwen/qwen-2.5-7b-instruct", + "name": "Qwen: Qwen2.5 7B Instruct", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2023-09-13", - "last_updated": "2024-04-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2024-09", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 6554 + }, + "cost": { + "input": 0.04, + "output": 0.1 + } }, - "openai/gpt-4o": { - "id": "openai/gpt-4o", - "name": "OpenAI: GPT-4o", + "qwen/qwen-vl-max": { + "id": "qwen/qwen-vl-max", + "name": "Qwen: Qwen VL Max", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-05-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } - }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "OpenAI: GPT-5.3-Codex", - "attachment": true, - "reasoning": true, - "tool_call": true, - "release_date": "2026-02-25", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2024-04-08", + "last_updated": "2025-08-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.8, + "output": 3.2 + } }, - "openai/o3-mini-high": { - "id": "openai/o3-mini-high", - "name": "OpenAI: o3 Mini High", - "attachment": true, + "qwen/qwen3-coder-flash": { + "id": "qwen/qwen3-coder-flash", + "name": "Qwen: Qwen3 Coder Flash", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-01-31", - "last_updated": "2026-03-15", - "modalities": { "input": ["pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } - }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "OpenAI: GPT-5 Mini", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2025-08-07", + "temperature": true, + "release_date": "2025-07-23", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.195, + "output": 0.975, + "cache_read": 0.06 + } }, - "openai/gpt-4-turbo-preview": { - "id": "openai/gpt-4-turbo-preview", - "name": "OpenAI: GPT-4 Turbo Preview", + "qwen/qwen3-30b-a3b": { + "id": "qwen/qwen3-30b-a3b", + "name": "Qwen: Qwen3 30B A3B", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-01-25", + "release_date": "2025-04", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.08, + "output": 0.28, + "cache_read": 0.03 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "OpenAI: GPT-4o-mini", - "attachment": true, + "qwen/qwen3-next-80b-a3b-instruct": { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen: Qwen3 Next 80B A3B Instruct", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-07-18", + "release_date": "2025-09-11", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.075 }, - "limit": { "context": 128000, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 52429 + }, + "cost": { + "input": 0.09, + "output": 1.1 + } }, - "openai/gpt-5.1-codex-max": { - "id": "openai/gpt-5.1-codex-max", - "name": "OpenAI: GPT-5.1-Codex-Max", + "qwen/qwen3.5-plus-20260420": { + "id": "qwen/qwen3.5-plus-20260420", + "name": "Qwen: Qwen3.5 Plus 2026-04-20", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } - }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "OpenAI: GPT-4.1", - "attachment": true, - "reasoning": false, - "tool_call": true, "temperature": true, - "release_date": "2025-04-14", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2.4 + } }, - "openai/gpt-3.5-turbo": { - "id": "openai/gpt-3.5-turbo", - "name": "OpenAI: GPT-3.5 Turbo", + "qwen/qwen3-coder-next": { + "id": "qwen/qwen3-coder-next", + "name": "Qwen: Qwen3 Coder Next", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2023-03-01", - "last_updated": "2023-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 16385, "output": 4096 } + "release_date": "2026-02-02", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.12, + "output": 0.75, + "cache_read": 0.035 + } }, - "openai/gpt-3.5-turbo-instruct": { - "id": "openai/gpt-3.5-turbo-instruct", - "name": "OpenAI: GPT-3.5 Turbo Instruct", + "qwen/qwen-2.5-coder-32b-instruct": { + "id": "qwen/qwen-2.5-coder-32b-instruct", + "name": "Qwen2.5 Coder 32B Instruct", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2023-03-01", - "last_updated": "2023-09-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 4095, "output": 4096 } + "release_date": "2024-11-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.2, + "cache_read": 0.015 + } }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "OpenAI: gpt-oss-120b", - "attachment": false, - "reasoning": true, + "qwen/qwen3-vl-30b-a3b-instruct": { + "id": "qwen/qwen3-vl-30b-a3b-instruct", + "name": "Qwen: Qwen3 VL 30B A3B Instruct", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-05", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.039, "output": 0.19 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "openai/gpt-5.1-chat": { - "id": "openai/gpt-5.1-chat", - "name": "OpenAI: GPT-5.1 Chat", - "attachment": true, + "qwen/qwen3-coder-30b-a3b-instruct": { + "id": "qwen/qwen3-coder-30b-a3b-instruct", + "name": "Qwen: Qwen3 Coder 30B A3B Instruct", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "release_date": "2025-11-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } + "temperature": true, + "release_date": "2025-07-31", + "last_updated": "2025-07-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 160000, + "output": 32768 + }, + "cost": { + "input": 0.07, + "output": 0.27 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "OpenAI: GPT-5.4", - "attachment": true, + "qwen/qwen3-max-thinking": { + "id": "qwen/qwen3-max-thinking", + "name": "Qwen: Qwen3 Max Thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "release_date": "2026-03-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 15 }, - "limit": { "context": 1050000, "output": 128000 } - }, - "openai/o1": { - "id": "openai/o1", - "name": "OpenAI: o1", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": false, - "release_date": "2024-12-05", + "temperature": true, + "release_date": "2026-01-23", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.78, + "output": 3.9 + } }, - "openai/gpt-4o-audio-preview": { - "id": "openai/gpt-4o-audio-preview", - "name": "OpenAI: GPT-4o Audio", + "qwen/qwen-turbo": { + "id": "qwen/qwen-turbo", + "name": "Qwen: Qwen-Turbo", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-08-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "text"], "output": ["audio", "text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } - }, - "openai/o3": { - "id": "openai/o3", - "name": "OpenAI: o3", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2025-04-16", + "release_date": "2024-11-01", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.0325, + "output": 0.13, + "cache_read": 0.01 + } }, - "openai/gpt-5-chat": { - "id": "openai/gpt-5-chat", - "name": "OpenAI: GPT-5 Chat", + "qwen/qwen3-vl-235b-a22b-instruct": { + "id": "qwen/qwen3-vl-235b-a22b-instruct", + "name": "Qwen: Qwen3 VL 235B A22B Instruct", "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-08-07", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } + "tool_call": true, + "temperature": true, + "release_date": "2025-09-23", + "last_updated": "2026-01-10", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 52429 + }, + "cost": { + "input": 0.2, + "output": 0.88, + "cache_read": 0.11 + } }, - "openai/gpt-4o-search-preview": { - "id": "openai/gpt-4o-search-preview", - "name": "OpenAI: GPT-4o Search Preview", + "qwen/qwen3-coder": { + "id": "qwen/qwen3-coder", + "name": "Qwen: Qwen3 Coder 480B A35B", "attachment": false, "reasoning": false, - "tool_call": false, - "release_date": "2025-03-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } + "tool_call": true, + "temperature": true, + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 52429 + }, + "cost": { + "input": 0.22, + "output": 1, + "cache_read": 0.022 + } }, - "openai/o4-mini-high": { - "id": "openai/o4-mini-high", - "name": "OpenAI: o4 Mini High", + "qwen/qwen3.5-9b": { + "id": "qwen/qwen3.5-9b", + "name": "Qwen: Qwen3.5-9B", "attachment": true, "reasoning": true, "tool_call": true, - "release_date": "2025-04-17", + "temperature": true, + "release_date": "2026-03-10", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "output": 100000 } + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0.15 + } }, - "openai/gpt-4o-2024-05-13": { - "id": "openai/gpt-4o-2024-05-13", - "name": "OpenAI: GPT-4o (2024-05-13)", + "qwen/qwen3-vl-8b-thinking": { + "id": "qwen/qwen3-vl-8b-thinking", + "name": "Qwen: Qwen3 VL 8B Thinking", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-05-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "release_date": "2025-10-15", + "last_updated": "2025-11-25", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 15 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.117, + "output": 1.365 + } }, - "openai/gpt-4": { - "id": "openai/gpt-4", - "name": "OpenAI: GPT-4", + "qwen/qwen3.6-max-preview": { + "id": "qwen/qwen3.6-max-preview", + "name": "Qwen: Qwen3.6 Max Preview", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2023-03-14", - "last_updated": "2024-04-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 60 }, - "limit": { "context": 8191, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 1.04, + "output": 6.24, + "cache_write": 1.3 + } }, - "openai/gpt-5.3-chat": { - "id": "openai/gpt-5.3-chat", - "name": "OpenAI: GPT-5.3 Chat", - "attachment": true, - "reasoning": false, + "qwen/qwen-plus-2025-07-28:thinking": { + "id": "qwen/qwen-plus-2025-07-28:thinking", + "name": "Qwen: Qwen Plus 0728 (thinking)", + "attachment": false, + "reasoning": true, "tool_call": true, - "release_date": "2026-03-04", + "temperature": true, + "release_date": "2025-09-09", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 128000, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.26, + "output": 0.78 + } }, - "openai/gpt-4o-2024-11-20": { - "id": "openai/gpt-4o-2024-11-20", - "name": "OpenAI: GPT-4o (2024-11-20)", - "attachment": true, + "qwen/qwen-2.5-72b-instruct": { + "id": "qwen/qwen-2.5-72b-instruct", + "name": "Qwen2.5 72B Instruct", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-11-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2024-09", + "last_updated": "2026-01-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0.12, + "output": 0.39 + } }, - "openai/gpt-5.2-chat": { - "id": "openai/gpt-5.2-chat", - "name": "OpenAI: GPT-5.2 Chat", - "attachment": true, - "reasoning": false, + "qwen/qwen3-14b": { + "id": "qwen/qwen3-14b", + "name": "Qwen: Qwen3 14B", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-12-11", + "temperature": true, + "release_date": "2025-04", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.06, + "output": 0.24, + "cache_read": 0.025 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "OpenAI: GPT-5.2", + "qwen/qwen3.5-35b-a3b": { + "id": "qwen/qwen3.5-35b-a3b", + "name": "Qwen: Qwen3.5-35B-A3B", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-12-11", + "temperature": true, + "release_date": "2026-02-26", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.1625, + "output": 1.3 + } }, - "openai/o4-mini-deep-research": { - "id": "openai/o4-mini-deep-research", - "name": "OpenAI: o4 Mini Deep Research", + "qwen/qwen3.5-plus-02-15": { + "id": "qwen/qwen3.5-plus-02-15", + "name": "Qwen: Qwen3.5 Plus 2026-02-15", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-06-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } - }, - "openai/gpt-audio-mini": { - "id": "openai/gpt-audio-mini", - "name": "OpenAI: GPT Audio Mini", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2026-01-20", + "release_date": "2026-02-15", "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "text"], "output": ["audio", "text"] }, + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.4 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.26, + "output": 1.56 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "OpenAI: GPT-5.1", + "qwen/qwen3.6-flash": { + "id": "qwen/qwen3.6-flash", + "name": "Qwen: Qwen3.6 Flash", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_write": 0.3125 + } }, - "openai/gpt-4o-mini-search-preview": { - "id": "openai/gpt-4o-mini-search-preview", - "name": "OpenAI: GPT-4o-mini Search Preview", + "alfredpros/codellama-7b-instruct-solidity": { + "id": "alfredpros/codellama-7b-instruct-solidity", + "name": "AlfredPros: CodeLLaMa 7B Instruct Solidity", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 16384 } - }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "OpenAI: GPT-4.1 Mini", - "attachment": true, - "reasoning": false, - "tool_call": true, "temperature": true, "release_date": "2025-04-14", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 0.8, + "output": 1.2 + } }, - "openai/gpt-4o-mini-2024-07-18": { - "id": "openai/gpt-4o-mini-2024-07-18", - "name": "OpenAI: GPT-4o-mini (2024-07-18)", - "attachment": true, + "kwaipilot/kat-coder-pro-v2": { + "id": "kwaipilot/kat-coder-pro-v2", + "name": "Kwaipilot: KAT-Coder-Pro V2", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-07-18", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2026-03-27", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 80000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "OpenAI: GPT-5 Nano", + "google/gemini-2.5-pro-preview-05-06": { + "id": "google/gemini-2.5-pro-preview-05-06", + "name": "Google: Gemini 2.5 Pro Preview 05-06", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-08-07", + "temperature": true, + "release_date": "2025-05-06", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.005 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 1.25, + "output": 10, + "reasoning": 10, + "cache_read": 0.125, + "cache_write": 0.375 + } }, - "openai/gpt-oss-safeguard-20b": { - "id": "openai/gpt-oss-safeguard-20b", - "name": "OpenAI: gpt-oss-safeguard-20b", - "attachment": false, - "reasoning": true, - "tool_call": true, + "google/lyria-3-clip-preview": { + "id": "google/lyria-3-clip-preview", + "name": "Google: Lyria 3 Clip Preview", + "attachment": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-10-29", - "last_updated": "2025-10-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-30", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text"], + "output": ["audio", "text"] + }, "open_weights": false, - "cost": { "input": 0.075, "output": 0.3, "cache_read": 0.037 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openai/o3-pro": { - "id": "openai/o3-pro", - "name": "OpenAI: o3 Pro", + "google/gemini-3.1-pro-preview-customtools": { + "id": "google/gemini-3.1-pro-preview-customtools", + "name": "Google: Gemini 3.1 Pro Preview Custom Tools", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-04-16", + "temperature": true, + "release_date": "2026-02-26", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 20, "output": 80 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "reasoning": 12 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "OpenAI: gpt-oss-20b", - "attachment": false, + "google/gemini-2.5-flash-lite-preview-09-2025": { + "id": "google/gemini-2.5-flash-lite-preview-09-2025", + "name": "Google: Gemini 2.5 Flash Lite Preview 09-2025", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.14 }, - "limit": { "context": 131072, "output": 26215 } + "release_date": "2025-09-25", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "reasoning": 0.4, + "cache_read": 0.01, + "cache_write": 0.083333 + } }, - "openai/gpt-4o-2024-08-06": { - "id": "openai/gpt-4o-2024-08-06", - "name": "OpenAI: GPT-4o (2024-08-06)", + "google/gemini-2.0-flash-001": { + "id": "google/gemini-2.0-flash-001", + "name": "Google: Gemini 2.0 Flash", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-08-06", + "release_date": "2024-12-11", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025, + "cache_write": 0.083333 + } }, - "openai/gpt-4.1-nano": { - "id": "openai/gpt-4.1-nano", - "name": "OpenAI: GPT-4.1 Nano", + "google/lyria-3-pro-preview": { + "id": "google/lyria-3-pro-preview", + "name": "Google: Lyria 3 Pro Preview", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-04-14", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "release_date": "2026-03-30", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text"], + "output": ["audio", "text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openai/gpt-5-image": { - "id": "openai/gpt-5-image", - "name": "OpenAI: GPT-5 Image", - "attachment": true, - "reasoning": true, - "tool_call": true, + "google/gemma-3n-e4b-it": { + "id": "google/gemma-3n-e4b-it", + "name": "Google: Gemma 3n 4B", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-10-14", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["image", "text"] }, - "open_weights": false, - "cost": { "input": 10, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 6554 + }, + "cost": { + "input": 0.02, + "output": 0.04 + } }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "OpenAI: GPT-5 Codex", + "google/gemini-3.1-flash-lite-preview": { + "id": "google/gemini-3.1-flash-lite-preview", + "name": "Google: Gemini 3.1 Flash Lite Preview", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-03-03", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "reasoning": 1.5 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "OpenAI: o4 Mini", + "google/gemini-3.1-pro-preview": { + "id": "google/gemini-3.1-pro-preview", + "name": "Google: Gemini 3.1 Pro Preview", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-04-16", + "temperature": true, + "release_date": "2026-02-19", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.275 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "reasoning": 12 + } }, - "openai/o3-deep-research": { - "id": "openai/o3-deep-research", - "name": "OpenAI: o3 Deep Research", + "google/gemini-3-flash-preview": { + "id": "google/gemini-3-flash-preview", + "name": "Google: Gemini 3 Flash Preview", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-06-26", + "release_date": "2025-12-17", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 40, "cache_read": 2.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "reasoning": 3, + "cache_read": 0.05, + "cache_write": 0.083333 + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "OpenAI: GPT-5.1-Codex", + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Google: Gemini 2.5 Pro", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-03-20", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "reasoning": 10, + "cache_read": 0.125, + "cache_write": 0.375 + } }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "OpenAI: GPT-5.2 Pro", + "google/gemini-3-pro-image-preview": { + "id": "google/gemini-3-pro-image-preview", + "name": "Google: Nano Banana Pro (Gemini 3 Pro Image Preview)", "attachment": true, "reasoning": true, - "tool_call": true, - "temperature": false, - "release_date": "2025-12-11", + "tool_call": false, + "temperature": true, + "release_date": "2025-11-20", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["image", "text"], + "output": ["image", "text"] + }, "open_weights": false, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 65536, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 12, + "reasoning": 12 + } }, - "prime-intellect/intellect-3": { - "id": "prime-intellect/intellect-3", - "name": "Prime Intellect: INTELLECT-3", - "attachment": false, + "google/gemma-4-31b-it": { + "id": "google/gemma-4-31b-it", + "name": "Google: Gemma 4 31B", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-11-26", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.14, + "output": 0.4 + } }, - "microsoft/phi-4": { - "id": "microsoft/phi-4", - "name": "Microsoft: Phi 4", - "attachment": false, + "google/gemini-2.5-flash-image": { + "id": "google/gemini-2.5-flash-image", + "name": "Google: Nano Banana (Gemini 2.5 Flash Image)", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.14 }, - "limit": { "context": 16384, "output": 16384 } + "release_date": "2025-10-08", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["image", "text"] + }, + "open_weights": false, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "microsoft/wizardlm-2-8x22b": { - "id": "microsoft/wizardlm-2-8x22b", - "name": "WizardLM-2 8x22B", - "attachment": false, + "google/gemma-3-12b-it": { + "id": "google/gemma-3-12b-it", + "name": "Google: Gemma 3 12B", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-04-24", - "last_updated": "2024-04-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.62, "output": 0.62 }, - "limit": { "context": 65535, "output": 8000 } - }, - "cohere/command-r-08-2024": { - "id": "cohere/command-r-08-2024", - "name": "Cohere: Command R (08-2024)", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-08-30", - "last_updated": "2024-08-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4000 } - }, - "cohere/command-r-plus-08-2024": { - "id": "cohere/command-r-plus-08-2024", - "name": "Cohere: Command R+ (08-2024)", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-08-30", - "last_updated": "2024-08-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 4000 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.04, + "output": 0.13, + "cache_read": 0.015 + } }, - "cohere/command-r7b-12-2024": { - "id": "cohere/command-r7b-12-2024", - "name": "Cohere: Command R7B (12-2024)", - "attachment": false, - "reasoning": false, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Google: Gemini 2.5 Flash", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-02-27", - "last_updated": "2024-02-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.0375, "output": 0.15 }, - "limit": { "context": 128000, "output": 4000 } + "release_date": "2025-07-17", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "reasoning": 2.5, + "cache_read": 0.03, + "cache_write": 0.083333 + } }, - "cohere/command-a": { - "id": "cohere/command-a", - "name": "Cohere: Command A", - "attachment": false, - "reasoning": false, + "google/gemini-3.1-flash-image-preview": { + "id": "google/gemini-3.1-flash-image-preview", + "name": "Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)", + "attachment": true, + "reasoning": true, "tool_call": false, "temperature": true, - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "output": 8192 } + "release_date": "2026-02-26", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["image", "text"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3 + } }, - "kwaipilot/kat-coder-pro": { - "id": "kwaipilot/kat-coder-pro", - "name": "Kwaipilot: KAT-Coder-Pro V1", - "attachment": false, + "google/gemma-3-4b-it": { + "id": "google/gemma-3-4b-it", + "name": "Google: Gemma 3 4B", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2025-10-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-13", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.207, "output": 0.828, "cache_read": 0.0414 }, - "limit": { "context": 256000, "output": 128000 } + "limit": { + "context": 131072, + "output": 19200 + }, + "cost": { + "input": 0.04, + "output": 0.08 + } }, - "switchpoint/router": { - "id": "switchpoint/router", - "name": "Switchpoint Router", - "attachment": false, + "google/gemini-2.5-pro-preview": { + "id": "google/gemini-2.5-pro-preview", + "name": "Google: Gemini 2.5 Pro Preview 06-05", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-07-12", + "release_date": "2025-06-05", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.85, "output": 3.4 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "reasoning": 10, + "cache_read": 0.125, + "cache_write": 0.375 + } }, - "morph/morph-v3-large": { - "id": "morph/morph-v3-large", - "name": "Morph: Morph V3 Large", + "google/gemma-2-27b-it": { + "id": "google/gemma-2-27b-it", + "name": "Google: Gemma 2 27B", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.9, "output": 1.9 }, - "limit": { "context": 262144, "output": 131072 } + "release_date": "2024-06-24", + "last_updated": "2024-06-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.65, + "output": 0.65 + } }, - "morph/morph-v3-fast": { - "id": "morph/morph-v3-fast", - "name": "Morph: Morph V3 Fast", - "attachment": false, + "google/gemma-3-27b-it": { + "id": "google/gemma-3-27b-it", + "name": "Google: Gemma 3 27B", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 1.2 }, - "limit": { "context": 81920, "output": 38000 } + "release_date": "2025-03-12", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 0.03, + "output": 0.11, + "cache_read": 0.02 + } }, - "x-ai/grok-4-fast": { - "id": "x-ai/grok-4-fast", - "name": "xAI: Grok 4 Fast", + "google/gemma-4-26b-a4b-it": { + "id": "google/gemma-4-26b-a4b-it", + "name": "Google: Gemma 4 26B A4B", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "release_date": "2026-04-03", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.12, + "output": 0.4 + } }, - "x-ai/grok-4.20-beta": { - "id": "x-ai/grok-4.20-beta", - "name": "xAI: Grok 4.20 Beta", + "google/gemini-2.5-flash-lite": { + "id": "google/gemini-2.5-flash-lite", + "name": "Google: Gemini 2.5 Flash Lite", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-12", + "release_date": "2025-06-17", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 2000000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "reasoning": 0.4, + "cache_read": 0.01, + "cache_write": 0.083333 + } }, - "x-ai/grok-4.1-fast": { - "id": "x-ai/grok-4.1-fast", - "name": "xAI: Grok 4.1 Fast", + "google/gemini-2.0-flash-lite-001": { + "id": "google/gemini-2.0-flash-lite-001", + "name": "Google: Gemini 2.0 Flash Lite", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-12-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["audio", "image", "pdf", "text", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "x-ai/grok-4": { - "id": "x-ai/grok-4", - "name": "xAI: Grok 4", + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "MoonshotAI: Kimi K2.5", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 51200 } + "release_date": "2026-01-27", + "last_updated": "2026-03-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65535 + }, + "cost": { + "input": 0.45, + "output": 2.2 + } }, - "x-ai/grok-code-fast-1": { - "id": "x-ai/grok-code-fast-1", - "name": "xAI: Grok Code Fast 1", + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "MoonshotAI: Kimi K2 0905", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 26215 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.15 + } }, - "x-ai/grok-4.20-multi-agent-beta": { - "id": "x-ai/grok-4.20-multi-agent-beta", - "name": "xAI: Grok 4.20 Multi-Agent Beta", + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "MoonshotAI: Kimi K2.6", "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 2000000, "output": 32768 } - }, - "x-ai/grok-3-mini": { - "id": "x-ai/grok-3-mini", - "name": "xAI: Grok 3 Mini", - "attachment": false, - "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 26215 } + "release_date": "2026-04-20", + "last_updated": "2026-05-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65535 + }, + "cost": { + "input": 0.75, + "output": 3.5, + "cache_read": 0.375 + } }, - "x-ai/grok-3-beta": { - "id": "x-ai/grok-3-beta", - "name": "xAI: Grok 3 Beta", + "moonshotai/kimi-k2": { + "id": "moonshotai/kimi-k2", + "name": "MoonshotAI: Kimi K2 0711", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 26215 } + "release_date": "2025-07-11", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131000, + "output": 26215 + }, + "cost": { + "input": 0.55, + "output": 2.2 + } }, - "x-ai/grok-code-fast-1:optimized:free": { - "id": "x-ai/grok-code-fast-1:optimized:free", - "name": "xAI: Grok Code Fast 1 Optimized (experimental, free)", + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "MoonshotAI: Kimi K2 Thinking", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-27", + "release_date": "2025-11-06", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 10000 } - }, - "x-ai/grok-3": { - "id": "x-ai/grok-3", - "name": "xAI: Grok 3", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 26215 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65535 + }, + "cost": { + "input": 0.47, + "output": 2, + "cache_read": 0.2 + } }, - "x-ai/grok-3-mini-beta": { - "id": "x-ai/grok-3-mini-beta", - "name": "xAI: Grok 3 Mini Beta", + "aion-labs/aion-1.0": { + "id": "aion-labs/aion-1.0", + "name": "AionLabs: Aion-1.0", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-02-05", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 4, + "output": 8 + } }, - "anthropic/claude-opus-4.6": { - "id": "anthropic/claude-opus-4.6", - "name": "Anthropic: Claude Opus 4.6", - "attachment": true, - "reasoning": true, - "tool_call": true, + "aion-labs/aion-rp-llama-3.1-8b": { + "id": "aion-labs/aion-rp-llama-3.1-8b", + "name": "AionLabs: Aion-RP 1.0 (8B)", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-02-05", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.8, + "output": 1.6 + } }, - "anthropic/claude-haiku-4.5": { - "id": "anthropic/claude-haiku-4.5", - "name": "Anthropic: Claude Haiku 4.5", - "attachment": true, + "aion-labs/aion-2.0": { + "id": "aion-labs/aion-2.0", + "name": "AionLabs: Aion-2.0", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2026-02-24", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.8, + "output": 1.6 + } }, - "anthropic/claude-3.7-sonnet:thinking": { - "id": "anthropic/claude-3.7-sonnet:thinking", - "name": "Anthropic: Claude 3.7 Sonnet (thinking)", - "attachment": true, + "aion-labs/aion-1.0-mini": { + "id": "aion-labs/aion-1.0-mini", + "name": "AionLabs: Aion-1.0-Mini", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-02-19", + "release_date": "2025-02-05", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.7, + "output": 1.4 + } }, - "anthropic/claude-opus-4.1": { - "id": "anthropic/claude-opus-4.1", - "name": "Anthropic: Claude Opus 4.1", + "~moonshotai/kimi-latest": { + "id": "~moonshotai/kimi-latest", + "name": "MoonshotAI: Kimi Latest", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "release_date": "2026-04-27", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 262142, + "output": 262142 + }, + "cost": { + "input": 0.74, + "output": 3.49, + "cache_read": 0.14 + } }, - "anthropic/claude-3.7-sonnet": { - "id": "anthropic/claude-3.7-sonnet", - "name": "Anthropic: Claude 3.7 Sonnet", - "attachment": true, - "reasoning": true, + "thedrummer/unslopnemo-12b": { + "id": "thedrummer/unslopnemo-12b", + "name": "TheDrummer: UnslopNemo 12B", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-02-19", + "release_date": "2024-11-09", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } }, - "anthropic/claude-sonnet-4.6": { - "id": "anthropic/claude-sonnet-4.6", - "name": "Anthropic: Claude Sonnet 4.6", - "attachment": true, - "reasoning": true, - "tool_call": true, + "thedrummer/cydonia-24b-v4.1": { + "id": "thedrummer/cydonia-24b-v4.1", + "name": "TheDrummer: Cydonia 24B V4.1", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-02-17", + "release_date": "2025-09-27", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 1000000, "output": 128000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 0.5 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Anthropic: Claude Sonnet 4", - "attachment": true, - "reasoning": true, - "tool_call": true, + "thedrummer/skyfall-36b-v2": { + "id": "thedrummer/skyfall-36b-v2", + "name": "TheDrummer: Skyfall 36B V2", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-05-22", + "release_date": "2025-03-11", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.55, + "output": 0.8 + } }, - "anthropic/claude-3.5-haiku": { - "id": "anthropic/claude-3.5-haiku", - "name": "Anthropic: Claude 3.5 Haiku", - "attachment": true, + "thedrummer/rocinante-12b": { + "id": "thedrummer/rocinante-12b", + "name": "TheDrummer: Rocinante 12B", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2024-09-30", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.17, + "output": 0.43 + } }, - "anthropic/claude-opus-4.5": { - "id": "anthropic/claude-opus-4.5", - "name": "Anthropic: Claude Opus 4.5", + "anthropic/claude-opus-4.1": { + "id": "anthropic/claude-opus-4.1", + "name": "Anthropic: Claude Opus 4.1", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-11-24", + "release_date": "2025-08-05", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "anthropic/claude-3.5-sonnet": { - "id": "anthropic/claude-3.5-sonnet", - "name": "Anthropic: Claude 3.5 Sonnet", + "anthropic/claude-3.7-sonnet:thinking": { + "id": "anthropic/claude-3.7-sonnet:thinking", + "name": "Anthropic: Claude 3.7 Sonnet (thinking)", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-10-22", + "release_date": "2025-02-19", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 6, "output": 30 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "anthropic/claude-3-haiku": { - "id": "anthropic/claude-3-haiku", - "name": "Anthropic: Claude 3 Haiku", + "anthropic/claude-opus-4.6-fast": { + "id": "anthropic/claude-opus-4.6-fast", + "name": "Anthropic: Claude Opus 4.6 (Fast)", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-03-07", - "last_updated": "2024-03-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-05-31", + "release_date": "2026-04-07", + "last_updated": "2026-04-11", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 150, + "cache_read": 3, + "cache_write": 37.5 + } }, - "anthropic/claude-sonnet-4.5": { - "id": "anthropic/claude-sonnet-4.5", - "name": "Anthropic: Claude Sonnet 4.5", + "anthropic/claude-3.7-sonnet": { + "id": "anthropic/claude-3.7-sonnet", + "name": "Anthropic: Claude 3.7 Sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-29", + "release_date": "2025-02-19", "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Anthropic: Claude Opus 4", + "anthropic/claude-opus-4.6": { + "id": "anthropic/claude-opus-4.6", + "name": "Anthropic: Claude Opus 4.6", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text"], "output": ["text"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } - }, - "alpindale/goliath-120b": { - "id": "alpindale/goliath-120b", - "name": "Goliath 120B", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2023-11-10", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 3.75, "output": 7.5 }, - "limit": { "context": 6144, "output": 1024 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "relace/relace-search": { - "id": "relace/relace-search", - "name": "Relace: Relace Search", - "attachment": false, - "reasoning": false, + "anthropic/claude-opus-4.7": { + "id": "anthropic/claude-opus-4.7", + "name": "Anthropic: Claude Opus 4.7", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-12-09", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 256000, "output": 128000 } - }, - "relace/relace-apply-3": { - "id": "relace/relace-apply-3", - "name": "Relace: Relace Apply 3", - "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2025-09-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-04-16", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.85, "output": 1.25 }, - "limit": { "context": 256000, "output": 128000 } - }, - "sao10k/l3.1-70b-hanami-x1": { - "id": "sao10k/l3.1-70b-hanami-x1", - "name": "Sao10K: Llama 3.1 70B Hanami x1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-01-08", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 3, "output": 3 }, - "limit": { "context": 16000, "output": 16000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "sao10k/l3-lunaris-8b": { - "id": "sao10k/l3-lunaris-8b", - "name": "Sao10K: Llama 3 8B Lunaris", - "attachment": false, - "reasoning": false, - "tool_call": false, + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Anthropic: Claude Sonnet 4", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2024-08-13", + "release_date": "2025-05-22", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.05 }, - "limit": { "context": 8192, "output": 8192 } + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "sao10k/l3.3-euryale-70b": { - "id": "sao10k/l3.3-euryale-70b", - "name": "Sao10K: Llama 3.3 Euryale 70B", - "attachment": false, - "reasoning": false, - "tool_call": false, + "anthropic/claude-sonnet-4.5": { + "id": "anthropic/claude-sonnet-4.5", + "name": "Anthropic: Claude Sonnet 4.5", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2024-12-18", + "release_date": "2025-09-29", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.65, "output": 0.75 }, - "limit": { "context": 131072, "output": 16384 } + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "sao10k/l3.1-euryale-70b": { - "id": "sao10k/l3.1-euryale-70b", - "name": "Sao10K: Llama 3.1 Euryale 70B v2.2", - "attachment": false, - "reasoning": false, + "anthropic/claude-opus-4.5": { + "id": "anthropic/claude-opus-4.5", + "name": "Anthropic: Claude Opus 4.5", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-08-28", + "release_date": "2025-11-24", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.85, "output": 0.85 }, - "limit": { "context": 131072, "output": 16384 } + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "sao10k/l3-euryale-70b": { - "id": "sao10k/l3-euryale-70b", - "name": "Sao10k: Llama 3 Euryale 70B v2.1", - "attachment": false, + "anthropic/claude-3-haiku": { + "id": "anthropic/claude-3-haiku", + "name": "Anthropic: Claude 3 Haiku", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-06-18", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.48, "output": 1.48 }, - "limit": { "context": 8192, "output": 8192 } + "release_date": "2024-03-07", + "last_updated": "2024-03-07", + "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 + } }, - "upstage/solar-pro-3": { - "id": "upstage/solar-pro-3", - "name": "Upstage: Solar Pro 3", - "attachment": false, + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Anthropic: Claude Opus 4", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-01-27", + "release_date": "2025-05-22", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["image", "pdf", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "mancer/weaver": { - "id": "mancer/weaver", - "name": "Mancer: Weaver (alpha)", - "attachment": false, + "anthropic/claude-3.5-haiku": { + "id": "anthropic/claude-3.5-haiku", + "name": "Anthropic: Claude 3.5 Haiku", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2023-08-02", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.75, "output": 1 }, - "limit": { "context": 8000, "output": 2000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "deepseek/deepseek-v3.1-terminus": { - "id": "deepseek/deepseek-v3.1-terminus", - "name": "DeepSeek: DeepSeek V3.1 Terminus", - "attachment": false, + "anthropic/claude-haiku-4.5": { + "id": "anthropic/claude-haiku-4.5", + "name": "Anthropic: Claude Haiku 4.5", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.21, "output": 0.79, "cache_read": 0.13 }, - "limit": { "context": 163840, "output": 32768 } + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "deepseek/deepseek-r1-distill-llama-70b": { - "id": "deepseek/deepseek-r1-distill-llama-70b", - "name": "DeepSeek: R1 Distill Llama 70B", - "attachment": false, + "anthropic/claude-sonnet-4.6": { + "id": "anthropic/claude-sonnet-4.6", + "name": "Anthropic: Claude Sonnet 4.6", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-01-23", + "knowledge": "2025-08-31", + "release_date": "2026-02-17", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 0.8, "cache_read": 0.015 }, - "limit": { "context": 131072, "output": 16384 } + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "deepseek/deepseek-r1": { - "id": "deepseek/deepseek-r1", - "name": "DeepSeek: R1", + "switchpoint/router": { + "id": "switchpoint/router", + "name": "Switchpoint Router", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.5 }, - "limit": { "context": 64000, "output": 16000 } + "release_date": "2025-07-12", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.85, + "output": 3.4 + } }, - "deepseek/deepseek-chat": { - "id": "deepseek/deepseek-chat", - "name": "DeepSeek: DeepSeek V3", - "attachment": false, + "bytedance/ui-tars-1.5-7b": { + "id": "bytedance/ui-tars-1.5-7b", + "name": "ByteDance: UI-TARS 7B ", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-12-01", + "release_date": "2025-07-23", "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.32, "output": 0.89, "cache_read": 0.15 }, - "limit": { "context": 163840, "output": 163840 } + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 2048 + }, + "cost": { + "input": 0.1, + "output": 0.2 + } }, - "deepseek/deepseek-v3.2-exp": { - "id": "deepseek/deepseek-v3.2-exp", - "name": "DeepSeek: DeepSeek V3.2 Exp", + "tngtech/deepseek-r1t2-chimera": { + "id": "tngtech/deepseek-r1t2-chimera", + "name": "TNG: DeepSeek R1T2 Chimera", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-08", + "last_updated": "2025-07-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 0.41 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.25, + "output": 0.85, + "cache_read": 0.125 + } }, - "deepseek/deepseek-chat-v3.1": { - "id": "deepseek/deepseek-chat-v3.1", - "name": "DeepSeek: DeepSeek V3.1", + "xiaomi/mimo-v2.5-pro": { + "id": "xiaomi/mimo-v2.5-pro", + "name": "Xiaomi: MiMo V2.5 Pro", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.75 }, - "limit": { "context": 32768, "output": 7168 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "deepseek/deepseek-v3.2-speciale": { - "id": "deepseek/deepseek-v3.2-speciale", - "name": "DeepSeek: DeepSeek V3.2 Speciale", - "attachment": false, + "xiaomi/mimo-v2-omni": { + "id": "xiaomi/mimo-v2-omni", + "name": "Xiaomi: MiMo-V2-Omni", + "family": "mimo", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 1.2, "cache_read": 0.135 }, - "limit": { "context": 163840, "output": 163840 } + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08 + } }, - "deepseek/deepseek-r1-distill-qwen-32b": { - "id": "deepseek/deepseek-r1-distill-qwen-32b", - "name": "DeepSeek: R1 Distill Qwen 32B", - "attachment": false, + "xiaomi/mimo-v2.5": { + "id": "xiaomi/mimo-v2.5", + "name": "Xiaomi: MiMo-V2.5", + "family": "mimo", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.29, "output": 0.29 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08, + "context_over_200k": { + "input": 0.8, + "output": 4, + "cache_read": 0.16 + }, + "tiers": [ + { + "input": 0.8, + "output": 4, + "cache_read": 0.16, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "deepseek/deepseek-chat-v3-0324": { - "id": "deepseek/deepseek-chat-v3-0324", - "name": "DeepSeek: DeepSeek V3 0324", + "xiaomi/mimo-v2-pro": { + "id": "xiaomi/mimo-v2-pro", + "name": "Xiaomi: MiMo-V2-Pro", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-03-24", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.77, "cache_read": 0.095 }, - "limit": { "context": 163840, "output": 65536 } + "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, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "deepseek/deepseek-r1-0528": { - "id": "deepseek/deepseek-r1-0528", - "name": "DeepSeek: R1 0528", + "xiaomi/mimo-v2-flash": { + "id": "xiaomi/mimo-v2-flash", + "name": "Xiaomi: MiMo-V2-Flash", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12-01", + "release_date": "2025-12-16", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.45, "output": 2.15, "cache_read": 0.2 }, - "limit": { "context": 163840, "output": 65536 } - }, - "deepseek/deepseek-v3.2": { - "id": "deepseek/deepseek-v3.2", - "name": "DeepSeek: DeepSeek V3.2", - "attachment": false, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.09, + "output": 0.29, + "cache_read": 0.045 + } + } + } + }, + "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": { + "anthropic--claude-4.6-opus": { + "id": "anthropic--claude-4.6-opus", + "name": "anthropic--claude-4.6-opus", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.26, "output": 0.38, "cache_read": 0.125 }, - "limit": { "context": 163840, "output": 65536 } + "knowledge": "2025-05", + "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 + } }, - "nvidia/llama-3.1-nemotron-70b-instruct": { - "id": "nvidia/llama-3.1-nemotron-70b-instruct", - "name": "NVIDIA: Llama 3.1 Nemotron 70B Instruct", - "attachment": false, + "anthropic--claude-3-haiku": { + "id": "anthropic--claude-3-haiku", + "name": "anthropic--claude-3-haiku", + "family": "claude-haiku", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-10-12", - "last_updated": "2024-10-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-08-31", + "release_date": "2024-03-13", + "last_updated": "2024-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 1.2 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 0.25, + "output": 1.25, + "cache_read": 0.03, + "cache_write": 0.3 + } }, - "nvidia/llama-3.3-nemotron-super-49b-v1.5": { - "id": "nvidia/llama-3.3-nemotron-super-49b-v1.5", - "name": "NVIDIA: Llama 3.3 Nemotron Super 49B V1.5", - "attachment": false, - "reasoning": true, + "anthropic--claude-3-opus": { + "id": "anthropic--claude-3-opus", + "name": "anthropic--claude-3-opus", + "family": "claude-opus", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-03-16", - "last_updated": "2025-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-08-31", + "release_date": "2024-02-29", + "last_updated": "2024-02-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "nvidia/nemotron-nano-12b-v2-vl": { - "id": "nvidia/nemotron-nano-12b-v2-vl", - "name": "NVIDIA: Nemotron Nano 12B 2 VL", + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "gpt-5-mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-10-28", - "last_updated": "2026-01-31", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 131072, "output": 26215 } + "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, + "cache_read": 0.025 + } }, - "nvidia/nemotron-nano-9b-v2": { - "id": "nvidia/nemotron-nano-9b-v2", - "name": "NVIDIA: Nemotron Nano 9B V2", - "attachment": false, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "gpt-5-nano", + "family": "gpt-nano", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-08-18", - "last_updated": "2025-08-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.16 }, - "limit": { "context": 131072, "output": 26215 } + "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, + "cache_read": 0.005 + } }, - "nvidia/nemotron-3-super-120b-a12b:free": { - "id": "nvidia/nemotron-3-super-120b-a12b:free", - "name": "NVIDIA: Nemotron 3 Super (free)", - "attachment": false, + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "gemini-2.5-pro", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01", + "release_date": "2025-03-25", + "last_updated": "2025-06-05", + "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 + } }, - "nvidia/nemotron-3-nano-30b-a3b": { - "id": "nvidia/nemotron-3-nano-30b-a3b", - "name": "NVIDIA: Nemotron 3 Nano 30B A3B", - "attachment": false, + "anthropic--claude-3.7-sonnet": { + "id": "anthropic--claude-3.7-sonnet", + "name": "anthropic--claude-3.7-sonnet", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-12", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 262144, "output": 52429 } + "knowledge": "2024-10-31", + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "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 + } }, - "gryphe/mythomax-l2-13b": { - "id": "gryphe/mythomax-l2-13b", - "name": "MythoMax 13B", - "attachment": false, + "sonar-pro": { + "id": "sonar-pro", + "name": "sonar-pro", + "family": "sonar-pro", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-04-25", - "last_updated": "2024-04-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.06 }, - "limit": { "context": 4096, "output": 4096 } - }, - "z-ai/glm-4.7-flash": { - "id": "z-ai/glm-4.7-flash", - "name": "Z.ai: GLM 4.7 Flash", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 202752, "output": 40551 } - }, - "z-ai/glm-4.5": { - "id": "z-ai/glm-4.5", - "name": "Z.ai: GLM 4.5", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.175 }, - "limit": { "context": 131072, "output": 98304 } - }, - "z-ai/glm-4.6": { - "id": "z-ai/glm-4.6", - "name": "Z.ai: GLM 4.6", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.39, "output": 1.9, "cache_read": 0.175 }, - "limit": { "context": 204800, "output": 204800 } + "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 + } }, - "z-ai/glm-4.6v": { - "id": "z-ai/glm-4.6v", - "name": "Z.ai: GLM 4.6V", + "anthropic--claude-4.5-sonnet": { + "id": "anthropic--claude-4.5-sonnet", + "name": "anthropic--claude-4.5-sonnet", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2026-01-10", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 131072, "output": 131072 } + "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 + } }, - "z-ai/glm-5": { - "id": "z-ai/glm-5", - "name": "Z.ai: GLM 5", - "attachment": false, + "anthropic--claude-4.6-sonnet": { + "id": "anthropic--claude-4.6-sonnet", + "name": "anthropic--claude-4.6-sonnet", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.72, "output": 2.3 }, - "limit": { "context": 202752, "output": 131072 } + "knowledge": "2025-08", + "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 + } }, - "z-ai/glm-4.5-air": { - "id": "z-ai/glm-4.5-air", - "name": "Z.ai: GLM 4.5 Air", + "sonar-deep-research": { + "id": "sonar-deep-research", + "name": "sonar-deep-research", + "family": "sonar-deep-research", "attachment": false, "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.85, "cache_read": 0.025 }, - "limit": { "context": 131072, "output": 98304 } + "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 + } }, - "z-ai/glm-4.5v": { - "id": "z-ai/glm-4.5v", - "name": "Z.ai: GLM 4.5V", + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "gemini-2.5-flash", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-11", - "last_updated": "2025-08-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 1.8, "cache_read": 0.11 }, - "limit": { "context": 65536, "output": 16384 } + "knowledge": "2025-01", + "release_date": "2025-03-25", + "last_updated": "2025-06-05", + "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 + } }, - "z-ai/glm-4.7": { - "id": "z-ai/glm-4.7", - "name": "Z.ai: GLM 4.7", - "attachment": false, + "anthropic--claude-4.5-opus": { + "id": "anthropic--claude-4.5-opus", + "name": "anthropic--claude-4.5-opus", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.38, "output": 1.98, "cache_read": 0.2 }, - "limit": { "context": 202752, "output": 65535 } - }, - "z-ai/glm-4-32b": { - "id": "z-ai/glm-4-32b", - "name": "Z.ai: GLM 4 32B ", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-07-25", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 128000, "output": 32768 } - }, - "nex-agi/deepseek-v3.1-nex-n1": { - "id": "nex-agi/deepseek-v3.1-nex-n1", - "name": "Nex AGI: DeepSeek V3.1 Nex N1", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-11-24", + "last_updated": "2025-11-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 131072, "output": 163840 } - }, - "allenai/olmo-3.1-32b-instruct": { - "id": "allenai/olmo-3.1-32b-instruct", - "name": "AllenAI: Olmo 3.1 32B Instruct", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2026-01-07", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 65536, "output": 32768 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "allenai/olmo-2-0325-32b-instruct": { - "id": "allenai/olmo-2-0325-32b-instruct", - "name": "AllenAI: Olmo 2 32B Instruct", + "sonar": { + "id": "sonar", + "name": "sonar", + "family": "sonar", "attachment": false, "reasoning": false, "tool_call": false, - "release_date": "2025-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 128000, "output": 32768 } - }, - "allenai/olmo-3-32b-think": { - "id": "allenai/olmo-3-32b-think", - "name": "AllenAI: Olmo 3 32B Think", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-11-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.5 }, - "limit": { "context": 65536, "output": 65536 } - }, - "allenai/olmo-3-7b-think": { - "id": "allenai/olmo-3-7b-think", - "name": "AllenAI: Olmo 3 7B Think", - "attachment": false, - "reasoning": true, - "tool_call": false, "temperature": true, - "release_date": "2025-11-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.12, "output": 0.2 }, - "limit": { "context": 65536, "output": 65536 } + "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 + } }, - "allenai/olmo-3.1-32b-think": { - "id": "allenai/olmo-3.1-32b-think", - "name": "AllenAI: Olmo 3.1 32B Think", - "attachment": false, + "anthropic--claude-4-opus": { + "id": "anthropic--claude-4-opus", + "name": "anthropic--claude-4-opus", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-12-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.5 }, - "limit": { "context": 65536, "output": 65536 } + "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 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "allenai/olmo-3-7b-instruct": { - "id": "allenai/olmo-3-7b-instruct", - "name": "AllenAI: Olmo 3 7B Instruct", - "attachment": false, + "anthropic--claude-3-sonnet": { + "id": "anthropic--claude-3-sonnet", + "name": "anthropic--claude-3-sonnet", + "family": "claude-sonnet", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-11-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.2 }, - "limit": { "context": 65536, "output": 65536 } + "knowledge": "2023-08-31", + "release_date": "2024-03-04", + "last_updated": "2024-03-04", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "allenai/molmo-2-8b": { - "id": "allenai/molmo-2-8b", - "name": "AllenAI: Molmo2 8B", + "anthropic--claude-4-sonnet": { + "id": "anthropic--claude-4-sonnet", + "name": "anthropic--claude-4-sonnet", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2026-01-09", - "last_updated": "2026-01-31", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 36864, "output": 36864 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "google/gemini-2.5-flash-lite": { - "id": "google/gemini-2.5-flash-lite", - "name": "Google: Gemini 2.5 Flash Lite", + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "gemini-2.5-flash-lite", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, + "knowledge": "2025-01", "release_date": "2025-06-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "reasoning": 0.4, "cache_read": 0.01, "cache_write": 0.083333 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "google/gemini-2.5-flash-lite-preview-09-2025": { - "id": "google/gemini-2.5-flash-lite-preview-09-2025", - "name": "Google: Gemini 2.5 Flash Lite Preview 09-2025", + "anthropic--claude-4.5-haiku": { + "id": "anthropic--claude-4.5-haiku", + "name": "anthropic--claude-4.5-haiku", + "family": "claude-haiku", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "reasoning": 0.4, "cache_read": 0.01, "cache_write": 0.083333 }, - "limit": { "context": 1048576, "output": 65536 } - }, - "google/gemma-2-9b-it": { - "id": "google/gemma-2-9b-it", - "name": "Google: Gemma 2 9B", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-06-28", - "last_updated": "2024-06-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.09 }, - "limit": { "context": 8192, "output": 1639 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "google/gemini-3.1-pro-preview": { - "id": "google/gemini-3.1-pro-preview", - "name": "Google: Gemini 3.1 Pro Preview", + "gpt-5": { + "id": "gpt-5", + "name": "gpt-5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-19", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 12, "reasoning": 12 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "google/gemini-3-pro-preview": { - "id": "google/gemini-3-pro-preview", - "name": "Google: Gemini 3 Pro Preview", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "gpt-4.1", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-11-18", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "reasoning": 12, "cache_read": 0.2, "cache_write": 0.375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "google/gemma-3-27b-it": { - "id": "google/gemma-3-27b-it", - "name": "Google: Gemma 3 27B", + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "gpt-4.1-mini", + "family": "gpt-mini", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-03-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.11, "cache_read": 0.02 }, - "limit": { "context": 128000, "output": 65536 } + "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 + } }, - "google/gemma-3-4b-it": { - "id": "google/gemma-3-4b-it", - "name": "Google: Gemma 3 4B", + "anthropic--claude-3.5-sonnet": { + "id": "anthropic--claude-3.5-sonnet", + "name": "anthropic--claude-3.5-sonnet", + "family": "claude-sonnet", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.08 }, - "limit": { "context": 131072, "output": 19200 } + "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": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + } + } + }, + "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": { + "auto": { + "id": "auto", + "name": "Auto", + "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 + } }, - "google/gemma-3n-e4b-it": { - "id": "google/gemma-3n-e4b-it", - "name": "Google: Gemma 3n 4B", + "morph-v3-fast": { + "id": "morph-v3-fast", + "name": "Morph v3 Fast", + "family": "morph", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.04 }, - "limit": { "context": 32768, "output": 6554 } + "temperature": false, + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16000, + "output": 16000 + }, + "cost": { + "input": 0.8, + "output": 1.2 + } }, - "google/gemini-2.5-pro-preview-05-06": { - "id": "google/gemini-2.5-pro-preview-05-06", - "name": "Google: Gemini 2.5 Pro Preview 05-06", - "attachment": true, - "reasoning": true, - "tool_call": true, + "morph-v3-large": { + "id": "morph-v3-large", + "name": "Morph v3 Large", + "family": "morph", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.9, + "output": 1.9 + } + } + } + }, + "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": { + "workers-ai/@cf/myshell-ai/melotts": { + "id": "workers-ai/@cf/myshell-ai/melotts", + "name": "MyShell MeloTTS", + "family": "melotts", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-05-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "reasoning": 10, "cache_read": 0.125, "cache_write": 0.375 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "google/gemini-2.0-flash-001": { - "id": "google/gemini-2.0-flash-001", - "name": "Google: Gemini 2.0 Flash", - "attachment": true, + "workers-ai/@cf/ibm-granite/granite-4.0-h-micro": { + "id": "workers-ai/@cf/ibm-granite/granite-4.0-h-micro", + "name": "IBM Granite 4.0 H Micro", + "family": "granite", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-12-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025, "cache_write": 0.083333 }, - "limit": { "context": 1048576, "output": 8192 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.017, + "output": 0.11 + } }, - "google/gemini-2.0-flash-lite-001": { - "id": "google/gemini-2.0-flash-lite-001", - "name": "Google: Gemini 2.0 Flash Lite", - "attachment": true, + "workers-ai/@cf/huggingface/distilbert-sst-2-int8": { + "id": "workers-ai/@cf/huggingface/distilbert-sst-2-int8", + "name": "DistilBERT SST-2 INT8", + "family": "distilbert", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-12-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 1048576, "output": 8192 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.026, + "output": 0 + } }, - "google/gemini-3-flash-preview": { - "id": "google/gemini-3-flash-preview", - "name": "Google: Gemini 3 Flash Preview", - "attachment": true, + "workers-ai/@cf/zai-org/glm-4.7-flash": { + "id": "workers-ai/@cf/zai-org/glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm-flash", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "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.06, + "output": 0.4 + } + }, + "workers-ai/@cf/pipecat-ai/smart-turn-v2": { + "id": "workers-ai/@cf/pipecat-ai/smart-turn-v2", + "name": "Pipecat Smart Turn v2", + "family": "smart-turn", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3, "reasoning": 3, "cache_read": 0.05, "cache_write": 0.083333 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "google/gemini-2.5-pro-preview": { - "id": "google/gemini-2.5-pro-preview", - "name": "Google: Gemini 2.5 Pro Preview 06-05", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct": { + "id": "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct", + "name": "Mistral Small 3.1 24B Instruct", + "family": "mistral-small", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-06-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text"], "output": ["text"] }, + "release_date": "2025-04-11", + "last_updated": "2025-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "reasoning": 10, "cache_read": 0.125, "cache_write": 0.375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.35, + "output": 0.56 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Google: Gemini 2.5 Pro", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/facebook/bart-large-cnn": { + "id": "workers-ai/@cf/facebook/bart-large-cnn", + "name": "BART Large CNN", + "family": "bart", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-03-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-04-09", + "last_updated": "2025-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "reasoning": 10, "cache_read": 0.125, "cache_write": 0.375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Google: Gemini 2.5 Flash", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it": { + "id": "workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it", + "name": "Gemma SEA-LION v4 27B IT", + "family": "gemma", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-07-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "reasoning": 2.5, "cache_read": 0.03, "cache_write": 0.083333 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.35, + "output": 0.56 + } }, - "google/gemini-3.1-pro-preview-customtools": { - "id": "google/gemini-3.1-pro-preview-customtools", - "name": "Google: Gemini 3.1 Pro Preview Custom Tools", - "attachment": true, + "workers-ai/@cf/nvidia/nemotron-3-120b-a12b": { + "id": "workers-ai/@cf/nvidia/nemotron-3-120b-a12b", + "name": "Nemotron 3 Super 120B", + "family": "nemotron", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 12, "reasoning": 12 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "google/gemma-2-27b-it": { - "id": "google/gemma-2-27b-it", - "name": "Google: Gemma 2 27B", + "workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": { + "id": "workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", + "name": "DeepSeek R1 Distill Qwen 32B", + "family": "deepseek-thinking", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-06-24", - "last_updated": "2024-06-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.65, "output": 0.65 }, - "limit": { "context": 8192, "output": 2048 } - }, - "google/gemini-3.1-flash-lite-preview": { - "id": "google/gemini-3.1-flash-lite-preview", - "name": "Google: Gemini 3.1 Flash Lite Preview", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2026-03-03", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1.5, "reasoning": 1.5 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.5, + "output": 4.88 + } }, - "google/gemini-3.1-flash-image-preview": { - "id": "google/gemini-3.1-flash-image-preview", - "name": "Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)", - "attachment": true, - "reasoning": true, + "workers-ai/@cf/openai/gpt-oss-20b": { + "id": "workers-ai/@cf/openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "attachment": false, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["image", "text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 65536, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 0.3 + } }, - "google/gemini-2.5-flash-image": { - "id": "google/gemini-2.5-flash-image", - "name": "Google: Nano Banana (Gemini 2.5 Flash Image)", - "attachment": true, + "workers-ai/@cf/openai/gpt-oss-120b": { + "id": "workers-ai/@cf/openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-10-08", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["image", "text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.35, + "output": 0.75 + } }, - "google/gemma-3-12b-it": { - "id": "google/gemma-3-12b-it", - "name": "Google: Gemma 3 12B", - "attachment": true, + "workers-ai/@cf/mistral/mistral-7b-instruct-v0.1": { + "id": "workers-ai/@cf/mistral/mistral-7b-instruct-v0.1", + "name": "Mistral 7B Instruct v0.1", + "family": "mistral", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-03-13", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.13, "cache_read": 0.015 }, - "limit": { "context": 131072, "output": 131072 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.11, + "output": 0.19 + } }, - "google/gemini-3-pro-image-preview": { - "id": "google/gemini-3-pro-image-preview", - "name": "Google: Nano Banana Pro (Gemini 3 Pro Image Preview)", - "attachment": true, - "reasoning": true, + "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct": { + "id": "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-11-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["image", "text"] }, + "release_date": "2025-04-16", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "reasoning": 12 }, - "limit": { "context": 65536, "output": 32768 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.27, + "output": 0.85 + } }, - "undi95/remm-slerp-l2-13b": { - "id": "undi95/remm-slerp-l2-13b", - "name": "ReMM SLERP 13B", + "workers-ai/@cf/meta/llama-3-8b-instruct-awq": { + "id": "workers-ai/@cf/meta/llama-3-8b-instruct-awq", + "name": "Llama 3 8B Instruct AWQ", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2023-07-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.45, "output": 0.65 }, - "limit": { "context": 6144, "output": 4096 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.12, + "output": 0.27 + } }, - "amazon/nova-lite-v1": { - "id": "amazon/nova-lite-v1", - "name": "Amazon: Nova Lite 1.0", - "attachment": true, + "workers-ai/@cf/meta/llama-guard-3-8b": { + "id": "workers-ai/@cf/meta/llama-guard-3-8b", + "name": "Llama Guard 3 8B", + "family": "llama", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-12-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0.24 }, - "limit": { "context": 300000, "output": 5120 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.48, + "output": 0.03 + } }, - "amazon/nova-2-lite-v1": { - "id": "amazon/nova-2-lite-v1", - "name": "Amazon: Nova 2 Lite", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/meta/m2m100-1.2b": { + "id": "workers-ai/@cf/meta/m2m100-1.2b", + "name": "M2M100 1.2B", + "family": "m2m", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "pdf", "text", "video"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1000000, "output": 65535 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.34, + "output": 0.34 + } }, - "amazon/nova-micro-v1": { - "id": "amazon/nova-micro-v1", - "name": "Amazon: Nova Micro 1.0", + "workers-ai/@cf/meta/llama-2-7b-chat-fp16": { + "id": "workers-ai/@cf/meta/llama-2-7b-chat-fp16", + "name": "Llama 2 7B Chat FP16", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-12-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.035, "output": 0.14 }, - "limit": { "context": 128000, "output": 5120 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.56, + "output": 6.67 + } }, - "amazon/nova-pro-v1": { - "id": "amazon/nova-pro-v1", - "name": "Amazon: Nova Pro 1.0", - "attachment": true, + "workers-ai/@cf/meta/llama-3.2-11b-vision-instruct": { + "id": "workers-ai/@cf/meta/llama-3.2-11b-vision-instruct", + "name": "Llama 3.2 11B Vision Instruct", + "family": "llama", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 3.2 }, - "limit": { "context": 300000, "output": 5120 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.049, + "output": 0.68 + } }, - "amazon/nova-premier-v1": { - "id": "amazon/nova-premier-v1", - "name": "Amazon: Nova Premier 1.0", - "attachment": true, + "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast": { + "id": "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "name": "Llama 3.3 70B Instruct FP8 Fast", + "family": "llama", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-11-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 12.5 }, - "limit": { "context": 1000000, "output": 32000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.29, + "output": 2.25 + } }, - "baidu/ernie-4.5-21b-a3b": { - "id": "baidu/ernie-4.5-21b-a3b", - "name": "Baidu: ERNIE 4.5 21B A3B", + "workers-ai/@cf/meta/llama-3.2-1b-instruct": { + "id": "workers-ai/@cf/meta/llama-3.2-1b-instruct", + "name": "Llama 3.2 1B Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 120000, "output": 8000 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.027, + "output": 0.2 + } }, - "baidu/ernie-4.5-300b-a47b": { - "id": "baidu/ernie-4.5-300b-a47b", - "name": "Baidu: ERNIE 4.5 300B A47B ", + "workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8": { + "id": "workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8", + "name": "Llama 3.1 8B Instruct FP8", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.28, "output": 1.1 }, - "limit": { "context": 123000, "output": 12000 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.29 + } }, - "baidu/ernie-4.5-21b-a3b-thinking": { - "id": "baidu/ernie-4.5-21b-a3b-thinking", - "name": "Baidu: ERNIE 4.5 21B A3B Thinking", + "workers-ai/@cf/meta/llama-3.2-3b-instruct": { + "id": "workers-ai/@cf/meta/llama-3.2-3b-instruct", + "name": "Llama 3.2 3B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 131072, "output": 65536 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.051, + "output": 0.34 + } }, - "baidu/ernie-4.5-vl-28b-a3b": { - "id": "baidu/ernie-4.5-vl-28b-a3b", - "name": "Baidu: ERNIE 4.5 VL 28B A3B", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/meta/llama-3.1-8b-instruct-awq": { + "id": "workers-ai/@cf/meta/llama-3.1-8b-instruct-awq", + "name": "Llama 3.1 8B Instruct AWQ", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.14, "output": 0.56 }, - "limit": { "context": 30000, "output": 8000 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.12, + "output": 0.27 + } }, - "baidu/ernie-4.5-vl-424b-a47b": { - "id": "baidu/ernie-4.5-vl-424b-a47b", - "name": "Baidu: ERNIE 4.5 VL 424B A47B ", - "attachment": true, - "reasoning": true, + "workers-ai/@cf/meta/llama-3-8b-instruct": { + "id": "workers-ai/@cf/meta/llama-3-8b-instruct", + "name": "Llama 3 8B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2026-01", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.42, "output": 1.25 }, - "limit": { "context": 123000, "output": 16000 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.28, + "output": 0.83 + } }, - "ibm-granite/granite-4.0-h-micro": { - "id": "ibm-granite/granite-4.0-h-micro", - "name": "IBM: Granite 4.0 Micro", + "workers-ai/@cf/meta/llama-3.1-8b-instruct": { + "id": "workers-ai/@cf/meta/llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2025-10-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.017, "output": 0.11 }, - "limit": { "context": 131000, "output": 32768 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.28, + "output": 0.8299999999999998 + } }, - "kilo/auto": { - "id": "kilo/auto", - "name": "Kilo: Auto", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct": { + "id": "workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct", + "name": "Qwen 2.5 Coder 32B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2024-06-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2025-04-11", + "last_updated": "2025-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.66, + "output": 1 + } }, - "kilo/auto-free": { - "id": "kilo/auto-free", - "name": "Deprecated Kilo Auto Free", + "workers-ai/@cf/qwen/qwen3-embedding-0.6b": { + "id": "workers-ai/@cf/qwen/qwen3-embedding-0.6b", + "name": "Qwen3 Embedding 0.6B", + "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.012, + "output": 0 + } }, - "kilo/auto-small": { - "id": "kilo/auto-small", - "name": "Deprecated Kilo Auto Small", - "attachment": true, - "reasoning": true, - "tool_call": true, + "workers-ai/@cf/qwen/qwq-32b": { + "id": "workers-ai/@cf/qwen/qwq-32b", + "name": "QwQ 32B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2025-04-11", + "last_updated": "2025-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.66, + "output": 1 + } }, - "meta-llama/llama-3.3-70b-instruct": { - "id": "meta-llama/llama-3.3-70b-instruct", - "name": "Meta: Llama 3.3 70B Instruct", + "workers-ai/@cf/qwen/qwen3-30b-a3b-fp8": { + "id": "workers-ai/@cf/qwen/qwen3-30b-a3b-fp8", + "name": "Qwen3 30B A3B FP8", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-08-01", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.32 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.051, + "output": 0.34 + } }, - "meta-llama/llama-3.2-1b-instruct": { - "id": "meta-llama/llama-3.2-1b-instruct", - "name": "Meta: Llama 3.2 1B Instruct", + "workers-ai/@cf/google/gemma-3-12b-it": { + "id": "workers-ai/@cf/google/gemma-3-12b-it", + "name": "Gemma 3 12B IT", + "family": "gemma", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-09-18", + "release_date": "2025-04-11", + "last_updated": "2025-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.35, + "output": 0.56 + } + }, + "workers-ai/@cf/moonshotai/kimi-k2.5": { + "id": "workers-ai/@cf/moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, + "reasoning": true, + "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"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.027, "output": 0.2 }, - "limit": { "context": 60000, "output": 12000 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "meta-llama/llama-guard-4-12b": { - "id": "meta-llama/llama-guard-4-12b", - "name": "Meta: Llama Guard 4 12B", + "workers-ai/@cf/moonshotai/kimi-k2.6": { + "id": "workers-ai/@cf/moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 163840, "output": 32768 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "meta-llama/llama-3.1-405b-instruct": { - "id": "meta-llama/llama-3.1-405b-instruct", - "name": "Meta: Llama 3.1 405B Instruct", + "workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B": { + "id": "workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B", + "name": "IndicTrans2 EN-Indic 1B", + "family": "indictrans", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-07-16", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 4, "output": 4 }, - "limit": { "context": 131000, "output": 26200 } + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.34, + "output": 0.34 + } }, - "meta-llama/llama-3.1-8b-instruct": { - "id": "meta-llama/llama-3.1-8b-instruct", - "name": "Meta: Llama 3.1 8B Instruct", + "workers-ai/@cf/pfnet/plamo-embedding-1b": { + "id": "workers-ai/@cf/pfnet/plamo-embedding-1b", + "name": "PLaMo Embedding 1B", + "family": "plamo", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.05 }, - "limit": { "context": 16384, "output": 16384 } - }, - "meta-llama/llama-3.2-11b-vision-instruct": { - "id": "meta-llama/llama-3.2-11b-vision-instruct", - "name": "Meta: Llama 3.2 11B Vision Instruct", - "attachment": true, - "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-09-25", - "last_updated": "2024-09-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.049, "output": 0.049 }, - "limit": { "context": 131072, "output": 16384 } - }, - "meta-llama/llama-4-scout": { - "id": "meta-llama/llama-4-scout", - "name": "Meta: Llama 4 Scout", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 327680, "output": 16384 } + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.019, + "output": 0 + } }, - "meta-llama/llama-3-8b-instruct": { - "id": "meta-llama/llama-3-8b-instruct", - "name": "Meta: Llama 3 8B Instruct", + "workers-ai/@cf/baai/bge-small-en-v1.5": { + "id": "workers-ai/@cf/baai/bge-small-en-v1.5", + "name": "BGE Small EN v1.5", + "family": "bge", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-04-25", + "release_date": "2025-04-03", "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.04 }, - "limit": { "context": 8192, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "meta-llama/llama-3-70b-instruct": { - "id": "meta-llama/llama-3-70b-instruct", - "name": "Meta: Llama 3 70B Instruct", + "workers-ai/@cf/baai/bge-large-en-v1.5": { + "id": "workers-ai/@cf/baai/bge-large-en-v1.5", + "name": "BGE Large EN v1.5", + "family": "bge", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.51, "output": 0.74 }, - "limit": { "context": 8192, "output": 8000 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 0 + } }, - "meta-llama/llama-4-maverick": { - "id": "meta-llama/llama-4-maverick", - "name": "Meta: Llama 4 Maverick", - "attachment": true, + "workers-ai/@cf/baai/bge-reranker-base": { + "id": "workers-ai/@cf/baai/bge-reranker-base", + "name": "BGE Reranker Base", + "family": "bge", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-12-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 1048576, "output": 16384 } + "release_date": "2025-04-09", + "last_updated": "2025-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.0031, + "output": 0 + } }, - "meta-llama/llama-guard-3-8b": { - "id": "meta-llama/llama-guard-3-8b", - "name": "Llama Guard 3 8B", + "workers-ai/@cf/baai/bge-base-en-v1.5": { + "id": "workers-ai/@cf/baai/bge-base-en-v1.5", + "name": "BGE Base EN v1.5", + "family": "bge", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-04-18", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.06 }, - "limit": { "context": 131072, "output": 26215 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.067, + "output": 0 + } }, - "meta-llama/llama-3.2-3b-instruct": { - "id": "meta-llama/llama-3.2-3b-instruct", - "name": "Meta: Llama 3.2 3B Instruct", + "workers-ai/@cf/baai/bge-m3": { + "id": "workers-ai/@cf/baai/bge-m3", + "name": "BGE M3", + "family": "bge", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-09-18", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.051, "output": 0.34 }, - "limit": { "context": 80000, "output": 16384 } + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.012, + "output": 0 + } }, - "meta-llama/llama-3.1-70b-instruct": { - "id": "meta-llama/llama-3.1-70b-instruct", - "name": "Meta: Llama 3.1 70B Instruct", + "workers-ai/@cf/deepgram/aura-2-en": { + "id": "workers-ai/@cf/deepgram/aura-2-en", + "name": "Deepgram Aura 2 (EN)", + "family": "aura", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-07-16", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 131072, "output": 26215 } + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "meta-llama/llama-3.1-405b": { - "id": "meta-llama/llama-3.1-405b", - "name": "Meta: Llama 3.1 405B (base)", + "workers-ai/@cf/deepgram/aura-2-es": { + "id": "workers-ai/@cf/deepgram/aura-2-es", + "name": "Deepgram Aura 2 (ES)", + "family": "aura", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2024-08-02", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 4, "output": 4 }, - "limit": { "context": 32768, "output": 32768 } + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openrouter/hunter-alpha": { - "id": "openrouter/hunter-alpha", - "name": "Hunter Alpha", + "workers-ai/@cf/deepgram/nova-3": { + "id": "workers-ai/@cf/deepgram/nova-3", + "name": "Deepgram Nova 3", + "family": "nova", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 1048576, "output": 32000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openrouter/free": { - "id": "openrouter/free", - "name": "Free Models Router", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 32768 } - }, - "openrouter/bodybuilder": { - "id": "openrouter/bodybuilder", - "name": "Body Builder (beta)", - "attachment": false, - "reasoning": false, - "tool_call": false, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 }, - "status": "beta" + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "ai-gateway-provider" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "openrouter/auto": { - "id": "openrouter/auto", - "name": "Auto Router", + "openai/gpt-4-turbo": { + "id": "openai/gpt-4-turbo", + "name": "GPT-4 Turbo", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "pdf", "text", "video"], "output": ["image", "text"] }, + "knowledge": "2023-12", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000000, "output": 32768 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "openrouter/healer-alpha": { - "id": "openrouter/healer-alpha", - "name": "Healer Alpha", + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["audio", "image", "text", "video"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 32000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "perplexity/sonar-deep-research": { - "id": "perplexity/sonar-deep-research", - "name": "Perplexity: Sonar Deep Research", - "attachment": false, + "openai/o3-pro": { + "id": "openai/o3-pro", + "name": "o3-pro", + "family": "o-pro", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-01-27", - "last_updated": "2025-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 128000, "output": 25600 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 20, + "output": 80 + } }, - "perplexity/sonar": { - "id": "perplexity/sonar", - "name": "Perplexity: Sonar", + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 127072, "output": 25415 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "perplexity/sonar-reasoning-pro": { - "id": "perplexity/sonar-reasoning-pro", - "name": "Perplexity: Sonar Reasoning Pro", + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "o4-mini", + "family": "o-mini", "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 128000, "output": 25600 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.28 + } }, - "perplexity/sonar-pro": { - "id": "perplexity/sonar-pro", - "name": "Perplexity: Sonar Pro", + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 8000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "ai-gateway-provider" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "perplexity/sonar-pro-search": { - "id": "perplexity/sonar-pro-search", - "name": "Perplexity: Sonar Pro Search", + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-10-31", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "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, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 8000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "essentialai/rnj-1-instruct": { - "id": "essentialai/rnj-1-instruct", - "name": "EssentialAI: Rnj 1 Instruct", - "attachment": false, - "reasoning": false, + "openai/o1": { + "id": "openai/o1", + "name": "o1", + "family": "o", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-12-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 32768, "output": 6554 } + "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 + } }, - "arcee-ai/coder-large": { - "id": "arcee-ai/coder-large", - "name": "Arcee AI: Coder Large", + "openai/gpt-3.5-turbo": { + "id": "openai/gpt-3.5-turbo", + "name": "GPT-3.5-turbo", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, + "structured_output": false, "temperature": true, - "release_date": "2025-05-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 0.8 }, - "limit": { "context": 32768, "output": 32768 } + "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": 1.25 + } }, - "arcee-ai/trinity-large-preview:free": { - "id": "arcee-ai/trinity-large-preview:free", - "name": "Arcee AI: Trinity Large Preview (free)", + "openai/o3-mini": { + "id": "openai/o3-mini", + "name": "o3-mini", + "family": "o-mini", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-01-28", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131000, "output": 26200 } + "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 + } }, - "arcee-ai/virtuoso-large": { - "id": "arcee-ai/virtuoso-large", - "name": "Arcee AI: Virtuoso Large", - "attachment": false, + "openai/gpt-4": { + "id": "openai/gpt-4", + "name": "GPT-4", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "release_date": "2025-05-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.75, "output": 1.2 }, - "limit": { "context": 131072, "output": 64000 } + "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 + } }, - "arcee-ai/trinity-mini": { - "id": "arcee-ai/trinity-mini", - "name": "Arcee AI: Trinity Mini", - "attachment": false, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-12", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.045, "output": 0.15 }, - "limit": { "context": 131072, "output": 131072 } - }, - "arcee-ai/spotlight": { - "id": "arcee-ai/spotlight", - "name": "Arcee AI: Spotlight", - "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-05-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 131072, "output": 65537 } + "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 + }, + "provider": { + "npm": "ai-gateway-provider" + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + } }, - "arcee-ai/maestro-reasoning": { - "id": "arcee-ai/maestro-reasoning", - "name": "Arcee AI: Maestro Reasoning", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-05-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.9, "output": 3.3 }, - "limit": { "context": 131072, "output": 32000 } + "openai/o3": { + "id": "openai/o3", + "name": "o3", + "family": "o", + "attachment": true, + "reasoning": true, + "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 + } }, - "bytedance/ui-tars-1.5-7b": { - "id": "bytedance/ui-tars-1.5-7b", - "name": "ByteDance: UI-TARS 7B ", + "openai/gpt-4o": { + "id": "openai/gpt-4o", + "name": "GPT-4o", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-07-23", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-05-13", + "last_updated": "2024-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.2 }, - "limit": { "context": 128000, "output": 2048 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "kilo-auto/free": { - "id": "kilo-auto/free", - "name": "Kilo Auto Free", - "attachment": false, + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "kilo-auto/balanced": { - "id": "kilo-auto/balanced", - "name": "Kilo Auto Balanced", - "attachment": false, + "anthropic/claude-haiku-4-5": { + "id": "anthropic/claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "kilo-auto/small": { - "id": "kilo-auto/small", - "name": "Kilo Auto Small", + "anthropic/claude-sonnet-4-6": { + "id": "anthropic/claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "provider": { + "npm": "ai-gateway-provider" + }, + "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 + } + } }, - "kilo-auto/frontier": { - "id": "kilo-auto/frontier", - "name": "Kilo Auto Frontier", + "anthropic/claude-opus-4-7": { + "id": "anthropic/claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2026-01", + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 1000000, "output": 128000 } - }, - "nousresearch/hermes-2-pro-llama-3-8b": { - "id": "nousresearch/hermes-2-pro-llama-3-8b", - "name": "NousResearch: Hermes 2 Pro - Llama-3 8B", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-05-27", - "last_updated": "2024-06-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.14, "output": 0.14 }, - "limit": { "context": 8192, "output": 8192 } - }, - "nousresearch/hermes-4-70b": { - "id": "nousresearch/hermes-4-70b", - "name": "Nous: Hermes 4 70B", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-08-25", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.4, "cache_read": 0.055 }, - "limit": { "context": 131072, "output": 131072 } - }, - "nousresearch/hermes-3-llama-3.1-70b": { - "id": "nousresearch/hermes-3-llama-3.1-70b", - "name": "Nous: Hermes 3 70B Instruct", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-08-18", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "nousresearch/hermes-4-405b": { - "id": "nousresearch/hermes-4-405b", - "name": "Nous: Hermes 4 405B", - "attachment": false, + "anthropic/claude-opus-4-1": { + "id": "anthropic/claude-opus-4-1", + "name": "Claude Opus 4.1 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-08-25", - "last_updated": "2025-08-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 131072, "output": 26215 } - }, - "nousresearch/hermes-3-llama-3.1-405b": { - "id": "nousresearch/hermes-3-llama-3.1-405b", - "name": "Nous: Hermes 3 405B Instruct", - "attachment": false, - "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2024-08-16", - "last_updated": "2024-08-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 131072, "output": 16384 } + "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 + } }, - "minimax/minimax-m2-her": { - "id": "minimax/minimax-m2-her", - "name": "MiniMax: MiniMax M2-her", - "attachment": false, + "anthropic/claude-3-5-haiku": { + "id": "anthropic/claude-3-5-haiku", + "name": "Claude Haiku 3.5 (latest)", + "family": "claude-haiku", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2026-01-23", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 65536, "output": 2048 } + "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 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "minimax/minimax-01": { - "id": "minimax/minimax-01", - "name": "MiniMax: MiniMax-01", + "anthropic/claude-3.5-sonnet": { + "id": "anthropic/claude-3.5-sonnet", + "name": "Claude Sonnet 3.5 v2", + "family": "claude-sonnet", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 1000192, "output": 1000192 } + "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": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "minimax/minimax-m2": { - "id": "minimax/minimax-m2", - "name": "MiniMax: MiniMax M2", - "attachment": false, + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude Sonnet 4 (latest)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-10-23", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.255, "output": 1, "cache_read": 0.03 }, - "limit": { "context": 196608, "output": 196608 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "MiniMax: MiniMax M2.1", - "attachment": false, + "anthropic/claude-opus-4-5": { + "id": "anthropic/claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 0.95, "cache_read": 0.03 }, - "limit": { "context": 196608, "output": 39322 } + "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 + } }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "MiniMax: MiniMax M2.5", - "attachment": false, - "reasoning": true, + "anthropic/claude-3-haiku": { + "id": "anthropic/claude-3-haiku", + "name": "Claude Haiku 3", + "family": "claude-haiku", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 1.2, "cache_read": 0.029 }, - "limit": { "context": 196608, "output": 196608 } + "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 + } }, - "minimax/minimax-m1": { - "id": "minimax/minimax-m1", - "name": "MiniMax: MiniMax M1", - "attachment": false, + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Claude Opus 4 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2.2 }, - "limit": { "context": 1000000, "output": 40000 } + "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 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "minimax/minimax-m2.5:free": { - "id": "minimax/minimax-m2.5:free", - "name": "MiniMax: MiniMax M2.5 (free)", - "attachment": false, + "anthropic/claude-opus-4-6": { + "id": "anthropic/claude-opus-4-6", + "name": "Claude Opus 4.6 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 204800, "output": 131072 } + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "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 + } + } }, - "qwen/qwen3-coder-30b-a3b-instruct": { - "id": "qwen/qwen3-coder-30b-a3b-instruct", - "name": "Qwen: Qwen3 Coder 30B A3B Instruct", - "attachment": false, + "anthropic/claude-3.5-haiku": { + "id": "anthropic/claude-3.5-haiku", + "name": "Claude Haiku 3.5 (latest)", + "family": "claude-haiku", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-07-31", - "last_updated": "2025-07-31", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.27 }, - "limit": { "context": 160000, "output": 32768 } - }, - "qwen/qwen3-8b": { - "id": "qwen/qwen3-8b", - "name": "Qwen: Qwen3 8B", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-04", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.05 }, - "limit": { "context": 40960, "output": 8192 } + "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 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "qwen/qwen3.5-9b": { - "id": "qwen/qwen3.5-9b", - "name": "Qwen: Qwen3.5-9B", + "anthropic/claude-sonnet-4-5": { + "id": "anthropic/claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-10", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.15 }, - "limit": { "context": 256000, "output": 32768 } + "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 + } }, - "qwen/qwen-turbo": { - "id": "qwen/qwen-turbo", - "name": "Qwen: Qwen-Turbo", - "attachment": false, + "anthropic/claude-3-sonnet": { + "id": "anthropic/claude-3-sonnet", + "name": "Claude Sonnet 3", + "family": "claude-sonnet", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-11-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-08-31", + "release_date": "2024-03-04", + "last_updated": "2024-03-04", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.0325, "output": 0.13, "cache_read": 0.01 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 0.3 + } }, - "qwen/qwen-vl-max": { - "id": "qwen/qwen-vl-max", - "name": "Qwen: Qwen VL Max", + "anthropic/claude-3-opus": { + "id": "anthropic/claude-3-opus", + "name": "Claude Opus 3", + "family": "claude-opus", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-04-08", - "last_updated": "2025-08-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-08-31", + "release_date": "2024-02-29", + "last_updated": "2024-02-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 3.2 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "qwen/qwen3-vl-235b-a22b-instruct": { - "id": "qwen/qwen3-vl-235b-a22b-instruct", - "name": "Qwen: Qwen3 VL 235B A22B Instruct", + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-09-23", - "last_updated": "2026-01-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.88, "cache_read": 0.11 }, - "limit": { "context": 262144, "output": 52429 } + "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, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } + } + } + }, + "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.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1-Codex-max", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2024-09-30", + "release_date": "2025-12-04", + "last_updated": "2025-12-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 128000, + "output": 128000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwq-32b": { - "id": "qwen/qwq-32b", - "name": "Qwen: QwQ 32B", - "attachment": false, + "claude-opus-4.6": { + "id": "claude-opus-4.6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-11-28", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.4 }, - "limit": { "context": 32768, "output": 32768 } + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 144000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-coder-next": { - "id": "qwen/qwen3-coder-next", - "name": "Qwen: Qwen3 Coder Next", - "attachment": false, - "reasoning": false, + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2026-02-02", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.12, "output": 0.75, "cache_read": 0.035 }, - "limit": { "context": 262144, "output": 65536 } + "knowledge": "2025-01", + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen-vl-plus": { - "id": "qwen/qwen-vl-plus", - "name": "Qwen: Qwen VL Plus", + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash", + "family": "gemini-flash", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-01-25", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1365, "output": 0.4095, "cache_read": 0.042 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen-max": { - "id": "qwen/qwen-max", - "name": "Qwen: Qwen-Max ", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2024-04-03", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.04, "output": 4.16, "cache_read": 0.32 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3.5-flash-02-23": { - "id": "qwen/qwen3.5-flash-02-23", - "name": "Qwen: Qwen3.5-Flash", + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5-mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1000000, "output": 65536 } + "knowledge": "2024-06", + "release_date": "2025-08-13", + "last_updated": "2025-08-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 264000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-vl-32b-instruct": { - "id": "qwen/qwen3-vl-32b-instruct", - "name": "Qwen: Qwen3 VL 32B Instruct", + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-10-21", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.104, "output": 0.416 }, - "limit": { "context": 131072, "output": 32768 } - }, - "qwen/qwen2.5-coder-7b-instruct": { - "id": "qwen/qwen2.5-coder-7b-instruct", - "name": "Qwen: Qwen2.5 Coder 7B Instruct", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-09-17", - "last_updated": "2024-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.09 }, - "limit": { "context": 32768, "output": 6554 } + "limit": { + "context": 128000, + "input": 128000, + "output": 64000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-14b": { - "id": "qwen/qwen3-14b", - "name": "Qwen: Qwen3 14B", + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3-Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-04", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.24, "cache_read": 0.025 }, - "limit": { "context": 40960, "output": 40960 } + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-02-24", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-30b-a3b-thinking-2507": { - "id": "qwen/qwen3-30b-a3b-thinking-2507", - "name": "Qwen: Qwen3 30B A3B Thinking 2507", - "attachment": false, - "reasoning": true, + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.051, "output": 0.34 }, - "limit": { "context": 32768, "output": 6554 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3.5-plus-02-15": { - "id": "qwen/qwen3.5-plus-02-15", - "name": "Qwen: Qwen3.5 Plus 2026-02-15", + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, + "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, - "cost": { "input": 0.26, "output": 1.56 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 264000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3.5-35b-a3b": { - "id": "qwen/qwen3.5-35b-a3b", - "name": "Qwen: Qwen3.5-35B-A3B", + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1625, "output": 1.3 }, - "limit": { "context": 262144, "output": 65536 } + "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, + "output": 0 + } }, - "qwen/qwen3.5-122b-a10b": { - "id": "qwen/qwen3.5-122b-a10b", - "name": "Qwen: Qwen3.5-122B-A10B", + "claude-opus-4.7": { + "id": "claude-opus-4.7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.26, "output": 2.08 }, - "limit": { "context": 262144, "output": 65536 } + "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": 144000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-30b-a3b": { - "id": "qwen/qwen3-30b-a3b", - "name": "Qwen: Qwen3 30B A3B", + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2-Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-04", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.08, "output": 0.28, "cache_read": 0.03 }, - "limit": { "context": 40960, "output": 40960 } + "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": 0, + "output": 0 + } }, - "qwen/qwen-plus": { - "id": "qwen/qwen-plus", - "name": "Qwen: Qwen-Plus", + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1-Codex-mini", + "family": "gpt-codex", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2024-01-25", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.4, "output": 1.2, "cache_read": 0.08 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 400000, + "input": 128000, + "output": 128000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-vl-8b-thinking": { - "id": "qwen/qwen3-vl-8b-thinking", - "name": "Qwen: Qwen3 VL 8B Thinking", + "claude-sonnet-4": { + "id": "claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-11-25", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.117, "output": 1.365 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 216000, + "input": 128000, + "output": 16000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-coder": { - "id": "qwen/qwen3-coder", - "name": "Qwen: Qwen3 Coder 480B A35B", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 1, "cache_read": 0.022 }, - "limit": { "context": 262144, "output": 52429 } + "knowledge": "2025-08", + "release_date": "2025-08-27", + "last_updated": "2025-08-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3.5-27b": { - "id": "qwen/qwen3.5-27b", - "name": "Qwen: Qwen3.5-27B", + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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": 264000, + "input": 128000, + "output": 64000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } + }, + "claude-sonnet-4.5": { + "id": "claude-sonnet-4.5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.195, "output": 1.56 }, - "limit": { "context": 262144, "output": 65536 } + "knowledge": "2025-03-31", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 144000, + "input": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen2.5-vl-32b-instruct": { - "id": "qwen/qwen2.5-vl-32b-instruct", - "name": "Qwen: Qwen2.5 VL 32B Instruct", + "claude-opus-41": { + "id": "claude-opus-41", + "name": "Claude Opus 4.1", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": false, "temperature": true, - "release_date": "2025-03-24", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 16384 } + "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": 80000, + "output": 16000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen-2.5-7b-instruct": { - "id": "qwen/qwen-2.5-7b-instruct", - "name": "Qwen: Qwen2.5 7B Instruct", - "attachment": false, - "reasoning": false, + "claude-opus-4.5": { + "id": "claude-opus-4.5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-09", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.1 }, - "limit": { "context": 32768, "output": 6554 } + "knowledge": "2025-03-31", + "release_date": "2025-11-24", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 160000, + "input": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen-plus-2025-07-28:thinking": { - "id": "qwen/qwen-plus-2025-07-28:thinking", - "name": "Qwen: Qwen Plus 0728 (thinking)", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-09-09", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.26, "output": 0.78 }, - "limit": { "context": 1000000, "output": 32768 } + "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, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen2.5-vl-72b-instruct": { - "id": "qwen/qwen2.5-vl-72b-instruct", - "name": "Qwen: Qwen2.5 VL 72B Instruct", + "gpt-4o": { + "id": "gpt-4o", + "name": "GPT-4o", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-02-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.8, "output": 0.8, "cache_read": 0.075 }, - "limit": { "context": 32768, "output": 32768 } - }, - "qwen/qwen3-235b-a22b-2507": { - "id": "qwen/qwen3-235b-a22b-2507", - "name": "Qwen: Qwen3 235B A22B Instruct 2507", - "attachment": false, - "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-04", - "last_updated": "2026-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.071, "output": 0.1 }, - "limit": { "context": 262144, "output": 52429 } + "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, + "input": 64000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-vl-8b-instruct": { - "id": "qwen/qwen3-vl-8b-instruct", - "name": "Qwen: Qwen3 VL 8B Instruct", + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-11-25", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.08, "output": 0.5 }, - "limit": { "context": 131072, "output": 32768 } + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-next-80b-a3b-thinking": { - "id": "qwen/qwen3-next-80b-a3b-thinking", - "name": "Qwen: Qwen3 Next 80B A3B Thinking", - "attachment": false, + "claude-haiku-4.5": { + "id": "claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.0975, "output": 0.78 }, - "limit": { "context": 131072, "output": 32768 } + "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": 144000, + "input": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-vl-30b-a3b-instruct": { - "id": "qwen/qwen3-vl-30b-a3b-instruct", - "name": "Qwen: Qwen3 VL 30B A3B Instruct", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-10-05", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 131072, "output": 32768 } + "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, + "input": 64000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-235b-a22b-thinking-2507": { - "id": "qwen/qwen3-235b-a22b-thinking-2507", - "name": "Qwen: Qwen3 235B A22B Thinking 2507", - "attachment": false, + "claude-sonnet-4.6": { + "id": "claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-25", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.11, "output": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 128000, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-max-thinking": { - "id": "qwen/qwen3-max-thinking", - "name": "Qwen: Qwen3 Max Thinking", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-01-23", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.78, "output": 3.9 }, - "limit": { "context": 262144, "output": 32768 } - }, - "qwen/qwen3-next-80b-a3b-instruct": { - "id": "qwen/qwen3-next-80b-a3b-instruct", - "name": "Qwen: Qwen3 Next 80B A3B Instruct", + "limit": { + "context": 400000, + "input": 128000, + "output": 128000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } + } + } + }, + "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-122b-a10b": { + "id": "qwen/qwen3.5-122b-a10b", + "name": "Qwen3.5 122B A10B", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 1.1 }, - "limit": { "context": 131072, "output": 52429 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.4, + "output": 3.2 + } }, - "qwen/qwen3-235b-a22b": { - "id": "qwen/qwen3-235b-a22b", - "name": "Qwen: Qwen3 235B A22B", + "qwen/qwen3.5-27b": { + "id": "qwen/qwen3.5-27b", + "name": "Qwen3.5 27B", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.455, "output": 1.82, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.3, + "output": 2.4 + } }, - "qwen/qwen3-vl-30b-a3b-thinking": { - "id": "qwen/qwen3-vl-30b-a3b-thinking", - "name": "Qwen: Qwen3 VL 30B A3B Thinking", - "attachment": true, + "qwen/qwen3.5-397b-a17b": { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen3.5 397B A17B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-10-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 1.56 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "qwen/qwen-plus-2025-07-28": { - "id": "qwen/qwen-plus-2025-07-28", - "name": "Qwen: Qwen Plus 0728", + "qwen/qwen3.5-9b": { + "id": "qwen/qwen3.5-9b", + "name": "Qwen3.5 9B", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-09", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.26, "output": 0.78 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "qwen/qwen3.5-397b-a17b": { - "id": "qwen/qwen3.5-397b-a17b", - "name": "Qwen: Qwen3.5 397B A17B", - "attachment": true, + "qwen/qwen3.5-35b-a3b": { + "id": "qwen/qwen3.5-35b-a3b", + "name": "Qwen3.5 35B A3B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-15", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.39, "output": 2.34 }, - "limit": { "context": 262144, "output": 65536 } - }, - "qwen/qwen3-coder-plus": { - "id": "qwen/qwen3-coder-plus", - "name": "Qwen: Qwen3 Coder Plus", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.25, + "output": 1.3 + } + } + } + }, + "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-tts": { + "id": "mimo-v2-tts", + "name": "MiMo-V2-TTS", + "family": "mimo", "attachment": false, "reasoning": false, + "tool_call": false, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "mimo-v2-flash": { + "id": "mimo-v2-flash", + "name": "MiMo-V2-Flash", + "family": "mimo", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-01", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12-01", + "release_date": "2025-12-16", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.65, "output": 3.25, "cache_read": 0.2 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "qwen/qwen3-max": { - "id": "qwen/qwen3-max", - "name": "Qwen: Qwen3 Max", + "mimo-v2-pro": { + "id": "mimo-v2-pro", + "name": "MiMo-V2-Pro", + "family": "mimo", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-09-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 6, "cache_read": 0.24 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "qwen/qwen3-32b": { - "id": "qwen/qwen3-32b", - "name": "Qwen: Qwen3 32B", - "attachment": false, + "mimo-v2.5": { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.24, "cache_read": 0.04 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "qwen/qwen3-vl-235b-a22b-thinking": { - "id": "qwen/qwen3-vl-235b-a22b-thinking", - "name": "Qwen: Qwen3 VL 235B A22B Thinking", + "mimo-v2-omni": { + "id": "mimo-v2-omni", + "name": "MiMo-V2-Omni", + "family": "mimo", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-09-24", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.26, "output": 2.6 }, - "limit": { "context": 131072, "output": 32768 } + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "qwen/qwen-2.5-72b-instruct": { - "id": "qwen/qwen-2.5-72b-instruct", - "name": "Qwen2.5 72B Instruct", + "mimo-v2.5-pro": { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-09", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.12, "output": 0.39 }, - "limit": { "context": 32768, "output": 16384 } - }, - "qwen/qwen3-coder-flash": { - "id": "qwen/qwen3-coder-flash", - "name": "Qwen: Qwen3 Coder Flash", - "attachment": false, - "reasoning": false, + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 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-5v-turbo": { + "id": "glm-5v-turbo", + "name": "GLM-5V-Turbo", + "family": "glm", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-23", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.195, "output": 0.975, "cache_read": 0.06 }, - "limit": { "context": 1000000, "output": 65536 } - }, - "qwen/qwen-2.5-vl-7b-instruct": { - "id": "qwen/qwen-2.5-vl-7b-instruct", - "name": "Qwen: Qwen2.5-VL 7B Instruct", - "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-08-28", - "last_updated": "2024-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 32768, "output": 6554 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24, + "cache_write": 0 + } }, - "qwen/qwen-2.5-coder-32b-instruct": { - "id": "qwen/qwen-2.5-coder-32b-instruct", - "name": "Qwen2.5 Coder 32B Instruct", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-11-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.2, "cache_read": 0.015 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11, + "cache_write": 0 + } }, - "qwen/qwen3-30b-a3b-instruct-2507": { - "id": "qwen/qwen3-30b-a3b-instruct-2507", - "name": "Qwen: Qwen3 30B A3B Instruct 2507", + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-29", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.3, "cache_read": 0.04 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2, + "cache_write": 0 + } }, - "xiaomi/mimo-v2-flash": { - "id": "xiaomi/mimo-v2-flash", - "name": "Xiaomi: MiMo-V2-Flash", + "glm-4.7-flashx": { + "id": "glm-4.7-flashx", + "name": "GLM-4.7-FlashX", + "family": "glm-flash", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-14", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.29, "cache_read": 0.045 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.07, + "output": 0.4, + "cache_read": 0.01, + "cache_write": 0 + } }, - "stepfun/step-3.5-flash": { - "id": "stepfun/step-3.5-flash", - "name": "StepFun: Step 3.5 Flash", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 256000 } + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26, + "cache_write": 0 + } }, - "stepfun/step-3.5-flash:free": { - "id": "stepfun/step-3.5-flash:free", - "name": "StepFun: Step 3.5 Flash (free)", + "glm-4.5": { + "id": "glm-4.5", + "name": "GLM-4.5", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11, + "cache_write": 0 + } }, - "alfredpros/codellama-7b-instruct-solidity": { - "id": "alfredpros/codellama-7b-instruct-solidity", - "name": "AlfredPros: CodeLLaMa 7B Instruct Solidity", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM-4.5-Air", + "family": "glm-air", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-14", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 1.2 }, - "limit": { "context": 4096, "output": 4096 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.2, + "output": 1.1, + "cache_read": 0.03, + "cache_write": 0 + } }, - "ai21/jamba-large-1.7": { - "id": "ai21/jamba-large-1.7", - "name": "AI21: Jamba Large 1.7", + "glm-5-turbo": { + "id": "glm-5-turbo", + "name": "GLM-5-Turbo", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-08-09", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 256000, "output": 4096 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24, + "cache_write": 0 + } }, - "liquid/lfm-2.2-6b": { - "id": "liquid/lfm-2.2-6b", - "name": "LiquidAI: LFM2-2.6B", - "attachment": false, - "reasoning": false, - "tool_call": false, + "glm-4.5v": { + "id": "glm-4.5v", + "name": "GLM-4.5V", + "family": "glm", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-10-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-08-11", + "last_updated": "2025-08-11", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.02 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 64000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 1.8 + } }, - "liquid/lfm2-8b-a1b": { - "id": "liquid/lfm2-8b-a1b", - "name": "LiquidAI: LFM2-8B-A1B", + "glm-4.6": { + "id": "glm-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-10-20", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0.02 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11, + "cache_write": 0 + } }, - "liquid/lfm-2-24b-a2b": { - "id": "liquid/lfm-2-24b-a2b", - "name": "LiquidAI: LFM2-24B-A2B", - "attachment": false, - "reasoning": false, - "tool_call": false, + "glm-4.6v": { + "id": "glm-4.6v", + "name": "GLM-4.6V", + "family": "glm", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.03, "output": 0.12 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "aion-labs/aion-2.0": { - "id": "aion-labs/aion-2.0", - "name": "AionLabs: Aion-2.0", + "glm-4.5-flash": { + "id": "glm-4.5-flash", + "name": "GLM-4.5-Flash", + "family": "glm-flash", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 1.6 }, - "limit": { "context": 131072, "output": 32768 } + "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, + "cache_read": 0, + "cache_write": 0 + } }, - "aion-labs/aion-rp-llama-3.1-8b": { - "id": "aion-labs/aion-rp-llama-3.1-8b", - "name": "AionLabs: Aion-RP 1.0 (8B)", + "glm-4.7-flash": { + "id": "glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm-flash", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-02-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 1.6 }, - "limit": { "context": 32768, "output": 32768 } - }, - "aion-labs/aion-1.0-mini": { - "id": "aion-labs/aion-1.0-mini", - "name": "AionLabs: Aion-1.0-Mini", + "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 + } + } + } + }, + "opencode": { + "id": "opencode", + "env": ["OPENCODE_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://opencode.ai/zen/v1", + "name": "OpenCode Zen", + "doc": "https://opencode.ai/docs/zen", + "models": { + "minimax-m2.7": { + "id": "minimax-m2.7", + "name": "MiniMax M2.7", + "family": "minimax", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-02-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.7, "output": 1.4 }, - "limit": { "context": 131072, "output": 32768 } + "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 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "aion-labs/aion-1.0": { - "id": "aion-labs/aion-1.0", - "name": "AionLabs: Aion-1.0", - "attachment": false, + "gpt-5.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "family": "gpt-codex", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-02-05", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 4, "output": 8 }, - "limit": { "context": 131072, "output": 32768 } - }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "MoonshotAI: Kimi K2 Thinking", - "attachment": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } + }, + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-11-06", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.47, "output": 2, "cache_read": 0.2 }, - "limit": { "context": 131072, "output": 65535 } + "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 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "MoonshotAI: Kimi K2.5", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, + "knowledge": "2024-10", "release_date": "2026-01-27", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.45, "output": 2.2 }, - "limit": { "context": 262144, "output": 65535 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.08 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "MoonshotAI: Kimi K2 0905", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 2, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 204800, + "output": 131072 + }, + "status": "deprecated", + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.1 + } }, - "moonshotai/kimi-k2": { - "id": "moonshotai/kimi-k2", - "name": "MoonshotAI: Kimi K2 0711", + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.2 }, - "limit": { "context": 131000, "output": 26215 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "tencent/hunyuan-a13b-instruct": { - "id": "tencent/hunyuan-a13b-instruct", - "name": "Tencent: Hunyuan A13B Instruct", + "glm-4.7-free": { + "id": "glm-4.7-free", + "name": "GLM-4.7 Free", + "family": "glm-free", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131072, "output": 131072 } + "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 + } }, - "alibaba/tongyi-deepresearch-30b-a3b": { - "id": "alibaba/tongyi-deepresearch-30b-a3b", - "name": "Tongyi DeepResearch 30B A3B", - "attachment": false, + "gemini-3.1-pro": { + "id": "gemini-3.1-pro", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-09-18", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.09, "output": 0.45 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "provider": { + "npm": "@ai-sdk/google" + }, + "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 + } + } }, - "bytedance-seed/seed-2.0-mini": { - "id": "bytedance-seed/seed-2.0-mini", - "name": "ByteDance Seed: Seed-2.0-Mini", + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, - "release_date": "2026-02-27", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 262144, "output": 131072 } + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "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 + } }, - "bytedance-seed/seed-1.6-flash": { - "id": "bytedance-seed/seed-1.6-flash", - "name": "ByteDance Seed: Seed 1.6 Flash", + "kimi-k2.5-free": { + "id": "kimi-k2.5-free", + "name": "Kimi K2.5 Free", + "family": "kimi-free", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "bytedance-seed/seed-1.6": { - "id": "bytedance-seed/seed-1.6", - "name": "ByteDance Seed: Seed 1.6", + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-09", - "last_updated": "2025-09", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, + "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, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "bytedance-seed/seed-2.0-lite": { - "id": "bytedance-seed/seed-2.0-lite", - "name": "ByteDance Seed: Seed-2.0-Lite", + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-10", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 262144, "output": 131072 } - }, - "inflection/inflection-3-pi": { - "id": "inflection/inflection-3-pi", - "name": "Inflection: Inflection 3 Pi", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-10-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 8000, "output": 1024 } - }, - "inflection/inflection-3-productivity": { - "id": "inflection/inflection-3-productivity", - "name": "Inflection: Inflection 3 Productivity", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-10-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 8000, "output": 1024 } - }, - "writer/palmyra-x5": { - "id": "writer/palmyra-x5", - "name": "Writer: Palmyra X5", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-28", - "last_updated": "2025-04-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.6, "output": 6 }, - "limit": { "context": 1040000, "output": 8192 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "inception/mercury-2": { - "id": "inception/mercury-2", - "name": "Inception: Mercury 2", - "attachment": false, + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, + "structured_output": true, + "temperature": false, + "knowledge": "2025-08-31", "release_date": "2026-02-24", "last_updated": "2026-02-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 50000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "inception/mercury-coder": { - "id": "inception/mercury-coder", - "name": "Inception: Mercury Coder", + "minimax-m2.5-free": { + "id": "minimax-m2.5-free", + "name": "MiniMax M2.5 Free", + "family": "minimax-free", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-02-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 0.75 }, - "limit": { "context": 128000, "output": 32000 } + "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": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "inception/mercury": { - "id": "inception/mercury", - "name": "Inception: Mercury", + "ring-2.6-1t-free": { + "id": "ring-2.6-1t-free", + "name": "Ring 2.6 1T Free", + "family": "ring-1t-free", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-06-26", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 0.75 }, - "limit": { "context": 128000, "output": 32000 } - }, - "anthracite-org/magnum-v4-72b": { - "id": "anthracite-org/magnum-v4-72b", - "name": "Magnum v4 72B", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-10-22", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-05-08", + "last_updated": "2026-05-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 3, "output": 5 }, - "limit": { "context": 16384, "output": 2048 } + "limit": { + "context": 262000, + "output": 66000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "thedrummer/skyfall-36b-v2": { - "id": "thedrummer/skyfall-36b-v2", - "name": "TheDrummer: Skyfall 36B V2", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-03-11", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 0.8 }, - "limit": { "context": 32768, "output": 32768 } + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "thedrummer/rocinante-12b": { - "id": "thedrummer/rocinante-12b", - "name": "TheDrummer: Rocinante 12B", + "deepseek-v4-flash-free": { + "id": "deepseek-v4-flash-free", + "name": "DeepSeek V4 Flash Free", + "family": "deepseek-flash-free", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2024-09-30", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.43 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "thedrummer/cydonia-24b-v4.1": { - "id": "thedrummer/cydonia-24b-v4.1", - "name": "TheDrummer: Cydonia 24B V4.1", + "big-pickle": { + "id": "big-pickle", + "name": "Big Pickle", + "family": "big-pickle", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-09-27", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.5 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2025-01", + "release_date": "2025-10-17", + "last_updated": "2025-10-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "thedrummer/unslopnemo-12b": { - "id": "thedrummer/unslopnemo-12b", - "name": "TheDrummer: UnslopNemo 12B", - "attachment": false, - "reasoning": false, + "claude-opus-4-1": { + "id": "claude-opus-4-1", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-11-09", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 32768, "output": 32768 } + "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" + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "tngtech/deepseek-r1t2-chimera": { - "id": "tngtech/deepseek-r1t2-chimera", - "name": "TNG: DeepSeek R1T2 Chimera", - "attachment": false, + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen3.6", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-08", - "last_updated": "2025-07-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 0.85, "cache_read": 0.125 }, - "limit": { "context": 163840, "output": 163840 } + "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" + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "cache_write": 0.625 + } }, - "deepcogito/cogito-v2.1-671b": { - "id": "deepcogito/cogito-v2.1-671b", - "name": "Deep Cogito: Cogito v2.1 671B", - "attachment": false, + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.25, "output": 1.25 }, - "limit": { "context": 128000, "output": 32768 } + "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 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "mistralai/mistral-medium-3.1": { - "id": "mistralai/mistral-medium-3.1", - "name": "Mistral: Mistral Medium 3.1", + "claude-3-5-haiku": { + "id": "claude-3-5-haiku", + "name": "Claude Haiku 3.5", + "family": "claude-haiku", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-08-12", - "last_updated": "2025-08-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-07-31", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 200000, + "output": 8192 + }, + "status": "deprecated", + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "mistralai/mixtral-8x22b-instruct": { - "id": "mistralai/mixtral-8x22b-instruct", - "name": "Mistral: Mixtral 8x22B Instruct", + "minimax-m2.1": { + "id": "minimax-m2.1", + "name": "MiniMax M2.1", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-04-17", - "last_updated": "2024-04-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 65536, "output": 13108 } + "limit": { + "context": 204800, + "output": 131072 + }, + "status": "deprecated", + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.1 + } }, - "mistralai/devstral-medium": { - "id": "mistralai/devstral-medium", - "name": "Mistral: Devstral Medium", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-10", - "last_updated": "2025-07-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } }, - "mistralai/mistral-7b-instruct-v0.1": { - "id": "mistralai/mistral-7b-instruct-v0.1", - "name": "Mistral: Mistral 7B Instruct v0.1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } + }, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.11, "output": 0.19 }, - "limit": { "context": 2824, "output": 565 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "mistralai/mistral-medium-3": { - "id": "mistralai/mistral-medium-3", - "name": "Mistral: Mistral Medium 3", + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex Mini", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "mistralai/devstral-2512": { - "id": "mistralai/devstral-2512", - "name": "Mistral: Devstral 2 2512", - "attachment": false, - "reasoning": false, + "claude-sonnet-4": { + "id": "claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-12", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 262144, "output": 65536 } + "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 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "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 + } + } }, - "mistralai/mixtral-8x7b-instruct": { - "id": "mistralai/mixtral-8x7b-instruct", - "name": "Mistral: Mixtral 8x7B Instruct", - "attachment": false, - "reasoning": false, + "gemini-3-flash": { + "id": "gemini-3-flash", + "name": "Gemini 3 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2023-12-10", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.54, "output": 0.54 }, - "limit": { "context": 32768, "output": 16384 } + "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" + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05 + } }, - "mistralai/mistral-small-24b-instruct-2501": { - "id": "mistralai/mistral-small-24b-instruct-2501", - "name": "Mistral: Mistral Small 3", + "trinity-large-preview-free": { + "id": "trinity-large-preview-free", + "name": "Trinity Large Preview", + "family": "trinity", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-12-29", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-01-28", + "last_updated": "2026-01-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.08 }, - "limit": { "context": 32768, "output": 16384 } + "limit": { + "context": 131072, + "output": 131072 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "mistralai/ministral-8b-2512": { - "id": "mistralai/ministral-8b-2512", - "name": "Mistral: Ministral 3 8B 2512", + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-12-02", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 262144, "output": 32768 } + "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" + }, + "cost": { + "input": 1.07, + "output": 8.5, + "cache_read": 0.107 + } }, - "mistralai/ministral-14b-2512": { - "id": "mistralai/ministral-14b-2512", - "name": "Mistral: Ministral 3 14B 2512", + "gpt-5.4-pro": { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 262144, "output": 52429 } - }, - "mistralai/mistral-large-2411": { - "id": "mistralai/mistral-large-2411", - "name": "Mistral Large 2411", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-07-24", - "last_updated": "2024-11-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 131072, "output": 26215 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 30, + "output": 180, + "cache_read": 30 + } }, - "mistralai/codestral-2508": { - "id": "mistralai/codestral-2508", - "name": "Mistral: Codestral 2508", + "glm-5-free": { + "id": "glm-5-free", + "name": "GLM-5 Free", + "family": "glm-free", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 51200 } + "limit": { + "context": 204800, + "output": 131072 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "mistralai/mistral-large-2407": { - "id": "mistralai/mistral-large-2407", - "name": "Mistral Large 2407", - "attachment": false, - "reasoning": false, + "claude-opus-4-5": { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-11-19", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 131072, "output": 32768 } + "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 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "mistralai/devstral-small": { - "id": "mistralai/devstral-small", - "name": "Mistral: Devstral Small 1.1", + "minimax-m2.1-free": { + "id": "minimax-m2.1-free", + "name": "MiniMax M2.1 Free", + "family": "minimax-free", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-07", - "last_updated": "2025-07-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 131072, "output": 26215 } - }, - "mistralai/mistral-small-creative": { - "id": "mistralai/mistral-small-creative", - "name": "Mistral: Mistral Small Creative", - "attachment": false, - "reasoning": false, - "tool_call": true, - "release_date": "2025-12-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 204800, + "output": 131072 + }, + "status": "deprecated", + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "mistralai/voxtral-small-24b-2507": { - "id": "mistralai/voxtral-small-24b-2507", - "name": "Mistral: Voxtral Small 24B 2507", + "qwen3.6-plus-free": { + "id": "qwen3.6-plus-free", + "name": "Qwen3.6 Plus Free", + "family": "qwen-free", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text", "audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 32000, "output": 6400 } + "knowledge": "2024-12", + "release_date": "2026-03-30", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 64000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "mistralai/mistral-nemo": { - "id": "mistralai/mistral-nemo", - "name": "Mistral: Mistral Nemo", + "glm-4.6": { + "id": "glm-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-07-01", - "last_updated": "2024-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.04 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 204800, + "output": 131072 + }, + "status": "deprecated", + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.1 + } }, - "mistralai/mistral-large": { - "id": "mistralai/mistral-large", - "name": "Mistral Large", + "ling-2.6-flash-free": { + "id": "ling-2.6-flash-free", + "name": "Ling 2.6 Flash Free", + "family": "ling-flash-free", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-07-24", - "last_updated": "2025-12-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 25600 } + "limit": { + "context": 262100, + "output": 32800 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0 + } }, - "mistralai/ministral-3b-2512": { - "id": "mistralai/ministral-3b-2512", - "name": "Mistral: Ministral 3 3B 2512", + "gemini-3-pro": { + "id": "gemini-3-pro", + "name": "Gemini 3 Pro", + "family": "gemini-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-12-02", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131072, "output": 32768 } + "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" + }, + "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 + } + } }, - "mistralai/mistral-small-3.2-24b-instruct": { - "id": "mistralai/mistral-small-3.2-24b-instruct", - "name": "Mistral: Mistral Small 3.2 24B", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-06-20", - "last_updated": "2025-06-20", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.18, "cache_read": 0.03 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "mistralai/pixtral-large-2411": { - "id": "mistralai/pixtral-large-2411", - "name": "Mistral: Pixtral Large 2411", + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "GPT-5 Codex", + "family": "gpt-codex", "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-11-19", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 131072, "output": 32768 } - }, - "mistralai/mistral-saba": { - "id": "mistralai/mistral-saba", - "name": "Mistral: Saba", - "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-02-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 32768, "output": 32768 } - }, - "mistralai/mistral-small-3.1-24b-instruct": { - "id": "mistralai/mistral-small-3.1-24b-instruct", - "name": "Mistral: Mistral Small 3.1 24B", - "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-03-17", - "last_updated": "2026-03-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 0.56, "cache_read": 0.015 }, - "limit": { "context": 128000, "output": 131072 } + "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" + }, + "cost": { + "input": 1.07, + "output": 8.5, + "cache_read": 0.107 + } }, - "mistralai/mistral-large-2512": { - "id": "mistralai/mistral-large-2512", - "name": "Mistral: Mistral Large 3 2512", + "grok-code": { + "id": "grok-code", + "name": "Grok Code Fast 1", + "family": "grok", "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-11-01", - "last_updated": "2025-12-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 262144, "output": 52429 } - } - } - }, - "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", - "family": "glm", - "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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.5": { - "id": "ZhipuAI/GLM-4.5", - "name": "GLM-4.5", - "family": "glm", + "release_date": "2025-08-20", + "last_updated": "2025-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + }, + "mimo-v2-flash-free": { + "id": "mimo-v2-flash-free", + "name": "MiMo V2 Flash Free", + "family": "mimo-flash-free", "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2024-12", + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 98304 } + "limit": { + "context": 262144, + "output": 65536 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "ZhipuAI/GLM-4.6": { - "id": "ZhipuAI/GLM-4.6", - "name": "GLM-4.6", - "family": "glm", + "gpt-5.3-codex-spark": { + "id": "gpt-5.3-codex-spark", + "name": "GPT-5.3 Codex Spark", + "family": "gpt-codex-spark", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 202752, "output": 98304 } + "structured_output": true, + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 128000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "Qwen/Qwen3-30B-A3B-Thinking-2507": { - "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", - "name": "Qwen3 30B A3B Thinking 2507", - "family": "qwen", + "hy3-preview-free": { + "id": "hy3-preview-free", + "name": "Hy3 preview Free", + "family": "hy3-free", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 256000, + "output": 64000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen3-235B-A22B-Thinking-2507", - "family": "qwen", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 131072 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "Qwen/Qwen3-Coder-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", - "name": "Qwen3 Coder 30B A3B Instruct", - "family": "qwen", + "kimi-k2": { + "id": "kimi-k2", + "name": "Kimi K2", + "family": "kimi", "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"] }, + "knowledge": "2024-10", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 262144, + "output": 262144 + }, + "status": "deprecated", + "cost": { + "input": 0.4, + "output": 2.5, + "cache_read": 0.4 + } }, - "Qwen/Qwen3-30B-A3B-Instruct-2507": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 16384 } + "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" + }, + "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 + } + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", + "qwen3-coder": { + "id": "qwen3-coder", + "name": "Qwen3 Coder", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-04-28", - "last_updated": "2025-07-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 131072 } - } - } - }, - "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": { - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT-5.2-Codex", - "family": "gpt-codex", + "limit": { + "context": 262144, + "output": 65536 + }, + "status": "deprecated", + "cost": { + "input": 0.45, + "output": 1.8 + } + }, + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.07, + "output": 8.5, + "cache_read": 0.107 + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "GPT-5.1-Codex-Mini", - "family": "gpt-codex", + "qwen3.5-plus": { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "family": "qwen3.5", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-04", + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 100000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 0.2, + "output": 1.2, + "cache_read": 0.02, + "cache_write": 0.25 + } }, - "openai/gpt-5.4-pro": { - "id": "openai/gpt-5.4-pro", - "name": "GPT-5.4 Pro", - "family": "gpt-pro", + "mimo-v2-pro-free": { + "id": "mimo-v2-pro-free", + "name": "MiMo V2 Pro Free", + "family": "mimo-pro-free", "attachment": true, "reasoning": true, "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, - "cost": { "input": 30, "output": 180, "cache_read": 30 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "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": true, + "limit": { + "context": 1048576, + "output": 64000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "openai/gpt-oss-120b:free": { - "id": "openai/gpt-oss-120b:free", - "name": "gpt-oss-120b (free)", - "family": "gpt-oss", + "nemotron-3-super-free": { + "id": "nemotron-3-super-free", + "name": "Nemotron 3 Super Free", + "family": "nemotron-free", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2026-02", + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 204800, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "openai/gpt-oss-120b:exacto": { - "id": "openai/gpt-oss-120b:exacto", - "name": "GPT OSS 120B (exacto)", - "family": "gpt-oss", + "gpt-5.5-pro": { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": false, + "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 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 30, + "output": 180, + "cache_read": 30 + } + }, + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.24 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "status": "deprecated", + "cost": { + "input": 0.4, + "output": 2.5, + "cache_read": 0.4 + } }, - "openai/gpt-5.4-mini": { - "id": "openai/gpt-5.4-mini", - "name": "GPT-5.4 Mini", - "family": "gpt-mini", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 7.5e-7, "output": 0.0000045, "cache_read": 7.5e-8 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 1.07, + "output": 8.5, + "cache_read": 0.107 + } }, - "openai/gpt-5-pro": { - "id": "openai/gpt-5-pro", - "name": "GPT-5 Pro", - "family": "gpt-pro", + "mimo-v2-omni-free": { + "id": "mimo-v2-omni-free", + "name": "MiMo V2 Omni Free", + "family": "mimo-omni-free", "attachment": true, "reasoning": true, "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, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 272000 } + "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": true, + "limit": { + "context": 262144, + "output": 64000 + }, + "status": "deprecated", + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "GPT-5", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "GPT-5.3-Codex", - "family": "gpt-codex", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-03-05", + "last_updated": "2026-03-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/openai" + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + }, + "tiers": [ + { + "input": 5, + "output": 22.5, + "cache_read": 0.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "provider": { + "npm": "@ai-sdk/anthropic" + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } + } + } + }, + "stepfun": { + "id": "stepfun", + "env": ["STEPFUN_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.stepfun.com/v1", + "name": "StepFun", + "doc": "https://platform.stepfun.com/docs/zh/overview/concept", + "models": { + "step-3.5-flash-2603": { + "id": "step-3.5-flash-2603", + "name": "Step 3.5 Flash 2603", + "attachment": false, + "reasoning": true, + "tool_call": 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 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "GPT-4o-mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": false, + "step-1-32k": { + "id": "step-1-32k", + "name": "Step 1 (32K)", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-01-01", + "last_updated": "2026-02-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 2.05, + "output": 9.59, + "cache_read": 0.41 + } }, - "openai/gpt-5.1-codex-max": { - "id": "openai/gpt-5.1-codex-max", - "name": "GPT-5.1-Codex-Max", - "family": "gpt-codex", - "attachment": true, + "step-3.5-flash": { + "id": "step-3.5-flash", + "name": "Step 3.5 Flash", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.1, "output": 9, "cache_read": 0.11 }, - "limit": { "context": 400000, "output": 128000 } + "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.096, + "output": 0.288, + "cache_read": 0.019 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", - "attachment": true, - "reasoning": false, + "step-2-16k": { + "id": "step-2-16k", + "name": "Step 2 (16K)", + "attachment": false, + "reasoning": true, "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"] }, + "knowledge": "2024-06", + "release_date": "2025-01-01", + "last_updated": "2026-02-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } - }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "limit": { + "context": 16384, + "input": 16384, + "output": 8192 + }, + "cost": { + "input": 5.21, + "output": 16.44, + "cache_read": 1.04 + } + } + } + }, + "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": { + "NousResearch/Hermes-4-70B": { + "id": "NousResearch/Hermes-4-70B", + "name": "Hermes-4-70B", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2026-01-30", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.072, "output": 0.28 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 0.13, + "output": 0.4, + "reasoning": 0.4, + "cache_read": 0.013, + "cache_write": 0.16 + } }, - "openai/gpt-5.1-chat": { - "id": "openai/gpt-5.1-chat", - "name": "GPT-5.1 Chat", - "family": "gpt-codex", - "attachment": true, + "NousResearch/Hermes-4-405B": { + "id": "NousResearch/Hermes-4-405B", + "name": "Hermes-4-405B", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2025-11", + "release_date": "2026-01-30", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 1, + "output": 3, + "reasoning": 3, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "Qwen/Qwen2.5-VL-72B-Instruct": { + "id": "Qwen/Qwen2.5-VL-72B-Instruct", + "name": "Qwen2.5-VL-72B-Instruct", "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-01-20", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.025, + "cache_write": 0.31 + } + }, + "Qwen/Qwen3.5-397B-A17B": { + "id": "Qwen/Qwen3.5-397B-A17B", + "name": "Qwen3.5-397B-A17B", + "attachment": false, "reasoning": true, "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, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-07-15", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "input": 250000, + "output": 8192 + }, "cost": { - "input": 2.5, - "output": 15, - "cache_read": 0.25, - "context_over_200k": { "input": 5, "output": 22.5, "cache_read": 0.5 } + "input": 0.6, + "output": 3.6, + "cache_read": 0.06, + "cache_write": 0.75 + } + }, + "Qwen/Qwen3-Embedding-8B": { + "id": "Qwen/Qwen3-Embedding-8B", + "name": "Qwen3-Embedding-8B", + "family": "text-embedding", + "attachment": false, + "reasoning": false, + "tool_call": false, + "structured_output": false, + "temperature": false, + "knowledge": "2025-10", + "release_date": "2026-01-10", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "open_weights": true, + "limit": { + "context": 32768, + "input": 32768, + "output": 0 + }, + "cost": { + "input": 0.01, + "output": 0 + } }, - "openai/gpt-oss-20b:free": { - "id": "openai/gpt-oss-20b:free", - "name": "gpt-oss-20b (free)", - "family": "gpt-oss", + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", + "name": "Qwen3-30B-A3B-Instruct-2507", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2026-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2026-01-28", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01, + "cache_write": 0.125 + } }, - "openai/gpt-5-chat": { - "id": "openai/gpt-5-chat", - "name": "GPT-5 Chat (latest)", - "family": "gpt-codex", - "attachment": true, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", + "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "knowledge": "2024-09-30", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-07-25", + "last_updated": "2025-10-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 262144, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "openai/gpt-5.4-nano": { - "id": "openai/gpt-5.4-nano", - "name": "GPT-5.4 Nano", - "family": "gpt-nano", - "attachment": true, + "Qwen/Qwen3-32B": { + "id": "Qwen/Qwen3-32B", + "name": "Qwen3-32B", + "attachment": false, "reasoning": false, "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, - "cost": { "input": 2e-7, "output": 0.00000125, "cache_read": 2e-8 }, - "limit": { "context": 400000, "output": 128000 } - }, - "openai/gpt-5.2-chat": { - "id": "openai/gpt-5.2-chat", - "name": "GPT-5.2 Chat", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } - }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-12", + "release_date": "2026-01-28", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01, + "cache_write": 0.125 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", - "attachment": true, + "Qwen/Qwen3-235B-A22B-Thinking-2507-fast": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507-fast", + "name": "Qwen3-235B-A22B-Thinking-2507-fast", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-07", + "release_date": "2025-07-25", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "input": 7000, + "output": 8192 + }, + "cost": { + "input": 0.5, + "output": 2, + "cache_read": 0.05, + "cache_write": 0.625 + } }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "GPT-4.1 Mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": false, + "Qwen/Qwen3.5-397B-A17B-fast": { + "id": "Qwen/Qwen3.5-397B-A17B-fast", + "name": "Qwen3.5-397B-A17B-fast", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "knowledge": "2025-07", + "release_date": "2025-07-15", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "input": 7000, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 3.6, + "cache_read": 0.06, + "cache_write": 0.75 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", - "attachment": true, + "Qwen/Qwen3-Next-80B-A3B-Thinking-fast": { + "id": "Qwen/Qwen3-Next-80B-A3B-Thinking-fast", + "name": "Qwen3-Next-80B-A3B-Thinking-fast", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0.4 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-07", + "release_date": "2025-07-25", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "input": 7000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 1.2, + "cache_read": 0.015, + "cache_write": 0.1875 + } }, - "openai/gpt-oss-safeguard-20b": { - "id": "openai/gpt-oss-safeguard-20b", - "name": "GPT OSS Safeguard 20B", - "family": "gpt-oss", + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", + "name": "Qwen3-Next-80B-A3B-Thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-10-29", - "last_updated": "2025-10-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 131072, "output": 65536 } + "knowledge": "2025-12", + "release_date": "2026-01-28", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 1.2, + "reasoning": 1.2, + "cache_read": 0.015, + "cache_write": 0.18 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "PrimeIntellect/INTELLECT-3": { + "id": "PrimeIntellect/INTELLECT-3", + "name": "INTELLECT-3", "attachment": false, - "reasoning": true, + "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"] }, + "knowledge": "2025-10", + "release_date": "2026-01-25", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 1.1, + "cache_read": 0.02, + "cache_write": 0.25 + } }, - "openai/gpt-5-image": { - "id": "openai/gpt-5-image", - "name": "GPT-5 Image", - "family": "gpt", - "attachment": true, + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "GLM-5", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-10-14", - "last_updated": "2025-10-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text", "image"] }, + "knowledge": "2026-01", + "release_date": "2026-03-01", + "last_updated": "2026-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "input": 200000, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.1, + "cache_write": 1 + } }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "GPT-5 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama-3.3-70B-Instruct", + "attachment": false, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-08", + "release_date": "2025-12-05", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 8192 + }, + "cost": { + "input": 0.13, + "output": 0.4, + "cache_read": 0.013, + "cache_write": 0.16 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "o4 Mini", - "family": "o-mini", - "attachment": true, - "reasoning": true, + "meta-llama/Meta-Llama-3.1-8B-Instruct": { + "id": "meta-llama/Meta-Llama-3.1-8B-Instruct", + "name": "Meta-Llama-3.1-8B-Instruct", + "attachment": false, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } + "knowledge": "2024-12", + "release_date": "2024-07-23", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 4096 + }, + "cost": { + "input": 0.02, + "output": 0.06, + "cache_read": 0.002, + "cache_write": 0.025 + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT-5.1-Codex", - "family": "gpt-codex", - "attachment": true, + "nvidia/nemotron-3-super-120b-a12b": { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "Nemotron-3-Super-120B-A12B", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2026-02", + "release_date": "2026-03-11", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "input": 256000, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "GPT-5.2 Pro", - "family": "gpt-pro", - "attachment": true, - "reasoning": true, + "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1": { + "id": "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1", + "name": "Llama-3.1-Nemotron-Ultra-253B-v1", + "attachment": false, + "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-01-15", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 120000, + "output": 4096 + }, + "cost": { + "input": 0.6, + "output": 1.8, + "cache_read": 0.06, + "cache_write": 0.75 + } }, - "prime-intellect/intellect-3": { - "id": "prime-intellect/intellect-3", - "name": "Intellect 3", - "family": "glm", + "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B": { + "id": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B", + "name": "Nemotron-3-Nano-30B-A3B", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-08-10", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 32000, + "input": 30000, + "output": 4096 + }, + "cost": { + "input": 0.06, + "output": 0.24, + "cache_read": 0.006, + "cache_write": 0.075 + } }, - "x-ai/grok-4-fast": { - "id": "x-ai/grok-4-fast", - "name": "Grok 4 Fast", - "family": "grok", + "nvidia/Nemotron-3-Nano-Omni": { + "id": "nvidia/Nemotron-3-Nano-Omni", + "name": "Nemotron-3-Nano-Omni", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05, "cache_write": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "knowledge": "2025-01", + "release_date": "2025-01-20", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "input": 60000, + "output": 8192 + }, + "cost": { + "input": 0.06, + "output": 0.24, + "cache_read": 0.006, + "cache_write": 0.075 + } }, - "x-ai/grok-4.20-beta": { - "id": "x-ai/grok-4.20-beta", - "name": "Grok 4.20 Beta", - "family": "grok", - "attachment": true, + "deepseek-ai/DeepSeek-V3.2-fast": { + "id": "deepseek-ai/DeepSeek-V3.2-fast", + "name": "DeepSeek-V3.2-fast", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 0.2, "context_over_200k": { "input": 4, "output": 12 } }, - "limit": { "context": 2000000, "output": 30000 }, - "status": "beta" + "knowledge": "2025-01", + "release_date": "2025-01-27", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "input": 7000, + "output": 8192 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.04, + "cache_write": 0.5 + } }, - "x-ai/grok-4.1-fast": { - "id": "x-ai/grok-4.1-fast", - "name": "Grok 4.1 Fast", - "family": "grok", + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek-V3.2", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05, "cache_write": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "knowledge": "2025-11", + "release_date": "2026-01-20", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163000, + "input": 160000, + "output": 16384 + }, + "cost": { + "input": 0.3, + "output": 0.45, + "reasoning": 0.45, + "cache_read": 0.03, + "cache_write": 0.375 + } }, - "x-ai/grok-4": { - "id": "x-ai/grok-4", - "name": "Grok 4", - "family": "grok", + "openai/gpt-oss-120b-fast": { + "id": "openai/gpt-oss-120b-fast", + "name": "gpt-oss-120b-fast", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75, "cache_write": 15 }, - "limit": { "context": 256000, "output": 64000 } + "knowledge": "2025-06", + "release_date": "2025-06-10", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "input": 7000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.5, + "cache_read": 0.01, + "cache_write": 0.125 + } }, - "x-ai/grok-code-fast-1": { - "id": "x-ai/grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "gpt-oss-120b", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "knowledge": "2025-09", + "release_date": "2026-01-10", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "input": 124000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "reasoning": 0.6, + "cache_read": 0.015, + "cache_write": 0.18 + } }, - "x-ai/grok-4.20-multi-agent-beta": { - "id": "x-ai/grok-4.20-multi-agent-beta", - "name": "Grok 4.20 Multi - Agent Beta", - "family": "grok", - "attachment": true, - "reasoning": true, + "google/gemma-2-2b-it": { + "id": "google/gemma-2-2b-it", + "name": "Gemma-2-2b-it", + "attachment": false, + "reasoning": false, "tool_call": false, + "structured_output": false, "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 0.2, "context_over_200k": { "input": 4, "output": 12 } }, - "limit": { "context": 2000000, "output": 30000 }, - "status": "beta" + "knowledge": "2024-06", + "release_date": "2024-07-31", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "input": 8000, + "output": 4096 + }, + "cost": { + "input": 0.02, + "output": 0.06, + "cache_read": 0.002, + "cache_write": 0.025 + } }, - "x-ai/grok-3-mini": { - "id": "x-ai/grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": false, - "reasoning": true, + "google/gemma-3-27b-it": { + "id": "google/gemma-3-27b-it", + "name": "Gemma-3-27b-it", + "attachment": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "cache_read": 0.075, "cache_write": 0.5 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-10", + "release_date": "2026-01-20", + "last_updated": "2026-02-04", + "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.01, + "cache_write": 0.125 + } }, - "x-ai/grok-3-beta": { - "id": "x-ai/grok-3-beta", - "name": "Grok 3 Beta", - "family": "grok", - "attachment": false, - "reasoning": false, + "moonshotai/Kimi-K2.5-fast": { + "id": "moonshotai/Kimi-K2.5-fast", + "name": "Kimi-K2.5-fast", + "family": "kimi", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75, "cache_write": 15 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-06", + "release_date": "2025-12-15", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "input": 256000, + "output": 8192 + }, + "cost": { + "input": 0.5, + "output": 2.5, + "cache_read": 0.05, + "cache_write": 0.625 + } }, - "x-ai/grok-3": { - "id": "x-ai/grok-3", - "name": "Grok 3", - "family": "grok", - "attachment": false, - "reasoning": false, + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi-K2.5", + "family": "kimi", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75, "cache_write": 15 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-06", + "release_date": "2025-12-15", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "input": 256000, + "output": 8192 + }, + "cost": { + "input": 0.5, + "output": 2.5, + "reasoning": 2.5, + "cache_read": 0.05, + "cache_write": 0.625 + } }, - "x-ai/grok-3-mini-beta": { - "id": "x-ai/grok-3-mini-beta", - "name": "Grok 3 Mini Beta", - "family": "grok", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax-M2.5", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "cache_read": 0.075, "cache_write": 0.5 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2025-01", + "release_date": "2025-01-20", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "input": 190000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03, + "cache_write": 0.375 + } }, - "anthropic/claude-opus-4.6": { - "id": "anthropic/claude-opus-4.6", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "MiniMaxAI/MiniMax-M2.5-fast": { + "id": "MiniMaxAI/MiniMax-M2.5-fast", + "name": "MiniMax-M2.5-fast", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-05-30", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 5, - "output": 25, - "cache_read": 0.5, - "cache_write": 6.25, - "context_over_200k": { "input": 10, "output": 37.5, "cache_read": 1, "cache_write": 12.5 } + "knowledge": "2025-01", + "release_date": "2025-01-20", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "input": 7000, + "output": 8192 }, - "limit": { "context": 1000000, "output": 128000 } + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03, + "cache_write": 0.375 + } }, - "anthropic/claude-haiku-4.5": { - "id": "anthropic/claude-haiku-4.5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, + "deepseek-ai/DeepSeek-V4-Pro": { + "id": "deepseek-ai/DeepSeek-V4-Pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } - }, - "anthropic/claude-opus-4.1": { - "id": "anthropic/claude-opus-4.1", - "name": "Claude Opus 4.1", - "family": "claude-opus", + "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.75, + "output": 3.5, + "cache_read": 0.15 + } + } + } + }, + "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": { + "topazlabs-co/topazlabs": { + "id": "topazlabs-co/topazlabs", + "name": "TopazLabs", + "family": "topazlabs", "attachment": true, - "reasoning": 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"] }, + "temperature": false, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 204, + "output": 0 + } }, - "anthropic/claude-3.7-sonnet": { - "id": "anthropic/claude-3.7-sonnet", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", + "novita/kimi-k2.5": { + "id": "novita/kimi-k2.5", + "name": "Kimi-K2.5", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-01", - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 128000, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "anthropic/claude-sonnet-4.6": { - "id": "anthropic/claude-sonnet-4.6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", + "novita/glm-4.7": { + "id": "novita/glm-4.7", + "name": "glm-4.7", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 205000, + "output": 131072 }, - "limit": { "context": 1000000, "output": 128000 } + "status": "deprecated" }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "novita/glm-5": { + "id": "novita/glm-5", + "name": "GLM-5", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-02-15", + "last_updated": "2026-02-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 205000, + "output": 131072 }, - "limit": { "context": 200000, "output": 64000 } + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "anthropic/claude-3.5-haiku": { - "id": "anthropic/claude-3.5-haiku", - "name": "Claude Haiku 3.5", - "family": "claude-haiku", + "novita/minimax-m2.1": { + "id": "novita/minimax-m2.1", + "name": "minimax-m2.1", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "temperature": false, + "release_date": "2025-12-26", + "last_updated": "2025-12-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 205000, + "output": 131072 + } }, - "anthropic/claude-opus-4.5": { - "id": "anthropic/claude-opus-4.5", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "novita/glm-4.6": { + "id": "novita/glm-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-05-30", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 0, + "output": 0 + } }, - "anthropic/claude-sonnet-4.5": { - "id": "anthropic/claude-sonnet-4.5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", + "novita/kimi-k2.6": { + "id": "novita/kimi-k2.6", + "name": "Kimi-K2.6", "attachment": true, "reasoning": true, "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, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "knowledge": "2025-04", + "release_date": "2026-04-20", + "last_updated": "2026-05-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "input": 262144, + "output": 262144 }, - "limit": { "context": 1000000, "output": 64000 } + "cost": { + "input": 0.96, + "output": 4.04, + "cache_read": 0.16 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Claude Opus 4", - "family": "claude-opus", + "novita/glm-4.6v": { + "id": "novita/glm-4.6v", + "name": "glm-4.6v", "attachment": true, "reasoning": true, "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"] }, + "temperature": false, + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 131000, + "output": 32768 + } }, - "deepseek/deepseek-v3.1-terminus": { - "id": "deepseek/deepseek-v3.1-terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", - "attachment": false, + "novita/deepseek-v3.2": { + "id": "novita/deepseek-v3.2", + "name": "DeepSeek-V3.2", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 131072, "output": 65536 } - }, - "deepseek/deepseek-r1-distill-llama-70b": { - "id": "deepseek/deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill Llama 70B", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-01-23", - "last_updated": "2025-01-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 128000, + "output": 0 + }, + "cost": { + "input": 0.27, + "output": 0.4, + "cache_read": 0.13 + } }, - "deepseek/deepseek-v3.1-terminus:exacto": { - "id": "deepseek/deepseek-v3.1-terminus:exacto", - "name": "DeepSeek V3.1 Terminus (exacto)", - "family": "deepseek", - "attachment": false, + "novita/glm-4.7-flash": { + "id": "novita/glm-4.7-flash", + "name": "glm-4.7-flash", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 131072, "output": 65536 } + "temperature": false, + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 65500 + } }, - "deepseek/deepseek-chat-v3.1": { - "id": "deepseek/deepseek-chat-v3.1", - "name": "DeepSeek-V3.1", - "family": "deepseek", - "attachment": false, + "novita/glm-4.7-n": { + "id": "novita/glm-4.7-n", + "name": "glm-4.7-n", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 163840, "output": 163840 } + "temperature": false, + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 205000, + "output": 131072 + } }, - "deepseek/deepseek-v3.2-speciale": { - "id": "deepseek/deepseek-v3.2-speciale", - "name": "DeepSeek V3.2 Speciale", - "family": "deepseek", - "attachment": false, + "novita/kimi-k2-thinking": { + "id": "novita/kimi-k2-thinking", + "name": "kimi-k2-thinking", + "family": "kimi", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.27, "output": 0.41 }, - "limit": { "context": 163840, "output": 65536 } + "temperature": false, + "release_date": "2025-11-07", + "last_updated": "2025-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 0 + } }, - "deepseek/deepseek-chat-v3-0324": { - "id": "deepseek/deepseek-chat-v3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", - "attachment": false, + "fireworks-ai/kimi-k2.5-fw": { + "id": "fireworks-ai/kimi-k2.5-fw", + "name": "Kimi-K2.5-FW", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 16384, "output": 8192 } - }, - "deepseek/deepseek-v3.2": { - "id": "deepseek/deepseek-v3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", - "attachment": false, - "reasoning": true, "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, - "cost": { "input": 0.28, "output": 0.4 }, - "limit": { "context": 163840, "output": 65536 } + "temperature": false, + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "input": 245760, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/nemotron-nano-9b-v2:free": { - "id": "nvidia/nemotron-nano-9b-v2:free", - "name": "Nemotron Nano 9B V2 (free)", - "family": "nemotron", - "attachment": false, + "empiriolabs/deepseek-v4-pro-el": { + "id": "empiriolabs/deepseek-v4-pro-el", + "name": "DeepSeek-V4-Pro-EL", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-09", - "release_date": "2025-09-05", - "last_updated": "2025-08-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-05-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 384000 + }, + "cost": { + "input": 1.67, + "output": 3.33 + } }, - "nvidia/nemotron-3-super-120b-a12b": { - "id": "nvidia/nemotron-3-super-120b-a12b", - "name": "Nemotron 3 Super", - "family": "nemotron", - "attachment": false, + "empiriolabs/deepseek-v4-flash-el": { + "id": "empiriolabs/deepseek-v4-flash-el", + "name": "DeepSeek-V4-Flash-EL", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-05-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 1000000, + "input": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.14, + "output": 0.28 + } }, - "nvidia/nemotron-nano-12b-v2-vl:free": { - "id": "nvidia/nemotron-nano-12b-v2-vl:free", - "name": "Nemotron Nano 12B 2 VL (free)", - "family": "nemotron", - "attachment": false, - "reasoning": true, + "elevenlabs/elevenlabs-v2.5-turbo": { + "id": "elevenlabs/elevenlabs-v2.5-turbo", + "name": "ElevenLabs-v2.5-Turbo", + "family": "elevenlabs", + "attachment": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-10-28", - "last_updated": "2026-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 128000 } + "temperature": false, + "release_date": "2024-10-28", + "last_updated": "2024-10-28", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 0 + } }, - "nvidia/nemotron-nano-9b-v2": { - "id": "nvidia/nemotron-nano-9b-v2", - "name": "nvidia-nemotron-nano-9b-v2", - "family": "nemotron", - "attachment": false, - "reasoning": true, + "elevenlabs/elevenlabs-v3": { + "id": "elevenlabs/elevenlabs-v3", + "name": "ElevenLabs-v3", + "family": "elevenlabs", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 0.04, "output": 0.16 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 0 + } }, - "nvidia/nemotron-3-super-120b-a12b:free": { - "id": "nvidia/nemotron-3-super-120b-a12b:free", - "name": "Nemotron 3 Super (free)", - "family": "nemotron", - "attachment": false, - "reasoning": true, + "elevenlabs/elevenlabs-music": { + "id": "elevenlabs/elevenlabs-music", + "name": "ElevenLabs-Music", + "family": "elevenlabs", + "attachment": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "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 + } }, - "nvidia/nemotron-3-nano-30b-a3b:free": { - "id": "nvidia/nemotron-3-nano-30b-a3b:free", - "name": "Nemotron 3 Nano 30B A3B (free)", - "family": "nemotron", - "attachment": false, + "cerebras/gpt-oss-120b-cs": { + "id": "cerebras/gpt-oss-120b-cs", + "name": "GPT-OSS-120B-CS", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-12-14", - "last_updated": "2026-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 256000 } + "temperature": false, + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 0 + }, + "cost": { + "input": 0.35, + "output": 0.75 + } }, - "z-ai/glm-4.7-flash": { - "id": "z-ai/glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm", - "attachment": false, - "reasoning": true, + "cerebras/llama-3.1-8b-cs": { + "id": "cerebras/llama-3.1-8b-cs", + "name": "Llama-3.1-8B-CS", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "structured_output": true, - "temperature": true, - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.4 }, - "limit": { "context": 200000, "output": 65535 } + "temperature": false, + "release_date": "2025-05-13", + "last_updated": "2025-05-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 0 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "z-ai/glm-4.5": { - "id": "z-ai/glm-4.5", - "name": "GLM 4.5", - "family": "glm", - "attachment": false, + "cerebras/qwen3-32b-cs": { + "id": "cerebras/qwen3-32b-cs", + "name": "qwen3-32b-cs", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 128000, "output": 96000 } - }, - "z-ai/glm-4.6": { - "id": "z-ai/glm-4.6", - "name": "GLM 4.6", - "family": "glm", - "attachment": false, + "temperature": false, + "release_date": "2025-05-15", + "last_updated": "2025-05-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + }, + "status": "deprecated" + }, + "cerebras/qwen3-235b-2507-cs": { + "id": "cerebras/qwen3-235b-2507-cs", + "name": "qwen3-235b-2507-cs", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 200000, "output": 128000 } + "temperature": false, + "release_date": "2025-08-06", + "last_updated": "2025-08-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + }, + "status": "deprecated" }, - "z-ai/glm-4.5-air:free": { - "id": "z-ai/glm-4.5-air:free", - "name": "GLM 4.5 Air (free)", - "family": "glm-air", - "attachment": false, - "reasoning": true, + "cerebras/llama-3.3-70b-cs": { + "id": "cerebras/llama-3.3-70b-cs", + "name": "llama-3.3-70b-cs", + "attachment": true, + "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 96000 } + "temperature": false, + "release_date": "2025-05-13", + "last_updated": "2025-05-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + }, + "status": "deprecated" }, - "z-ai/glm-5": { - "id": "z-ai/glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, + "stabilityai/stablediffusionxl": { + "id": "stabilityai/stablediffusionxl", + "name": "StableDiffusionXL", + "family": "stable-diffusion", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 202752, "output": 131000 } + "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 + } }, - "z-ai/glm-4.5-air": { - "id": "z-ai/glm-4.5-air", - "name": "GLM 4.5 Air", - "family": "glm-air", - "attachment": false, + "xai/grok-code-fast-1": { + "id": "xai/grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 128000, "output": 96000 } + "temperature": false, + "release_date": "2025-08-22", + "last_updated": "2025-08-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "z-ai/glm-4.5v": { - "id": "z-ai/glm-4.5v", - "name": "GLM 4.5V", - "family": "glm", + "xai/grok-4-fast-reasoning": { + "id": "xai/grok-4-fast-reasoning", + "name": "Grok-4-Fast-Reasoning", + "family": "grok", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 1.8 }, - "limit": { "context": 64000, "output": 16384 } + "temperature": false, + "release_date": "2025-09-16", + "last_updated": "2025-09-16", + "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 + } }, - "z-ai/glm-4.7": { - "id": "z-ai/glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, - "reasoning": true, + "xai/grok-4.1-fast-non-reasoning": { + "id": "xai/grok-4.1-fast-non-reasoning", + "name": "Grok-4.1-Fast-Non-Reasoning", + "family": "grok", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "z-ai/glm-4.6:exacto": { - "id": "z-ai/glm-4.6:exacto", - "name": "GLM 4.6 (exacto)", - "family": "glm", - "attachment": false, + "xai/grok-4": { + "id": "xai/grok-4", + "name": "Grok-4", + "family": "grok", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 1.9, "cache_read": 0.11 }, - "limit": { "context": 200000, "output": 128000 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "sourceful/riverflow-v2-standard-preview": { - "id": "sourceful/riverflow-v2-standard-preview", - "name": "Riverflow V2 Standard Preview", - "family": "sourceful", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-08", - "last_updated": "2026-01-28", - "modalities": { "input": ["text", "image"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 8192 } + "xai/grok-3-mini": { + "id": "xai/grok-3-mini", + "name": "Grok 3 Mini", + "family": "grok", + "attachment": true, + "reasoning": true, + "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 + } }, - "sourceful/riverflow-v2-fast-preview": { - "id": "sourceful/riverflow-v2-fast-preview", - "name": "Riverflow V2 Fast Preview", - "family": "sourceful", - "attachment": false, + "xai/grok-4.20-multi-agent": { + "id": "xai/grok-4.20-multi-agent", + "name": "Grok-4.20-Multi-Agent", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-08", - "last_updated": "2026-01-28", - "modalities": { "input": ["text", "image"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 8192 } + "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": 2, + "output": 6, + "cache_read": 0.2 + } }, - "sourceful/riverflow-v2-max-preview": { - "id": "sourceful/riverflow-v2-max-preview", - "name": "Riverflow V2 Max Preview", - "family": "sourceful", - "attachment": false, + "xai/grok-3": { + "id": "xai/grok-3", + "name": "Grok 3", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-08", - "last_updated": "2026-01-28", - "modalities": { "input": ["text", "image"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 8192 } + "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 + } }, - "cognitivecomputations/dolphin-mistral-24b-venice-edition:free": { - "id": "cognitivecomputations/dolphin-mistral-24b-venice-edition:free", - "name": "Uncensored (free)", - "family": "mistral", - "attachment": false, + "xai/grok-4-fast-non-reasoning": { + "id": "xai/grok-4-fast-non-reasoning", + "name": "Grok-4-Fast-Non-Reasoning", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-07-09", - "last_updated": "2026-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 32768 } + "tool_call": true, + "temperature": false, + "release_date": "2025-09-16", + "last_updated": "2025-09-16", + "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 + } }, - "google/gemini-2.5-flash-lite": { - "id": "google/gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "family": "gemini-flash-lite", + "xai/grok-4.1-fast-reasoning": { + "id": "xai/grok-4.1-fast-reasoning", + "name": "Grok-4.1-Fast-Reasoning", + "family": "grok", "attachment": true, "reasoning": true, "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"] }, + "temperature": false, + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 2000000, + "output": 30000 + } }, - "google/gemma-3-12b-it:free": { - "id": "google/gemma-3-12b-it:free", - "name": "Gemma 3 12B (free)", - "family": "gemma", + "runwayml/runway": { + "id": "runwayml/runway", + "name": "Runway", + "family": "runway", "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } + "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 + } }, - "google/gemini-2.5-flash-lite-preview-09-2025": { - "id": "google/gemini-2.5-flash-lite-preview-09-2025", - "name": "Gemini 2.5 Flash Lite Preview 09-25", - "family": "gemini-flash-lite", + "runwayml/runway-gen-4-turbo": { + "id": "runwayml/runway-gen-4-turbo", + "name": "Runway-Gen-4-Turbo", + "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 + } + }, + "openai/gpt-5.1-codex-max": { + "id": "openai/gpt-5.1-codex-max", + "name": "GPT-5.1-Codex-Max", "attachment": true, "reasoning": true, "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", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "google/gemma-2-9b-it": { - "id": "google/gemma-2-9b-it", - "name": "Gemma 2 9B", - "family": "gemma", - "attachment": false, + "openai/sora-2-pro": { + "id": "openai/sora-2-pro", + "name": "Sora-2-Pro", + "family": "sora", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-06-28", - "last_updated": "2024-06-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.09 }, - "limit": { "context": 8192, "output": 8192 } + "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 + } }, - "google/gemini-3.1-pro-preview": { - "id": "google/gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", + "openai/chatgpt-4o-latest": { + "id": "openai/chatgpt-4o-latest", + "name": "ChatGPT-4o-Latest", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "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", "audio", "video", "pdf"], "output": ["text"] }, + "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": 2, - "output": 12, - "reasoning": 12, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "input": 4.5, + "output": 14 + } + }, + "openai/gpt-5-chat": { + "id": "openai/gpt-5-chat", + "name": "GPT-5-Chat", + "family": "gpt-codex", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": false, + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "google/gemini-3-pro-preview": { - "id": "google/gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "GPT-5.2-Pro", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "structured_output": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-11-18", - "last_updated": "2025-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12 }, - "limit": { "context": 1050000, "output": 66000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 19, + "output": 150 + } }, - "google/gemma-3-27b-it": { - "id": "google/gemma-3-27b-it", - "name": "Gemma 3 27B", - "family": "gemma", + "openai/gpt-4o-aug": { + "id": "openai/gpt-4o-aug", + "name": "GPT-4o-Aug", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.15 }, - "limit": { "context": 96000, "output": 96000 } + "temperature": false, + "release_date": "2024-11-21", + "last_updated": "2024-11-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 2.2, + "output": 9, + "cache_read": 1.1 + } }, - "google/gemma-3-4b-it": { - "id": "google/gemma-3-4b-it", - "name": "Gemma 3 4B", - "family": "gemma", + "openai/gpt-image-2": { + "id": "openai/gpt-image-2", + "name": "GPT-Image-2", "attachment": true, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01703, "output": 0.06815 }, - "limit": { "context": 96000, "output": 96000 } + "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": 32.3232, + "cache_read": 1.2626 + } }, - "google/gemma-3n-e4b-it": { - "id": "google/gemma-3n-e4b-it", - "name": "Gemma 3n 4B", - "family": "gemma", + "openai/gpt-4-classic-0314": { + "id": "openai/gpt-4-classic-0314", + "name": "GPT-4-Classic-0314", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.02, "output": 0.04 }, - "limit": { "context": 32768, "output": 32768 } - }, - "google/gemini-2.5-pro-preview-06-05": { - "id": "google/gemini-2.5-pro-preview-06-05", - "name": "Gemini 2.5 Pro Preview 06-05", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-08-26", + "last_updated": "2024-08-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 8192, + "output": 4096 + }, + "status": "deprecated", + "cost": { + "input": 27, + "output": 54 + } }, - "google/gemma-3-4b-it:free": { - "id": "google/gemma-3-4b-it:free", - "name": "Gemma 3 4B (free)", - "family": "gemma", + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT-5-mini", + "family": "gpt-mini", "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2025-06-25", + "last_updated": "2025-06-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.22, + "output": 1.8, + "cache_read": 0.022 + } }, - "google/gemini-2.5-pro-preview-05-06": { - "id": "google/gemini-2.5-pro-preview-05-06", - "name": "Gemini 2.5 Pro Preview 05-06", - "family": "gemini-pro", + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "GPT-5-nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-05-06", - "last_updated": "2025-05-06", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.045, + "output": 0.36, + "cache_read": 0.0045 + } }, - "google/gemini-2.0-flash-001": { - "id": "google/gemini-2.0-flash-001", - "name": "Gemini 2.0 Flash", - "family": "gemini-flash", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "GPT-5.3-Codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-02-10", + "last_updated": "2026-02-10", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 8192 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.6, + "output": 13, + "cache_read": 0.16 + } }, - "google/gemma-3-27b-it:free": { - "id": "google/gemma-3-27b-it:free", - "name": "Gemma 3 27B (free)", - "family": "gemma", + "openai/gpt-4-turbo": { + "id": "openai/gpt-4-turbo", + "name": "GPT-4-Turbo", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "temperature": false, + "release_date": "2023-09-13", + "last_updated": "2023-09-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 9, + "output": 27 + } }, - "google/gemini-3-flash-preview": { - "id": "google/gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", "attachment": true, "reasoning": true, "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", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.6, + "output": 13, + "cache_read": 0.16 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", + "openai/o3-pro": { + "id": "openai/o3-pro", + "name": "o3-pro", + "family": "o-pro", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06-10", + "last_updated": "2025-06-10", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 18, + "output": 72 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", + "openai/o3-mini-high": { + "id": "openai/o3-mini-high", + "name": "o3-mini-high", + "family": "o-mini", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-07-17", - "last_updated": "2025-07-17", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.0375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 0.99, + "output": 4 + } }, - "google/gemini-3.1-pro-preview-customtools": { - "id": "google/gemini-3.1-pro-preview-customtools", - "name": "Gemini 3.1 Pro Preview Custom Tools", - "family": "gemini-pro", + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o-mini", + "family": "gpt-mini", "attachment": true, - "reasoning": true, + "reasoning": false, "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", "audio", "video", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2, - "output": 12, - "reasoning": 12, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "limit": { + "context": 124096, + "output": 4096 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.14, + "output": 0.54, + "cache_read": 0.068 + } }, - "google/gemini-2.5-flash-preview-09-2025": { - "id": "google/gemini-2.5-flash-preview-09-2025", - "name": "Gemini 2.5 Flash Preview 09-25", - "family": "gemini-flash", + "openai/o4-mini-deep-research": { + "id": "openai/o4-mini-deep-research", + "name": "o4-mini-deep-research", + "family": "o-mini", "attachment": true, "reasoning": true, "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", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06-27", + "last_updated": "2025-06-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.031 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.8, + "output": 7.2, + "cache_read": 0.45 + } }, - "google/gemini-3.1-flash-lite-preview": { - "id": "google/gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite Preview", - "family": "gemini-flash-lite", + "openai/gpt-5.4-mini": { + "id": "openai/gpt-5.4-mini", + "name": "GPT-5.4-Mini", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image", "video", "pdf", "audio"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-03-12", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 0.25, - "output": 1.5, - "reasoning": 1.5, - "cache_read": 0.025, - "cache_write": 0.083, - "input_audio": 0.5, - "output_audio": 0.5 + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.68, + "output": 4, + "cache_read": 0.068 + } }, - "google/gemma-3-12b-it": { - "id": "google/gemma-3-12b-it", - "name": "Gemma 3 12B", - "family": "gemma", + "openai/dall-e-3": { + "id": "openai/dall-e-3", + "name": "DALL-E-3", + "family": "dall-e", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.1 }, - "limit": { "context": 131072, "output": 131072 } + "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 + } }, - "google/gemma-3n-e2b-it:free": { - "id": "google/gemma-3n-e2b-it:free", - "name": "Gemma 3n 2B (free)", - "family": "gemma", + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "o4-mini", + "family": "o-mini", "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2000 } + "reasoning": true, + "tool_call": true, + "temperature": false, + "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": 0.99, + "output": 4, + "cache_read": 0.25 + } }, - "google/gemma-3n-e4b-it:free": { - "id": "google/gemma-3n-e4b-it:free", - "name": "Gemma 3n 4B (free)", - "family": "gemma", + "openai/gpt-5.4-nano": { + "id": "openai/gpt-5.4-nano", + "name": "GPT-5.4-Nano", "attachment": true, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2000 } + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.18, + "output": 1.1, + "cache_read": 0.018 + } }, - "meta-llama/llama-3.2-11b-vision-instruct": { - "id": "meta-llama/llama-3.2-11b-vision-instruct", - "name": "Llama 3.2 11B Vision Instruct", - "family": "llama", + "openai/gpt-image-1": { + "id": "openai/gpt-image-1", + "name": "GPT-Image-1", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": 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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "tool_call": true, + "temperature": false, + "release_date": "2025-03-31", + "last_updated": "2025-03-31", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 0 + } }, - "meta-llama/llama-3.2-3b-instruct:free": { - "id": "meta-llama/llama-3.2-3b-instruct:free", - "name": "Llama 3.2 3B Instruct (free)", - "family": "llama", + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT-5.2-Codex", "attachment": true, - "reasoning": false, - "tool_call": 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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } - }, - "meta-llama/llama-3.3-70b-instruct:free": { - "id": "meta-llama/llama-3.3-70b-instruct:free", - "name": "Llama 3.3 70B Instruct (free)", - "family": "llama", - "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.6, + "output": 13, + "cache_read": 0.16 + } }, - "openrouter/free": { - "id": "openrouter/free", - "name": "Free Models Router", + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT-5.1-Codex-Mini", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-01", - "last_updated": "2026-02-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-11-12", + "last_updated": "2025-11-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "input": 200000, "output": 8000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.22, + "output": 1.8, + "cache_read": 0.022 + } }, - "arcee-ai/trinity-mini:free": { - "id": "arcee-ai/trinity-mini:free", - "name": "Trinity Mini", - "family": "trinity-mini", - "attachment": false, - "reasoning": false, + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2026-01-28", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2025-11-12", + "last_updated": "2025-11-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "arcee-ai/trinity-large-preview:free": { - "id": "arcee-ai/trinity-large-preview:free", - "name": "Trinity Large Preview", - "family": "trinity", - "attachment": false, + "openai/gpt-image-1-mini": { + "id": "openai/gpt-image-1-mini", + "name": "GPT-Image-1-Mini", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2026-01-28", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } }, - "nousresearch/hermes-4-70b": { - "id": "nousresearch/hermes-4-70b", - "name": "Hermes 4 70B", - "family": "hermes", - "attachment": false, + "openai/o1": { + "id": "openai/o1", + "name": "o1", + "family": "o", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2025-08-25", - "last_updated": "2025-08-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.4 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2024-12-18", + "last_updated": "2024-12-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 14, + "output": 54 + } }, - "nousresearch/hermes-4-405b": { - "id": "nousresearch/hermes-4-405b", - "name": "Hermes 4 405B", - "family": "hermes", - "attachment": false, + "openai/gpt-5.4-pro": { + "id": "openai/gpt-5.4-pro", + "name": "GPT-5.4-Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2025-08-25", - "last_updated": "2025-08-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2026-03-05", + "last_updated": "2026-03-05", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 27, + "output": 160 + } }, - "nousresearch/hermes-3-llama-3.1-405b:free": { - "id": "nousresearch/hermes-3-llama-3.1-405b:free", - "name": "Hermes 3 405B Instruct (free)", - "family": "hermes", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-08-16", - "last_updated": "2024-08-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 131072 } + "openai/gpt-3.5-turbo": { + "id": "openai/gpt-3.5-turbo", + "name": "GPT-3.5-Turbo", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": false, + "release_date": "2023-09-13", + "last_updated": "2023-09-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16384, + "output": 2048 + }, + "cost": { + "input": 0.45, + "output": 1.4 + } }, - "minimax/minimax-01": { - "id": "minimax/minimax-01", - "name": "MiniMax-01", - "family": "minimax", + "openai/o3-deep-research": { + "id": "openai/o3-deep-research", + "name": "o3-deep-research", + "family": "o", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 1000000, "output": 1000000 } + "temperature": false, + "release_date": "2025-06-27", + "last_updated": "2025-06-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 9, + "output": 36, + "cache_read": 2.2 + } }, - "minimax/minimax-m2": { - "id": "minimax/minimax-m2", - "name": "MiniMax M2", - "family": "minimax", - "attachment": false, + "openai/o3-mini": { + "id": "openai/o3-mini", + "name": "o3-mini", + "family": "o-mini", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "structured_output": true, - "temperature": true, - "release_date": "2025-10-23", - "last_updated": "2025-10-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.28, "output": 1.15, "cache_read": 0.28, "cache_write": 1.15 }, - "limit": { "context": 196600, "output": 118000 } + "temperature": false, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 0.99, + "output": 4 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", - "attachment": false, + "openai/o1-pro": { + "id": "openai/o1-pro", + "name": "o1-pro", + "family": "o-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "temperature": false, + "release_date": "2025-03-19", + "last_updated": "2025-03-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 140, + "output": 540 + } }, - "minimax/minimax-m2.7": { - "id": "minimax/minimax-m2.7", - "name": "MiniMax M2.7", - "family": "minimax", - "attachment": false, + "openai/gpt-4o-search": { + "id": "openai/gpt-4o-search", + "name": "GPT-4o-Search", + "family": "gpt", + "attachment": true, + "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.2, + "output": 9 + } + }, + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "GPT-5-Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "temperature": false, + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9 + } }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT-5.4", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131072 } + "temperature": false, + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 2.2, + "output": 14, + "cache_read": 0.22 + } }, - "minimax/minimax-m1": { - "id": "minimax/minimax-m1", - "name": "MiniMax M1", - "family": "minimax", - "attachment": false, + "openai/gpt-5.3-codex-spark": { + "id": "openai/gpt-5.3-codex-spark", + "name": "GPT-5.3-Codex-Spark", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2.2 }, - "limit": { "context": 1000000, "output": 40000 } + "temperature": false, + "release_date": "2026-03-04", + "last_updated": "2026-03-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen/qwen3-coder-30b-a3b-instruct": { - "id": "qwen/qwen3-coder-30b-a3b-instruct", - "name": "Qwen3 Coder 30B A3B Instruct", - "family": "qwen", - "attachment": false, + "openai/gpt-3.5-turbo-raw": { + "id": "openai/gpt-3.5-turbo-raw", + "name": "GPT-3.5-Turbo-Raw", + "family": "gpt", + "attachment": true, "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, - "cost": { "input": 0.07, "output": 0.27 }, - "limit": { "context": 160000, "output": 65536 } + "temperature": false, + "release_date": "2023-09-27", + "last_updated": "2023-09-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 4524, + "output": 2048 + }, + "cost": { + "input": 0.45, + "output": 1.4 + } }, - "qwen/qwen3-235b-a22b-07-25": { - "id": "qwen/qwen3-235b-a22b-07-25", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", - "attachment": false, + "openai/gpt-4.1-nano": { + "id": "openai/gpt-4.1-nano", + "name": "GPT-4.1-nano", + "family": "gpt-nano", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-28", - "last_updated": "2025-07-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.85 }, - "limit": { "context": 262144, "output": 131072 } + "temperature": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.09, + "output": 0.36, + "cache_read": 0.022 + } }, - "qwen/qwen3-30b-a3b-thinking-2507": { - "id": "qwen/qwen3-30b-a3b-thinking-2507", - "name": "Qwen3 30B A3B Thinking 2507", - "family": "qwen", - "attachment": false, + "openai/o3": { + "id": "openai/o3", + "name": "o3", + "family": "o", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262000, "output": 262000 } + "temperature": false, + "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.8, + "output": 7.2, + "cache_read": 0.45 + } }, - "qwen/qwen3.5-plus-02-15": { - "id": "qwen/qwen3.5-plus-02-15", - "name": "Qwen3.5 Plus 2026-02-15", - "family": "qwen", + "openai/gpt-5-pro": { + "id": "openai/gpt-5-pro", + "name": "GPT-5-Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "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"] }, + "temperature": false, + "release_date": "2025-10-06", + "last_updated": "2025-10-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2.4 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 14, + "output": 110 + } }, - "qwen/qwen3-coder": { - "id": "qwen/qwen3-coder", - "name": "Qwen3 Coder", - "family": "qwen", - "attachment": false, + "openai/sora-2": { + "id": "openai/sora-2", + "name": "Sora-2", + "family": "sora", + "attachment": true, "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": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 262144, "output": 66536 } - }, - "qwen/qwen3-4b:free": { - "id": "qwen/qwen3-4b:free", - "name": "Qwen3 4B (free)", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-30", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 40960, "output": 40960 } + "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 + } }, - "qwen/qwen3-coder:free": { - "id": "qwen/qwen3-coder:free", - "name": "Qwen3 Coder 480B A35B Instruct (free)", - "family": "qwen", - "attachment": false, + "openai/gpt-4o": { + "id": "openai/gpt-4o", + "name": "GPT-4o", + "family": "gpt", + "attachment": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 66536 } + "temperature": false, + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + } }, - "qwen/qwen2.5-vl-72b-instruct": { - "id": "qwen/qwen2.5-vl-72b-instruct", - "name": "Qwen2.5 VL 72B Instruct", - "family": "qwen", + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT-5", + "family": "gpt", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-02-01", - "last_updated": "2025-02-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } - }, - "qwen/qwen3-next-80b-a3b-thinking": { - "id": "qwen/qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", - "family": "qwen", - "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.14, "output": 1.4 }, - "limit": { "context": 262144, "output": 262144 } + "temperature": false, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "qwen/qwen3-235b-a22b-thinking-2507": { - "id": "qwen/qwen3-235b-a22b-thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", - "attachment": false, - "reasoning": true, + "openai/gpt-5.2-instant": { + "id": "openai/gpt-5.2-instant", + "name": "GPT-5.2-Instant", + "attachment": true, + "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.078, "output": 0.312 }, - "limit": { "context": 262144, "output": 81920 } + "temperature": false, + "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.6, + "output": 13, + "cache_read": 0.16 + } }, - "qwen/qwen3-next-80b-a3b-instruct:free": { - "id": "qwen/qwen3-next-80b-a3b-instruct:free", - "name": "Qwen3 Next 80B A3B Instruct (free)", - "family": "qwen", - "attachment": false, + "openai/gpt-4o-mini-search": { + "id": "openai/gpt-4o-mini-search", + "name": "GPT-4o-mini-Search", + "family": "gpt-mini", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262144, "output": 262144 } + "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": 0.14, + "output": 0.54 + } }, - "qwen/qwen3-next-80b-a3b-instruct": { - "id": "qwen/qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", - "family": "qwen", - "attachment": false, + "openai/gpt-image-1.5": { + "id": "openai/gpt-image-1.5", + "name": "gpt-image-1.5", + "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.14, "output": 1.4 }, - "limit": { "context": 262144, "output": 262144 } + "tool_call": false, + "temperature": false, + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 0 + } }, - "qwen/qwen3.6-plus-preview:free": { - "id": "qwen/qwen3.6-plus-preview:free", - "name": "Qwen3.6 Plus Preview (free)", - "family": "qwen", - "attachment": false, - "reasoning": true, + "openai/gpt-3.5-turbo-instruct": { + "id": "openai/gpt-3.5-turbo-instruct", + "name": "GPT-3.5-Turbo-Instruct", + "family": "gpt", + "attachment": true, + "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-03-30", - "last_updated": "2026-03-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2023-09-20", + "last_updated": "2023-09-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 3500, + "output": 1024 + }, + "cost": { + "input": 1.4, + "output": 1.8 + } }, - "qwen/qwen3-coder:exacto": { - "id": "qwen/qwen3-coder:exacto", - "name": "Qwen3 Coder (exacto)", - "family": "qwen", - "attachment": false, + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", + "attachment": true, "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": true, - "cost": { "input": 0.38, "output": 1.53 }, - "limit": { "context": 131072, "output": 32768 } + "temperature": false, + "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.8, + "output": 7.2, + "cache_read": 0.45 + } }, - "qwen/qwen3.5-397b-a17b": { - "id": "qwen/qwen3.5-397b-a17b", - "name": "Qwen3.5 397B A17B", - "family": "qwen", + "openai/gpt-5.1-instant": { + "id": "openai/gpt-5.1-instant", + "name": "GPT-5.1-Instant", + "family": "gpt", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 262144, "output": 65536 } + "temperature": false, + "release_date": "2025-11-12", + "last_updated": "2025-11-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "qwen/qwen3-max": { - "id": "qwen/qwen3-max", - "name": "Qwen3 Max", - "family": "qwen", - "attachment": false, - "reasoning": true, + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "GPT-4.1-mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-04-15", + "last_updated": "2025-04-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 6 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.36, + "output": 1.4, + "cache_read": 0.09 + } }, - "qwen/qwen3-coder-flash": { - "id": "qwen/qwen3-coder-flash", - "name": "Qwen3 Coder Flash", - "family": "qwen", - "attachment": false, + "openai/gpt-4-classic": { + "id": "openai/gpt-4-classic", + "name": "GPT-4-Classic", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": false, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-03-25", + "last_updated": "2024-03-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 128000, "output": 66536 } + "limit": { + "context": 8192, + "output": 4096 + }, + "status": "deprecated", + "cost": { + "input": 27, + "output": 54 + } }, - "qwen/qwen-2.5-coder-32b-instruct": { - "id": "qwen/qwen-2.5-coder-32b-instruct", - "name": "Qwen2.5 Coder 32B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-11-11", - "last_updated": "2024-11-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 8192 } + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "release_date": "2025-11-12", + "last_updated": "2025-11-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "qwen/qwen3-30b-a3b-instruct-2507": { - "id": "qwen/qwen3-30b-a3b-instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", - "family": "qwen", - "attachment": false, + "openai/gpt-5.3-instant": { + "id": "openai/gpt-5.3-instant", + "name": "GPT-5.3-Instant", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262000, "output": 262000 } + "temperature": false, + "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 + }, + "cost": { + "input": 1.6, + "output": 13, + "cache_read": 0.16 + } }, - "xiaomi/mimo-v2-pro": { - "id": "xiaomi/mimo-v2-pro", - "name": "MiMo-V2-Pro", - "family": "mimo", - "attachment": false, - "reasoning": true, + "google/veo-3-fast": { + "id": "google/veo-3-fast", + "name": "Veo-3-Fast", + "family": "veo", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "structured_output": true, - "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "xiaomi/mimo-v2-omni": { - "id": "xiaomi/mimo-v2-omni", - "name": "MiMo-V2-Omni", - "family": "mimo", + "google/veo-3.1-fast": { + "id": "google/veo-3.1-fast", + "name": "Veo-3.1-Fast", + "family": "veo", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "structured_output": true, - "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "video", "audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262144, "output": 65536 } + "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 + } }, - "xiaomi/mimo-v2-flash": { - "id": "xiaomi/mimo-v2-flash", - "name": "MiMo-V2-Flash", - "family": "mimo", - "attachment": false, + "google/gemini-3.1-pro": { + "id": "google/gemini-3.1-pro", + "name": "Gemini-3.1-Pro", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-14", - "last_updated": "2025-12-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01 }, - "limit": { "context": 262144, "output": 65536 } - }, - "black-forest-labs/flux.2-pro": { - "id": "black-forest-labs/flux.2-pro", - "name": "FLUX.2 Pro", - "family": "flux", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-25", - "last_updated": "2026-01-31", - "modalities": { "input": ["image", "text"], "output": ["image"] }, + "temperature": false, + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 46864, "output": 46864 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2 + } }, - "black-forest-labs/flux.2-max": { - "id": "black-forest-labs/flux.2-max", - "name": "FLUX.2 Max", - "family": "flux", - "attachment": false, + "google/imagen-3-fast": { + "id": "google/imagen-3-fast", + "name": "Imagen-3-Fast", + "family": "imagen", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-16", - "last_updated": "2026-01-31", - "modalities": { "input": ["image", "text"], "output": ["image"] }, + "tool_call": true, + "temperature": false, + "release_date": "2024-10-17", + "last_updated": "2024-10-17", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 46864, "output": 46864 } - }, - "black-forest-labs/flux.2-klein-4b": { - "id": "black-forest-labs/flux.2-klein-4b", - "name": "FLUX.2 Klein 4B", - "family": "flux", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2026-01-14", - "last_updated": "2026-01-31", - "modalities": { "input": ["image", "text"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 40960, "output": 40960 } + "limit": { + "context": 480, + "output": 0 + } }, - "black-forest-labs/flux.2-flex": { - "id": "black-forest-labs/flux.2-flex", - "name": "FLUX.2 Flex", - "family": "flux", - "attachment": false, + "google/gemini-2.0-flash": { + "id": "google/gemini-2.0-flash", + "name": "Gemini-2.0-Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-11-25", - "last_updated": "2026-01-31", - "modalities": { "input": ["image", "text"], "output": ["image"] }, + "tool_call": true, + "temperature": false, + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 67344, "output": 67344 } + "limit": { + "context": 990000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.42 + } }, - "stepfun/step-3.5-flash": { - "id": "stepfun/step-3.5-flash", - "name": "Step 3.5 Flash", - "family": "step", - "attachment": false, + "google/gemini-deep-research": { + "id": "google/gemini-deep-research", + "name": "gemini-deep-research", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 256000 } + "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 + } }, - "stepfun/step-3.5-flash:free": { - "id": "stepfun/step-3.5-flash:free", - "name": "Step 3.5 Flash (free)", - "family": "step", - "attachment": false, + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini-2.5-Pro", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 256000 } + "temperature": false, + "release_date": "2025-02-05", + "last_updated": "2025-02-05", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1065535, + "output": 65535 + }, + "cost": { + "input": 0.87, + "output": 7, + "cache_read": 0.087 + } }, - "liquid/lfm-2.5-1.2b-instruct:free": { - "id": "liquid/lfm-2.5-1.2b-instruct:free", - "name": "LFM2.5-1.2B-Instruct (free)", - "family": "liquid", - "attachment": false, + "google/imagen-3": { + "id": "google/imagen-3", + "name": "Imagen-3", + "family": "imagen", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2026-01-20", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 32768 } + "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 + } }, - "liquid/lfm-2.5-1.2b-thinking:free": { - "id": "liquid/lfm-2.5-1.2b-thinking:free", - "name": "LFM2.5-1.2B-Thinking (free)", - "family": "liquid", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2026-01-20", - "last_updated": "2026-01-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 32768 } + "google/nano-banana": { + "id": "google/nano-banana", + "name": "Nano-Banana", + "family": "nano-banana", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": false, + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "output": 0 + }, + "cost": { + "input": 0.21, + "output": 1.8, + "cache_read": 0.021 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini-2.5-Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "temperature": false, + "release_date": "2025-04-26", + "last_updated": "2025-04-26", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1065535, + "output": 65535 + }, + "cost": { + "input": 0.21, + "output": 1.8, + "cache_read": 0.021 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "google/gemini-3.1-flash-lite": { + "id": "google/gemini-3.1-flash-lite", + "name": "Gemini-3.1-Flash-Lite", "attachment": true, "reasoning": true, "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", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "temperature": false, + "release_date": "2026-02-18", + "last_updated": "2026-02-18", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "Kimi K2 Instruct 0905", - "family": "kimi", - "attachment": false, - "reasoning": false, + "google/gemini-3-flash": { + "id": "google/gemini-3-flash", + "name": "Gemini-3-Flash", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 16384 } + "temperature": false, + "release_date": "2025-10-07", + "last_updated": "2025-10-07", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2.4, + "cache_read": 0.04 + } }, - "moonshotai/kimi-k2": { - "id": "moonshotai/kimi-k2", - "name": "Kimi K2", - "family": "kimi", - "attachment": false, + "google/veo-3.1": { + "id": "google/veo-3.1", + "name": "Veo-3.1", + "family": "veo", + "attachment": true, "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, - "cost": { "input": 0.55, "output": 2.2 }, - "limit": { "context": 131072, "output": 32768 } + "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 + } }, - "moonshotai/kimi-k2-0905:exacto": { - "id": "moonshotai/kimi-k2-0905:exacto", - "name": "Kimi K2 Instruct 0905 (exacto)", - "family": "kimi", - "attachment": false, + "google/lyria": { + "id": "google/lyria", + "name": "Lyria", + "family": "lyria", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 16384 } + "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 + } }, - "moonshotai/kimi-k2:free": { - "id": "moonshotai/kimi-k2:free", - "name": "Kimi K2 (free)", - "family": "kimi", - "attachment": false, + "google/imagen-4-ultra": { + "id": "google/imagen-4-ultra", + "name": "Imagen-4-Ultra", + "family": "imagen", + "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-11", - "last_updated": "2025-07-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32800, "output": 32800 } + "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 + } }, - "bytedance-seed/seedream-4.5": { - "id": "bytedance-seed/seedream-4.5", - "name": "Seedream 4.5", - "family": "seed", - "attachment": false, + "google/nano-banana-pro": { + "id": "google/nano-banana-pro", + "name": "Nano-Banana-Pro", + "family": "nano-banana", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-23", - "last_updated": "2026-01-31", - "modalities": { "input": ["image", "text"], "output": ["image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4096, "output": 4096 } + "tool_call": true, + "temperature": false, + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 65536, + "output": 0 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2 + } }, - "inception/mercury-2": { - "id": "inception/mercury-2", - "name": "Mercury 2", - "family": "mercury", - "attachment": false, + "google/gemini-3-pro": { + "id": "google/gemini-3-pro", + "name": "Gemini-3-Pro", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-03-04", - "last_updated": "2026-03-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-10-22", + "last_updated": "2025-10-22", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 50000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "status": "deprecated", + "cost": { + "input": 1.6, + "output": 9.6, + "cache_read": 0.16 + } }, - "inception/mercury-coder": { - "id": "inception/mercury-coder", - "name": "Mercury Coder", - "family": "mercury", - "attachment": false, + "google/imagen-4-fast": { + "id": "google/imagen-4-fast", + "name": "Imagen-4-Fast", + "family": "imagen", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-04-30", - "last_updated": "2025-04-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06-25", + "last_updated": "2025-06-25", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 480, + "output": 0 + } }, - "inception/mercury": { - "id": "inception/mercury", - "name": "Mercury", - "family": "mercury", - "attachment": false, + "google/veo-3": { + "id": "google/veo-3", + "name": "Veo-3", + "family": "veo", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-06-26", - "last_updated": "2025-06-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-21", + "last_updated": "2025-05-21", + "modalities": { + "input": ["text"], + "output": ["video"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 480, + "output": 0 + } }, - "mistralai/mistral-medium-3.1": { - "id": "mistralai/mistral-medium-3.1", - "name": "Mistral Medium 3.1", - "family": "mistral-medium", + "google/gemini-2.5-flash-lite": { + "id": "google/gemini-2.5-flash-lite", + "name": "Gemini-2.5-Flash-Lite", + "family": "gemini-flash-lite", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-08-12", - "last_updated": "2025-08-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06-19", + "last_updated": "2025-06-19", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 1024000, + "output": 64000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "mistralai/devstral-small-2505": { - "id": "mistralai/devstral-small-2505", - "name": "Devstral Small", - "family": "devstral", - "attachment": false, + "google/imagen-4": { + "id": "google/imagen-4", + "name": "Imagen-4", + "family": "imagen", + "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"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.12 }, - "limit": { "context": 128000, "output": 128000 } + "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 + } }, - "mistralai/mistral-small-2603": { - "id": "mistralai/mistral-small-2603", - "name": "Mistral Small 4", - "family": "mistral-small", + "google/gemma-4-31b": { + "id": "google/gemma-4-31b", + "name": "Gemma-4-31B", "attachment": true, - "reasoning": 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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "temperature": false, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "mistralai/mistral-medium-3": { - "id": "mistralai/mistral-medium-3", - "name": "Mistral Medium 3", - "family": "mistral-medium", + "google/gemini-2.0-flash-lite": { + "id": "google/gemini-2.0-flash-lite", + "name": "Gemini-2.0-Flash-Lite", + "family": "gemini-flash-lite", "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"] }, + "temperature": false, + "release_date": "2025-02-05", + "last_updated": "2025-02-05", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 990000, + "output": 8192 + }, + "cost": { + "input": 0.052, + "output": 0.21 + } }, - "mistralai/devstral-2512": { - "id": "mistralai/devstral-2512", - "name": "Devstral 2 2512", - "family": "devstral", - "attachment": false, + "google/veo-2": { + "id": "google/veo-2", + "name": "Veo-2", + "family": "veo", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-12", - "release_date": "2025-09-12", - "last_updated": "2025-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "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 + } }, - "mistralai/codestral-2508": { - "id": "mistralai/codestral-2508", - "name": "Codestral 2508", - "family": "codestral", - "attachment": false, + "lumalabs/ray2": { + "id": "lumalabs/ray2", + "name": "Ray2", + "family": "ray", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 256000 } + "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 + } }, - "mistralai/devstral-medium-2507": { - "id": "mistralai/devstral-medium-2507", - "name": "Devstral Medium", - "family": "devstral", - "attachment": false, - "reasoning": false, + "anthropic/claude-opus-4.1": { + "id": "anthropic/claude-opus-4.1", + "name": "Claude-Opus-4.1", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-07-10", - "last_updated": "2025-07-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "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 + }, + "cost": { + "input": 13, + "output": 64, + "cache_read": 1.3, + "cache_write": 16 + } }, - "mistralai/devstral-small-2507": { - "id": "mistralai/devstral-small-2507", - "name": "Devstral Small 1.1", - "family": "devstral", - "attachment": false, + "anthropic/claude-sonnet-3.5": { + "id": "anthropic/claude-sonnet-3.5", + "name": "Claude-Sonnet-3.5", + "family": "claude-sonnet", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-07-10", - "last_updated": "2025-07-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 131072, "output": 131072 } + "temperature": false, + "release_date": "2024-06-05", + "last_updated": "2024-06-05", + "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 + } }, - "mistralai/mistral-small-3.2-24b-instruct": { - "id": "mistralai/mistral-small-3.2-24b-instruct", - "name": "Mistral Small 3.2 24B Instruct", - "family": "mistral-small", + "anthropic/claude-haiku-3": { + "id": "anthropic/claude-haiku-3", + "name": "Claude-Haiku-3", + "family": "claude-haiku", "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 96000, "output": 8192 } + "temperature": false, + "release_date": "2024-03-09", + "last_updated": "2024-03-09", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 189096, + "output": 8192 + }, + "cost": { + "input": 0.21, + "output": 1.1, + "cache_read": 0.021, + "cache_write": 0.26 + } }, - "mistralai/mistral-small-3.1-24b-instruct": { - "id": "mistralai/mistral-small-3.1-24b-instruct", - "name": "Mistral Small 3.1 24B Instruct", - "family": "mistral-small", + "anthropic/claude-opus-4.6": { + "id": "anthropic/claude-opus-4.6", + "name": "Claude-Opus-4.6", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-17", - "last_updated": "2025-03-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } - } - } - }, - "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": { - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT-5.2-Codex", + "temperature": false, + "release_date": "2026-02-04", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 983040, + "output": 128000 + }, + "cost": { + "input": 4.3, + "output": 21, + "cache_read": 0.43, + "cache_write": 5.3 + } + }, + "anthropic/claude-opus-4.7": { + "id": "anthropic/claude-opus-4.7", + "name": "Claude-Opus-4.7", "attachment": true, "reasoning": true, "tool_call": true, "temperature": false, - "knowledge": "2025-01-01", - "release_date": "2026-01-15", - "last_updated": "2026-01-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-04-15", + "last_updated": "2026-04-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.17 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 1048576, + "output": 128000 + }, + "cost": { + "input": 4.3, + "output": 21, + "cache_read": 0.43, + "cache_write": 5.4 + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "GPT-5.1-Codex-Mini", + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude-Sonnet-4", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-21", + "last_updated": "2025-05-21", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 983040, + "output": 64000 + }, + "cost": { + "input": 2.6, + "output": 13, + "cache_read": 0.26, + "cache_write": 3.2 + } }, - "openai/gpt-5.4-pro": { - "id": "openai/gpt-5.4-pro", - "name": "GPT-5.4 Pro", + "anthropic/claude-sonnet-4.5": { + "id": "anthropic/claude-sonnet-4.5", + "name": "Claude-Sonnet-4.5", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-09-26", + "last_updated": "2025-09-26", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 45, "output": 225 }, - "limit": { "context": 1050000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 983040, + "output": 32768 + }, + "cost": { + "input": 2.6, + "output": 13, + "cache_read": 0.26, + "cache_write": 3.2 + } }, - "openai/gpt-5.4-mini": { - "id": "openai/gpt-5.4-mini", - "name": "GPT-5.4 Mini", + "anthropic/claude-opus-4.5": { + "id": "anthropic/claude-opus-4.5", + "name": "Claude-Opus-4.5", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-11-21", + "last_updated": "2025-11-21", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.75, "output": 4.5 }, - "limit": { "context": 400000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 196608, + "output": 64000 + }, + "cost": { + "input": 4.3, + "output": 21, + "cache_read": 0.43, + "cache_write": 5.3 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "GPT-5", + "anthropic/claude-sonnet-3.7": { + "id": "anthropic/claude-sonnet-3.7", + "name": "Claude-Sonnet-3.7", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 196608, + "output": 128000 + }, + "cost": { + "input": 2.6, + "output": 13, + "cache_read": 0.26, + "cache_write": 3.2 + } }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "GPT-5.3 Codex", + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Claude-Opus-4", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-21", + "last_updated": "2025-05-21", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 192512, + "output": 28672 + }, + "cost": { + "input": 13, + "output": 64, + "cache_read": 1.3, + "cache_write": 16 + } }, - "openai/gpt-5.1-chat": { - "id": "openai/gpt-5.1-chat", - "name": "GPT-5.1 Chat", + "anthropic/claude-haiku-3.5": { + "id": "anthropic/claude-haiku-3.5", + "name": "Claude-Haiku-3.5", + "family": "claude-haiku", "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["pdf", "image", "text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12 }, - "limit": { "context": 128000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 189096, + "output": 8192 + }, + "cost": { + "input": 0.68, + "output": 3.4, + "cache_read": 0.068, + "cache_write": 0.85 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT-5.4", + "anthropic/claude-haiku-4.5": { + "id": "anthropic/claude-haiku-4.5", + "name": "Claude-Haiku-4.5", + "family": "claude-haiku", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3.75, "output": 18.75 }, - "limit": { "context": 1050000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } - }, - "openai/gpt-5.4-nano": { - "id": "openai/gpt-5.4-nano", - "name": "GPT-5.4 Nano", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.25 }, - "limit": { "context": 400000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 192000, + "output": 64000 + }, + "cost": { + "input": 0.85, + "output": 4.3, + "cache_read": 0.085, + "cache_write": 1.1 + } }, - "openai/gpt-5.3-chat": { - "id": "openai/gpt-5.3-chat", - "name": "GPT-5.3 Chat", + "anthropic/claude-sonnet-3.5-june": { + "id": "anthropic/claude-sonnet-3.5-june", + "name": "Claude-Sonnet-3.5-June", + "family": "claude-sonnet", "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-11-18", + "last_updated": "2024-11-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 128000, "output": 16380 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 189096, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 2.6, + "output": 13, + "cache_read": 0.26, + "cache_write": 3.2 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", + "anthropic/claude-sonnet-4.6": { + "id": "anthropic/claude-sonnet-4.6", + "name": "Claude-Sonnet-4.6", "attachment": true, "reasoning": true, "tool_call": true, "temperature": false, - "knowledge": "2025-01-01", - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["image", "text", "pdf"], "output": ["text"] }, + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.17 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 983040, + "output": 128000 + }, + "cost": { + "input": 2.6, + "output": 13, + "cache_read": 0.26, + "cache_write": 3.2 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT-5.1", + "ideogramai/ideogram": { + "id": "ideogramai/ideogram", + "name": "Ideogram", + "family": "ideogram", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["image", "text", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-04-03", + "last_updated": "2024-04-03", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 150, + "output": 0 + } }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "GPT-5 Codex", + "ideogramai/ideogram-v2": { + "id": "ideogramai/ideogram-v2", + "name": "Ideogram-v2", + "family": "ideogram", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-08-21", + "last_updated": "2024-08-21", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 150, + "output": 0 + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT-5.1-Codex", + "ideogramai/ideogram-v2a-turbo": { + "id": "ideogramai/ideogram-v2a-turbo", + "name": "Ideogram-v2a-Turbo", + "family": "ideogram", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-02-27", + "last_updated": "2025-02-27", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12 }, - "limit": { "context": 400000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 150, + "output": 0 + } }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "GPT-5.2-Pro", + "ideogramai/ideogram-v2a": { + "id": "ideogramai/ideogram-v2a", + "name": "Ideogram-v2a", + "family": "ideogram", "attachment": true, - "reasoning": 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", "pdf"], "output": ["text"] }, + "release_date": "2025-02-27", + "last_updated": "2025-02-27", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai", "api": "https://zenmux.ai/api/v1" } + "limit": { + "context": 150, + "output": 0 + } }, - "x-ai/grok-4-fast": { - "id": "x-ai/grok-4-fast", - "name": "Grok 4 Fast", + "trytako/tako": { + "id": "trytako/tako", + "name": "Tako", + "family": "tako", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 64000 } + "limit": { + "context": 2048, + "output": 0 + } }, - "x-ai/grok-4.1-fast": { - "id": "x-ai/grok-4.1-fast", - "name": "Grok 4.1 Fast", + "poetools/claude-code": { + "id": "poetools/claude-code", + "name": "claude-code", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-11-27", + "last_updated": "2025-11-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 64000 } + "limit": { + "context": 0, + "output": 0 + } }, - "x-ai/grok-4": { - "id": "x-ai/grok-4", - "name": "Grok 4", + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-12-01", + "release_date": "2026-04-08", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 4.5455, + "output": 27.2727, + "cache_read": 0.4545 + } }, - "x-ai/grok-code-fast-1": { - "id": "x-ai/grok-code-fast-1", - "name": "Grok Code Fast 1", - "attachment": false, + "openai/gpt-5.5-pro": { + "id": "openai/gpt-5.5-pro", + "name": "GPT-5.5-Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": false, + "temperature": false, + "knowledge": "2025-12-01", + "release_date": "2026-04-08", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 64000 } - }, - "x-ai/grok-4.1-fast-non-reasoning": { - "id": "x-ai/grok-4.1-fast-non-reasoning", - "name": "Grok 4.1 Fast Non Reasoning", - "attachment": true, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 27.2727, + "output": 163.6364 + } + } + } + }, + "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": { + "mistral-nemo": { + "id": "mistral-nemo", + "name": "Mistral Nemo", + "family": "mistral-nemo", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 64000 } + "limit": { + "context": 128000, + "output": 16400 + }, + "cost": { + "input": 20, + "output": 40 + } }, - "x-ai/grok-4.2-fast": { - "id": "x-ai/grok-4.2-fast", - "name": "Grok 4.2 Fast", - "attachment": true, + "grok-4-1-fast-reasoning": { + "id": "grok-4-1-fast-reasoning", + "name": "xAI Grok 4.1 Fast Reasoning", + "family": "grok", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-11-17", + "last_updated": "2025-11-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 9 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 0.19999999999999998, + "output": 0.5, + "cache_read": 0.049999999999999996 + } }, - "x-ai/grok-4.2-fast-non-reasoning": { - "id": "x-ai/grok-4.2-fast-non-reasoning", - "name": "Grok 4.2 Fast Non Reasoning", - "attachment": true, + "gemma2-9b-it": { + "id": "gemma2-9b-it", + "name": "Google Gemma 2", + "family": "gemma", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-25", + "last_updated": "2024-06-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 9 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.01, + "output": 0.03 + } }, - "anthropic/claude-opus-4.6": { - "id": "anthropic/claude-opus-4.6", - "name": "Claude Opus 4.6", - "attachment": true, - "reasoning": true, + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Meta Llama 3.3 70B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-06", - "last_updated": "2026-02-06", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 128000, + "output": 16400 + }, + "cost": { + "input": 0.13, + "output": 0.39 + } }, - "anthropic/claude-haiku-4.5": { - "id": "anthropic/claude-haiku-4.5", - "name": "Claude Haiku 4.5", - "attachment": true, + "llama-4-scout": { + "id": "llama-4-scout", + "name": "Meta Llama 4 Scout 17B 16E", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.08, + "output": 0.3 + } }, - "anthropic/claude-opus-4.1": { - "id": "anthropic/claude-opus-4.1", - "name": "Claude Opus 4.1", - "attachment": true, - "reasoning": true, + "chatgpt-4o-latest": { + "id": "chatgpt-4o-latest", + "name": "OpenAI ChatGPT-4o", + "family": "gpt", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["image", "text", "pdf"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-08-14", + "last_updated": "2024-08-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 5, + "output": 20, + "cache_read": 2.5 + } }, - "anthropic/claude-3.7-sonnet": { - "id": "anthropic/claude-3.7-sonnet", - "name": "Claude 3.7 Sonnet", - "attachment": true, - "reasoning": true, + "claude-3.5-sonnet-v2": { + "id": "claude-3.5-sonnet-v2", + "name": "Anthropic: Claude 3.5 Sonnet v2", + "family": "claude-sonnet", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.30000000000000004, + "cache_write": 3.75 + } }, - "anthropic/claude-sonnet-4.6": { - "id": "anthropic/claude-sonnet-4.6", - "name": "Claude Sonnet 4.6", - "attachment": true, - "reasoning": true, + "hermes-2-pro-llama-3-8b": { + "id": "hermes-2-pro-llama-3-8b", + "name": "Hermes 2 Pro Llama 3 8B", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-18", - "last_updated": "2026-02-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-05", + "release_date": "2024-05-27", + "last_updated": "2024-05-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.14, + "output": 0.14 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude Sonnet 4", - "attachment": true, - "reasoning": true, + "claude-3.7-sonnet": { + "id": "claude-3.7-sonnet", + "name": "Anthropic: Claude 3.7 Sonnet", + "family": "claude-sonnet", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["image", "text", "pdf"], "output": ["text"] }, + "knowledge": "2025-02", + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.30000000000000004, + "cache_write": 3.75 + } }, - "anthropic/claude-3.5-haiku": { - "id": "anthropic/claude-3.5-haiku", - "name": "Claude 3.5 Haiku", - "attachment": true, + "llama-prompt-guard-2-22m": { + "id": "llama-prompt-guard-2-22m", + "name": "Meta Llama Prompt Guard 2 22M", + "family": "llama", + "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2024-11-04", - "last_updated": "2024-11-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 512, + "output": 2 + }, + "cost": { + "input": 0.01, + "output": 0.01 + } }, - "anthropic/claude-opus-4.5": { - "id": "anthropic/claude-opus-4.5", - "name": "Claude Opus 4.5", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["pdf", "image", "text"], "output": ["text"] }, + "o1-mini": { + "id": "o1-mini", + "name": "OpenAI: o1-mini", + "family": "o-mini", + "attachment": false, + "reasoning": false, + "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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "anthropic/claude-sonnet-4.5": { - "id": "anthropic/claude-sonnet-4.5", - "name": "Claude Sonnet 4.5", - "attachment": true, - "reasoning": true, + "gpt-4.1-mini-2025-04-14": { + "id": "gpt-4.1-mini-2025-04-14", + "name": "OpenAI GPT-4.1 Mini", + "family": "gpt-mini", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.39999999999999997, + "output": 1.5999999999999999, + "cache_read": 0.09999999999999999 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Claude Opus 4", - "attachment": true, + "deepseek-r1-distill-llama-70b": { + "id": "deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["image", "text", "pdf"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.03, + "output": 0.13 + } }, - "volcengine/doubao-seed-2.0-lite": { - "id": "volcengine/doubao-seed-2.0-lite", - "name": "Doubao-Seed-2.0-lite", - "attachment": true, + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3 32B", + "family": "qwen", + "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-04-28", + "last_updated": "2025-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.09, "output": 0.51, "cache_read": 0.02, "cache_write": 0.0024 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 131072, + "output": 40960 + }, + "cost": { + "input": 0.29, + "output": 0.59 + } }, - "volcengine/doubao-seed-2.0-mini": { - "id": "volcengine/doubao-seed-2.0-mini", - "name": "Doubao-Seed-2.0-mini", - "attachment": true, - "reasoning": true, + "llama-3.3-70b-versatile": { + "id": "llama-3.3-70b-versatile", + "name": "Meta Llama 3.3 70B Versatile", + "family": "llama", + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2024-12", + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.03, "output": 0.28, "cache_read": 0.01, "cache_write": 0.0024 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 131072, + "output": 32678 + }, + "cost": { + "input": 0.59, + "output": 0.7899999999999999 + } }, - "volcengine/doubao-seed-2.0-pro": { - "id": "volcengine/doubao-seed-2.0-pro", - "name": "Doubao-Seed-2.0-pro", - "attachment": true, - "reasoning": true, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "OpenAI GPT-5 Mini", + "family": "gpt-mini", + "attachment": false, + "reasoning": false, "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"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.45, "output": 2.24, "cache_read": 0.09, "cache_write": 0.0024 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.024999999999999998 + } }, - "volcengine/doubao-seed-2.0-code": { - "id": "volcengine/doubao-seed-2.0-code", - "name": "Doubao Seed 2.0 Code", - "attachment": true, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "OpenAI GPT-5 Nano", + "family": "gpt-nano", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.9, "output": 4.48 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.049999999999999996, + "output": 0.39999999999999997, + "cache_read": 0.005 + } }, - "volcengine/doubao-seed-1.8": { - "id": "volcengine/doubao-seed-1.8", - "name": "Doubao-Seed-1.8", - "attachment": true, + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "Google Gemini 3 Pro Preview", + "family": "gemini-pro", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.11, "output": 0.28, "cache_read": 0.02, "cache_write": 0.0024 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.19999999999999998 + } }, - "volcengine/doubao-seed-code": { - "id": "volcengine/doubao-seed-code", - "name": "Doubao-Seed-Code", - "attachment": true, - "reasoning": true, + "claude-3-haiku-20240307": { + "id": "claude-3-haiku-20240307", + "name": "Anthropic: Claude 3 Haiku", + "family": "claude-haiku", + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2024-03", + "release_date": "2024-03-07", + "last_updated": "2024-03-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.17, "output": 1.12, "cache_read": 0.03 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 0.25, + "output": 1.25, + "cache_read": 0.03, + "cache_write": 0.3 + } }, - "deepseek/deepseek-chat": { - "id": "deepseek/deepseek-chat", - "name": "DeepSeek-V3.2 (Non-thinking Mode)", + "llama-4-maverick": { + "id": "llama-4-maverick", + "name": "Meta Llama 4 Maverick 17B 128E", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 0.42, "cache_read": 0.03 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "deepseek/deepseek-v3.2-exp": { - "id": "deepseek/deepseek-v3.2-exp", - "name": "DeepSeek-V3.2-Exp", + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "Anthropic: Claude Sonnet 4.5 (20250929)", + "family": "claude-sonnet", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", + "knowledge": "2025-09", "release_date": "2025-09-29", "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.22, "output": 0.33 }, - "limit": { "context": 163000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.30000000000000004, + "cache_write": 3.75 + } }, - "deepseek/deepseek-v3.2": { - "id": "deepseek/deepseek-v3.2", - "name": "DeepSeek V3.2", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Google Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-05", - "last_updated": "2025-12-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 0.43 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.3125, + "cache_write": 1.25 + } }, - "z-ai/glm-4.7-flash-free": { - "id": "z-ai/glm-4.7-flash-free", - "name": "GLM 4.7 Flash (Free)", + "claude-4.5-opus": { + "id": "claude-4.5-opus", + "name": "Anthropic: Claude Opus 4.5", + "family": "claude-opus", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-11-24", + "last_updated": "2025-11-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "z-ai/glm-5-turbo": { - "id": "z-ai/glm-5-turbo", - "name": "GLM 5 Turbo", - "attachment": true, - "reasoning": true, + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "xAI Grok 4.1 Fast Non-Reasoning", + "family": "grok", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-11-17", + "last_updated": "2025-11-17", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.88, "output": 3.48 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.19999999999999998, + "output": 0.5, + "cache_read": 0.049999999999999996 + } }, - "z-ai/glm-4.5": { - "id": "z-ai/glm-4.5", - "name": "GLM 4.5", + "sonar-pro": { + "id": "sonar-pro", + "name": "Perplexity Sonar Pro", + "family": "sonar-pro", "attachment": false, - "reasoning": true, + "reasoning": false, + "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": 200000, + "output": 4096 + }, + "cost": { + "input": 3, + "output": 15 + } + }, + "mistral-large-2411": { + "id": "mistral-large-2411", + "name": "Mistral-Large", + "family": "mistral-large", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-24", + "last_updated": "2024-07-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 1.54, "cache_read": 0.07 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "z-ai/glm-4.7-flashx": { - "id": "z-ai/glm-4.7-flashx", - "name": "GLM 4.7 FlashX", + "o3-pro": { + "id": "o3-pro", + "name": "OpenAI o3 Pro", + "family": "o-pro", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.42, "cache_read": 0.01 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 20, + "output": 80 + } }, - "z-ai/glm-4.6": { - "id": "z-ai/glm-4.6", - "name": "GLM 4.6", + "claude-opus-4-1": { + "id": "claude-opus-4-1", + "name": "Anthropic: Claude Opus 4.1", + "family": "claude-opus", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-08", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 1.54, "cache_read": 0.07 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "z-ai/glm-4.6v": { - "id": "z-ai/glm-4.6v", - "name": "GLM 4.6V", - "attachment": true, - "reasoning": true, + "gpt-4o-mini": { + "id": "gpt-4o-mini", + "name": "OpenAI GPT-4o-mini", + "family": "gpt-mini", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.42, "cache_read": 0.03 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.075 + } }, - "z-ai/glm-5": { - "id": "z-ai/glm-5", - "name": "GLM 5", + "claude-4.5-haiku": { + "id": "claude-4.5-haiku", + "name": "Anthropic: Claude 4.5 Haiku", + "family": "claude-haiku", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.58, "output": 2.6, "cache_read": 0.14 }, - "limit": { "context": 200000, "output": 128000 } + "knowledge": "2025-10", + "release_date": "2025-10-01", + "last_updated": "2025-10-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.09999999999999999, + "cache_write": 1.25 + } }, - "z-ai/glm-4.5-air": { - "id": "z-ai/glm-4.5-air", - "name": "GLM 4.5 Air", + "kimi-k2-0711": { + "id": "kimi-k2-0711", + "name": "Kimi K2 (07/11)", + "family": "kimi", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.11, "output": 0.56, "cache_read": 0.02 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.5700000000000001, + "output": 2.3 + } }, - "z-ai/glm-4.7": { - "id": "z-ai/glm-4.7", - "name": "GLM 4.7", + "o4-mini": { + "id": "o4-mini", + "name": "OpenAI o4 Mini", + "family": "o-mini", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 1.14, "cache_read": 0.06 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.275 + } }, - "z-ai/glm-4.6v-flash-free": { - "id": "z-ai/glm-4.6v-flash-free", - "name": "GLM 4.6V Flash (Free)", - "attachment": true, + "sonar-deep-research": { + "id": "sonar-deep-research", + "name": "Perplexity Sonar Deep Research", + "family": "sonar-deep-research", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-27", + "last_updated": "2025-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 127000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 8 + } }, - "z-ai/glm-4.6v-flash": { - "id": "z-ai/glm-4.6v-flash", - "name": "GLM 4.6V FlashX", - "attachment": true, - "reasoning": true, - "tool_call": true, + "gemma-3-12b-it": { + "id": "gemma-3-12b-it", + "name": "Google Gemma 3 12B", + "family": "gemma", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.02, "output": 0.21, "cache_read": 0.0043 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.049999999999999996, + "output": 0.09999999999999999 + } }, - "inclusionai/ring-1t": { - "id": "inclusionai/ring-1t", - "name": "Ring-1T", + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Google Gemini 2.5 Flash", + "family": "gemini-flash", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-10-12", - "last_updated": "2025-10-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-06-17", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.56, "output": 2.24, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.075, + "cache_write": 0.3 + } }, - "inclusionai/ling-1t": { - "id": "inclusionai/ling-1t", - "name": "Ling-1T", + "deepseek-tng-r1t2-chimera": { + "id": "deepseek-tng-r1t2-chimera", + "name": "DeepSeek TNG R1T2 Chimera", + "family": "deepseek-thinking", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-10-09", - "last_updated": "2025-10-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-07-02", + "last_updated": "2025-07-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.56, "output": 2.24, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 130000, + "output": 163840 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "google/gemini-2.5-flash-lite": { - "id": "google/gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "attachment": true, + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "OpenAI: GPT-5.1 Codex Mini", + "family": "gpt-codex", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-07-22", - "last_updated": "2025-07-22", - "modalities": { "input": ["pdf", "image", "text", "audio"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03, "cache_write": 1 }, - "limit": { "context": 1048000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.024999999999999998 + } }, - "google/gemini-3.1-pro-preview": { - "id": "google/gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "attachment": true, + "claude-sonnet-4": { + "id": "claude-sonnet-4", + "name": "Anthropic: Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2026-02-19", - "release_date": "2026-02-19", - "last_updated": "2026-02-19", - "modalities": { "input": ["text", "image", "pdf", "audio", "video"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-05-14", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2, "cache_write": 4.5 }, - "limit": { "context": 1048000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.30000000000000004, + "cache_write": 3.75 + } }, - "google/gemini-3-pro-preview": { - "id": "google/gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "attachment": true, - "reasoning": true, + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "xAI Grok Code Fast 1", + "family": "grok", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image", "pdf", "audio", "video"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-08-25", + "last_updated": "2024-08-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2, "cache_write": 4.5 }, - "limit": { "context": 1048000, "output": 64000 } + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.19999999999999998, + "output": 1.5, + "cache_read": 0.02 + } }, - "google/gemini-3-flash-preview": { - "id": "google/gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "attachment": true, - "reasoning": true, + "gpt-5.1": { + "id": "gpt-5.1", + "name": "OpenAI GPT-5.1", + "family": "gpt", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text", "image", "pdf", "audio"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05, "cache_write": 1 }, - "limit": { "context": 1048000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12500000000000003 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "attachment": true, - "reasoning": true, - "tool_call": true, + "deepseek-reasoner": { + "id": "deepseek-reasoner", + "name": "DeepSeek Reasoner", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["pdf", "image", "text", "audio", "video"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31, "cache_write": 4.5 }, - "limit": { "context": 1048000, "output": 64000 } + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.56, + "output": 1.68, + "cache_read": 0.07 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "attachment": true, + "grok-4-fast-reasoning": { + "id": "grok-4-fast-reasoning", + "name": "xAI: Grok 4 Fast Reasoning", + "family": "grok", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["pdf", "image", "text", "audio"], "output": ["text"] }, + "knowledge": "2025-09", + "release_date": "2025-09-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.07, "cache_write": 1 }, - "limit": { "context": 1048000, "output": 64000 } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 0.19999999999999998, + "output": 0.5, + "cache_read": 0.049999999999999996 + } }, - "google/gemini-3.1-flash-lite-preview": { - "id": "google/gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite Preview", - "attachment": true, + "o1": { + "id": "o1", + "name": "OpenAI: o1", + "family": "o", + "attachment": false, + "reasoning": false, + "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": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } + }, + "llama-3.1-8b-instant": { + "id": "llama-3.1-8b-instant", + "name": "Meta Llama 3.1 8B Instant", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-03-20", - "last_updated": "2025-03-20", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1.5 }, - "limit": { "context": 1050000, "output": 65530 } + "limit": { + "context": 131072, + "output": 32678 + }, + "cost": { + "input": 0.049999999999999996, + "output": 0.08 + } }, - "baidu/ernie-5.0-thinking-preview": { - "id": "baidu/ernie-5.0-thinking-preview", - "name": "ERNIE 5.0", - "attachment": true, - "reasoning": true, + "o3-mini": { + "id": "o3-mini", + "name": "OpenAI o3 Mini", + "family": "o-mini", + "attachment": false, + "reasoning": false, "tool_call": true, + "temperature": false, + "knowledge": "2023-10", + "release_date": "2023-10-01", + "last_updated": "2023-10-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } + }, + "sonar": { + "id": "sonar", + "name": "Perplexity Sonar", + "family": "sonar", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-01-22", - "last_updated": "2026-01-22", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-27", + "last_updated": "2025-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.84, "output": 3.37 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 127000, + "output": 4096 + }, + "cost": { + "input": 1, + "output": 1 + } }, - "minimax/minimax-m2.5-lightning": { - "id": "minimax/minimax-m2.5-lightning", - "name": "MiniMax M2.5 highspeed", + "kimi-k2-0905": { + "id": "kimi-k2-0905", + "name": "Kimi K2 (09/05)", + "family": "kimi", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-09", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 4.8, "cache_read": 0.06, "cache_write": 0.75 }, - "limit": { "context": 204800, "output": 131072 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.5, + "output": 2, + "cache_read": 0.39999999999999997 + } }, - "minimax/minimax-m2": { - "id": "minimax/minimax-m2", - "name": "MiniMax M2", + "mistral-small": { + "id": "mistral-small", + "name": "Mistral Small", + "family": "mistral-small", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-02", + "release_date": "2024-02-26", + "last_updated": "2024-02-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.38 }, - "limit": { "context": 204000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 75, + "output": 200 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "MiniMax M2.1", + "qwen3-30b-a3b": { + "id": "qwen3-30b-a3b", + "name": "Qwen3 30B A3B", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-06-01", + "last_updated": "2025-06-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.38 }, - "limit": { "context": 204000, "output": 64000 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 41000, + "output": 41000 + }, + "cost": { + "input": 0.08, + "output": 0.29 + } }, - "minimax/minimax-m2.7": { - "id": "minimax/minimax-m2.7", - "name": "MiniMax M2.7", - "attachment": true, - "reasoning": true, + "grok-4": { + "id": "grok-4", + "name": "xAI Grok 4", + "family": "grok", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-09", + "last_updated": "2024-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3055, "output": 1.2219 }, - "limit": { "context": 204800, "output": 131070 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "minimax/minimax-m2.7-highspeed": { - "id": "minimax/minimax-m2.7-highspeed", - "name": "MiniMax M2.7 highspeed", - "attachment": true, + "qwen3-235b-a22b-thinking": { + "id": "qwen3-235b-a22b-thinking", + "name": "Qwen3 235B A22B Thinking", + "family": "qwen", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.611, "output": 2.4439 }, - "limit": { "context": 204800, "output": 131070 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 262144, + "output": 81920 + }, + "cost": { + "input": 0.3, + "output": 2.9000000000000004 + } }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "MiniMax M2.5", + "qwen2.5-coder-7b-fast": { + "id": "qwen2.5-coder-7b-fast", + "name": "Qwen2.5 Coder 7B fast", + "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2024-09-15", + "last_updated": "2024-09-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 }, - "provider": { "npm": "@ai-sdk/anthropic", "api": "https://zenmux.ai/api/anthropic/v1" } + "limit": { + "context": 32000, + "output": 8192 + }, + "cost": { + "input": 0.03, + "output": 0.09 + } }, - "qwen/qwen3.5-plus": { - "id": "qwen/qwen3.5-plus", - "name": "Qwen3.5 Plus", - "attachment": true, - "reasoning": true, + "llama-3.1-8b-instruct-turbo": { + "id": "llama-3.1-8b-instruct-turbo", + "name": "Meta Llama 3.1 8B Instruct Turbo", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4.8 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.02, + "output": 0.03 + } }, - "qwen/qwen3-coder-plus": { - "id": "qwen/qwen3-coder-plus", - "name": "Qwen3-Coder-Plus", + "qwen3-next-80b-a3b-instruct": { + "id": "qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 262000, + "output": 16384 + }, + "cost": { + "input": 0.14, + "output": 1.4 + } }, - "qwen/qwen3-max": { - "id": "qwen/qwen3-max", - "name": "Qwen3-Max-Thinking", + "glm-4.6": { + "id": "glm-4.6", + "name": "Zai GLM-4.6", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-01-23", - "last_updated": "2026-01-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 6 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.44999999999999996, + "output": 1.5 + } }, - "qwen/qwen3.5-flash": { - "id": "qwen/qwen3.5-flash", - "name": "Qwen3.5 Flash", - "attachment": true, + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "OpenAI: GPT-5 Codex", + "family": "gpt-codex", + "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1020000, "output": 1020000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12500000000000003 + } }, - "xiaomi/mimo-v2-flash-free": { - "id": "xiaomi/mimo-v2-flash-free", - "name": "MiMo-V2-Flash Free", + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "Anthropic: Claude Opus 4.1 (20250805)", + "family": "claude-opus", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-08", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 262000, "output": 64000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "xiaomi/mimo-v2-pro": { - "id": "xiaomi/mimo-v2-pro", - "name": "MiMo V2 Pro", - "attachment": true, - "reasoning": true, + "gpt-5.1-chat-latest": { + "id": "gpt-5.1-chat-latest", + "name": "OpenAI GPT-5.1 Chat", + "family": "gpt-codex", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 4.5 }, - "limit": { "context": 1000000, "output": 256000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12500000000000003 + } }, - "xiaomi/mimo-v2-omni": { - "id": "xiaomi/mimo-v2-omni", - "name": "MiMo V2 Omni", - "attachment": true, + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "Anthropic: Claude 4.5 Haiku (20251001)", + "family": "claude-haiku", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-03-20", - "last_updated": "2026-03-20", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-10", + "release_date": "2025-10-01", + "last_updated": "2025-10-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 265000, "output": 265000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.09999999999999999, + "cache_write": 1.25 + } }, - "xiaomi/mimo-v2-flash": { - "id": "xiaomi/mimo-v2-flash", - "name": "MiMo-V2-Flash", + "sonar-reasoning": { + "id": "sonar-reasoning", + "name": "Perplexity Sonar Reasoning", + "family": "sonar-reasoning", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01-27", + "last_updated": "2025-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01 }, - "limit": { "context": 262000, "output": 64000 } + "limit": { + "context": 127000, + "output": 4096 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "stepfun/step-3.5-flash-free": { - "id": "stepfun/step-3.5-flash-free", - "name": "Step 3.5 Flash (Free)", + "claude-opus-4": { + "id": "claude-opus-4", + "name": "Anthropic: Claude Opus 4", + "family": "claude-opus", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-02", - "last_updated": "2026-02-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-05-14", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "stepfun/step-3": { - "id": "stepfun/step-3", - "name": "Step-3", - "attachment": true, - "reasoning": true, - "tool_call": true, + "llama-prompt-guard-2-86m": { + "id": "llama-prompt-guard-2-86m", + "name": "Meta Llama Prompt Guard 2 86M", + "family": "llama", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-07-31", - "last_updated": "2025-07-31", - "modalities": { "input": ["image", "text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.21, "output": 0.57 }, - "limit": { "context": 65536, "output": 64000 } + "limit": { + "context": 512, + "output": 2 + }, + "cost": { + "input": 0.01, + "output": 0.01 + } }, - "stepfun/step-3.5-flash": { - "id": "stepfun/step-3.5-flash", - "name": "Step 3.5 Flash", + "gpt-4.1-nano": { + "id": "gpt-4.1-nano", + "name": "OpenAI GPT-4.1 Nano", + "family": "gpt-nano", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2026-02-02", - "last_updated": "2026-02-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cache_read": 0.024999999999999998 + } }, - "kuaishou/kat-coder-pro-v1-free": { - "id": "kuaishou/kat-coder-pro-v1-free", - "name": "KAT-Coder-Pro-V1 Free", + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3 Coder 30B A3B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-10-23", - "last_updated": "2025-10-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-07-31", + "last_updated": "2025-07-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.09999999999999999, + "output": 0.3 + } }, - "kuaishou/kat-coder-pro-v1": { - "id": "kuaishou/kat-coder-pro-v1", - "name": "KAT-Coder-Pro-V1", + "claude-3.5-haiku": { + "id": "claude-3.5-haiku", + "name": "Anthropic: Claude 3.5 Haiku", + "family": "claude-haiku", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-10-23", - "last_updated": "2025-10-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 0.7999999999999999, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", + "grok-3-mini": { + "id": "grok-3-mini", + "name": "xAI Grok 3 Mini", + "family": "grok", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262000, "output": 64000 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "cache_read": 0.075 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "attachment": true, - "reasoning": true, + "o3": { + "id": "o3", + "name": "OpenAI o3", + "family": "o", + "attachment": false, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": false, - "knowledge": "2025-01-01", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.58, "output": 3.02, "cache_read": 0.1 }, - "limit": { "context": 262000, "output": 64000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "Kimi K2 0905", + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-09-04", - "last_updated": "2025-09-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-09", + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262000, "output": 64000 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 0.41 + } }, - "moonshotai/kimi-k2-thinking-turbo": { - "id": "moonshotai/kimi-k2-thinking-turbo", - "name": "Kimi K2 Thinking Turbo", + "gpt-oss-20b": { + "id": "gpt-oss-20b", + "name": "OpenAI GPT-OSS 20b", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01-01", - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.15, "output": 8, "cache_read": 0.15 }, - "limit": { "context": 262000, "output": 64000 } - } - } - }, - "perplexity": { - "id": "perplexity", - "env": ["PERPLEXITY_API_KEY"], - "npm": "@ai-sdk/perplexity", - "name": "Perplexity", - "doc": "https://docs.perplexity.ai", - "models": { - "sonar-deep-research": { - "id": "sonar-deep-research", - "name": "Perplexity Sonar Deep Research", + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.049999999999999996, + "output": 0.19999999999999998 + } + }, + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "OpenAI: GPT-5 Pro", + "family": "gpt-pro", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": false, "knowledge": "2025-01", - "release_date": "2025-02-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "reasoning": 3 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "sonar": { - "id": "sonar", - "name": "Sonar", - "family": "sonar", + "llama-guard-4": { + "id": "llama-guard-4", + "name": "Meta Llama Guard 4 12B", + "family": "llama", "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, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 128000, "output": 4096 } - }, - "sonar-reasoning-pro": { - "id": "sonar-reasoning-pro", - "name": "Sonar Reasoning Pro", - "family": "sonar-reasoning", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 128000, "output": 4096 } - }, - "sonar-pro": { - "id": "sonar-pro", - "name": "Sonar Pro", - "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"] }, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 8192 } - } - } - }, - "privatemode-ai": { - "id": "privatemode-ai", - "env": ["PRIVATEMODE_API_KEY", "PRIVATEMODE_ENDPOINT"], - "npm": "@ai-sdk/openai-compatible", - "api": "http://localhost:8080/v1", - "name": "Privatemode AI", - "doc": "https://docs.privatemode.ai/api/overview", - "models": { - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "gpt-oss-120b", - "family": "gpt-oss", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-04", - "last_updated": "2025-08-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 131072, + "output": 1024 + }, + "cost": { + "input": 0.21, + "output": 0.21 + } }, - "qwen3-embedding-4b": { - "id": "qwen3-embedding-4b", - "name": "Qwen3-Embedding 4B", - "family": "qwen", + "gpt-4o": { + "id": "gpt-4o", + "name": "OpenAI GPT-4o", + "family": "gpt", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-06-06", - "last_updated": "2025-06-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32000, "output": 2560 } - }, - "whisper-large-v3": { - "id": "whisper-large-v3", - "name": "Whisper large-v3", - "family": "whisper", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "knowledge": "2023-09", - "release_date": "2023-09-01", - "last_updated": "2023-09-01", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 0, "output": 4096 } - }, - "gemma-3-27b": { - "id": "gemma-3-27b", - "name": "Gemma 3 27B", - "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2024-05", + "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": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "qwen3-coder-30b-a3b": { - "id": "qwen3-coder-30b-a3b", - "name": "Qwen3-Coder 30B-A3B", + "qwen3-vl-235b-a22b-instruct": { + "id": "qwen3-vl-235b-a22b-instruct", + "name": "Qwen3 VL 235B A22B Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } - } - } - }, - "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": { - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": true, - "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"] }, + "knowledge": "2025-09", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.3, + "output": 1.5 + } }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", - "attachment": true, + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "Google Gemini 2.5 Flash Lite", + "family": "gemini-flash-lite", + "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-07-22", + "last_updated": "2025-07-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cache_read": 0.024999999999999998, + "cache_write": 0.09999999999999999 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, - "reasoning": true, + "qwen3-coder": { + "id": "qwen3-coder", + "name": "Qwen3 Coder 480B A35B Instruct Turbo", + "family": "qwen", + "attachment": false, + "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"] }, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.22, + "output": 0.95 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT-5.1", + "gpt-5": { + "id": "gpt-5", + "name": "OpenAI GPT-5", "family": "gpt", - "attachment": true, - "reasoning": true, + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2025-01", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12500000000000003 + } }, - "anthropic/claude-opus-4-5": { - "id": "anthropic/claude-opus-4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", - "attachment": true, + "ernie-4.5-21b-a3b-thinking": { + "id": "ernie-4.5-21b-a3b-thinking", + "name": "Baidu Ernie 4.5 21B A3B Thinking", + "family": "ernie", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-03", + "release_date": "2025-03-16", + "last_updated": "2025-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 8000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "anthropic/claude-opus-4-6": { - "id": "anthropic/claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "OpenAI GPT-OSS 120b", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.04, + "output": 0.16 + } }, - "anthropic/claude-sonnet-4-6": { - "id": "anthropic/claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "gpt-5-chat-latest": { + "id": "gpt-5-chat-latest", + "name": "OpenAI GPT-5 Chat Latest", + "family": "gpt-codex", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-09", + "release_date": "2024-09-30", + "last_updated": "2024-09-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.12500000000000003 + } }, - "anthropic/claude-sonnet-4-5": { - "id": "anthropic/claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", + "claude-4.5-sonnet": { + "id": "claude-4.5-sonnet", + "name": "Anthropic: Claude Sonnet 4.5", "family": "claude-sonnet", - "attachment": true, + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07-31", + "knowledge": "2025-09", "release_date": "2025-09-29", "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.30000000000000004, + "cache_write": 3.75 + } }, - "anthropic/claude-haiku-4-5": { - "id": "anthropic/claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, - "reasoning": true, + "deepseek-v3": { + "id": "deepseek-v3", + "name": "DeepSeek V3", + "family": "deepseek", + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2024-12", + "release_date": "2024-12-26", + "last_updated": "2024-12-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.56, + "output": 1.68, + "cache_read": 0.07 + } }, - "xai/grok-4-1-fast-non-reasoning": { - "id": "xai/grok-4-1-fast-non-reasoning", - "name": "Grok 4.1 Fast (Non-Reasoning)", - "family": "grok", - "attachment": true, + "llama-3.1-8b-instruct": { + "id": "llama-3.1-8b-instruct", + "name": "Meta Llama 3.1 8B Instruct", + "family": "llama", + "attachment": false, "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"] }, + "knowledge": "2024-07", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.02, + "output": 0.049999999999999996 + } }, - "nvidia/nemotron-3-super-120b-a12b": { - "id": "nvidia/nemotron-3-super-120b-a12b", - "name": "Nemotron 3 Super 120B", - "family": "nemotron", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "OpenAI GPT-4.1", + "family": "gpt", "attachment": false, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0.25, "output": 2.5 }, - "limit": { "context": 1000000, "output": 32000 } + "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 + } }, - "google/gemini-3.1-pro-preview": { - "id": "google/gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2025-11", + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "limit": { + "context": 256000, + "output": 262144 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.48, + "output": 2 + } }, - "google/gemini-3-flash-preview": { - "id": "google/gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "OpenAI GPT-4.1 Mini", + "family": "gpt-mini", + "attachment": false, + "reasoning": false, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 0.5, - "output": 3, - "cache_read": 0.05, - "context_over_200k": { "input": 0.5, "output": 3, "cache_read": 0.05 } + "limit": { + "context": 1047576, + "output": 32768 }, - "limit": { "context": 1048576, "output": 65536 } + "cost": { + "input": 0.39999999999999997, + "output": 1.5999999999999999, + "cache_read": 0.09999999999999999 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", - "attachment": true, + "deepseek-v3.1-terminus": { + "id": "deepseek-v3.1-terminus", + "name": "DeepSeek V3.1 Terminus", + "family": "deepseek", + "attachment": false, "reasoning": true, "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.21600000000000003 + } + }, + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "OpenAI: GPT-5.1 Codex", + "family": "gpt-codex", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": false, "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, "cost": { "input": 1.25, "output": 10, - "cache_read": 0.125, - "context_over_200k": { "input": 2.5, "output": 15, "cache_read": 0.25 } - }, - "limit": { "context": 1048576, "output": 65536 } + "cache_read": 0.12500000000000003 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "grok-3": { + "id": "grok-3", + "name": "xAI Grok 3", + "family": "grok", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-06-01", + "last_updated": "2024-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.03 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "perplexity/sonar": { - "id": "perplexity/sonar", - "name": "Sonar", - "family": "sonar", + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "xAI Grok 4 Fast Non-Reasoning", + "family": "grok", "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"] }, + "knowledge": "2025-09", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 0.19999999999999998, + "output": 0.5, + "cache_read": 0.049999999999999996 + } + }, + "sonar-reasoning-pro": { + "id": "sonar-reasoning-pro", + "name": "Perplexity Sonar Reasoning Pro", + "family": "sonar-reasoning", + "attachment": false, + "reasoning": true, + "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, - "cost": { "input": 0.25, "output": 2.5, "cache_read": 0.0625 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 127000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 8 + } } } }, - "gitlab": { - "id": "gitlab", - "env": ["GITLAB_TOKEN"], - "npm": "gitlab-ai-provider", - "name": "GitLab Duo", - "doc": "https://docs.gitlab.com/user/duo_agent_platform/", + "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": { - "duo-chat-gpt-5-1": { - "id": "duo-chat-gpt-5-1", - "name": "Agentic Chat (GPT-5.1)", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": false, - "knowledge": "2024-09-30", - "release_date": "2026-01-22", - "last_updated": "2026-01-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } - }, - "duo-chat-gpt-5-2": { - "id": "duo-chat-gpt-5-2", - "name": "Agentic Chat (GPT-5.2)", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": false, - "knowledge": "2025-08-31", - "release_date": "2026-01-23", - "last_updated": "2026-01-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } - }, - "duo-chat-sonnet-4-6": { - "id": "duo-chat-sonnet-4-6", - "name": "Agentic Chat (Claude Sonnet 4.6)", - "family": "claude-sonnet", - "attachment": true, + "minimax-m2.7": { + "id": "minimax-m2.7", + "name": "minimax-m2.7", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 1000000, "output": 64000 } + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 196608 + } }, - "duo-chat-opus-4-6": { - "id": "duo-chat-opus-4-6", - "name": "Agentic Chat (Claude Opus 4.6)", - "family": "claude-opus", - "attachment": true, + "gpt-oss:20b": { + "id": "gpt-oss:20b", + "name": "gpt-oss:20b", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 1000000, "output": 64000 } + "release_date": "2025-08-05", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + } }, - "duo-chat-haiku-4-5": { - "id": "duo-chat-haiku-4-5", - "name": "Agentic Chat (Claude Haiku 4.5)", - "family": "claude-haiku", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "kimi-k2.5", + "family": "kimi", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-02-28", - "release_date": "2026-01-08", - "last_updated": "2026-01-08", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "duo-chat-gpt-5-codex": { - "id": "duo-chat-gpt-5-codex", - "name": "Agentic Chat (GPT-5 Codex)", - "family": "gpt-codex", + "glm-4.7": { + "id": "glm-4.7", + "name": "glm-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": false, - "knowledge": "2024-09-30", - "release_date": "2026-01-22", - "last_updated": "2026-01-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "release_date": "2025-12-22", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + } }, - "duo-chat-gpt-5-mini": { - "id": "duo-chat-gpt-5-mini", - "name": "Agentic Chat (GPT-5 Mini)", - "family": "gpt-mini", + "gemma4:31b": { + "id": "gemma4:31b", + "name": "gemma4:31b", + "family": "gemma", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": false, - "knowledge": "2024-05-30", - "release_date": "2026-01-22", - "last_updated": "2026-01-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "knowledge": "2025-01", + "release_date": "2026-04-02", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "duo-chat-gpt-5-2-codex": { - "id": "duo-chat-gpt-5-2-codex", - "name": "Agentic Chat (GPT-5.2 Codex)", - "family": "gpt-codex", - "attachment": true, + "gpt-oss:120b": { + "id": "gpt-oss:120b", + "name": "gpt-oss:120b", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": false, - "knowledge": "2025-08-31", - "release_date": "2026-01-22", - "last_updated": "2026-01-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "release_date": "2025-08-05", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + } }, - "duo-chat-gpt-5-4-mini": { - "id": "duo-chat-gpt-5-4-mini", - "name": "Agentic Chat (GPT-5.4 Mini)", - "family": "gpt-mini", + "qwen3.5:397b": { + "id": "qwen3.5:397b", + "name": "qwen3.5:397b", + "family": "qwen", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "interleaved": { + "field": "reasoning_details" + }, + "release_date": "2026-02-15", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + } }, - "duo-chat-gpt-5-3-codex": { - "id": "duo-chat-gpt-5-3-codex", - "name": "Agentic Chat (GPT-5.3 Codex)", - "family": "gpt-codex", - "attachment": true, + "deepseek-v3.1:671b": { + "id": "deepseek-v3.1:671b", + "name": "deepseek-v3.1:671b", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "release_date": "2025-08-21", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + } }, - "duo-chat-gpt-5-4-nano": { - "id": "duo-chat-gpt-5-4-nano", - "name": "Agentic Chat (GPT-5.4 Nano)", - "family": "gpt-nano", - "attachment": true, + "glm-5": { + "id": "glm-5", + "name": "glm-5", + "family": "glm", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "interleaved": { + "field": "reasoning_content" + }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + } }, - "duo-chat-gpt-5-4": { - "id": "duo-chat-gpt-5-4", - "name": "Agentic Chat (GPT-5.4)", - "family": "gpt", + "qwen3-vl:235b-instruct": { + "id": "qwen3-vl:235b-instruct", + "name": "qwen3-vl:235b-instruct", + "family": "qwen", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "release_date": "2025-09-22", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 131072 + } }, - "duo-chat-sonnet-4-5": { - "id": "duo-chat-sonnet-4-5", - "name": "Agentic Chat (Claude Sonnet 4.5)", - "family": "claude-sonnet", + "gemma3:4b": { + "id": "gemma3:4b", + "name": "gemma3:4b", + "family": "gemma", + "attachment": true, + "reasoning": false, + "tool_call": false, + "release_date": "2024-12-01", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + } + }, + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "gemini-3-flash-preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-07-31", - "release_date": "2026-01-08", - "last_updated": "2026-01-08", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-01", + "release_date": "2025-12-17", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1048576, + "output": 65536 + } }, - "duo-chat-opus-4-5": { - "id": "duo-chat-opus-4-5", - "name": "Agentic Chat (Claude Opus 4.5)", - "family": "claude-opus", + "ministral-3:14b": { + "id": "ministral-3:14b", + "name": "ministral-3:14b", + "family": "ministral", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2026-01-08", - "last_updated": "2026-01-08", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 64000 } - } - } - }, - "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.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", + "release_date": "2024-12-01", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 128000 + } + }, + "minimax-m2": { + "id": "minimax-m2", + "name": "minimax-m2", + "family": "minimax", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2025-08-31", - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2025-10-23", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 128000 + } }, - "gemini-3.1-pro-preview": { - "id": "gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", - "attachment": true, + "qwen3-next:80b": { + "id": "qwen3-next:80b", + "name": "qwen3-next:80b", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "release_date": "2025-09-15", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 1048576, "output": 65536 }, - "provider": { "npm": "@ai-sdk/openai-compatible" } + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", + "qwen3-vl:235b": { + "id": "qwen3-vl:235b", + "name": "qwen3-vl:235b", + "family": "qwen", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai-compatible" } + "release_date": "2025-09-22", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1 Codex Max", - "family": "gpt-codex", + "rnj-1:8b": { + "id": "rnj-1:8b", + "name": "rnj-1:8b", + "family": "rnj", "attachment": false, - "reasoning": 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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2025-12-06", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 4096 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", - "attachment": true, + "minimax-m2.1": { + "id": "minimax-m2.1", + "name": "minimax-m2.1", + "family": "minimax", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai-compatible" } + "release_date": "2025-12-23", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", + "glm-5.1": { + "id": "glm-5.1", + "name": "glm-5.1", "family": "glm", "attachment": false, "reasoning": true, "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"] }, + "interleaved": { + "field": "reasoning_content" + }, + "release_date": "2026-03-27", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 202752, "output": 131000 }, - "provider": { "npm": "@ai-sdk/openai-compatible" } + "limit": { + "context": 202752, + "output": 131072 + } }, - "gemini-3.1-flash-lite-preview": { - "id": "gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite Preview", - "family": "gemini-flash-lite", + "mistral-large-3:675b": { + "id": "mistral-large-3:675b", + "name": "mistral-large-3:675b", + "family": "mistral-large", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0.25, "output": 1.5, "cache_read": 0.025, "cache_write": 1 }, - "limit": { "context": 1048576, "output": 65536 }, - "provider": { "npm": "@ai-sdk/openai-compatible" } + "release_date": "2025-12-02", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek-V3.2", - "family": "deepseek", - "attachment": false, - "reasoning": true, + "ministral-3:8b": { + "id": "ministral-3:8b", + "name": "ministral-3:8b", + "family": "ministral", + "attachment": true, + "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 0.42 }, - "limit": { "context": 128000, "output": 128000 }, - "provider": { "npm": "@ai-sdk/openai-compatible" } + "limit": { + "context": 262144, + "output": 128000 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt-codex", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } - } - } - }, - "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": { - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3 Coder 30B A3B Instruct", + "gemma3:12b": { + "id": "gemma3:12b", + "name": "gemma3:12b", + "family": "gemma", + "attachment": true, + "reasoning": false, + "tool_call": false, + "release_date": "2024-12-01", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + } + }, + "qwen3-coder:480b": { + "id": "qwen3-coder:480b", + "name": "qwen3-coder:480b", "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": false, - "cost": { "input": 0.09999999999999999, "output": 0.3 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-07-22", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + } }, - "gemini-2.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "Google Gemini 2.5 Flash Lite", - "family": "gemini-flash-lite", + "nemotron-3-nano:30b": { + "id": "nemotron-3-nano:30b", + "name": "nemotron-3-nano:30b", + "family": "nemotron", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-22", - "last_updated": "2025-07-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 0.09999999999999999, - "output": 0.39999999999999997, - "cache_read": 0.024999999999999998, - "cache_write": 0.09999999999999999 + "release_date": "2025-12-15", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 1048576, "output": 65535 } + "open_weights": true, + "limit": { + "context": 1048576, + "output": 131072 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "OpenAI: GPT-5.1 Codex Mini", - "family": "gpt-codex", + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "deepseek-v4-flash", + "family": "deepseek-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.024999999999999998 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1048576, + "output": 1048576 + } }, - "llama-3.3-70b-versatile": { - "id": "llama-3.3-70b-versatile", - "name": "Meta Llama 3.3 70B Versatile", - "family": "llama", + "glm-4.6": { + "id": "glm-4.6", + "name": "glm-4.6", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.59, "output": 0.7899999999999999 }, - "limit": { "context": 131072, "output": 32678 } + "release_date": "2025-09-29", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + } }, - "claude-4.5-opus": { - "id": "claude-4.5-opus", - "name": "Anthropic: Claude Opus 4.5", - "family": "claude-opus", - "attachment": false, + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "kimi-k2.6", + "family": "kimi", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "hermes-2-pro-llama-3-8b": { - "id": "hermes-2-pro-llama-3-8b", - "name": "Hermes 2 Pro Llama 3 8B", - "family": "llama", + "ministral-3:3b": { + "id": "ministral-3:3b", + "name": "ministral-3:3b", + "family": "ministral", + "attachment": true, + "reasoning": false, + "tool_call": true, + "release_date": "2024-10-22", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 128000 + } + }, + "gemma3:27b": { + "id": "gemma3:27b", + "name": "gemma3:27b", + "family": "gemma", + "attachment": true, + "reasoning": false, + "tool_call": false, + "release_date": "2025-07-27", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + } + }, + "devstral-2:123b": { + "id": "devstral-2:123b", + "name": "devstral-2:123b", + "family": "devstral", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-05", - "release_date": "2024-05-27", - "last_updated": "2024-05-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.14 }, - "limit": { "context": 131072, "output": 131072 } + "release_date": "2025-12-09", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "OpenAI o3 Mini", - "family": "o-mini", + "cogito-2.1:671b": { + "id": "cogito-2.1:671b", + "name": "cogito-2.1:671b", + "family": "cogito", + "attachment": false, + "reasoning": true, + "tool_call": true, + "release_date": "2025-11-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 32000 + } + }, + "qwen3-coder-next": { + "id": "qwen3-coder-next", + "name": "qwen3-coder-next", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2023-10", - "release_date": "2023-10-01", - "last_updated": "2023-10-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } + "release_date": "2026-02-02", + "last_updated": "2026-02-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + } }, - "deepseek-v3.1-terminus": { - "id": "deepseek-v3.1-terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", + "nemotron-3-super": { + "id": "nemotron-3-super", + "name": "nemotron-3-super", + "family": "nemotron", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.27, "output": 1, "cache_read": 0.21600000000000003 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2026-03-11", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + } }, - "deepseek-r1-distill-llama-70b": { - "id": "deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill Llama 70B", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "deepseek-v4-pro", "family": "deepseek-thinking", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.03, "output": 0.13 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1048576, + "output": 1048576 + } }, - "sonar-reasoning": { - "id": "sonar-reasoning", - "name": "Perplexity Sonar Reasoning", - "family": "sonar-reasoning", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "minimax-m2.5", + "family": "minimax", "attachment": false, "reasoning": true, - "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, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 127000, "output": 4096 } - }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "OpenAI: GPT-5 Pro", - "family": "gpt-pro", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, + "tool_call": true, "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 128000, "output": 32768 } + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + } }, - "qwen3-vl-235b-a22b-instruct": { - "id": "qwen3-vl-235b-a22b-instruct", - "name": "Qwen3 VL 235B A22B Instruct", - "family": "qwen", + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "deepseek-v3.2", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 256000, "output": 16384 } + "release_date": "2025-06-15", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + } }, "kimi-k2-thinking": { "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", + "name": "kimi-k2-thinking", "family": "kimi-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-11", + "knowledge": "2024-08", "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.48, "output": 2 }, - "limit": { "context": 256000, "output": 262144 } + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "kimi-k2-0711": { - "id": "kimi-k2-0711", - "name": "Kimi K2 (07/11)", - "family": "kimi", - "attachment": false, + "devstral-small-2:24b": { + "id": "devstral-small-2:24b", + "name": "devstral-small-2:24b", + "family": "devstral", + "attachment": true, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5700000000000001, "output": 2.3 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2025-12-09", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "OpenAI GPT-5", - "family": "gpt", + "kimi-k2:1t": { + "id": "kimi-k2:1t", + "name": "kimi-k2:1t", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12500000000000003 }, - "limit": { "context": 400000, "output": 128000 } - }, - "llama-3.3-70b-instruct": { - "id": "llama-3.3-70b-instruct", - "name": "Meta Llama 3.3 70B Instruct", - "family": "llama", + "knowledge": "2024-10", + "release_date": "2025-07-11", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } + } + } + }, + "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-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.13, "output": 0.39 }, - "limit": { "context": 128000, "output": 16400 } + "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 + } }, - "chatgpt-4o-latest": { - "id": "chatgpt-4o-latest", - "name": "OpenAI ChatGPT-4o", - "family": "gpt", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-14", - "last_updated": "2024-08-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 20, "cache_read": 2.5 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "deepseek-v3": { - "id": "deepseek-v3", - "name": "DeepSeek V3", - "family": "deepseek", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM-4.5-Air", + "family": "glm-air", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.56, "output": 1.68, "cache_read": 0.07 }, - "limit": { "context": 128000, "output": 8192 } - }, - "gemma2-9b-it": { - "id": "gemma2-9b-it", - "name": "Google Gemma 2", - "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, - "cost": { "input": 0.01, "output": 0.03 }, - "limit": { "context": 8192, "output": 8192 } + "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, + "cache_read": 0, + "cache_write": 0 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Google Gemini 3 Pro Preview", - "family": "gemini-pro", + "glm-5-turbo": { + "id": "glm-5-turbo", + "name": "GLM-5-Turbo", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.19999999999999998 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "OpenAI GPT-4o", - "family": "gpt", - "attachment": false, - "reasoning": false, + "glm-5v-turbo": { + "id": "glm-5v-turbo", + "name": "GLM-5V-Turbo", + "family": "glm", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-05", - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } - }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "xAI Grok 4 Fast Non-Reasoning", - "family": "grok", + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "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": { + "openai.gpt-oss-safeguard-120b": { + "id": "openai.gpt-oss-safeguard-120b", + "name": "GPT OSS Safeguard 120B", + "family": "gpt-oss", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.19999999999999998, "output": 0.5, "cache_read": 0.049999999999999996 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "grok-4": { - "id": "grok-4", - "name": "xAI Grok 4", - "family": "grok", + "nvidia.nemotron-nano-3-30b": { + "id": "nvidia.nemotron-nano-3-30b", + "name": "NVIDIA Nemotron Nano 3 30B", + "family": "nemotron", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 256000 } + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.06, + "output": 0.24 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "xAI Grok Code Fast 1", - "family": "grok", + "nvidia.nemotron-super-3-120b": { + "id": "nvidia.nemotron-super-3-120b", + "name": "NVIDIA Nemotron 3 Super 120B A12B", + "family": "nemotron", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-25", - "last_updated": "2024-08-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.19999999999999998, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "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 + } }, - "kimi-k2-0905": { - "id": "kimi-k2-0905", - "name": "Kimi K2 (09/05)", - "family": "kimi", + "writer.palmyra-x5-v1:0": { + "id": "writer.palmyra-x5-v1:0", + "name": "Palmyra X5", + "family": "palmyra", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.5, "output": 2, "cache_read": 0.39999999999999997 }, - "limit": { "context": 262144, "output": 16384 } - }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "OpenAI GPT-5 Mini", - "family": "gpt-mini", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-04-28", + "last_updated": "2025-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.024999999999999998 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 1040000, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 6 + } }, - "mistral-large-2411": { - "id": "mistral-large-2411", - "name": "Mistral-Large", - "family": "mistral-large", + "mistral.ministral-3-8b-instruct": { + "id": "mistral.ministral-3-8b-instruct", + "name": "Ministral 3 8B", + "family": "ministral", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-24", - "last_updated": "2024-07-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "ernie-4.5-21b-a3b-thinking": { - "id": "ernie-4.5-21b-a3b-thinking", - "name": "Baidu Ernie 4.5 21B A3B Thinking", - "family": "ernie", - "attachment": false, + "au.anthropic.claude-opus-4-6-v1": { + "id": "au.anthropic.claude-opus-4-6-v1", + "name": "AU Anthropic Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-03-16", - "last_updated": "2025-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 128000, "output": 8000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 16.5, + "output": 82.5, + "cache_read": 1.65, + "cache_write": 20.625 + } }, - "llama-guard-4": { - "id": "llama-guard-4", - "name": "Meta Llama Guard 4 12B", - "family": "llama", + "mistral.ministral-3-3b-instruct": { + "id": "mistral.ministral-3-3b-instruct", + "name": "Ministral 3 3B", + "family": "ministral", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.21, "output": 0.21 }, - "limit": { "context": 131072, "output": 1024 } + "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 + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "Anthropic: Claude Sonnet 4.5 (20250929)", + "anthropic.claude-sonnet-4-5-20250929-v1:0": { + "id": "anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5", "family": "claude-sonnet", - "attachment": false, + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-09", + "knowledge": "2025-07-31", "release_date": "2025-09-29", "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.30000000000000004, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "gpt-4o-mini": { - "id": "gpt-4o-mini", - "name": "OpenAI GPT-4o-mini", - "family": "gpt-mini", + "mistral.devstral-2-123b": { + "id": "mistral.devstral-2-123b", + "name": "Devstral 2 123B", + "family": "devstral", "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", "image"], "output": ["text"] }, + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.4, + "output": 2 + } + }, + "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)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.075 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "qwen2.5-coder-7b-fast": { - "id": "qwen2.5-coder-7b-fast", - "name": "Qwen2.5 Coder 7B fast", - "family": "qwen", - "attachment": false, + "mistral.voxtral-small-24b-2507": { + "id": "mistral.voxtral-small-24b-2507", + "name": "Voxtral Small 24B 2507", + "family": "mistral", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-09-15", - "last_updated": "2024-09-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.03, "output": 0.09 }, - "limit": { "context": 32000, "output": 8192 } + "release_date": "2025-07-01", + "last_updated": "2025-07-01", + "modalities": { + "input": ["text", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.35 + } }, - "qwen3-30b-a3b": { - "id": "qwen3-30b-a3b", - "name": "Qwen3 30B A3B", - "family": "qwen", + "google.gemma-3-12b-it": { + "id": "google.gemma-3-12b-it", + "name": "Google Gemma 3 12B", + "family": "gemma", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, + "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.08, "output": 0.29 }, - "limit": { "context": 41000, "output": 41000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.049999999999999996, + "output": 0.09999999999999999 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "OpenAI GPT-4.1", - "family": "gpt", - "attachment": false, + "amazon.nova-pro-v1:0": { + "id": "amazon.nova-pro-v1:0", + "name": "Nova Pro", + "family": "nova-pro", + "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"] }, + "knowledge": "2024-10", + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 300000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 3.2, + "cache_read": 0.2 + } }, - "llama-3.1-8b-instruct": { - "id": "llama-3.1-8b-instruct", - "name": "Meta Llama 3.1 8B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "anthropic.claude-haiku-4-5-20251001-v1:0": { + "id": "anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.02, "output": 0.049999999999999996 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "gpt-5.1-chat-latest": { - "id": "gpt-5.1-chat-latest", - "name": "OpenAI GPT-5.1 Chat", - "family": "gpt-codex", + "minimax.minimax-m2": { + "id": "minimax.minimax-m2", + "name": "MiniMax M2", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, + "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": 204608, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "global.anthropic.claude-opus-4-7": { + "id": "global.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (Global)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "knowledge": "2026-01-31", + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12500000000000003 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "sonar-deep-research": { - "id": "sonar-deep-research", - "name": "Perplexity Sonar Deep Research", - "family": "sonar-deep-research", + "mistral.pixtral-large-2502-v1:0": { + "id": "mistral.pixtral-large-2502-v1:0", + "name": "Pixtral Large (25.02)", + "family": "mistral", "attachment": false, - "reasoning": true, - "tool_call": false, + "reasoning": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-27", - "last_updated": "2025-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-08", + "last_updated": "2025-04-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 127000, "output": 4096 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "sonar": { - "id": "sonar", - "name": "Perplexity Sonar", - "family": "sonar", - "attachment": false, + "meta.llama4-maverick-17b-instruct-v1:0": { + "id": "meta.llama4-maverick-17b-instruct-v1:0", + "name": "Llama 4 Maverick 17B Instruct", + "family": "llama", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-27", - "last_updated": "2025-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 127000, "output": 4096 } + "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 + }, + "cost": { + "input": 0.24, + "output": 0.97 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "OpenAI GPT-OSS 120b", - "family": "gpt-oss", - "attachment": false, + "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)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04, "output": 0.16 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "llama-4-scout": { - "id": "llama-4-scout", - "name": "Meta Llama 4 Scout 17B 16E", - "family": "llama", - "attachment": false, - "reasoning": false, + "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)", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "llama-prompt-guard-2-22m": { - "id": "llama-prompt-guard-2-22m", - "name": "Meta Llama Prompt Guard 2 22M", - "family": "llama", + "amazon.nova-micro-v1:0": { + "id": "amazon.nova-micro-v1:0", + "name": "Nova Micro", + "family": "nova-micro", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.01, "output": 0.01 }, - "limit": { "context": 512, "output": 2 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.035, + "output": 0.14, + "cache_read": 0.00875 + } }, - "qwen3-coder": { - "id": "qwen3-coder", - "name": "Qwen3 Coder 480B A35B Instruct Turbo", - "family": "qwen", - "attachment": false, - "reasoning": false, + "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)", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.22, "output": 0.95 }, - "limit": { "context": 262144, "output": 16384 } - }, - "o1": { - "id": "o1", - "name": "OpenAI: o1", - "family": "o", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "codex-mini-latest": { - "id": "codex-mini-latest", - "name": "OpenAI Codex Mini Latest", - "family": "gpt-codex-mini", + "openai.gpt-oss-20b-1:0": { + "id": "openai.gpt-oss-20b-1:0", + "name": "gpt-oss-20b", + "family": "gpt-oss", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": true, + "temperature": true, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.375 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.07, + "output": 0.3 + } }, - "o3": { - "id": "o3", - "name": "OpenAI o3", - "family": "o", + "zai.glm-5": { + "id": "zai.glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-06", - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "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": 202752, + "output": 101376 + }, + "cost": { + "input": 1, + "output": 3.2 + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "xAI Grok 4.1 Fast Non-Reasoning", - "family": "grok", + "qwen.qwen3-32b-v1:0": { + "id": "qwen.qwen3-32b-v1:0", + "name": "Qwen3 32B (dense)", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-17", - "last_updated": "2025-11-17", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.19999999999999998, "output": 0.5, "cache_read": 0.049999999999999996 }, - "limit": { "context": 2000000, "output": 30000 } + "knowledge": "2024-04", + "release_date": "2025-09-18", + "last_updated": "2025-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "sonar-reasoning-pro": { - "id": "sonar-reasoning-pro", - "name": "Perplexity Sonar Reasoning Pro", - "family": "sonar-reasoning", + "deepseek.v3.2": { + "id": "deepseek.v3.2", + "name": "DeepSeek-V3.2", + "family": "deepseek", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-27", - "last_updated": "2025-01-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 127000, "output": 4096 } + "knowledge": "2024-07", + "release_date": "2026-02-06", + "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 + } }, - "claude-3-haiku-20240307": { - "id": "claude-3-haiku-20240307", - "name": "Anthropic: Claude 3 Haiku", + "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)", "family": "claude-haiku", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-03-07", - "last_updated": "2024-03-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "llama-3.1-8b-instant": { - "id": "llama-3.1-8b-instant", - "name": "Meta Llama 3.1 8B Instant", - "family": "llama", + "zai.glm-4.7-flash": { + "id": "zai.glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + } + }, + "us.anthropic.claude-opus-4-7": { + "id": "us.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (US)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.049999999999999996, "output": 0.08 }, - "limit": { "context": 131072, "output": 32678 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "deepseek-reasoner": { - "id": "deepseek-reasoner", - "name": "DeepSeek Reasoner", - "family": "deepseek-thinking", + "amazon.nova-2-lite-v1:0": { + "id": "amazon.nova-2-lite-v1:0", + "name": "Nova 2 Lite", + "family": "nova", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.56, "output": 1.68, "cache_read": 0.07 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.33, + "output": 2.75 + } }, - "claude-3.5-sonnet-v2": { - "id": "claude-3.5-sonnet-v2", - "name": "Anthropic: Claude 3.5 Sonnet v2", - "family": "claude-sonnet", - "attachment": false, - "reasoning": false, + "anthropic.claude-opus-4-5-20251101-v1:0": { + "id": "anthropic.claude-opus-4-5-20251101-v1:0", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-11-24", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.30000000000000004, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "llama-4-maverick": { - "id": "llama-4-maverick", - "name": "Meta Llama 4 Maverick 17B 128E", - "family": "llama", + "qwen.qwen3-coder-480b-a35b-v1:0": { + "id": "qwen.qwen3-coder-480b-a35b-v1:0", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 8192 } + "knowledge": "2024-04", + "release_date": "2025-09-18", + "last_updated": "2025-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.22, + "output": 1.8 + } }, - "grok-3-mini": { - "id": "grok-3-mini", - "name": "xAI Grok 3 Mini", - "family": "grok", - "attachment": false, + "amazon.nova-lite-v1:0": { + "id": "amazon.nova-lite-v1:0", + "name": "Nova Lite", + "family": "nova-lite", + "attachment": true, "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"] }, + "knowledge": "2024-10", + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 300000, + "output": 8192 + }, + "cost": { + "input": 0.06, + "output": 0.24, + "cache_read": 0.015 + } }, - "gpt-4.1-mini-2025-04-14": { - "id": "gpt-4.1-mini-2025-04-14", - "name": "OpenAI GPT-4.1 Mini", - "family": "gpt-mini", + "meta.llama3-1-8b-instruct-v1:0": { + "id": "meta.llama3-1-8b-instruct-v1:0", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "attachment": false, "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, - "cost": { "input": 0.39999999999999997, "output": 1.5999999999999999, "cache_read": 0.09999999999999999 }, - "limit": { "context": 1047576, "output": 32768 } + "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 + }, + "cost": { + "input": 0.22, + "output": 0.22 + } }, - "claude-opus-4-1": { - "id": "claude-opus-4-1", - "name": "Anthropic: Claude Opus 4.1", + "anthropic.claude-opus-4-7": { + "id": "anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7", "family": "claude-opus", - "attachment": false, + "attachment": true, "reasoning": true, "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 + } + }, + "google.gemma-3-27b-it": { + "id": "google.gemma-3-27b-it", + "name": "Google Gemma 3 27B Instruct", + "family": "gemma", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": 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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2025-07", + "release_date": "2025-07-27", + "last_updated": "2025-07-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 8192 + }, + "cost": { + "input": 0.12, + "output": 0.2 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "Zai GLM-4.6", - "family": "glm", - "attachment": false, + "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)", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.44999999999999996, "output": 1.5 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "llama-3.1-8b-instruct-turbo": { - "id": "llama-3.1-8b-instruct-turbo", - "name": "Meta Llama 3.1 8B Instruct Turbo", - "family": "llama", + "google.gemma-3-4b-it": { + "id": "google.gemma-3-4b-it", + "name": "Gemma 3 4B IT", + "family": "gemma", "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"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.02, "output": 0.03 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.04, + "output": 0.08 + } }, - "claude-3.7-sonnet": { - "id": "claude-3.7-sonnet", - "name": "Anthropic: Claude 3.7 Sonnet", - "family": "claude-sonnet", - "attachment": false, + "meta.llama4-scout-17b-instruct-v1:0": { + "id": "meta.llama4-scout-17b-instruct-v1:0", + "name": "Llama 4 Scout 17B Instruct", + "family": "llama", + "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.30000000000000004, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2024-08", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 3500000, + "output": 16384 + }, + "cost": { + "input": 0.17, + "output": 0.66 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Google Gemini 2.5 Pro", - "family": "gemini-pro", + "deepseek.v3-v1:0": { + "id": "deepseek.v3-v1:0", + "name": "DeepSeek-V3.1", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": 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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.3125, "cache_write": 1.25 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2024-07", + "release_date": "2025-09-18", + "last_updated": "2025-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 81920 + }, + "cost": { + "input": 0.58, + "output": 1.68 + } }, - "qwen3-235b-a22b-thinking": { - "id": "qwen3-235b-a22b-thinking", - "name": "Qwen3 235B A22B Thinking", - "family": "qwen", + "mistral.magistral-small-2509": { + "id": "mistral.magistral-small-2509", + "name": "Magistral Small 1.2", + "family": "magistral", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.9000000000000004 }, - "limit": { "context": 262144, "output": 81920 } + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 40000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "Anthropic: Claude Opus 4.1 (20250805)", - "family": "claude-opus", + "qwen.qwen3-next-80b-a3b": { + "id": "qwen.qwen3-next-80b-a3b", + "name": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.14, + "output": 1.4 + } }, - "claude-sonnet-4": { - "id": "claude-sonnet-4", - "name": "Anthropic: Claude Sonnet 4", - "family": "claude-sonnet", + "zai.glm-4.7": { + "id": "zai.glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-05-14", - "last_updated": "2025-05-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.30000000000000004, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Google Gemini 2.5 Flash", - "family": "gemini-flash", + "moonshot.kimi-k2-thinking": { + "id": "moonshot.kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": true, + "structured_output": 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, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "cache_write": 0.3 }, - "limit": { "context": 1048576, "output": 65535 } - }, - "sonar-pro": { - "id": "sonar-pro", - "name": "Perplexity Sonar Pro", - "family": "sonar-pro", - "attachment": false, - "reasoning": false, - "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, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 4096 } + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.6, + "output": 2.5 + } }, - "mistral-nemo": { - "id": "mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", - "attachment": false, - "reasoning": false, - "tool_call": false, + "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)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-11-24", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 20, "output": 40 }, - "limit": { "context": 128000, "output": 16400 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "qwen3-next-80b-a3b-instruct": { - "id": "qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", - "family": "qwen", + "mistral.ministral-3-14b-instruct": { + "id": "mistral.ministral-3-14b-instruct", + "name": "Ministral 14B 3.0", + "family": "ministral", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 1.4 }, - "limit": { "context": 262000, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "grok-4-1-fast-reasoning": { - "id": "grok-4-1-fast-reasoning", - "name": "xAI Grok 4.1 Fast Reasoning", - "family": "grok", + "deepseek.r1-v1:0": { + "id": "deepseek.r1-v1:0", + "name": "DeepSeek-R1", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-17", - "last_updated": "2025-11-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.19999999999999998, "output": 0.5, "cache_read": 0.049999999999999996 }, - "limit": { "context": 2000000, "output": 2000000 } - }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "OpenAI GPT-5.1", - "family": "gpt", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-05-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12500000000000003 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "claude-3.5-haiku": { - "id": "claude-3.5-haiku", - "name": "Anthropic: Claude 3.5 Haiku", - "family": "claude-haiku", + "mistral.voxtral-mini-3b-2507": { + "id": "mistral.voxtral-mini-3b-2507", + "name": "Voxtral Mini 3B 2507", + "family": "mistral", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["audio", "text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7999999999999999, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "mistral-small": { - "id": "mistral-small", - "name": "Mistral Small", - "family": "mistral-small", + "openai.gpt-oss-120b-1:0": { + "id": "openai.gpt-oss-120b-1:0", + "name": "gpt-oss-120b", + "family": "gpt-oss", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-02", - "release_date": "2024-02-26", - "last_updated": "2024-02-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 75, "output": 200 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "OpenAI GPT-4.1 Mini", - "family": "gpt-mini", + "nvidia.nemotron-nano-12b-v2": { + "id": "nvidia.nemotron-nano-12b-v2", + "name": "NVIDIA Nemotron Nano 12B v2 VL BF16", + "family": "nemotron", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.39999999999999997, "output": 1.5999999999999999, "cache_read": 0.09999999999999999 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "gpt-5-chat-latest": { - "id": "gpt-5-chat-latest", - "name": "OpenAI GPT-5 Chat Latest", - "family": "gpt-codex", - "attachment": false, - "reasoning": false, + "eu.anthropic.claude-opus-4-7": { + "id": "eu.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (EU)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2024-09", - "release_date": "2024-09-30", - "last_updated": "2024-09-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2026-01-31", + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12500000000000003 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "grok-4-fast-reasoning": { - "id": "grok-4-fast-reasoning", - "name": "xAI: Grok 4 Fast Reasoning", - "family": "grok", + "minimax.minimax-m2.5": { + "id": "minimax.minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.19999999999999998, "output": 0.5, "cache_read": 0.049999999999999996 }, - "limit": { "context": 2000000, "output": 2000000 } + "release_date": "2026-03-18", + "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 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "OpenAI GPT-5 Nano", - "family": "gpt-nano", + "meta.llama3-3-70b-instruct-v1:0": { + "id": "meta.llama3-3-70b-instruct-v1:0", + "name": "Llama 3.3 70B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.049999999999999996, "output": 0.39999999999999997, "cache_read": 0.005 }, - "limit": { "context": 400000, "output": 128000 } + "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.72, + "output": 0.72 + } }, - "grok-3": { - "id": "grok-3", - "name": "xAI Grok 3", - "family": "grok", + "meta.llama3-1-70b-instruct-v1:0": { + "id": "meta.llama3-1-70b-instruct-v1:0", + "name": "Llama 3.1 70B Instruct", + "family": "llama", "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 131072 } + "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 + }, + "cost": { + "input": 0.72, + "output": 0.72 + } }, - "deepseek-tng-r1t2-chimera": { - "id": "deepseek-tng-r1t2-chimera", - "name": "DeepSeek TNG R1T2 Chimera", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": false, + "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)", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-02", - "last_updated": "2025-07-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 130000, "output": 163840 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "Anthropic: Claude 4.5 Haiku (20251001)", - "family": "claude-haiku", - "attachment": false, - "reasoning": false, + "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)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2025-10-01", - "last_updated": "2025-10-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-11-24", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.09999999999999999, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "claude-4.5-sonnet": { - "id": "claude-4.5-sonnet", - "name": "Anthropic: Claude Sonnet 4.5", - "family": "claude-sonnet", + "moonshotai.kimi-k2.5": { + "id": "moonshotai.kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": 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, - "cost": { "input": 3, "output": 15, "cache_read": 0.30000000000000004, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2026-02-06", + "last_updated": "2026-02-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.6, + "output": 3 + } }, - "o3-pro": { - "id": "o3-pro", - "name": "OpenAI o3 Pro", - "family": "o-pro", - "attachment": false, - "reasoning": false, + "au.anthropic.claude-sonnet-4-6": { + "id": "au.anthropic.claude-sonnet-4-6", + "name": "AU Anthropic Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-06", - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": true, + "temperature": true, + "knowledge": "2025-08", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 20, "output": 80 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 3.3, + "output": 16.5, + "cache_read": 0.33, + "cache_write": 4.125 + } }, - "gpt-oss-20b": { - "id": "gpt-oss-20b", - "name": "OpenAI GPT-OSS 20b", + "openai.gpt-oss-safeguard-20b": { + "id": "openai.gpt-oss-safeguard-20b", + "name": "GPT OSS Safeguard 20B", "family": "gpt-oss", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.049999999999999996, "output": 0.19999999999999998 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.07, + "output": 0.2 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3 32B", + "qwen.qwen3-coder-30b-a3b-v1:0": { + "id": "qwen.qwen3-coder-30b-a3b-v1:0", + "name": "Qwen3 Coder 30B A3B Instruct", "family": "qwen", "attachment": false, - "reasoning": 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"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-09-18", + "last_updated": "2025-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.29, "output": 0.59 }, - "limit": { "context": 131072, "output": 40960 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "gpt-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "OpenAI GPT-4.1 Nano", - "family": "gpt-nano", + "minimax.minimax-m2.1": { + "id": "minimax.minimax-m2.1", + "name": "MiniMax M2.1", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09999999999999999, "output": 0.39999999999999997, "cache_read": 0.024999999999999998 }, - "limit": { "context": 1047576, "output": 32768 } + "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 + } }, - "gemma-3-12b-it": { - "id": "gemma-3-12b-it", - "name": "Google Gemma 3 12B", - "family": "gemma", - "attachment": false, + "qwen.qwen3-vl-235b-a22b": { + "id": "qwen.qwen3-vl-235b-a22b", + "name": "Qwen/Qwen3-VL-235B-A22B-Instruct", + "family": "qwen", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.049999999999999996, "output": 0.09999999999999999 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.3, + "output": 1.5 + } }, - "claude-4.5-haiku": { - "id": "claude-4.5-haiku", - "name": "Anthropic: Claude 4.5 Haiku", - "family": "claude-haiku", + "qwen.qwen3-coder-next": { + "id": "qwen.qwen3-coder-next", + "name": "Qwen3 Coder Next", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2025-10-01", - "last_updated": "2025-10-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.09999999999999999, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2026-02-06", + "last_updated": "2026-02-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.22, + "output": 1.8 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", + "nvidia.nemotron-nano-9b-v2": { + "id": "nvidia.nemotron-nano-9b-v2", + "name": "NVIDIA Nemotron Nano 9B v2", + "family": "nemotron", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.41 }, - "limit": { "context": 163840, "output": 65536 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.06, + "output": 0.23 + } }, - "llama-prompt-guard-2-86m": { - "id": "llama-prompt-guard-2-86m", - "name": "Meta Llama Prompt Guard 2 86M", - "family": "llama", + "mistral.mistral-large-3-675b-instruct": { + "id": "mistral.mistral-large-3-675b-instruct", + "name": "Mistral Large 3", + "family": "mistral", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.01, "output": 0.01 }, - "limit": { "context": 512, "output": 2 } + "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 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "OpenAI: GPT-5 Codex", - "family": "gpt-codex", + "qwen.qwen3-235b-a22b-2507-v1:0": { + "id": "qwen.qwen3-235b-a22b-2507-v1:0", + "name": "Qwen3 235B A22B 2507", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12500000000000003 }, - "limit": { "context": 400000, "output": 128000 } + "structured_output": true, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2025-09-18", + "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 + } }, - "o4-mini": { - "id": "o4-mini", - "name": "OpenAI o4 Mini", - "family": "o-mini", + "writer.palmyra-x4-v1:0": { + "id": "writer.palmyra-x4-v1:0", + "name": "Palmyra X4", + "family": "palmyra", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-06", - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-04-28", + "last_updated": "2025-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.275 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 122880, + "output": 8192 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "OpenAI: GPT-5.1 Codex", - "family": "gpt-codex", - "attachment": false, - "reasoning": false, + "anthropic.claude-opus-4-1-20250805-v1:0": { + "id": "anthropic.claude-opus-4-1-20250805-v1:0", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.12500000000000003 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "o1-mini": { - "id": "o1-mini", - "name": "OpenAI: o1-mini", - "family": "o-mini", + "us.deepseek.r1-v1:0": { + "id": "us.deepseek.r1-v1:0", + "name": "DeepSeek-R1 (US)", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 128000, "output": 65536 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "claude-opus-4": { - "id": "claude-opus-4", - "name": "Anthropic: Claude Opus 4", + "eu.anthropic.claude-opus-4-6-v1": { + "id": "eu.anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6 (EU)", "family": "claude-opus", - "attachment": false, + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-05-14", - "last_updated": "2025-05-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } - } - } - }, - "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.7": { - "id": "MiniMax-M2.7", - "name": "MiniMax-M2.7", - "family": "minimax", - "attachment": false, - "reasoning": true, + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } + }, + "us.meta.llama4-maverick-17b-instruct-v1:0": { + "id": "us.meta.llama4-maverick-17b-instruct-v1:0", + "name": "Llama 4 Maverick 17B Instruct (US)", + "family": "llama", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.24, + "output": 0.97 + } }, - "MiniMax-M2.1": { - "id": "MiniMax-M2.1", - "name": "MiniMax-M2.1", - "family": "minimax", - "attachment": false, + "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)", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "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)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "MiniMax-M2": { - "id": "MiniMax-M2", - "name": "MiniMax-M2", - "family": "minimax", - "attachment": false, + "anthropic.claude-sonnet-4-6": { + "id": "anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196608, "output": 128000 } + "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 + } }, - "MiniMax-M2.5-highspeed": { - "id": "MiniMax-M2.5-highspeed", - "name": "MiniMax-M2.5-highspeed", - "family": "minimax", - "attachment": false, + "jp.anthropic.claude-sonnet-4-6": { + "id": "jp.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (JP)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "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 + } }, - "MiniMax-M2.7-highspeed": { - "id": "MiniMax-M2.7-highspeed", - "name": "MiniMax-M2.7-highspeed", - "family": "minimax", - "attachment": false, + "global.anthropic.claude-sonnet-4-6": { + "id": "global.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (Global)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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.5-plus": { - "id": "qwen3.5-plus", - "name": "Qwen3.5 Plus", - "family": "qwen", - "attachment": 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": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + }, + "us.anthropic.claude-sonnet-4-6": { + "id": "us.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (US)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-16", - "last_updated": "2026-02-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "qwen3-coder-next": { - "id": "qwen3-coder-next", - "name": "Qwen3 Coder Next", - "family": "qwen", - "attachment": false, - "reasoning": false, + "global.anthropic.claude-opus-4-6-v1": { + "id": "global.anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6 (Global)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 65536 } + "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 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "us.anthropic.claude-opus-4-6-v1": { + "id": "us.anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6 (US)", + "family": "claude-opus", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "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 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "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)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 196608, "output": 24576 } + "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 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, + "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)", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + } + }, + "eu.anthropic.claude-sonnet-4-6": { + "id": "eu.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (EU)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 202752, "output": 16384 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "qwen3-coder-plus": { - "id": "qwen3-coder-plus", - "name": "Qwen3 Coder Plus", - "family": "qwen", - "attachment": false, + "us.meta.llama4-scout-17b-instruct-v1:0": { + "id": "us.meta.llama4-scout-17b-instruct-v1:0", + "name": "Llama 4 Scout 17B Instruct (US)", + "family": "llama", + "attachment": true, "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"] }, + "knowledge": "2024-08", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 3500000, + "output": 16384 + }, + "cost": { + "input": 0.17, + "output": 0.66 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "anthropic.claude-opus-4-6-v1": { + "id": "anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 202752, "output": 16384 } + "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 + } }, - "qwen3-max-2026-01-23": { - "id": "qwen3-max-2026-01-23", - "name": "Qwen3 Max", - "family": "qwen", - "attachment": false, - "reasoning": false, + "jp.anthropic.claude-opus-4-7": { + "id": "jp.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (JP)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-01-23", - "last_updated": "2026-01-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } } } }, - "deepinfra": { - "id": "deepinfra", - "env": ["DEEPINFRA_API_KEY"], - "npm": "@ai-sdk/deepinfra", - "name": "Deep Infra", - "doc": "https://deepinfra.com/models", + "the-grid-ai": { + "id": "the-grid-ai", + "env": ["THEGRIDAI_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.thegrid.ai/v1", + "name": "The Grid AI", + "doc": "https://thegrid.ai/docs", "models": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "text-prime": { + "id": "text-prime", + "name": "Text Prime", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.05, "output": 0.24 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 30000 + }, + "status": "beta" }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "text-standard": { + "id": "text-standard", + "name": "Text Standard", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.03, "output": 0.14 }, - "limit": { "context": 131072, "output": 16384 } - }, - "anthropic/claude-4-opus": { - "id": "anthropic/claude-4-opus", - "name": "Claude Opus 4", - "family": "claude-opus", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-06-12", - "last_updated": "2025-06-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 16.5, "output": 82.5 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 128000, + "output": 16000 + }, + "status": "beta" }, - "anthropic/claude-3-7-sonnet-latest": { - "id": "anthropic/claude-3-7-sonnet-latest", - "name": "Claude Sonnet 3.7 (Latest)", - "family": "claude-sonnet", - "attachment": true, + "text-max": { + "id": "text-max", + "name": "Text Max", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10-31", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-24", + "last_updated": "2026-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.3, "output": 16.5, "cache_read": 0.33 }, - "limit": { "context": 200000, "output": 64000 } - }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "status": "beta" + } + } + }, + "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/development/model-apis/overview", + "models": { "zai-org/GLM-4.7": { "id": "zai-org/GLM-4.7", "name": "GLM-4.7", @@ -35622,3202 +69423,5255 @@ "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, "knowledge": "2025-04", "release_date": "2025-12-22", "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.43, "output": 1.75, "cache_read": 0.08 }, - "limit": { "context": 202752, "output": 16384 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "zai-org/GLM-4.6V": { - "id": "zai-org/GLM-4.6V", - "name": "GLM-4.6V", + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "GLM-5", "family": "glm", - "attachment": true, - "reasoning": true, - "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", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 204800, "output": 131072 } - }, - "zai-org/GLM-4.7-Flash": { - "id": "zai-org/GLM-4.7-Flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2026-01", + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.4 }, - "limit": { "context": 202752, "output": 16384 } + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 0.95, + "output": 3.15 + } }, - "zai-org/GLM-4.5": { - "id": "zai-org/GLM-4.5", - "name": "GLM-4.5", + "zai-org/GLM-4.6": { + "id": "zai-org/GLM-4.6", + "name": "GLM 4.6", "family": "glm", "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"] }, + "knowledge": "2025-08-31", + "release_date": "2025-09-16", + "last_updated": "2025-09-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 131072, "output": 98304 }, - "status": "deprecated" + "limit": { + "context": 200000, + "output": 200000 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM-5", - "family": "glm", + "nvidia/Nemotron-120B-A12B": { + "id": "nvidia/Nemotron-120B-A12B", + "name": "Nemotron 3 Super", + "family": "nemotron", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2026-02", + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 2.56, "cache_read": 0.16 }, - "limit": { "context": 202752, "output": 16384 } + "limit": { + "context": 262144, + "output": 32678 + }, + "cost": { + "input": 0.3, + "output": 0.75 + } }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "GLM-4.6", - "family": "glm", + "deepseek-ai/DeepSeek-V3.1": { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.43, "output": 1.74, "cache_read": 0.08 }, - "limit": { "context": 204800, "output": 131072 } - }, - "meta-llama/Llama-4-Scout-17B-16E-Instruct": { - "id": "meta-llama/Llama-4-Scout-17B-16E-Instruct", - "name": "Llama 4 Scout 17B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-25", + "last_updated": "2025-08-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 10000000, "output": 16384 } + "limit": { + "context": 164000, + "output": 131000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "meta-llama/Llama-3.1-8B-Instruct": { - "id": "meta-llama/Llama-3.1-8B-Instruct", - "name": "Llama 3.1 8B", - "family": "llama", + "deepseek-ai/DeepSeek-V3-0324": { + "id": "deepseek-ai/DeepSeek-V3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", "attachment": false, "reasoning": false, "tool_call": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.05 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 164000, + "output": 131000 + }, + "cost": { + "input": 0.77, + "output": 0.77 + } }, - "meta-llama/Llama-3.1-8B-Instruct-Turbo": { - "id": "meta-llama/Llama-3.1-8B-Instruct-Turbo", - "name": "Llama 3.1 8B Turbo", - "family": "llama", + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "knowledge": "2025-10", + "release_date": "2025-12-01", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.03 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 163800, + "output": 131100 + }, + "status": "deprecated", + "cost": { + "input": 0.3, + "output": 0.45 + } }, - "meta-llama/Llama-3.1-70B-Instruct-Turbo": { - "id": "meta-llama/Llama-3.1-70B-Instruct-Turbo", - "name": "Llama 3.1 70B Turbo", - "family": "llama", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-08", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.1, + "output": 0.5 + } }, - "meta-llama/Llama-3.1-70B-Instruct": { - "id": "meta-llama/Llama-3.1-70B-Instruct", - "name": "Llama 3.1 70B", - "family": "llama", + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2025-11-06", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 262144, + "output": 262144 + }, + "status": "deprecated", + "cost": { + "input": 0.6, + "output": 2.5 + } }, - "meta-llama/Llama-3.3-70B-Instruct-Turbo": { - "id": "meta-llama/Llama-3.3-70B-Instruct-Turbo", - "name": "Llama 3.3 70B Turbo", - "family": "llama", - "attachment": false, - "reasoning": false, + "moonshotai/Kimi-K2.6": { + "id": "moonshotai/Kimi-K2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, + "reasoning": true, "tool_call": true, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "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, - "cost": { "input": 0.1, "output": 0.32 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "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", - "family": "llama", + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi K2 Instruct 0905", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-08", + "release_date": "2025-09-05", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 262144, + "output": 262144 + }, + "status": "deprecated", + "cost": { + "input": 0.6, + "output": 2.5 + } }, - "MiniMaxAI/MiniMax-M2.1": { - "id": "MiniMaxAI/MiniMax-M2.1", - "name": "MiniMax M2.1", - "attachment": false, + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2026-01-30", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 1.2 }, - "limit": { "context": 196608, "output": 196608 } + "limit": { + "context": 262144, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 3 + } }, "MiniMaxAI/MiniMax-M2.5": { "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax M2.5", + "name": "MiniMax-M2.5", "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-06", + "knowledge": "2026-01", "release_date": "2026-02-12", "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 0.95, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 204000, + "output": 204000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "MiniMaxAI/MiniMax-M2": { - "id": "MiniMaxAI/MiniMax-M2", - "name": "MiniMax M2", - "family": "minimax", + "deepseek-ai/DeepSeek-V4-Pro": { + "id": "deepseek-ai/DeepSeek-V4-Pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.254, "output": 1.02 }, - "limit": { "context": 262144, "output": 32768 } - }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek-R1-0528", - "attachment": false, + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 1.74, + "output": 3.48, + "cache_read": 0.15 + } + } + } + }, + "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-reasoning": { + "id": "grok-4-1-fast-reasoning", + "name": "Grok 4.1 Fast (Reasoning)", + "family": "grok", + "attachment": true, "reasoning": true, - "tool_call": false, - "interleaved": { "field": "reasoning_content" }, + "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-11-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2.15, "cache_read": 0.35 }, - "limit": { "context": 163840, "output": 64000 } + "limit": { + "context": 2000000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek-V3.2", - "attachment": false, + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.26, "output": 0.38, "cache_read": 0.13 }, - "limit": { "context": 163840, "output": 64000 } - }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo", - "name": "Qwen3 Coder 480B A35B Instruct Turbo", - "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, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 262144, "output": 66536 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi-K2.5", "attachment": false, - "reasoning": false, + "reasoning": true, "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": true, - "cost": { "input": 0.4, "output": 1.6 }, - "limit": { "context": 262144, "output": 66536 } + "release_date": "1970-01-01", + "last_updated": "1970-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "moonshotai/Kimi-K2-Instruct": { - "id": "moonshotai/Kimi-K2-Instruct", - "name": "Kimi K2", - "family": "kimi", - "attachment": false, - "reasoning": false, + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 131072, "output": 32768 } + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "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 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.5, "output": 2.8 }, - "limit": { "context": 262144, "output": 32768 } + "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 + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi K2 0905", - "family": "kimi", - "attachment": false, - "reasoning": false, + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.4, "output": 2, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "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 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, - "reasoning": true, + "zai-glm-5-1": { + "id": "zai-glm-5-1", + "name": "Z.AI GLM-5.1", + "family": "glm", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, "knowledge": "2024-10", - "release_date": "2025-11-06", - "last_updated": "2025-11-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-01-20", + "last_updated": "2025-02-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.47, "output": 2 }, - "limit": { "context": 131072, "output": 32768 } - } - } - }, - "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-pro": { - "id": "mimo-v2-pro", - "name": "MiMo-V2-Pro", - "family": "mimo", + "limit": { + "context": 198000, + "output": 8192 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } + }, + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, "reasoning": true, "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": true, - "cost": { "input": 1, "output": 3, "cache_read": 0.2 }, - "limit": { "context": 1000000, "output": 128000 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } }, - "mimo-v2-omni": { - "id": "mimo-v2-omni", - "name": "MiMo-V2-Omni", - "family": "mimo", + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "Grok 4.1 Fast (Non-Reasoning)", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "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", "video", "pdf"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2, "cache_read": 0.08 }, - "limit": { "context": 256000, "output": 128000 } + "knowledge": "2025-11", + "release_date": "2025-11-25", + "last_updated": "2025-11-25", + "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 + } }, - "mimo-v2-flash": { - "id": "mimo-v2-flash", - "name": "MiMo-V2-Flash", - "family": "mimo", - "attachment": false, + "gpt-5-4-nano": { + "id": "gpt-5-4-nano", + "name": "GPT-5.4 Nano", + "family": "gpt-nano", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.1, "output": 0.3, "cache_read": 0.01 }, - "limit": { "context": 256000, "output": 64000 } - } - } - }, - "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": { - "google.gemma-3-27b-it": { - "id": "google.gemma-3-27b-it", - "name": "Google Gemma 3 27B Instruct", - "family": "gemma", + "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.2, + "output": 1.25, + "cache_read": 0.02 + } + }, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-27", - "last_updated": "2025-07-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.12, "output": 0.2 }, - "limit": { "context": 202752, "output": 8192 } + "knowledge": "2025-01", + "release_date": "2025-07-17", + "last_updated": "2025-07-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 + } }, - "qwen.qwen3-coder-480b-a35b-v1:0": { - "id": "qwen.qwen3-coder-480b-a35b-v1:0", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok 4.1 Fast (Reasoning)", + "family": "grok", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-18", - "last_updated": "2025-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 1.8 }, - "limit": { "context": 131072, "output": 65536 } + "knowledge": "2023-10", + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "moonshotai.kimi-k2.5": { - "id": "moonshotai.kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": false, + "gpt-5-5": { + "id": "gpt-5-5", + "name": "GPT-5.5", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": true, - "temperature": true, - "release_date": "2026-02-06", - "last_updated": "2026-02-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 256000, "output": 256000 } + "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": 272000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + } }, - "meta.llama3-1-405b-instruct-v1:0": { - "id": "meta.llama3-1-405b-instruct-v1:0", - "name": "Llama 3.1 405B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "grok-4-3": { + "id": "grok-4-3", + "name": "Grok 4.3", + "family": "grok", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 2.4, "output": 2.4 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-11", + "release_date": "2026-04-30", + "last_updated": "2026-04-30", + "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 + } }, - "deepseek.v3.2": { - "id": "deepseek.v3.2", - "name": "DeepSeek-V3.2", - "family": "deepseek", - "attachment": false, + "gpt-5-4-mini": { + "id": "gpt-5-4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2026-02-06", - "last_updated": "2026-02-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.62, "output": 1.85 }, - "limit": { "context": 163840, "output": 81920 } + "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, + "cache_read": 0.075 + } }, - "global.anthropic.claude-sonnet-4-6": { - "id": "global.anthropic.claude-sonnet-4-6", - "name": "Claude Sonnet 4.6 (Global)", - "family": "claude-sonnet", + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "nvidia.nemotron-super-3-120b": { - "id": "nvidia.nemotron-super-3-120b", - "name": "NVIDIA Nemotron 3 Super 120B A12B", - "family": "nemotron", - "attachment": false, - "reasoning": true, + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek v4 Pro", + "family": "deepseek", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.65 }, - "limit": { "context": 262144, "output": 131072 } + "knowledge": "2026-01", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 1.74, + "output": 3.48, + "cache_read": 0.14 + } }, - "minimax.minimax-m2.1": { - "id": "minimax.minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", + "gpt-oss-20b": { + "id": "gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": false, + "structured_output": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "1970-01-01", + "last_updated": "1970-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.07, + "output": 0.2 + } }, - "us.anthropic.claude-sonnet-4-20250514-v1:0": { - "id": "us.anthropic.claude-sonnet-4-20250514-v1:0", - "name": "Claude Sonnet 4 (US)", - "family": "claude-sonnet", + "qwen-3-6-plus": { + "id": "qwen-3-6-plus", + "name": "Qwen 3.6 Plus", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.1 + } }, - "meta.llama3-3-70b-instruct-v1:0": { - "id": "meta.llama3-3-70b-instruct-v1:0", - "name": "Llama 3.3 70B Instruct", - "family": "llama", - "attachment": false, + "minimax-m2-7": { + "id": "minimax-m2-7", + "name": "MiniMax-M2.7", + "family": "minimax", + "attachment": true, "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, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 128000, "output": 4096 } - }, - "google.gemma-3-12b-it": { - "id": "google.gemma-3-12b-it", - "name": "Google Gemma 3 12B", - "family": "gemma", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.049999999999999996, "output": 0.09999999999999999 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 192000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "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)", - "family": "claude-opus", + "minimax-m2-5": { + "id": "minimax-m2-5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "knowledge": "2024-09", + "release_date": "2025-01-15", + "last_updated": "2025-02-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 192000, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03 + } }, - "anthropic.claude-haiku-4-5-20251001-v1:0": { - "id": "anthropic.claude-haiku-4-5-20251001-v1:0", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", + "gpt-4o": { + "id": "gpt-4o", + "name": "GPT-4o", + "family": "gpt", "attachment": true, - "reasoning": 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"] }, + "knowledge": "2023-09", + "release_date": "2024-05-13", + "last_updated": "2024-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "mistral.pixtral-large-2502-v1:0": { - "id": "mistral.pixtral-large-2502-v1:0", - "name": "Pixtral Large (25.02)", - "family": "mistral", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-04-08", - "last_updated": "2025-04-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "1970-01-01", + "last_updated": "1970-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "anthropic.claude-3-5-sonnet-20240620-v1:0": { - "id": "anthropic.claude-3-5-sonnet-20240620-v1:0", - "name": "Claude Sonnet 3.5", - "family": "claude-sonnet", + "gemini-3-1-pro-preview": { + "id": "gemini-3-1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-06-20", - "last_updated": "2024-06-20", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2026-01", + "release_date": "2026-02-18", + "last_updated": "2026-02-18", + "modalities": { + "input": ["text", "image", "video", "audio", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2 + } }, - "mistral.ministral-3-8b-instruct": { - "id": "mistral.ministral-3-8b-instruct", - "name": "Ministral 3 8B", - "family": "ministral", + "kimi-k2-6": { + "id": "kimi-k2-6", + "name": "Kimi-K2.6", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "1970-01-01", + "last_updated": "1970-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 256000, + "output": 128000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "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)", - "family": "claude-haiku", + "gpt-5-3-codex": { + "id": "gpt-5-3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2026-01-31", + "release_date": "2026-02-15", + "last_updated": "2026-02-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } + } + } + }, + "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-5v-turbo": { + "id": "glm-5v-turbo", + "name": "GLM-5V-Turbo", + "family": "glm", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "openai.gpt-oss-120b-1:0": { - "id": "openai.gpt-oss-120b-1:0", - "name": "gpt-oss-120b", - "family": "gpt-oss", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "openai.gpt-oss-safeguard-120b": { - "id": "openai.gpt-oss-safeguard-120b", - "name": "GPT OSS Safeguard 120B", - "family": "gpt-oss", + "glm-5-turbo": { + "id": "glm-5-turbo", + "name": "GLM-5-Turbo", + "family": "glm", "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4096 } - }, - "anthropic.claude-3-5-sonnet-20241022-v2:0": { - "id": "anthropic.claude-3-5-sonnet-20241022-v2:0", - "name": "Claude Sonnet 3.5 v2", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "deepseek.v3-v1:0": { - "id": "deepseek.v3-v1:0", - "name": "DeepSeek-V3.1", - "family": "deepseek", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM-4.5-Air", + "family": "glm-air", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-09-18", - "last_updated": "2025-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.58, "output": 1.68 }, - "limit": { "context": 163840, "output": 81920 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "minimax.minimax-m2": { - "id": "minimax.minimax-m2", - "name": "MiniMax M2", - "family": "minimax", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": false, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204608, "output": 128000 } - }, - "qwen.qwen3-vl-235b-a22b": { - "id": "qwen.qwen3-vl-235b-a22b", - "name": "Qwen/Qwen3-VL-235B-A22B-Instruct", + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "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-coder-plus": { + "id": "qwen3-coder-plus", + "name": "Qwen3 Coder Plus", "family": "qwen", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 262000, "output": 262000 } - }, - "meta.llama3-2-1b-instruct-v1:0": { - "id": "meta.llama3-2-1b-instruct-v1:0", - "name": "Llama 3.2 1B Instruct", - "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131000, "output": 4096 } - }, - "openai.gpt-oss-safeguard-20b": { - "id": "openai.gpt-oss-safeguard-20b", - "name": "GPT OSS Safeguard 20B", - "family": "gpt-oss", - "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, - "cost": { "input": 0.07, "output": 0.2 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "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)", - "family": "claude-opus", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } }, - "nvidia.nemotron-nano-3-30b": { - "id": "nvidia.nemotron-nano-3-30b", - "name": "NVIDIA Nemotron Nano 3 30B", - "family": "nemotron", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.24 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "anthropic.claude-opus-4-1-20250805-v1:0": { - "id": "anthropic.claude-opus-4-1-20250805-v1:0", - "name": "Claude Opus 4.1", - "family": "claude-opus", - "attachment": true, + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "eu.anthropic.claude-sonnet-4-6": { - "id": "eu.anthropic.claude-sonnet-4-6", - "name": "Claude Sonnet 4.6 (EU)", - "family": "claude-sonnet", - "attachment": true, + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "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 + } }, - "qwen.qwen3-235b-a22b-2507-v1:0": { - "id": "qwen.qwen3-235b-a22b-2507-v1:0", - "name": "Qwen3 235B A22B 2507", + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-18", - "last_updated": "2025-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 0.88 }, - "limit": { "context": 262144, "output": 131072 } + "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 + } }, - "writer.palmyra-x5-v1:0": { - "id": "writer.palmyra-x5-v1:0", - "name": "Palmyra X5", - "family": "palmyra", + "qwen3-max-2026-01-23": { + "id": "qwen3-max-2026-01-23", + "name": "Qwen3 Max", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-04-28", - "last_updated": "2025-04-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-01-23", + "last_updated": "2026-01-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 6 }, - "limit": { "context": 1040000, "output": 8192 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "zai.glm-5": { - "id": "zai.glm-5", - "name": "GLM-5", - "family": "glm", + "qwen3-coder-next": { + "id": "qwen3-coder-next", + "name": "Qwen3 Coder Next", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2026-02-03", + "last_updated": "2026-02-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 202752, "output": 101376 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "amazon.nova-micro-v1:0": { - "id": "amazon.nova-micro-v1:0", - "name": "Nova Micro", - "family": "nova-micro", + "qwen3.5-plus": { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.035, "output": 0.14, "cache_read": 0.00875 }, - "limit": { "context": 128000, "output": 8192 } - }, - "writer.palmyra-x4-v1:0": { - "id": "writer.palmyra-x4-v1:0", - "name": "Palmyra X4", - "family": "palmyra", - "attachment": false, - "reasoning": true, + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "venice": { + "id": "venice", + "env": ["VENICE_API_KEY"], + "npm": "venice-ai-sdk-provider", + "name": "Venice AI", + "doc": "https://docs.venice.ai", + "models": { + "openai-gpt-4o-mini-2024-07-18": { + "id": "openai-gpt-4o-mini-2024-07-18", + "name": "GPT-4o Mini", + "family": "gpt-mini", + "attachment": true, + "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"] }, + "release_date": "2026-02-28", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 122880, "output": 8192 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.1875, + "output": 0.75, + "cache_read": 0.09375 + } }, - "mistral.voxtral-mini-3b-2507": { - "id": "mistral.voxtral-mini-3b-2507", - "name": "Voxtral Mini 3B 2507", - "family": "mistral", + "qwen3-next-80b": { + "id": "qwen3-next-80b", + "name": "Qwen 3 Next 80b", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["audio", "text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-07", + "release_date": "2025-04-29", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.35, + "output": 1.9 + } }, - "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)", - "family": "claude-sonnet", + "grok-4-20-multi-agent": { + "id": "grok-4-20-multi-agent", + "name": "Grok 4.20 Multi-Agent", + "family": "grok", "attachment": true, "reasoning": true, - "tool_call": true, + "tool_call": false, + "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"] }, + "release_date": "2026-03-12", + "last_updated": "2026-05-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } + } }, - "mistral.mistral-large-3-675b-instruct": { - "id": "mistral.mistral-large-3-675b-instruct", - "name": "Mistral Large 3", - "family": "mistral", + "qwen3-235b-a22b-instruct-2507": { + "id": "qwen3-235b-a22b-instruct-2507", + "name": "Qwen 3 235B A22B Instruct 2507", + "family": "qwen", "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", "image"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-04-29", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 256000, "output": 8192 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.75 + } }, - "zai.glm-4.7": { - "id": "zai.glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "z-ai-glm-5v-turbo": { + "id": "z-ai-glm-5v-turbo", + "name": "GLM 5V Turbo", + "family": "glmv", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-04-01", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 32768 + }, + "cost": { + "input": 1.5, + "output": 5, + "cache_read": 0.3 + } }, - "qwen.qwen3-32b-v1:0": { - "id": "qwen.qwen3-32b-v1:0", - "name": "Qwen3 32B (dense)", - "family": "qwen", - "attachment": false, - "reasoning": true, + "gemma-4-uncensored": { + "id": "gemma-4-uncensored", + "name": "Gemma 4 Uncensored", + "family": "gemma", + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-18", - "last_updated": "2025-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-13", + "last_updated": "2026-04-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.1625, + "output": 0.5 + } }, - "us.anthropic.claude-opus-4-6-v1": { - "id": "us.anthropic.claude-opus-4-6-v1", - "name": "Claude Opus 4.6 (US)", - "family": "claude-opus", + "grok-41-fast": { + "id": "grok-41-fast", + "name": "Grok 4.1 Fast", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-12-01", + "last_updated": "2026-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 30000 + }, + "cost": { + "input": 0.23, + "output": 0.57, + "cache_read": 0.06 + } }, - "anthropic.claude-sonnet-4-5-20250929-v1:0": { - "id": "anthropic.claude-sonnet-4-5-20250929-v1:0", - "name": "Claude Sonnet 4.5", + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", "family": "claude-sonnet", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3.6, + "output": 18, + "cache_read": 0.36, + "cache_write": 4.5 + } }, - "meta.llama3-2-11b-instruct-v1:0": { - "id": "meta.llama3-2-11b-instruct-v1:0", - "name": "Llama 3.2 11B Instruct", - "family": "llama", - "attachment": true, - "reasoning": false, + "nvidia-nemotron-cascade-2-30b-a3b": { + "id": "nvidia-nemotron-cascade-2-30b-a3b", + "name": "Nemotron Cascade 2 30B A3B", + "family": "nemotron", + "attachment": false, + "reasoning": true, "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"] }, + "release_date": "2026-03-24", + "last_updated": "2026-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.16, "output": 0.16 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 256000, + "output": 32768 + }, + "cost": { + "input": 0.14, + "output": 0.8 + } }, - "global.anthropic.claude-opus-4-6-v1": { - "id": "global.anthropic.claude-opus-4-6-v1", - "name": "Claude Opus 4.6 (Global)", - "family": "claude-opus", + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-12-19", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.7, + "output": 3.75, + "cache_read": 0.07 + } }, - "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)", - "family": "claude-sonnet", + "grok-4-20": { + "id": "grok-4-20", + "name": "Grok 4.20", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2026-03-12", + "last_updated": "2026-05-07", + "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 + } + } + }, + "google-gemma-4-26b-a4b-it": { + "id": "google-gemma-4-26b-a4b-it", + "name": "Google Gemma 4 26B A4B Instruct", + "family": "gemma", "attachment": true, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2026-04-02", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.1625, + "output": 0.5 + } }, - "anthropic.claude-sonnet-4-20250514-v1:0": { - "id": "anthropic.claude-sonnet-4-20250514-v1:0", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "structured_output": true, + "temperature": false, + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 6, + "output": 30, + "cache_read": 0.6, + "cache_write": 7.5 + } }, - "mistral.ministral-3-3b-instruct": { - "id": "mistral.ministral-3-3b-instruct", - "name": "Ministral 3 3B", - "family": "ministral", + "qwen3-coder-480b-a35b-instruct-turbo": { + "id": "qwen3-coder-480b-a35b-instruct-turbo", + "name": "Qwen 3 Coder 480B Turbo", + "family": "qwen", "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", "image"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 256000, "output": 8192 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.35, + "output": 1.5, + "cache_read": 0.04 + } }, - "meta.llama4-maverick-17b-instruct-v1:0": { - "id": "meta.llama4-maverick-17b-instruct-v1:0", - "name": "Llama 4 Maverick 17B Instruct", - "family": "llama", + "qwen3-5-397b-a17b": { + "id": "qwen3-5-397b-a17b", + "name": "Qwen 3.5 397B", + "family": "qwen", "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, - "cost": { "input": 0.24, "output": 0.97 }, - "limit": { "context": 1000000, "output": 16384 } - }, - "moonshot.kimi-k2-thinking": { - "id": "moonshot.kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, + "structured_output": true, "temperature": true, - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.75, + "output": 4.5 + } }, - "mistral.magistral-small-2509": { - "id": "mistral.magistral-small-2509", - "name": "Magistral Small 1.2", - "family": "magistral", + "zai-org-glm-4.7": { + "id": "zai-org-glm-4.7", + "name": "GLM 4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-24", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 128000, "output": 40000 } + "limit": { + "context": 198000, + "output": 16384 + }, + "cost": { + "input": 0.55, + "output": 2.65, + "cache_read": 0.11 + } }, - "us.anthropic.claude-opus-4-20250514-v1:0": { - "id": "us.anthropic.claude-opus-4-20250514-v1:0", - "name": "Claude Opus 4 (US)", - "family": "claude-opus", + "openai-gpt-54": { + "id": "openai-gpt-54", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-03-05", + "last_updated": "2026-03-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 1000000, + "output": 131072 + }, + "cost": { + "input": 3.13, + "output": 18.8, + "cache_read": 0.313 + } }, - "eu.anthropic.claude-sonnet-4-20250514-v1:0": { - "id": "eu.anthropic.claude-sonnet-4-20250514-v1:0", - "name": "Claude Sonnet 4 (EU)", - "family": "claude-sonnet", - "attachment": true, + "zai-org-glm-4.7-flash": { + "id": "zai-org-glm-4.7-flash", + "name": "GLM 4.7 Flash", + "family": "glm-flash", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2026-01-29", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } }, - "nvidia.nemotron-nano-12b-v2": { - "id": "nvidia.nemotron-nano-12b-v2", - "name": "NVIDIA Nemotron Nano 12B v2 VL BF16", + "nvidia-nemotron-3-nano-30b-a3b": { + "id": "nvidia-nemotron-3-nano-30b-a3b", + "name": "NVIDIA Nemotron 3 Nano 30B", "family": "nemotron", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 128000, "output": 4096 } - }, - "zai.glm-4.7-flash": { - "id": "zai.glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.4 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "mistral.voxtral-small-24b-2507": { - "id": "mistral.voxtral-small-24b-2507", - "name": "Voxtral Small 24B 2507", - "family": "mistral", + "qwen3-vl-235b-a22b": { + "id": "qwen3-vl-235b-a22b", + "name": "Qwen3 VL 235B", + "family": "qwen", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text", "audio"], "output": ["text"] }, + "release_date": "2026-01-16", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.35 }, - "limit": { "context": 32000, "output": 8192 } + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.25, + "output": 1.5 + } }, - "eu.anthropic.claude-opus-4-6-v1": { - "id": "eu.anthropic.claude-opus-4-6-v1", - "name": "Claude Opus 4.6 (EU)", - "family": "claude-opus", + "openai-gpt-53-codex": { + "id": "openai-gpt-53-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-02-24", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 2.19, + "output": 17.5, + "cache_read": 0.219 + } }, - "anthropic.claude-3-7-sonnet-20250219-v1:0": { - "id": "anthropic.claude-3-7-sonnet-20250219-v1:0", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", + "venice-uncensored-1-2": { + "id": "venice-uncensored-1-2", + "name": "Venice Uncensored 1.2", + "family": "venice", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "release_date": "2026-04-01", + "last_updated": "2026-04-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.9 + } }, - "openai.gpt-oss-20b-1:0": { - "id": "openai.gpt-oss-20b-1:0", - "name": "gpt-oss-20b", - "family": "gpt-oss", + "openai-gpt-52": { + "id": "openai-gpt-52", + "name": "GPT-5.2", + "family": "gpt", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2025-12-13", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.3 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 2.19, + "output": 17.5, + "cache_read": 0.219 + } }, - "qwen.qwen3-coder-30b-a3b-v1:0": { - "id": "qwen.qwen3-coder-30b-a3b-v1:0", - "name": "Qwen3 Coder 30B A3B Instruct", - "family": "qwen", + "mistral-small-3-2-24b-instruct": { + "id": "mistral-small-3-2-24b-instruct", + "name": "Mistral Small 3.2 24B Instruct", + "family": "mistral-small", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-18", - "last_updated": "2025-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 262144, "output": 131072 } + "release_date": "2026-01-15", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.09375, + "output": 0.25 + } }, - "meta.llama3-1-8b-instruct-v1:0": { - "id": "meta.llama3-1-8b-instruct-v1:0", - "name": "Llama 3.1 8B Instruct", - "family": "llama", + "minimax-m27": { + "id": "minimax-m27", + "name": "MiniMax M2.7", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.22, "output": 0.22 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2026-03-18", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 198000, + "output": 32768 + }, + "cost": { + "input": 0.375, + "output": 1.5, + "cache_read": 0.075 + } }, - "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)", - "family": "claude-haiku", - "attachment": true, + "qwen3-235b-a22b-thinking-2507": { + "id": "qwen3-235b-a22b-thinking-2507", + "name": "Qwen 3 235B A22B Thinking 2507", + "family": "qwen", + "attachment": false, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-07", + "release_date": "2025-04-29", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.45, + "output": 3.5 + } }, - "meta.llama3-2-90b-instruct-v1:0": { - "id": "meta.llama3-2-90b-instruct-v1:0", - "name": "Llama 3.2 90B Instruct", - "family": "llama", + "qwen3-5-35b-a3b": { + "id": "qwen3-5-35b-a3b", + "name": "Qwen 3.5 35B A3B", + "family": "qwen", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "release_date": "2026-02-25", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.3125, + "output": 1.25, + "cache_read": 0.15625 + } }, - "anthropic.claude-opus-4-6-v1": { - "id": "anthropic.claude-opus-4-6-v1", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "mercury-2": { + "id": "mercury-2", + "name": "Mercury 2", + "family": "mercury", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-02-20", + "last_updated": "2026-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 128000, + "output": 50000 + }, + "cost": { + "input": 0.3125, + "output": 0.9375, + "cache_read": 0.03125 + } }, - "anthropic.claude-3-5-haiku-20241022-v1:0": { - "id": "anthropic.claude-3-5-haiku-20241022-v1:0", - "name": "Claude Haiku 3.5", - "family": "claude-haiku", + "google-gemma-3-27b-it": { + "id": "google-gemma-3-27b-it", + "name": "Google Gemma 3 27B Instruct", + "family": "gemma", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "knowledge": "2025-07", + "release_date": "2025-11-04", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 198000, + "output": 16384 + }, + "cost": { + "input": 0.12, + "output": 0.2 + } }, - "meta.llama3-2-3b-instruct-v1:0": { - "id": "meta.llama3-2-3b-instruct-v1:0", - "name": "Llama 3.2 3B Instruct", - "family": "llama", + "olafangensan-glm-4.7-flash-heretic": { + "id": "olafangensan-glm-4.7-flash-heretic", + "name": "GLM 4.7 Flash Heretic", + "family": "glm-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-25", - "last_updated": "2024-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-04", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 131000, "output": 4096 } + "limit": { + "context": 200000, + "output": 24000 + }, + "cost": { + "input": 0.14, + "output": 0.8 + } }, - "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)", - "family": "claude-sonnet", + "openai-gpt-55-pro": { + "id": "openai-gpt-55-pro", + "name": "GPT-5.5 Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } - }, - "deepseek.r1-v1:0": { - "id": "deepseek.r1-v1:0", - "name": "DeepSeek-R1", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "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": false, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 128000, "output": 32768 } - }, - "mistral.ministral-3-14b-instruct": { - "id": "mistral.ministral-3-14b-instruct", - "name": "Ministral 14B 3.0", - "family": "ministral", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 37.5, + "output": 225 + } }, - "amazon.nova-lite-v1:0": { - "id": "amazon.nova-lite-v1:0", - "name": "Nova Lite", - "family": "nova-lite", + "openai-gpt-52-codex": { + "id": "openai-gpt-52-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "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"], "output": ["text"] }, + "knowledge": "2025-08", + "release_date": "2025-01-15", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0.24, "cache_read": 0.015 }, - "limit": { "context": 300000, "output": 8192 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 2.19, + "output": 17.5, + "cache_read": 0.219 + } }, - "amazon.nova-pro-v1:0": { - "id": "amazon.nova-pro-v1:0", - "name": "Nova Pro", - "family": "nova-pro", + "venice-uncensored-role-play": { + "id": "venice-uncensored-role-play", + "name": "Venice Role Play Uncensored", + "family": "venice", "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 300000, "output": 8192 } - }, - "mistral.devstral-2-123b": { - "id": "mistral.devstral-2-123b", - "name": "Devstral 2 123B", - "family": "devstral", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-20", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 256000, "output": 8192 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 2 + } }, - "qwen.qwen3-next-80b-a3b": { - "id": "qwen.qwen3-next-80b-a3b", - "name": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "family": "qwen", + "zai-org-glm-5": { + "id": "zai-org-glm-5", + "name": "GLM 5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-09-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 1.4 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-02-11", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 198000, + "output": 32000 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } }, - "minimax.minimax-m2.5": { - "id": "minimax.minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", + "zai-org-glm-4.6": { + "id": "zai-org-glm-4.6", + "name": "GLM 4.6", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": false, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-04-01", + "last_updated": "2026-04-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196608, "output": 98304 } - }, - "anthropic.claude-3-haiku-20240307-v1:0": { - "id": "anthropic.claude-3-haiku-20240307-v1:0", - "name": "Claude Haiku 3", - "family": "claude-haiku", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-02", - "release_date": "2024-03-13", - "last_updated": "2024-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 1.25 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 198000, + "output": 16384 + }, + "cost": { + "input": 0.85, + "output": 2.75, + "cache_read": 0.3 + } }, - "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)", - "family": "claude-opus", + "grok-4-3": { + "id": "grok-4-3", + "name": "Grok 4.3", + "family": "grok", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-04-18", + "last_updated": "2026-05-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } - }, - "meta.llama4-scout-17b-instruct-v1:0": { - "id": "meta.llama4-scout-17b-instruct-v1:0", - "name": "Llama 4 Scout 17B Instruct", - "family": "llama", + "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 + } + } + }, + "mistral-small-2603": { + "id": "mistral-small-2603", + "name": "Mistral Small 4", + "family": "mistral-small", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "release_date": "2026-03-16", + "last_updated": "2026-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.66 }, - "limit": { "context": 3500000, "output": 16384 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.1875, + "output": 0.75 + } }, - "amazon.nova-2-lite-v1:0": { - "id": "amazon.nova-2-lite-v1:0", - "name": "Nova 2 Lite", - "family": "nova", + "openai-gpt-oss-120b": { + "id": "openai-gpt-oss-120b", + "name": "OpenAI GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.33, "output": 2.75 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2025-07", + "release_date": "2025-11-06", + "last_updated": "2026-05-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.07, + "output": 0.3 + } }, - "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)", + "claude-opus-4-5": { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5", "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-12-06", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 198000, + "output": 32768 + }, + "cost": { + "input": 6, + "output": 30, + "cache_read": 0.6, + "cache_write": 7.5 + } }, - "amazon.nova-premier-v1:0": { - "id": "amazon.nova-premier-v1:0", - "name": "Nova Premier", - "family": "nova", + "qwen3-5-9b": { + "id": "qwen3-5-9b", + "name": "Qwen 3.5 9B", + "family": "qwen", "attachment": true, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 12.5 }, - "limit": { "context": 1000000, "output": 16384 } + "release_date": "2026-03-05", + "last_updated": "2026-04-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.15 + } }, - "anthropic.claude-sonnet-4-6": { - "id": "anthropic.claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "release_date": "2026-04-24", + "last_updated": "2026-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.17, + "output": 0.35, + "cache_read": 0.028 + } }, - "anthropic.claude-opus-4-20250514-v1:0": { - "id": "anthropic.claude-opus-4-20250514-v1:0", - "name": "Claude Opus 4", - "family": "claude-opus", + "openai-gpt-54-pro": { + "id": "openai-gpt-54-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-03-05", + "last_updated": "2026-03-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 37.5, + "output": 225, + "tiers": [ + { + "input": 75, + "output": 337.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ], + "context_over_200k": { + "input": 75, + "output": 337.5 + } + } }, - "nvidia.nemotron-nano-9b-v2": { - "id": "nvidia.nemotron-nano-9b-v2", - "name": "NVIDIA Nemotron Nano 9B v2", - "family": "nemotron", - "attachment": false, - "reasoning": false, + "openai-gpt-54-mini": { + "id": "openai-gpt-54-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-27", + "last_updated": "2026-03-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0.23 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.9375, + "output": 5.625, + "cache_read": 0.09375 + } }, - "google.gemma-3-4b-it": { - "id": "google.gemma-3-4b-it", - "name": "Gemma 3 4B IT", - "family": "gemma", + "minimax-m25": { + "id": "minimax-m25", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04, "output": 0.08 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 198000, + "output": 32768 + }, + "cost": { + "input": 0.34, + "output": 1.19, + "cache_read": 0.04 + } }, - "meta.llama3-1-70b-instruct-v1:0": { - "id": "meta.llama3-1-70b-instruct-v1:0", - "name": "Llama 3.1 70B Instruct", - "family": "llama", + "zai-org-glm-5-1": { + "id": "zai-org-glm-5-1", + "name": "GLM 5.1", + "family": "glm", "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, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 128000, "output": 4096 } - }, - "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)", - "family": "claude-haiku", - "attachment": true, "reasoning": true, "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", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2026-04-07", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "output": 24000 + }, + "cost": { + "input": 1.75, + "output": 5.5, + "cache_read": 0.325 + } }, - "anthropic.claude-opus-4-5-20251101-v1:0": { - "id": "anthropic.claude-opus-4-5-20251101-v1:0", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "openai-gpt-55": { + "id": "openai-gpt-55", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-04-23", + "last_updated": "2026-04-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 131072 + }, + "cost": { + "input": 6.25, + "output": 37.5, + "cache_read": 0.625, + "tiers": [ + { + "input": 12.5, + "output": 56.25, + "cache_read": 1.25, + "tier": { + "type": "context", + "size": 272000 + } + } + ], + "context_over_200k": { + "input": 12.5, + "output": 56.25, + "cache_read": 1.25 + } + } }, - "us.anthropic.claude-sonnet-4-6": { - "id": "us.anthropic.claude-sonnet-4-6", - "name": "Claude Sonnet 4.6 (US)", - "family": "claude-sonnet", + "qwen3-6-27b": { + "id": "qwen3-6-27b", + "name": "Qwen 3.6 27B", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-04-29", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.325, + "output": 3.25 + } }, - "global.anthropic.claude-sonnet-4-20250514-v1:0": { - "id": "global.anthropic.claude-sonnet-4-20250514-v1:0", - "name": "Claude Sonnet 4 (Global)", - "family": "claude-sonnet", + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } - } - } - }, - "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": { - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 204800, "output": 131072 } - }, - "zai-org/GLM-4.7-Flash": { - "id": "zai-org/GLM-4.7-Flash", - "name": "GLM-4.7-Flash", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-08-08", - "last_updated": "2025-08-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 6, + "output": 30, + "cache_read": 0.6, + "cache_write": 7.5 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM-5", - "family": "glm", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 202752, "output": 131072 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 1.73, + "output": 3.796, + "cache_read": 0.33 + } }, - "MiniMaxAI/MiniMax-M2.1": { - "id": "MiniMaxAI/MiniMax-M2.1", - "name": "MiniMax-M2.1", - "family": "minimax", + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, "knowledge": "2025-10", - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-04", + "last_updated": "2026-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 160000, + "output": 32768 + }, + "cost": { + "input": 0.33, + "output": 0.48, + "cache_read": 0.16 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "qwen-3-6-plus": { + "id": "qwen-3-6-plus", + "name": "Qwen 3.6 Plus Uncensored", + "family": "qwen", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2026-04-06", + "last_updated": "2026-04-12", + "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": 200000 + } + } + ], + "context_over_200k": { + "input": 2.5, + "output": 7.5, + "cache_read": 0.0625, + "cache_write": 0.78 + } + } }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek-R1-0528", - "family": "deepseek-thinking", + "aion-labs-aion-2-0": { + "id": "aion-labs-aion-2-0", + "name": "Aion 2.0", + "family": "o", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 3, "output": 5 }, - "limit": { "context": 163840, "output": 163840 } + "release_date": "2026-03-24", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 1, + "output": 2, + "cache_read": 0.25 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek-V3.2", - "family": "deepseek", - "attachment": false, + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.28, "output": 0.4 }, - "limit": { "context": 163840, "output": 65536 } + "release_date": "2025-01-15", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 198000, + "output": 64000 + }, + "cost": { + "input": 3.75, + "output": 18.75, + "cache_read": 0.375, + "cache_write": 4.69 + } }, - "Qwen/Qwen3-Next-80B-A3B-Thinking": { - "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", - "name": "Qwen3-Next-80B-A3B-Thinking", - "family": "qwen", - "attachment": false, + "openai-gpt-4o-2024-11-20": { + "id": "openai-gpt-4o-2024-11-20", + "name": "GPT-4o", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 2 }, - "limit": { "context": 262144, "output": 131072 } + "release_date": "2026-02-28", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 3.125, + "output": 12.5 + } }, - "Qwen/Qwen3-Coder-Next": { - "id": "Qwen/Qwen3-Coder-Next", - "name": "Qwen3-Coder-Next", - "family": "qwen", + "llama-3.3-70b": { + "id": "llama-3.3-70b", + "name": "Llama 3.3 70B", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-03", - "last_updated": "2026-02-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2025-04-06", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.7, + "output": 2.8 + } }, - "Qwen/Qwen3.5-397B-A17B": { - "id": "Qwen/Qwen3.5-397B-A17B", - "name": "Qwen3.5-397B-A17B", - "family": "qwen", + "kimi-k2-5": { + "id": "kimi-k2-5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-01", - "last_updated": "2026-02-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 262144, "output": 32768 } - }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen3-235B-A22B-Thinking-2507", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 3 }, - "limit": { "context": 262144, "output": 131072 } + "knowledge": "2024-04", + "release_date": "2026-01-27", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.56, + "output": 3.5, + "cache_read": 0.22 + } }, - "Qwen/Qwen3-Next-80B-A3B-Instruct": { - "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "name": "Qwen3-Next-80B-A3B-Instruct", - "family": "qwen", + "llama-3.2-3b": { + "id": "llama-3.2-3b", + "name": "Llama 3.2 3B", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-11", - "last_updated": "2025-09-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 262144, "output": 66536 } - }, - "Qwen/Qwen3-Embedding-4B": { - "id": "Qwen/Qwen3-Embedding-4B", - "name": "Qwen 3 Embedding 4B", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "knowledge": "2024-12", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-10-03", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32000, "output": 2048 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "name": "Qwen3-Coder-480B-A35B-Instruct", - "family": "qwen", + "arcee-trinity-large-thinking": { + "id": "arcee-trinity-large-thinking", + "name": "Trinity Large Thinking", + "family": "trinity", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 262144, "output": 66536 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.3125, + "output": 1.125, + "cache_read": 0.075 + } }, - "Qwen/Qwen3-Embedding-8B": { - "id": "Qwen/Qwen3-Embedding-8B", - "name": "Qwen 3 Embedding 8B", - "family": "qwen", + "hermes-3-llama-3.1-405b": { + "id": "hermes-3-llama-3.1-405b", + "name": "Hermes 3 Llama 3.1 405b", + "family": "hermes", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "knowledge": "2024-12", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32000, "output": 4096 } - }, - "moonshotai/Kimi-K2-Instruct": { - "id": "moonshotai/Kimi-K2-Instruct", - "name": "Kimi-K2-Instruct", - "family": "kimi", - "attachment": false, - "reasoning": false, - "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-14", - "last_updated": "2025-07-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-09-25", + "last_updated": "2026-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.1, + "output": 3 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi-K2.5", - "family": "kimi", + "gemini-3-1-pro-preview": { + "id": "gemini-3-1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-01", - "last_updated": "2026-01-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2026-02-19", + "last_updated": "2026-03-12", + "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, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + } + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi-K2-Instruct-0905", + "kimi-k2-6": { + "id": "kimi-k2-6", + "name": "Kimi K2.6", "family": "kimi", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-04", - "last_updated": "2025-09-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-20", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 262144, "output": 16384 } + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.85, + "output": 4.655, + "cache_read": 0.22 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "Kimi-K2-Thinking", - "family": "kimi-thinking", + "claude-opus-4-6-fast": { + "id": "claude-opus-4-6-fast", + "name": "Claude Opus 4.6 Fast", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-04-08", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 36, + "output": 180, + "cache_read": 3.6, + "cache_write": 45 + } + }, + "z-ai-glm-5-turbo": { + "id": "z-ai-glm-5-turbo", + "name": "GLM 5 Turbo", + "family": "glm", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-03-15", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 200000, + "output": 32768 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24 + } }, - "XiaomiMiMo/MiMo-V2-Flash": { - "id": "XiaomiMiMo/MiMo-V2-Flash", - "name": "MiMo-V2-Flash", - "family": "mimo", - "attachment": false, + "google-gemma-4-31b-it": { + "id": "google-gemma-4-31b-it", + "name": "Google Gemma 4 31B Instruct", + "family": "gemma", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-03", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262144, "output": 4096 } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.175, + "output": 0.5 + } } } }, - "stepfun": { - "id": "stepfun", - "env": ["STEPFUN_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://api.stepfun.com/v1", - "name": "StepFun", - "doc": "https://platform.stepfun.com/docs/zh/overview/concept", + "aihubmix": { + "id": "aihubmix", + "env": ["AIHUBMIX_API_KEY"], + "npm": "@aihubmix/ai-sdk-provider", + "name": "AIHubMix", + "doc": "https://docs.aihubmix.com", "models": { - "step-1-32k": { - "id": "step-1-32k", - "name": "Step 1 (32K)", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-01-01", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.05, "output": 9.59, "cache_read": 0.41 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } - }, - "step-3.5-flash": { - "id": "step-3.5-flash", - "name": "Step 3.5 Flash", + "minimax-m2.7": { + "id": "minimax-m2.7", + "name": "MiniMax-M2.7", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-29", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.096, "output": 0.288, "cache_read": 0.019 }, - "limit": { "context": 256000, "input": 256000, "output": 256000 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.2958, + "output": 1.1832, + "cache_read": 0.05916 + } }, - "step-2-16k": { - "id": "step-2-16k", - "name": "Step 2 (16K)", + "coding-glm-5.1-free": { + "id": "coding-glm-5.1-free", + "name": "Coding GLM 5.1 (free)", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-01-01", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-11", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5.21, "output": 16.44, "cache_read": 1.04 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } - } - } - }, - "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": { - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "GPT-5", - "family": "gpt", + "limit": { + "context": 204800, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } + }, + "gemini-3.1-pro-preview-customtools": { + "id": "gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } + } }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi-k2.5", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 0 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.105 + } + }, + "glm-5v-turbo": { + "id": "glm-5v-turbo", + "name": "GLM 5 Vision Turbo", + "family": "glm", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-05-09", + "last_updated": "2026-05-09", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.7042, + "output": 3.09848, + "cache_read": 0.169008 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", + "grok-4.3": { + "id": "grok-4.3", + "name": "Grok 4.3", + "family": "grok", "attachment": true, - "reasoning": false, + "reasoning": true, "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"] }, + "release_date": "2026-05-01", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "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 + } + } }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "coding-minimax-m2.7-highspeed": { + "id": "coding-minimax-m2.7-highspeed", + "name": "Coding MiniMax M2.7 Highspeed", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 204800, + "output": 13100 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10-01", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.005 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", - "attachment": false, + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 131072, "output": 65536 } + "knowledge": "2025-01", + "release_date": "2026-02-19", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2 + } }, - "x-ai/grok-4": { - "id": "x-ai/grok-4", - "name": "Grok 4", - "family": "grok", + "coding-glm-5.1": { + "id": "coding-glm-5.1", + "name": "Coding-GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-11", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75, "cache_write": 15 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.06, + "output": 0.22 + } }, - "anthropic/claude-opus-4.1": { - "id": "anthropic/claude-opus-4.1", - "name": "Claude Opus 4.1", - "family": "claude-opus", + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1050000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5 + } }, - "z-ai/glm-5": { - "id": "z-ai/glm-5", - "name": "GLM-5", - "family": "glm", + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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 + } + }, + "deepseek-v4-flash-think": { + "id": "deepseek-v4-flash-think", + "name": "DeepSeek V4 Flash Think", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.95, "output": 3.15 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.154, + "output": 0.308, + "cache_read": 0.0308 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.0375 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "deepseek-ai/deepseek-r1-distill-llama-70b": { - "id": "deepseek-ai/deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill Llama 70B", - "family": "deepseek-thinking", - "attachment": false, + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-01-23", - "last_updated": "2025-01-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.14 }, - "limit": { "context": 131072, "output": 131072 } + "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, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "qwen/qwen3-coder": { - "id": "qwen/qwen3-coder", - "name": "Qwen3 Coder", + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", "family": "qwen", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "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": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 262144, "output": 66536 } + "release_date": "2026-05-09", + "last_updated": "2026-05-09", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 991000, + "output": 64000 + }, + "cost": { + "input": 0.282, + "output": 1.692, + "cache_read": 0.0282, + "cache_write": 0.3525 + } }, - "moonshotai/kimi-k2": { - "id": "moonshotai/kimi-k2", - "name": "Kimi K2", - "family": "kimi", - "attachment": false, + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4-Mini", + "family": "gpt-mini", + "attachment": true, "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, - "cost": { "input": 0.55, "output": 2.2 }, - "limit": { "context": 131072, "output": 32768 } - } - } - }, - "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/development/model-apis/overview", - "models": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "structured_output": true, + "temperature": false, + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } + }, + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.845, + "output": 3.38, + "cache_read": 0.183112 + } }, - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o-mini", + "attachment": true, + "reasoning": true, + "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 + } + }, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2-Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "knowledge": "2025-08-31", + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } + }, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 204800, "output": 131072 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex mini", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.95, "output": 3.15 }, - "limit": { "context": 202752, "output": 131072 } + "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 + } }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "GLM 4.6", - "family": "glm", - "attachment": false, - "reasoning": false, + "gemini-3.1-flash-lite": { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2025-09-16", - "last_updated": "2025-09-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 200000, "output": 200000 } + "knowledge": "2025-01", + "release_date": "2026-03-03", + "last_updated": "2026-03-03", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.25 + } }, - "nvidia/Nemotron-120B-A12B": { - "id": "nvidia/Nemotron-120B-A12B", - "name": "Nemotron 3 Super", - "family": "nemotron", - "attachment": false, + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2026-02", - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.75 }, - "limit": { "context": 262144, "output": 32678 } + "knowledge": "2025-11", + "release_date": "2025-11-15", + "last_updated": "2025-11-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "claude-opus-4-6-think": { + "id": "claude-opus-4-6-think", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2026-01", - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204000, "output": 204000 } + "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": 32000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "deepseek-ai/DeepSeek-V3.1": { - "id": "deepseek-ai/DeepSeek-V3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "coding-minimax-m2.7-free": { + "id": "coding-minimax-m2.7-free", + "name": "Coding-MiniMax-M2.7-Free", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-25", - "last_updated": "2025-08-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 164000, "output": 131000 } + "limit": { + "context": 204800, + "output": 13100 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-V3-0324": { - "id": "deepseek-ai/DeepSeek-V3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.77, "output": 0.77 }, - "limit": { "context": 164000, "output": 131000 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.154, + "output": 0.308, + "cache_read": 0.0308 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", - "attachment": false, + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2025-12-01", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.45 }, - "limit": { "context": 163800, "output": 131100 }, - "status": "deprecated" + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.95, + "output": 3.9995, + "cache_read": 0.160835 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-12", - "release_date": "2026-01-30", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 262144, "output": 8192 } + "structured_output": true, + "temperature": false, + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi K2 Instruct 0905", - "family": "kimi", - "attachment": false, - "reasoning": false, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-09-05", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 262144 }, - "status": "deprecated" + "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 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 262144, "output": 262144 }, - "status": "deprecated" - } - } - }, - "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": { - "meituan/longcat-flash-thinking": { - "id": "meituan/longcat-flash-thinking", - "name": "LongCat Flash Thinking", - "family": "longcat", - "attachment": false, + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.478, + "output": 0.956, + "cache_read": 0.004302 + } + }, + "claude-opus-4-7-think": { + "id": "claude-opus-4-7-think", + "name": "Claude Opus 4.7 Thinking", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "meituan/longcat-flash-thinking-2601": { - "id": "meituan/longcat-flash-thinking-2601", - "name": "LongCat Flash Thinking 2601", - "family": "longcat", + "coding-minimax-m2.7": { + "id": "coding-minimax-m2.7", + "name": "Coding MiniMax M2.7", + "family": "minimax", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2026-03-13", - "last_updated": "2026-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 32768, "output": 32768 } + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 13100 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "meituan/longcat-flash-chat": { - "id": "meituan/longcat-flash-chat", - "name": "LongCat Flash Chat", - "family": "longcat", + "qwen3.6-max-preview": { + "id": "qwen3.6-max-preview", + "name": "Qwen3.6 Max Preview", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-30", - "last_updated": "2025-08-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-05-09", + "last_updated": "2026-05-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 240000, + "output": 64000 + }, + "cost": { + "input": 1.268, + "output": 7.608, + "cache_read": 0.1268, + "cache_write": 1.585 + } }, - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT-5.2-Codex", - "family": "gpt-codex", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12", - "last_updated": "2025-12", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } - }, - "openai/text-embedding-3-large": { - "id": "openai/text-embedding-3-large", - "name": "text-embedding-3-large", - "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"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.13, "output": 0 }, - "limit": { "context": 8192, "input": 6656, "output": 1536 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex mini", - "family": "gpt", + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "family": "gpt-mini", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-05-16", - "last_updated": "2025-05-16", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "openai/gpt-5.4-pro": { - "id": "openai/gpt-5.4-pro", - "name": "GPT 5.4 Pro", - "family": "gpt", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-05", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 30, "output": 180 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "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", - "family": "gpt", + "claude-sonnet-4-6-think": { + "id": "claude-sonnet-4-6-think", + "name": "Claude Sonnet 4.6 Think", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-17", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.75, "output": 4.5, "cache_read": 0.075 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } + } }, - "openai/gpt-5-pro": { - "id": "openai/gpt-5-pro", - "name": "GPT-5 pro", - "family": "gpt", + "qwen3.6-flash": { + "id": "qwen3.6-flash", + "name": "Qwen3.6 Flash", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text", "image"] }, + "knowledge": "2025-04", + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "input": 128000, "output": 272000 } + "limit": { + "context": 991000, + "output": 64000 + }, + "cost": { + "input": 0.169, + "output": 1.014, + "cache_read": 0.0169, + "cache_write": 0.21125 + } + } + } + }, + "cerebras": { + "id": "cerebras", + "env": ["CEREBRAS_API_KEY"], + "npm": "@ai-sdk/cerebras", + "name": "Cerebras", + "doc": "https://inference-docs.cerebras.ai/models/overview", + "models": { + "llama3.1-8b": { + "id": "llama3.1-8b", + "name": "Llama 3.1 8B", + "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": 32000, + "output": 8000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "openai/gpt-5.1-thinking": { - "id": "openai/gpt-5.1-thinking", - "name": "GPT 5.1 Thinking", - "family": "gpt", - "attachment": true, - "reasoning": true, + "qwen-3-235b-a22b-instruct-2507": { + "id": "qwen-3-235b-a22b-instruct-2507", + "name": "Qwen 3 235B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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": 131000, + "output": 32000 + }, + "cost": { + "input": 0.6, + "output": 1.2 + } }, - "openai/gpt-5.3-codex": { - "id": "openai/gpt-5.3-codex", - "name": "GPT 5.3 Codex", - "family": "gpt", - "attachment": true, - "reasoning": true, + "zai-glm-4.7": { + "id": "zai-glm-4.7", + "name": "Z.AI GLM-4.7", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "release_date": "2026-01-10", + "last_updated": "2026-01-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 40000 + }, + "cost": { + "input": 2.25, + "output": 2.75, + "cache_read": 0, + "cache_write": 0 + } }, - "openai/gpt-5.1-codex-max": { - "id": "openai/gpt-5.1-codex-max", - "name": "GPT 5.1 Codex Max", - "family": "gpt", - "attachment": true, + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } - }, - "openai/codex-mini": { - "id": "openai/codex-mini", - "name": "Codex Mini", - "family": "gpt-codex-mini", - "attachment": true, + "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 + } + } + } + }, + "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": { + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-05-16", - "last_updated": "2025-05-16", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.38 }, - "limit": { "context": 200000, "input": 100000, "output": 100000 } + "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 + } }, - "openai/gpt-3.5-turbo": { - "id": "openai/gpt-3.5-turbo", - "name": "GPT-3.5 Turbo", - "family": "gpt", + "qwen/qwen3-coder-30b": { + "id": "qwen/qwen3-coder-30b", + "name": "Qwen3 Coder 30B", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2021-09", - "release_date": "2023-03-01", - "last_updated": "2023-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 16385, "input": 12289, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openai/gpt-3.5-turbo-instruct": { - "id": "openai/gpt-3.5-turbo-instruct", - "name": "GPT-3.5 Turbo Instruct", - "family": "gpt", + "qwen/qwen3-30b-a3b-2507": { + "id": "qwen/qwen3-30b-a3b-2507", + "name": "Qwen3 30B A3B 2507", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2021-09", - "release_date": "2023-03-01", - "last_updated": "2023-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 8192, "input": 4096, "output": 4096 } - }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, - "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 131072, "output": 131072 } - }, - "openai/gpt-5.4": { - "id": "openai/gpt-5.4", - "name": "GPT 5.4", - "family": "gpt", + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } + } + } + }, + "lucidquery": { + "id": "lucidquery", + "env": ["LUCIDQUERY_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://lucidquery.com/api/v1", + "name": "LucidQuery AI", + "doc": "https://lucidquery.com/api/docs", + "models": { + "lucidnova-rf1-100b": { + "id": "lucidnova-rf1-100b", + "name": "LucidNova RF1 100B", + "family": "nova", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-05", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-09-16", + "release_date": "2024-12-28", + "last_updated": "2025-09-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } + "limit": { + "context": 120000, + "output": 8000 + }, + "cost": { + "input": 2, + "output": 5 + } }, - "openai/gpt-5-chat": { - "id": "openai/gpt-5-chat", - "name": "GPT-5 Chat", - "family": "gpt", + "lucidquery-nexus-coder": { + "id": "lucidquery-nexus-coder", + "name": "LucidQuery Nexus Coder", + "family": "lucid", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text", "image"] }, + "temperature": false, + "knowledge": "2025-08-01", + "release_date": "2025-09-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 128000, "input": 111616, "output": 16384 } - }, - "openai/gpt-5.4-nano": { - "id": "openai/gpt-5.4-nano", - "name": "GPT 5.4 Nano", - "family": "gpt", - "attachment": true, + "limit": { + "context": 250000, + "output": 60000 + }, + "cost": { + "input": 2, + "output": 5 + } + } + } + }, + "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-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-03-17", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.19999999999999998, "output": 1.25, "cache_read": 0.02 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } }, - "openai/gpt-5.3-chat": { - "id": "openai/gpt-5.3-chat", - "name": "GPT-5.3 Chat", - "family": "gpt", - "attachment": true, - "reasoning": true, + "kimi-k2-0711-preview": { + "id": "kimi-k2-0711-preview", + "name": "Kimi K2 0711", + "family": "kimi", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-03", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "input": 111616, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2025-07-14", + "last_updated": "2025-07-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "openai/text-embedding-ada-002": { - "id": "openai/text-embedding-ada-002", - "name": "text-embedding-ada-002", - "family": "text-embedding", + "kimi-k2-turbo-preview": { + "id": "kimi-k2-turbo-preview", + "name": "Kimi K2 Turbo", + "family": "kimi", "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, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8192, "input": 6656, "output": 1536 } + "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 + }, + "cost": { + "input": 2.4, + "output": 10, + "cache_read": 0.6 + } }, - "openai/gpt-5.2-chat": { - "id": "openai/gpt-5.2-chat", - "name": "GPT-5.2 Chat", - "family": "gpt", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 128000, "input": 111616, "output": 16384 } + "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": 262144 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, + "kimi-k2-thinking-turbo": { + "id": "kimi-k2-thinking-turbo", + "name": "Kimi K2 Thinking Turbo", + "family": "kimi-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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": 1.15, + "output": 8, + "cache_read": 0.15 + } }, - "openai/gpt-4o-mini-search-preview": { - "id": "openai/gpt-4o-mini-search-preview", - "name": "GPT 4o Mini Search Preview", - "family": "gpt-mini", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi-k2.5", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "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 + } + }, + "kimi-k2-0905-preview": { + "id": "kimi-k2-0905-preview", + "name": "Kimi K2 0905", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "knowledge": "2023-09", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "input": 111616, "output": 16384 } - }, - "openai/gpt-5.1-instant": { - "id": "openai/gpt-5.1-instant", - "name": "GPT-5.1 Instant", - "family": "gpt", + "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 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } + } + } + }, + "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": { + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text", "image"] }, + "knowledge": "2025-02-31", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 128000, "input": 111616, "output": 16384 } + "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 + } }, - "openai/gpt-oss-safeguard-20b": { - "id": "openai/gpt-oss-safeguard-20b", - "name": "gpt-oss-safeguard-20b", - "family": "gpt-oss", - "attachment": false, + "claude-opus-4-1": { + "id": "claude-opus-4-1", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.08, "output": 0.3, "cache_read": 0.04 }, - "limit": { "context": 131072, "input": 65536, "output": 65536 } + "limit": { + "context": 200000, + "output": 32000 + }, + "provider": { + "npm": "@ai-sdk/anthropic", + "api": "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "openai/o3-pro": { - "id": "openai/o3-pro", - "name": "o3 Pro", - "family": "o-pro", + "claude-opus-4-5": { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-10", - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 20, "output": 80 }, - "limit": { "context": 200000, "input": 100000, "output": 100000 } + "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 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.3 }, - "limit": { "context": 131072, "input": 98304, "output": 32768 } - }, - "openai/text-embedding-3-small": { - "id": "openai/text-embedding-3-small", - "name": "text-embedding-3-small", - "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, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 8192, "input": 6656, "output": 1536 } + "limit": { + "context": 262144, + "output": 262144 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible", + "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", + "shape": "completions" + }, + "cost": { + "input": 0.95, + "output": 4 + } }, - "openai/o3-deep-research": { - "id": "openai/o3-deep-research", - "name": "o3-deep-research", - "family": "o", + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-10", - "release_date": "2024-06-26", - "last_updated": "2024-06-26", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 40, "cache_read": 2.5 }, - "limit": { "context": 200000, "input": 100000, "output": 100000 } + "limit": { + "context": 200000, + "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 + } + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT-5.1-Codex", - "family": "gpt", + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "GPT 5.2 ", - "family": "gpt", - "attachment": true, + "mai-ds-r1": { + "id": "mai-ds-r1", + "name": "MAI-DS-R1", + "family": "mai", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "o4-mini", - "family": "o-mini", + "llama-4-maverick-17b-128e-instruct-fp8": { + "id": "llama-4-maverick-17b-128e-instruct-fp8", + "name": "Llama 4 Maverick 17B 128E Instruct FP8", + "family": "llama", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "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.25, + "output": 1 + } + }, + "codestral-2501": { + "id": "codestral-2501", + "name": "Codestral 25.01", + "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "GPT-5-Codex", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", "family": "gpt-codex", "attachment": false, "reasoning": true, @@ -38825,1178 +74679,2122 @@ "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"] }, + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text", "image", "audio"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "openai/gpt-4.1-nano": { - "id": "openai/gpt-4.1-nano", - "name": "GPT-4.1 nano", - "family": "gpt-nano", - "attachment": true, - "reasoning": false, + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": 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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1047576, "output": 32768 } + "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": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", - "attachment": true, + "deepseek-r1-0528": { + "id": "deepseek-r1-0528", + "name": "DeepSeek-R1-0528", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "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"] }, + "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": 163840 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } + }, + "gpt-3.5-turbo-instruct": { + "id": "gpt-3.5-turbo-instruct", + "name": "GPT-3.5 Turbo Instruct", + "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, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.005 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 1.5, + "output": 2 + } }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "GPT-4.1 mini", - "family": "gpt-mini", + "mistral-medium-2505": { + "id": "mistral-medium-2505", + "name": "Mistral Medium 3", + "family": "mistral-medium", "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"] }, + "knowledge": "2025-05", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "openai/o3": { - "id": "openai/o3", - "name": "o3", - "family": "o", - "attachment": true, + "phi-4-reasoning-plus": { + "id": "phi-4-reasoning-plus", + "name": "Phi-4-reasoning-plus", + "family": "phi", + "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, + "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 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } + }, + "cohere-embed-v3-english": { + "id": "cohere-embed-v3-english", + "name": "Embed v3 English", + "family": "cohere-embed", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": false, - "knowledge": "2024-05", - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2023-11-07", + "last_updated": "2023-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512, + "output": 1024 + }, + "cost": { + "input": 0.1, + "output": 0 + } + }, + "gpt-4-32k": { + "id": "gpt-4-32k", + "name": "GPT-4 32K", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2023-11", + "release_date": "2023-03-14", + "last_updated": "2023-03-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 60, + "output": 120 + } }, - "openai/o1": { - "id": "openai/o1", - "name": "o1", - "family": "o", + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2024-09-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT-4.1", + "phi-4": { + "id": "phi-4", + "name": "Phi-4", + "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 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } + }, + "gpt-3.5-turbo-0613": { + "id": "gpt-3.5-turbo-0613", + "name": "GPT-3.5 Turbo 0613", "family": "gpt", - "attachment": true, + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2021-08", + "release_date": "2023-06-13", + "last_updated": "2023-06-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 3, + "output": 4 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "GPT-4o mini", - "family": "gpt-mini", - "attachment": true, + "phi-3-medium-128k-instruct": { + "id": "phi-3-medium-128k-instruct", + "name": "Phi-3-medium-instruct (128k)", + "family": "phi", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": 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, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", - "attachment": true, + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek-V3.2", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + }, + "cost": { + "input": 0.58, + "output": 1.68 + } }, - "openai/gpt-4o": { - "id": "openai/gpt-4o", - "name": "GPT-4o", + "phi-3-small-128k-instruct": { + "id": "phi-3-small-128k-instruct", + "name": "Phi-3-small-instruct (128k)", + "family": "phi", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } + }, + "gpt-3.5-turbo-0301": { + "id": "gpt-3.5-turbo-0301", + "name": "GPT-3.5 Turbo 0301", "family": "gpt", - "attachment": true, + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2023-09", - "release_date": "2024-05-13", - "last_updated": "2024-08-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2021-08", + "release_date": "2023-03-01", + "last_updated": "2023-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 1.5, + "output": 2 + } }, - "openai/gpt-4-turbo": { - "id": "openai/gpt-4-turbo", - "name": "GPT-4 Turbo", - "family": "gpt", - "attachment": true, + "phi-4-mini": { + "id": "phi-4-mini", + "name": "Phi-4-mini", + "family": "phi", + "attachment": false, "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, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "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 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "GPT-5", - "family": "gpt", - "attachment": true, + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "GPT-5-Codex", + "family": "gpt-codex", + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "openai/o3-mini": { - "id": "openai/o3-mini", - "name": "o3-mini", - "family": "o-mini", + "meta-llama-3-8b-instruct": { + "id": "meta-llama-3-8b-instruct", + "name": "Meta-Llama-3-8B-Instruct", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2023-12", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.3, + "output": 0.61 + } + }, + "gpt-4": { + "id": "gpt-4", + "name": "GPT-4", + "family": "gpt", + "attachment": false, + "reasoning": false, "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"] }, + "temperature": true, + "knowledge": "2023-11", + "release_date": "2023-03-14", + "last_updated": "2023-03-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 60, + "output": 120 + } }, - "prime-intellect/intellect-3": { - "id": "prime-intellect/intellect-3", - "name": "INTELLECT 3", - "family": "intellect", + "phi-4-mini-reasoning": { + "id": "phi-4-mini-reasoning", + "name": "Phi-4-mini-reasoning", + "family": "phi", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-11-26", - "last_updated": "2025-11-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 131072, "output": 131072 } + "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 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "bfl/flux-pro-1.1": { - "id": "bfl/flux-pro-1.1", - "name": "FLUX1.1 [pro]", - "family": "flux", + "meta-llama-3.1-70b-instruct": { + "id": "meta-llama-3.1-70b-instruct", + "name": "Meta-Llama-3.1-70B-Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-10", - "last_updated": "2024-10", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 512, "output": 0 } + "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": 32768 + }, + "cost": { + "input": 2.68, + "output": 3.54 + } }, - "bfl/flux-pro-1.1-ultra": { - "id": "bfl/flux-pro-1.1-ultra", - "name": "FLUX1.1 [pro] Ultra", - "family": "flux", + "phi-3-mini-4k-instruct": { + "id": "phi-3-mini-4k-instruct", + "name": "Phi-3-mini-instruct (4k)", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2024-11", - "last_updated": "2024-11", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 512, "output": 0 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 1024 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "bfl/flux-pro-1.0-fill": { - "id": "bfl/flux-pro-1.0-fill", - "name": "FLUX.1 Fill [pro]", - "family": "flux", + "deepseek-v3.1": { + "id": "deepseek-v3.1", + "name": "DeepSeek-V3.1", + "family": "deepseek", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-10", - "last_updated": "2024-10", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 512, "output": 0 } + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.56, + "output": 1.68 + } }, - "bfl/flux-kontext-max": { - "id": "bfl/flux-kontext-max", - "name": "FLUX.1 Kontext Max", - "family": "flux", + "text-embedding-3-small": { + "id": "text-embedding-3-small", + "name": "text-embedding-3-small", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2025-06", - "last_updated": "2025-06", - "modalities": { "input": ["text"], "output": ["image"] }, + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 512, "output": 0 } + "limit": { + "context": 8191, + "output": 1536 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "bfl/flux-kontext-pro": { - "id": "bfl/flux-kontext-pro", - "name": "FLUX.1 Kontext Pro", - "family": "flux", + "gpt-3.5-turbo-1106": { + "id": "gpt-3.5-turbo-1106", + "name": "GPT-3.5 Turbo 1106", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2025-06", - "last_updated": "2025-06", - "modalities": { "input": ["text"], "output": ["image"] }, + "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": 512, "output": 0 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 2 + } }, - "cohere/embed-v4.0": { - "id": "cohere/embed-v4.0", - "name": "Embed v4.0", - "family": "cohere-embed", - "attachment": false, + "model-router": { + "id": "model-router", + "name": "Model Router", + "family": "model-router", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "release_date": "2025-05-19", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.14, + "output": 0 + } }, - "cohere/command-a": { - "id": "cohere/command-a", - "name": "Command A", - "family": "command", - "attachment": false, + "mistral-small-2503": { + "id": "mistral-small-2503", + "name": "Mistral Small 3.1", + "family": "mistral-small", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-03-13", - "last_updated": "2025-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2025-03-01", + "last_updated": "2025-03-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "output": 8000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "kwaipilot/kat-coder-pro-v1": { - "id": "kwaipilot/kat-coder-pro-v1", - "name": "KAT-Coder-Pro V1", - "family": "kat-coder", + "o1": { + "id": "o1", + "name": "o1", + "family": "o", "attachment": false, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-10-24", - "last_updated": "2025-10-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 256000, "output": 32000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } }, - "kwaipilot/kat-coder-pro-v2": { - "id": "kwaipilot/kat-coder-pro-v2", - "name": "Kat Coder Pro V2", - "family": "kat-coder", - "attachment": false, + "grok-4-fast-reasoning": { + "id": "grok-4-fast-reasoning", + "name": "Grok 4 Fast (Reasoning)", + "family": "grok", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-27", - "last_updated": "2026-03-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "morph/morph-v3-fast": { - "id": "morph/morph-v3-fast", - "name": "Morph v3 Fast", - "family": "morph", - "attachment": false, - "reasoning": false, - "tool_call": false, + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text", "image", "audio"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 1.2 }, - "limit": { "context": 16000, "output": 16000 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "morph/morph-v3-large": { - "id": "morph/morph-v3-large", - "name": "Morph v3 Large", - "family": "morph", + "cohere-embed-v3-multilingual": { + "id": "cohere-embed-v3-multilingual", + "name": "Embed v3 Multilingual", + "family": "cohere-embed", "attachment": false, "reasoning": false, "tool_call": false, "temperature": false, - "release_date": "2024-08-15", - "last_updated": "2024-08-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.9, "output": 1.9 }, - "limit": { "context": 32000, "output": 32000 } + "release_date": "2023-11-07", + "last_updated": "2023-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512, + "output": 1024 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "anthropic/claude-opus-4.6": { - "id": "anthropic/claude-opus-4.6", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "o1-preview": { + "id": "o1-preview", + "name": "o1-preview", + "family": "o", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, - "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02", - "last_updated": "2026-02", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 16.5, + "output": 66, + "cache_read": 8.25 + } }, - "anthropic/claude-haiku-4.5": { - "id": "anthropic/claude-haiku-4.5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, - "reasoning": true, - "tool_call": true, - "interleaved": true, + "gpt-3.5-turbo-0125": { + "id": "gpt-3.5-turbo-0125", + "name": "GPT-3.5 Turbo 0125", + "family": "gpt", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-02-28", - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2021-08", + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "anthropic/claude-sonnet-4.6": { - "id": "anthropic/claude-sonnet-4.6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex Mini", + "family": "gpt-codex", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, - "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "structured_output": true, + "temperature": false, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 400000, + "output": 128000 }, - "limit": { "context": 1000000, "output": 128000 } + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "anthropic/claude-opus-4.5": { - "id": "anthropic/claude-opus-4.5", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "cohere-embed-v-4-0": { + "id": "cohere-embed-v-4-0", + "name": "Embed v4", + "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 + }, + "cost": { + "input": 0.12, + "output": 0 + } + }, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, - "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "anthropic/claude-3.5-sonnet-20240620": { - "id": "anthropic/claude-3.5-sonnet-20240620", - "name": "Claude 3.5 Sonnet (2024-06-20)", - "family": "claude-sonnet", + "gpt-4-turbo-vision": { + "id": "gpt-4-turbo-vision", + "name": "GPT-4 Turbo Vision", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-06-20", - "last_updated": "2024-06-20", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2023-11", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "anthropic/claude-opus-4": { - "id": "anthropic/claude-opus-4", - "name": "Claude Opus 4", - "family": "claude-opus", + "gpt-5.1-chat": { + "id": "gpt-5.1-chat", + "name": "GPT-5.1 Chat", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "structured_output": true, + "temperature": false, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text", "image", "audio"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "anthropic/claude-sonnet-4.5": { - "id": "anthropic/claude-sonnet-4.5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "meta-llama-3.1-405b-instruct": { + "id": "meta-llama-3.1-405b-instruct", + "name": "Meta-Llama-3.1-405B-Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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": 32768 + }, + "cost": { + "input": 5.33, + "output": 16 + } }, - "anthropic/claude-3-haiku": { - "id": "anthropic/claude-3-haiku", - "name": "Claude Haiku 3", - "family": "claude-haiku", + "llama-3.2-11b-vision-instruct": { + "id": "llama-3.2-11b-vision-instruct", + "name": "Llama-3.2-11B-Vision-Instruct", + "family": "llama", "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, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "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.37, + "output": 0.37 + } }, - "anthropic/claude-3.5-sonnet": { - "id": "anthropic/claude-3.5-sonnet", - "name": "Claude Sonnet 3.5 v2", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, + "cohere-command-a": { + "id": "cohere-command-a", + "name": "Command A", + "family": "command-a", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04-30", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "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 + } }, - "anthropic/claude-3.5-haiku": { - "id": "anthropic/claude-3.5-haiku", - "name": "Claude Haiku 3.5", - "family": "claude-haiku", - "attachment": true, + "mistral-large-2411": { + "id": "mistral-large-2411", + "name": "Mistral Large 24.11", + "family": "mistral-large", + "attachment": false, "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"] }, + "knowledge": "2024-09", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08, "cache_write": 1 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "anthropic/claude-sonnet-4": { - "id": "anthropic/claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.125 + } }, - "anthropic/claude-3.7-sonnet": { - "id": "anthropic/claude-3.7-sonnet", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", - "attachment": true, + "deepseek-v3.2-speciale": { + "id": "deepseek-v3.2-speciale", + "name": "DeepSeek-V3.2-Speciale", + "family": "deepseek", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "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 + }, + "cost": { + "input": 0.58, + "output": 1.68 + } }, - "anthropic/claude-opus-4.1": { - "id": "anthropic/claude-opus-4.1", - "name": "Claude Opus 4", - "family": "claude-opus", - "attachment": true, + "deepseek-r1": { + "id": "deepseek-r1", + "name": "DeepSeek-R1", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": 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, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "anthropic/claude-3-opus": { - "id": "anthropic/claude-3-opus", - "name": "Claude Opus 3", - "family": "claude-opus", + "llama-3.2-90b-vision-instruct": { + "id": "llama-3.2-90b-vision-instruct", + "name": "Llama-3.2-90B-Vision-Instruct", + "family": "llama", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-02-29", - "last_updated": "2024-02-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 4096 } + "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": 2.04, + "output": 2.04 + } }, - "recraft/recraft-v2": { - "id": "recraft/recraft-v2", - "name": "Recraft V2", - "family": "recraft", + "text-embedding-ada-002": { + "id": "text-embedding-ada-002", + "name": "text-embedding-ada-002", + "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 + } + }, + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2024-03", - "last_updated": "2024-03", - "modalities": { "input": ["text"], "output": ["image"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-24", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 512, "output": 0 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "recraft/recraft-v3": { - "id": "recraft/recraft-v3", - "name": "Recraft V3", - "family": "recraft", + "phi-3-small-8k-instruct": { + "id": "phi-3-small-8k-instruct", + "name": "Phi-3-small-instruct (8k)", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2024-10", - "last_updated": "2024-10", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 512, "output": 0 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "deepseek/deepseek-v3.1-terminus": { - "id": "deepseek/deepseek-v3.1-terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", + "meta-llama-3-70b-instruct": { + "id": "meta-llama-3-70b-instruct", + "name": "Meta-Llama-3-70B-Instruct", + "family": "llama", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 2.68, + "output": 3.54 + } }, - "deepseek/deepseek-v3.2-thinking": { - "id": "deepseek/deepseek-v3.2-thinking", - "name": "DeepSeek V3.2 Thinking", - "family": "deepseek-thinking", - "attachment": false, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 0.28, "output": 0.42, "cache_read": 0.03 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.01 + } }, - "deepseek/deepseek-v3": { - "id": "deepseek/deepseek-v3", - "name": "DeepSeek V3 0324", - "family": "deepseek", - "attachment": false, - "reasoning": false, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-12-26", - "last_updated": "2024-12-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.77, "output": 0.77 }, - "limit": { "context": 163840, "output": 16384 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.03 + } }, - "deepseek/deepseek-v3.2-exp": { - "id": "deepseek/deepseek-v3.2-exp", - "name": "DeepSeek V3.2 Exp", - "family": "deepseek", + "phi-4-reasoning": { + "id": "phi-4-reasoning", + "name": "Phi-4-reasoning", + "family": "phi", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27, "output": 0.4 }, - "limit": { "context": 163840, "output": 163840 } + "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 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } }, - "deepseek/deepseek-v3.1": { - "id": "deepseek/deepseek-v3.1", - "name": "DeepSeek-V3.1", - "family": "deepseek", + "phi-3-mini-128k-instruct": { + "id": "phi-3-mini-128k-instruct", + "name": "Phi-3-mini-instruct (128k)", + "family": "phi", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1 }, - "limit": { "context": 163840, "output": 128000 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "deepseek/deepseek-v3.2": { - "id": "deepseek/deepseek-v3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", + "text-embedding-3-large": { + "id": "text-embedding-3-large", + "name": "text-embedding-3-large", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.4, "cache_read": 0.22 }, - "limit": { "context": 163842, "output": 8000 } + "limit": { + "context": 8191, + "output": 3072 + }, + "cost": { + "input": 0.13, + "output": 0 + } }, - "deepseek/deepseek-r1": { - "id": "deepseek/deepseek-r1", - "name": "DeepSeek-R1", - "family": "deepseek-thinking", + "o1-mini": { + "id": "o1-mini", + "name": "o1-mini", + "family": "o-mini", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-01-20", - "last_updated": "2025-05-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "zai/glm-4.7-flash": { - "id": "zai/glm-4.7-flash", - "name": "GLM 4.7 Flash", - "family": "glm", + "phi-3.5-moe-instruct": { + "id": "phi-3.5-moe-instruct", + "name": "Phi-3.5-MoE-instruct", + "family": "phi", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-13", - "last_updated": "2026-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.07, "output": 0.39999999999999997 }, - "limit": { "context": 200000, "output": 131000 } + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.16, + "output": 0.64 + } }, - "zai/glm-5-turbo": { - "id": "zai/glm-5-turbo", - "name": "GLM 5 Turbo", - "family": "glm", - "attachment": false, + "gpt-5-chat": { + "id": "gpt-5-chat", + "name": "GPT-5 Chat", + "family": "gpt-codex", + "attachment": true, "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2026-03-15", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "knowledge": "2024-10-24", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 4, "cache_read": 0.24 }, - "limit": { "context": 202800, "output": 131100 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "zai/glm-4.5": { - "id": "zai/glm-4.5", - "name": "GLM 4.5", - "family": "glm", + "deepseek-v3-0324": { + "id": "deepseek-v3-0324", + "name": "DeepSeek-V3-0324", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 1.14, + "output": 4.56 + } }, - "zai/glm-4.7-flashx": { - "id": "zai/glm-4.7-flashx", - "name": "GLM 4.7 FlashX", - "family": "glm-flash", + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.71, + "output": 0.71 + } }, - "zai/glm-4.6": { - "id": "zai/glm-4.6", - "name": "GLM 4.6", - "family": "glm", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": false, "reasoning": true, "tool_call": true, "interleaved": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-02-06", + "last_updated": "2026-02-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.45, "output": 1.8 }, - "limit": { "context": 200000, "output": 96000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "provider": { + "npm": "@ai-sdk/openai-compatible", + "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", + "shape": "completions" + }, + "cost": { + "input": 0.6, + "output": 3 + } }, - "zai/glm-4.6v": { - "id": "zai/glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", - "attachment": true, - "reasoning": true, + "meta-llama-3.1-8b-instruct": { + "id": "meta-llama-3.1-8b-instruct", + "name": "Meta-Llama-3.1-8B-Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.9, "cache_read": 0.05 }, - "limit": { "context": 128000, "output": 24000 } + "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": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.61 + } }, - "zai/glm-5": { - "id": "zai/glm-5", - "name": "GLM-5", - "family": "glm", + "ministral-3b": { + "id": "ministral-3b", + "name": "Ministral 3B", + "family": "ministral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 202800, "output": 131072 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "zai/glm-4.5-air": { - "id": "zai/glm-4.5-air", - "name": "GLM 4.5 Air", - "family": "glm-air", + "phi-3-medium-4k-instruct": { + "id": "phi-3-medium-4k-instruct", + "name": "Phi-3-medium-instruct (4k)", + "family": "phi", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 128000, "output": 96000 } + "limit": { + "context": 4096, + "output": 1024 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } }, - "zai/glm-4.5v": { - "id": "zai/glm-4.5v", - "name": "GLM 4.5V", - "family": "glm", + "llama-4-scout-17b-16e-instruct": { + "id": "llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "family": "llama", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-11", - "last_updated": "2025-08-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.8 }, - "limit": { "context": 66000, "output": 66000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.2, + "output": 0.78 + } }, - "zai/glm-4.7": { - "id": "zai/glm-4.7", - "name": "GLM 4.7", - "family": "glm", + "phi-3.5-mini-instruct": { + "id": "phi-3.5-mini-instruct", + "name": "Phi-3.5-mini-instruct", + "family": "phi", "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.43, "output": 1.75, "cache_read": 0.08 }, - "limit": { "context": 202752, "output": 120000 } + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "zai/glm-4.6v-flash": { - "id": "zai/glm-4.6v-flash", - "name": "GLM-4.6V-Flash", - "family": "glm", + "phi-4-multimodal": { + "id": "phi-4-multimodal", + "name": "Phi-4-multimodal", + "family": "phi", "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 128000, "output": 24000 } - }, - "xai/grok-imagine-image": { - "id": "xai/grok-imagine-image", - "name": "Grok Imagine Image", - "family": "grok", - "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2026-01-28", - "last_updated": "2026-02-19", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } + "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 + }, + "cost": { + "input": 0.08, + "output": 0.32, + "input_audio": 4 + } }, - "xai/grok-4.20-reasoning-beta": { - "id": "xai/grok-4.20-reasoning-beta", - "name": "Grok 4.20 Beta Reasoning", - "family": "grok", + "codex-mini": { + "id": "codex-mini", + "name": "Codex Mini", + "family": "gpt-codex-mini", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-04", + "release_date": "2025-05-16", + "last_updated": "2025-05-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 0.19999999999999998 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.5, + "output": 6, + "cache_read": 0.375 + } }, - "xai/grok-4.20-non-reasoning": { - "id": "xai/grok-4.20-non-reasoning", - "name": "Grok 4.20 Non-Reasoning", - "family": "grok", + "gpt-5.2-chat": { + "id": "gpt-5.2-chat", + "name": "GPT-5.2 Chat", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-23", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 6, "cache_read": 0.19999999999999998 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "xai/grok-4.1-fast-non-reasoning": { - "id": "xai/grok-4.1-fast-non-reasoning", - "name": "Grok 4.1 Fast Non-Reasoning", - "family": "grok", + "mistral-nemo": { + "id": "mistral-nemo", + "name": "Mistral Nemo", + "family": "mistral-nemo", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 128000 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } + }, + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "xai/grok-4.1-fast-reasoning": { - "id": "xai/grok-4.1-fast-reasoning", - "name": "Grok 4.1 Fast Reasoning", - "family": "grok", - "attachment": false, + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "family": "gpt-nano", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "xai/grok-4.20-multi-agent-beta": { - "id": "xai/grok-4.20-multi-agent-beta", - "name": "Grok 4.20 Multi Agent Beta", - "family": "grok", - "attachment": false, + "gpt-5.4-pro": { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 6, "cache_read": 0.19999999999999998 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180, + "context_over_200k": { + "input": 60, + "output": 270 + }, + "tiers": [ + { + "input": 60, + "output": 270, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "xai/grok-4.20-reasoning": { - "id": "xai/grok-4.20-reasoning", - "name": "Grok 4.20 Reasoning", - "family": "grok", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-23", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 6, "cache_read": 0.19999999999999998 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + }, + "tiers": [ + { + "input": 5, + "output": 22.5, + "cache_read": 0.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "xai/grok-4.20-multi-agent": { - "id": "xai/grok-4.20-multi-agent", - "name": "Grok 4.20 Multi-Agent", + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "Grok 4 Fast (Non-Reasoning)", "family": "grok", - "attachment": false, - "reasoning": true, + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 0.19999999999999998 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "xai/grok-4-fast-reasoning": { - "id": "xai/grok-4-fast-reasoning", - "name": "Grok 4 Fast Reasoning", + "grok-3": { + "id": "grok-3", + "name": "Grok 3", "family": "grok", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 256000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "xai/grok-imagine-image-pro": { - "id": "xai/grok-imagine-image-pro", - "name": "Grok Imagine Image Pro", - "family": "grok", - "attachment": false, + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2026-01-28", - "last_updated": "2026-02-19", - "modalities": { "input": ["text"], "output": ["text", "image"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "xai/grok-4.20-non-reasoning-beta": { - "id": "xai/grok-4.20-non-reasoning-beta", - "name": "Grok 4.20 Beta Non-Reasoning", - "family": "grok", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 6, "cache_read": 0.19999999999999998 }, - "limit": { "context": 2000000, "output": 2000000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "xai/grok-3": { - "id": "xai/grok-3", - "name": "Grok 3", - "family": "grok", + "cohere-command-r-plus-08-2024": { + "id": "cohere-command-r-plus-08-2024", + "name": "Command R+", + "family": "command-r", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "xai/grok-3-fast": { - "id": "xai/grok-3-fast", - "name": "Grok 3 Fast", - "family": "grok", - "attachment": false, + "gpt-4o": { + "id": "gpt-4o", + "name": "GPT-4o", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-05-13", + "last_updated": "2024-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 1.25 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "xai/grok-2-vision": { - "id": "xai/grok-2-vision", - "name": "Grok 2 Vision", - "family": "grok", + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "GPT-5 Pro", + "family": "gpt-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-08", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 10, "cache_read": 2 }, - "limit": { "context": 8192, "output": 4096 } + "limit": { + "context": 400000, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "xai/grok-3-mini": { - "id": "xai/grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": false, + "o3": { + "id": "o3", + "name": "o3", + "family": "o", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-05", + "release_date": "2025-04-16", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "reasoning": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "xai/grok-3-mini-fast": { - "id": "xai/grok-3-mini-fast", - "name": "Grok 3 Mini Fast", + "grok-3-mini": { + "id": "grok-3-mini", + "name": "Grok 3 Mini", "family": "grok", "attachment": false, "reasoning": true, @@ -40005,29 +76803,50 @@ "knowledge": "2024-11", "release_date": "2025-02-17", "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 4, "reasoning": 4, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "reasoning": 0.5, + "cache_read": 0.075 + } }, - "xai/grok-code-fast-1": { - "id": "xai/grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", - "attachment": false, - "reasoning": true, + "gpt-4.1-nano": { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.03 + } }, - "xai/grok-4": { - "id": "xai/grok-4", + "grok-4": { + "id": "grok-4", "name": "Grok 4", "family": "grok", "attachment": false, @@ -40037,1850 +76856,2740 @@ "knowledge": "2025-07", "release_date": "2025-07-09", "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "reasoning": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 64000 } - }, - "xai/grok-4-fast-non-reasoning": { - "id": "xai/grok-4-fast-non-reasoning", - "name": "Grok 4 Fast (Non-Reasoning)", - "family": "grok", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "reasoning": 15, + "cache_read": 0.75 + } }, - "nvidia/nemotron-3-super-120b-a12b": { - "id": "nvidia/nemotron-3-super-120b-a12b", - "name": "NVIDIA Nemotron 3 Super 120B A12B", - "family": "nemotron", + "o3-mini": { + "id": "o3-mini", + "name": "o3-mini", + "family": "o-mini", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.65 }, - "limit": { "context": 256000, "output": 32000 } - }, - "nvidia/nemotron-nano-12b-v2-vl": { - "id": "nvidia/nemotron-nano-12b-v2-vl", - "name": "Nvidia Nemotron Nano 12B V2 VL", - "family": "nemotron", - "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12", - "last_updated": "2024-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-05", + "release_date": "2024-12-20", + "last_updated": "2025-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "nvidia/nemotron-nano-9b-v2": { - "id": "nvidia/nemotron-nano-9b-v2", - "name": "Nvidia Nemotron Nano 9B V2", - "family": "nemotron", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-08-18", - "last_updated": "2025-08-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-10", + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04, "output": 0.16 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "nvidia/nemotron-3-nano-30b-a3b": { - "id": "nvidia/nemotron-3-nano-30b-a3b", - "name": "Nemotron 3 Nano 30B A3B", - "family": "nemotron", - "attachment": false, + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o-mini", + "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12", - "last_updated": "2024-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.06, "output": 0.24 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.28 + } }, - "google/text-embedding-005": { - "id": "google/text-embedding-005", - "name": "Text Embedding 005", - "family": "text-embedding", + "cohere-command-r-08-2024": { + "id": "cohere-command-r-08-2024", + "name": "Command R", + "family": "command-r", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-08", - "last_updated": "2024-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.03, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "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.15, + "output": 0.6 + } }, - "google/gemini-2.5-flash-lite": { - "id": "google/gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "family": "gemini-flash-lite", + "gpt-4o-mini": { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", "attachment": true, - "reasoning": 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", "audio", "video", "pdf"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "google/gemini-2.5-flash-lite-preview-09-2025": { - "id": "google/gemini-2.5-flash-lite-preview-09-2025", - "name": "Gemini 2.5 Flash Lite Preview 09-25", - "family": "gemini-flash-lite", + "gpt-4-turbo": { + "id": "gpt-4-turbo", + "name": "GPT-4 Turbo", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "google/gemini-3.1-pro-preview": { - "id": "google/gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-19", - "last_updated": "2026-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 1000000, "output": 64000 } - }, - "google/gemini-3-pro-preview": { - "id": "google/gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } + } + } + }, + "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": { + "id": "abliterated-model", + "name": "Abliterated Model", "attachment": true, - "reasoning": true, + "reasoning": false, "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", "audio", "pdf"], "output": ["text"] }, - "open_weights": false, + "release_date": "2026-01-06", + "last_updated": "2026-01-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 150000, + "input": 150000, + "output": 8192 + }, "cost": { - "input": 2, - "output": 12, - "cache_read": 0.2, - "context_over_200k": { "input": 4, "output": 18, "cache_read": 0.4 } + "input": 3, + "output": 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": { + "Qwen3.5-397B-A17B": { + "id": "Qwen3.5-397B-A17B", + "name": "Qwen3.5 397B A17B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "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 }, - "limit": { "context": 1000000, "output": 64000 } + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "google/imagen-4.0-fast-generate-001": { - "id": "google/imagen-4.0-fast-generate-001", - "name": "Imagen 4 Fast", - "family": "imagen", + "GLM-5.1": { + "id": "GLM-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-06", - "last_updated": "2025-06", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 480, "output": 0 } - }, - "google/imagen-4.0-generate-001": { - "id": "google/imagen-4.0-generate-001", - "name": "Imagen 4", - "family": "imagen", + "reasoning": true, + "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 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "cohere": { + "id": "cohere", + "env": ["COHERE_API_KEY"], + "npm": "@ai-sdk/cohere", + "name": "Cohere", + "doc": "https://docs.cohere.com/docs/models", + "models": { + "command-a-reasoning-08-2025": { + "id": "command-a-reasoning-08-2025", + "name": "Command A Reasoning", + "family": "command-a", "attachment": false, - "reasoning": false, - "tool_call": false, - "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-2.5-flash-preview-09-2025": { - "id": "google/gemini-2.5-flash-preview-09-2025", - "name": "Gemini 2.5 Flash Preview 09-25", - "family": "gemini-flash", - "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.03, "cache_write": 0.383 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "google/text-multilingual-embedding-002": { - "id": "google/text-multilingual-embedding-002", - "name": "Text Multilingual Embedding 002", - "family": "text-embedding", + "command-r7b-12-2024": { + "id": "command-r7b-12-2024", + "name": "Command R7B", + "family": "command-r", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-03", - "last_updated": "2024-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.03, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } - }, - "google/gemini-3.1-flash-lite-preview": { - "id": "google/gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite Preview", - "family": "gemini", - "attachment": true, - "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-03", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 1.5, "cache_read": 0.025, "cache_write": 1 }, - "limit": { "context": 1000000, "output": 65000 } + "knowledge": "2024-06-01", + "release_date": "2024-02-27", + "last_updated": "2024-02-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4000 + }, + "cost": { + "input": 0.0375, + "output": 0.15 + } }, - "google/gemini-3.1-flash-image-preview": { - "id": "google/gemini-3.1-flash-image-preview", - "name": "Gemini 3.1 Flash Image Preview (Nano Banana 2)", - "family": "gemini", + "c4ai-aya-vision-8b": { + "id": "c4ai-aya-vision-8b", + "name": "Aya Vision 8B", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-03-04", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16000, + "output": 4000 + } }, - "google/gemini-2.5-flash-image": { - "id": "google/gemini-2.5-flash-image", - "name": "Nano Banana (Gemini 2.5 Flash Image)", - "family": "gemini-flash", + "command-r-plus-08-2024": { + "id": "command-r-plus-08-2024", + "name": "Command R+", + "family": "command-r", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-03-20", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 32768, "output": 32768 } + "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 + } }, - "google/gemini-embedding-001": { - "id": "google/gemini-embedding-001", - "name": "Gemini Embedding 001", - "family": "gemini-embedding", + "c4ai-aya-expanse-8b": { + "id": "c4ai-aya-expanse-8b", + "name": "Aya Expanse 8B", "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, - "cost": { "input": 0.15, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "temperature": true, + "release_date": "2024-10-24", + "last_updated": "2024-10-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8000, + "output": 4000 + } }, - "google/gemini-2.5-flash-image-preview": { - "id": "google/gemini-2.5-flash-image-preview", - "name": "Nano Banana Preview (Gemini 2.5 Flash Image Preview)", - "family": "gemini-flash", + "command-r7b-arabic-02-2025": { + "id": "command-r7b-arabic-02-2025", + "name": "Command R7B Arabic", + "family": "command-r", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-03-20", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 32768, "output": 32768 } + "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 + } }, - "google/gemini-3-pro-image": { - "id": "google/gemini-3-pro-image", - "name": "Nano Banana Pro (Gemini 3 Pro Image)", - "family": "gemini-pro", + "command-a-vision-07-2025": { + "id": "command-a-vision-07-2025", + "name": "Command A Vision", + "family": "command-a", "attachment": false, "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-09", - "last_updated": "2025-09", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 2, "output": 120 }, - "limit": { "context": 65536, "output": 32768 } + "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 + } }, - "google/gemini-embedding-2": { - "id": "google/gemini-embedding-2", - "name": "Gemini Embedding 2", - "family": "gemini-embedding", - "attachment": false, + "c4ai-aya-vision-32b": { + "id": "c4ai-aya-vision-32b", + "name": "Aya Vision 32B", + "attachment": true, "reasoning": false, "tool_call": false, "temperature": true, - "release_date": "2026-03-10", - "last_updated": "2026-03-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } + "release_date": "2025-03-04", + "last_updated": "2025-05-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16000, + "output": 4000 + } }, - "google/imagen-4.0-ultra-generate-001": { - "id": "google/imagen-4.0-ultra-generate-001", - "name": "Imagen 4 Ultra", - "family": "imagen", + "command-a-translate-08-2025": { + "id": "command-a-translate-08-2025", + "name": "Command A Translate", + "family": "command-a", "attachment": false, "reasoning": false, - "tool_call": false, - "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 } - }, - "google/gemini-3-flash": { - "id": "google/gemini-3-flash", - "name": "Gemini 3 Flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, "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, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05 }, - "limit": { "context": 1000000, "output": 64000 } + "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 + } }, - "google/gemini-2.0-flash": { - "id": "google/gemini-2.0-flash", - "name": "Gemini 2.0 Flash", - "family": "gemini-flash", - "attachment": true, + "command-r-08-2024": { + "id": "command-r-08-2024", + "name": "Command R", + "family": "command-r", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 8192 } + "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 + } }, - "google/gemini-2.5-flash": { - "id": "google/gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "c4ai-aya-expanse-32b": { + "id": "c4ai-aya-expanse-32b", + "name": "Aya Expanse 32B", + "attachment": false, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "input_audio": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2024-10-24", + "last_updated": "2024-10-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4000 + } }, - "google/gemini-2.5-pro": { - "id": "google/gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, + "command-a-03-2025": { + "id": "command-a-03-2025", + "name": "Command A", + "family": "command-a", + "attachment": false, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.31 }, - "limit": { "context": 1048576, "output": 65536 } - }, - "google/gemini-2.0-flash-lite": { - "id": "google/gemini-2.0-flash-lite", - "name": "Gemini 2.0 Flash Lite", - "family": "gemini-flash-lite", - "attachment": 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 + } + } + } + }, + "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": { + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 1048576, "output": 8192 } + "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 + } }, - "amazon/titan-embed-text-v2": { - "id": "amazon/titan-embed-text-v2", - "name": "Titan Text Embeddings V2", - "family": "titan-embed", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "OpenAI GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-04", - "last_updated": "2024-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } - }, - "amazon/nova-2-lite": { - "id": "amazon/nova-2-lite", - "name": "Nova 2 Lite", - "family": "nova", - "attachment": true, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1000000, "output": 1000000 } - }, - "amazon/nova-lite": { - "id": "amazon/nova-lite", - "name": "Nova Lite", - "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.06, "output": 0.24, "cache_read": 0.015 }, - "limit": { "context": 300000, "output": 8192 } + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 2.92, + "output": 2.92 + } }, - "amazon/nova-pro": { - "id": "amazon/nova-pro", - "name": "Nova Pro", - "family": "nova-pro", - "attachment": true, + "speakleash/Bielik-11B-v3.0-Instruct": { + "id": "speakleash/Bielik-11B-v3.0-Instruct", + "name": "Bielik 11B v3.0 Instruct", + "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", "image", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 300000, "output": 8192 } + "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 + } }, - "amazon/nova-micro": { - "id": "amazon/nova-micro", - "name": "Nova Micro", - "family": "nova-micro", + "speakleash/Bielik-11B-v2.6-Instruct": { + "id": "speakleash/Bielik-11B-v2.6-Instruct", + "name": "Bielik 11B v2.6 Instruct", "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, - "cost": { "input": 0.035, "output": 0.14, "cache_read": 0.00875 }, - "limit": { "context": 128000, "output": 8192 } + "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 + } }, - "perplexity/sonar-reasoning": { - "id": "perplexity/sonar-reasoning", - "name": "Sonar Reasoning", - "family": "sonar-reasoning", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 127000, "output": 8000 } - }, - "perplexity/sonar": { - "id": "perplexity/sonar", - "name": "Sonar", - "family": "sonar", - "attachment": true, - "reasoning": false, "tool_call": true, + "structured_output": 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, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 127000, "output": 8000 } - }, - "perplexity/sonar-reasoning-pro": { - "id": "perplexity/sonar-reasoning-pro", - "name": "Sonar Reasoning Pro", - "family": "sonar-reasoning", + "knowledge": "2026-01", + "release_date": "2026-03-05", + "last_updated": "2026-03-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196000, + "input": 180000, + "output": 16000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } + } + } + }, + "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", + "family": "glm", "attachment": false, "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 127000, "output": 8000 } - }, - "perplexity/sonar-pro": { - "id": "perplexity/sonar-pro", - "name": "Sonar Pro", - "family": "sonar-pro", - "attachment": true, - "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 8000 } - }, - "voyage/voyage-code-3": { - "id": "voyage/voyage-code-3", - "name": "voyage-code-3", - "family": "voyage", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } - }, - "voyage/voyage-3.5-lite": { - "id": "voyage/voyage-3.5-lite", - "name": "voyage-3.5-lite", - "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, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } - }, - "voyage/voyage-code-2": { - "id": "voyage/voyage-code-2", - "name": "voyage-code-2", - "family": "voyage", + "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 + } + } + } + }, + "xai": { + "id": "xai", + "env": ["XAI_API_KEY"], + "npm": "@ai-sdk/xai", + "name": "xAI", + "doc": "https://docs.x.ai/docs/models", + "models": { + "grok-2-1212": { + "id": "grok-2-1212", + "name": "Grok 2 (1212)", + "family": "grok", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-01", - "last_updated": "2024-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2024-12-12", + "last_updated": "2024-12-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } }, - "voyage/voyage-4-lite": { - "id": "voyage/voyage-4-lite", - "name": "voyage-4-lite", - "family": "voyage", - "attachment": false, + "grok-vision-beta": { + "id": "grok-vision-beta", + "name": "Grok Vision Beta", + "family": "grok-vision", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2026-03-06", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 32000, "output": 0 } + "limit": { + "context": 8192, + "output": 4096 + }, + "cost": { + "input": 5, + "output": 15, + "cache_read": 5 + } }, - "voyage/voyage-finance-2": { - "id": "voyage/voyage-finance-2", - "name": "voyage-finance-2", - "family": "voyage", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-03", - "last_updated": "2024-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "grok-4.3": { + "id": "grok-4.3", + "name": "Grok 4.3", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-05-01", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "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 + } + } }, - "voyage/voyage-law-2": { - "id": "voyage/voyage-law-2", - "name": "voyage-law-2", - "family": "voyage", + "grok-3-mini-fast": { + "id": "grok-3-mini-fast", + "name": "Grok 3 Mini Fast", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-03", - "last_updated": "2024-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.12, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 4, + "reasoning": 4, + "cache_read": 0.15 + } }, - "voyage/voyage-4": { - "id": "voyage/voyage-4", - "name": "voyage-4", - "family": "voyage", + "grok-3-mini-latest": { + "id": "grok-3-mini-latest", + "name": "Grok 3 Mini Latest", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2026-03-06", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 32000, "output": 0 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "reasoning": 0.5, + "cache_read": 0.075 + } }, - "voyage/voyage-3-large": { - "id": "voyage/voyage-3-large", - "name": "voyage-3-large", - "family": "voyage", + "grok-3-fast": { + "id": "grok-3-fast", + "name": "Grok 3 Fast", + "family": "grok", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.18, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 1.25 + } }, - "voyage/voyage-3.5": { - "id": "voyage/voyage-3.5", - "name": "voyage-3.5", - "family": "voyage", - "attachment": false, + "grok-2-vision-latest": { + "id": "grok-2-vision-latest", + "name": "Grok 2 Vision Latest", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2024-08-20", + "last_updated": "2024-12-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 8192, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } }, - "voyage/voyage-4-large": { - "id": "voyage/voyage-4-large", - "name": "voyage-4-large", - "family": "voyage", - "attachment": false, - "reasoning": false, - "tool_call": false, + "grok-4.20-0309-reasoning": { + "id": "grok-4.20-0309-reasoning", + "name": "Grok 4.20 (Reasoning)", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2026-03-06", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-09", + "last_updated": "2026-03-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 32000, "output": 0 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "tiers": [ + { + "input": 4, + "output": 12, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + } + } }, - "arcee-ai/trinity-mini": { - "id": "arcee-ai/trinity-mini", - "name": "Trinity Mini", - "family": "trinity", - "attachment": false, + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "Grok 4.1 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12", - "last_updated": "2025-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.15 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "arcee-ai/trinity-large-preview": { - "id": "arcee-ai/trinity-large-preview", - "name": "Trinity Large Preview", - "family": "trinity", + "grok-3-mini-fast-latest": { + "id": "grok-3-mini-fast-latest", + "name": "Grok 3 Mini Fast Latest", + "family": "grok", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 4, + "reasoning": 4, + "cache_read": 0.15 + } }, - "bytedance/seed-1.6": { - "id": "bytedance/seed-1.6", - "name": "Seed 1.6", - "family": "seed", - "attachment": false, + "grok-4-fast": { + "id": "grok-4-fast", + "name": "Grok 4 Fast", + "family": "grok", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09", - "last_updated": "2025-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.05 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "bytedance/seed-1.8": { - "id": "bytedance/seed-1.8", - "name": "Seed 1.8", - "family": "seed", + "grok-3-latest": { + "id": "grok-3-latest", + "name": "Grok 3 Latest", + "family": "grok", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-10", - "last_updated": "2025-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.05 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "minimax/minimax-m2": { - "id": "minimax/minimax-m2", - "name": "MiniMax M2", - "family": "minimax", + "grok-2": { + "id": "grok-2", + "name": "Grok 2", + "family": "grok", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 1.15, "cache_read": 0.03, "cache_write": 0.38 }, - "limit": { "context": 262114, "output": 262114 } + "knowledge": "2024-08", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-10", + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.38 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "minimax/minimax-m2.7": { - "id": "minimax/minimax-m2.7", - "name": "Minimax M2.7", - "family": "minimax", + "grok-4.20-0309-non-reasoning": { + "id": "grok-4.20-0309-non-reasoning", + "name": "Grok 4.20 (Non-Reasoning)", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131000 } + "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.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + } + } }, - "minimax/minimax-m2.1-lightning": { - "id": "minimax/minimax-m2.1-lightning", - "name": "MiniMax M2.1 Lightning", - "family": "minimax", + "grok-3-fast-latest": { + "id": "grok-3-fast-latest", + "name": "Grok 3 Fast Latest", + "family": "grok", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.4, "cache_read": 0.03, "cache_write": 0.38 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 1.25 + } }, - "minimax/minimax-m2.7-highspeed": { - "id": "minimax/minimax-m2.7-highspeed", - "name": "MiniMax M2.7 High Speed", - "family": "minimax", + "grok-4.20-multi-agent-0309": { + "id": "grok-4.20-multi-agent-0309", + "name": "Grok 4.20 Multi-Agent", + "family": "grok", "attachment": true, "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131100 } - }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, - "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-09", + "last_updated": "2026-03-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "tiers": [ + { + "input": 4, + "output": 12, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + } + } }, - "minimax/minimax-m2.5-highspeed": { - "id": "minimax/minimax-m2.5-highspeed", - "name": "MiniMax M2.5 High Speed", - "family": "minimax", + "grok-4": { + "id": "grok-4", + "name": "Grok 4", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-03-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "reasoning": 15, + "cache_read": 0.75 + } }, - "xiaomi/mimo-v2-pro": { - "id": "xiaomi/mimo-v2-pro", - "name": "MiMo V2 Pro", - "family": "mimo", + "grok-2-latest": { + "id": "grok-2-latest", + "name": "Grok 2 Latest", + "family": "grok", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-08-20", + "last_updated": "2024-12-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 3, "cache_read": 0.19999999999999998 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } }, - "xiaomi/mimo-v2-flash": { - "id": "xiaomi/mimo-v2-flash", - "name": "MiMo V2 Flash", - "family": "mimo", + "grok-beta": { + "id": "grok-beta", + "name": "Grok Beta", + "family": "grok-beta", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.29 }, - "limit": { "context": 262144, "output": 32000 } + "limit": { + "context": 131072, + "output": 4096 + }, + "cost": { + "input": 5, + "output": 15, + "cache_read": 5 + } }, - "vercel/v0-1.5-md": { - "id": "vercel/v0-1.5-md", - "name": "v0-1.5-md", - "family": "v0", + "grok-2-vision": { + "id": "grok-2-vision", + "name": "Grok 2 Vision", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2025-06-09", - "last_updated": "2025-06-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 8192, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } }, - "vercel/v0-1.0-md": { - "id": "vercel/v0-1.0-md", - "name": "v0-1.0-md", - "family": "v0", + "grok-4-1-fast": { + "id": "grok-4-1-fast", + "name": "Grok 4.1 Fast", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "output": 32000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "grok-3-mini": { + "id": "grok-3-mini", + "name": "Grok 3 Mini", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.47, "output": 2, "cache_read": 0.14 }, - "limit": { "context": 216144, "output": 216144 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "reasoning": 0.5, + "cache_read": 0.075 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "grok-2-vision-1212": { + "id": "grok-2-vision-1212", + "name": "Grok 2 Vision (1212)", + "family": "grok", "attachment": true, - "reasoning": true, - "tool_call": true, - "interleaved": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01-26", - "last_updated": "2026-01-26", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 1.2 }, - "limit": { "context": 262144, "output": 262144 } - }, - "moonshotai/kimi-k2-turbo": { - "id": "moonshotai/kimi-k2-turbo", - "name": "Kimi K2 Turbo", - "family": "kimi", - "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"] }, + "release_date": "2024-08-20", + "last_updated": "2024-12-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.4, "output": 10 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 8192, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } }, - "moonshotai/kimi-k2-0905": { - "id": "moonshotai/kimi-k2-0905", - "name": "Kimi K2 0905", - "family": "kimi", + "grok-3": { + "id": "grok-3", + "name": "Grok 3", + "family": "grok", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "moonshotai/kimi-k2-thinking-turbo": { - "id": "moonshotai/kimi-k2-thinking-turbo", - "name": "Kimi K2 Thinking Turbo", - "family": "kimi-thinking", - "attachment": false, - "reasoning": true, + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "Grok 4 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.15, "output": 8, "cache_read": 0.15 }, - "limit": { "context": 262114, "output": 262114 } - }, - "moonshotai/kimi-k2": { - "id": "moonshotai/kimi-k2", - "name": "Kimi K2 Instruct", - "family": "kimi", + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } + } + } + }, + "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": { + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-14", - "last_updated": "2025-07-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 131072, "output": 16384 }, - "status": "deprecated" + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.09, + "output": 0.6 + } }, - "alibaba/qwen-3-32b": { - "id": "alibaba/qwen-3-32b", - "name": "Qwen 3.32B", + "Qwen/Qwen3.5-Plus": { + "id": "Qwen/Qwen3.5-Plus", + "name": "Qwen3.5 Plus", "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02", + "last_updated": "2026-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 40960, "output": 16384 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.4, + "output": 2.4, + "reasoning": 2.4 + } }, - "alibaba/qwen3-embedding-8b": { - "id": "alibaba/qwen3-embedding-8b", - "name": "Qwen3 Embedding 8B", + "Qwen/Qwen2.5-VL-32B-Instruct": { + "id": "Qwen/Qwen2.5-VL-32B-Instruct", + "name": "Qwen2.5 VL 32B Instruct", "family": "qwen", - "attachment": false, + "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0 }, - "limit": { "context": 32768, "output": 32768 } + "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 + } }, - "alibaba/qwen3.5-plus": { - "id": "alibaba/qwen3.5-plus", - "name": "Qwen 3.5 Plus", - "family": "qwen", - "attachment": true, + "zai-org/GLM-4.7": { + "id": "zai-org/GLM-4.7", + "name": "GLM-4.7", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-02-16", - "last_updated": "2026-02-19", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 2.4, "cache_read": 0.04, "cache_write": 0.5 }, - "limit": { "context": 1000000, "output": 64000 } + "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.2, + "output": 0.8 + } }, - "alibaba/qwen3-coder-next": { - "id": "alibaba/qwen3-coder-next", - "name": "Qwen3 Coder Next", - "family": "qwen", + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "GLM-5", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-22", - "last_updated": "2026-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.2 }, - "limit": { "context": 256000, "output": 256000 } + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 0.8, + "output": 2.56 + } }, - "alibaba/qwen3-max-preview": { - "id": "alibaba/qwen3-max-preview", - "name": "Qwen3 Max Preview", - "family": "qwen", + "zai-org/GLM-4.6": { + "id": "zai-org/GLM-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.2, "output": 6, "cache_read": 0.24 }, - "limit": { "context": 262144, "output": 32768 } + "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 + } }, - "alibaba/qwen3-coder": { - "id": "alibaba/qwen3-coder", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", - "attachment": false, + "mistralai/Mistral-Small-3.2-24B-Instruct-2506": { + "id": "mistralai/Mistral-Small-3.2-24B-Instruct-2506", + "name": "Mistral Small 3.2 24B Instruct", + "family": "mistral-small", + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.38, "output": 1.53 }, - "limit": { "context": 262144, "output": 66536 } + "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 + } }, - "alibaba/qwen3-embedding-0.6b": { - "id": "alibaba/qwen3-embedding-0.6b", - "name": "Qwen3 Embedding 0.6B", - "family": "qwen", + "mistralai/Mistral-Nemo-Instruct-2407": { + "id": "mistralai/Mistral-Nemo-Instruct-2407", + "name": "Mistral Nemo Instruct 2407", + "family": "mistral", "attachment": false, "reasoning": false, - "tool_call": false, - "temperature": false, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.01, "output": 0 }, - "limit": { "context": 32768, "output": 32768 } + "tool_call": true, + "structured_output": true, + "temperature": true, + "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 + } }, - "alibaba/qwen-3-235b": { - "id": "alibaba/qwen-3-235b", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", + "XiaomiMiMo/MiMo-V2-Flash": { + "id": "XiaomiMiMo/MiMo-V2-Flash", + "name": "MiMo V2 Flash", + "family": "mimo", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.13, "output": 0.6 }, - "limit": { "context": 40960, "output": 16384 } + "knowledge": "2024-12-01", + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "alibaba/qwen3-vl-instruct": { - "id": "alibaba/qwen3-vl-instruct", - "name": "Qwen3 VL Instruct", - "family": "qwen", - "attachment": true, + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.7, "output": 2.8 }, - "limit": { "context": 131072, "output": 129024 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "alibaba/qwen3-next-80b-a3b-thinking": { - "id": "alibaba/qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", - "family": "qwen", + "deepseek-ai/DeepSeek-V3.1": { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-12", - "last_updated": "2025-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-25", + "last_updated": "2025-08-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 1.5 }, - "limit": { "context": 131072, "output": 65536 } + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "alibaba/qwen3-235b-a22b-thinking": { - "id": "alibaba/qwen3-235b-a22b-thinking", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", - "attachment": true, - "reasoning": true, + "deepseek-ai/DeepSeek-V3-0324": { + "id": "deepseek-ai/DeepSeek-V3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.9 }, - "limit": { "context": 262114, "output": 262114 } + "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.25, + "output": 0.88 + } }, - "alibaba/qwen3-max-thinking": { - "id": "alibaba/qwen3-max-thinking", - "name": "Qwen 3 Max Thinking", - "family": "qwen", + "deepseek-ai/DeepSeek-V3.2-Exp": { + "id": "deepseek-ai/DeepSeek-V3.2-Exp", + "name": "DeepSeek V3.2 Exp", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-10", + "last_updated": "2025-10-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.2, "output": 6, "cache_read": 0.24 }, - "limit": { "context": 256000, "output": 65536 } + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 0.4 + } }, - "alibaba/qwen3-next-80b-a3b-instruct": { - "id": "alibaba/qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", - "family": "qwen", + "deepseek-ai/DeepSeek-R1-0528": { + "id": "deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek R1 0528", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": true, + "reasoning": true, + "tool_call": false, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-12", - "last_updated": "2025-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 1.1 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 163840, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 2.15 + } }, - "alibaba/qwen3-embedding-4b": { - "id": "alibaba/qwen3-embedding-4b", - "name": "Qwen3 Embedding 4B", - "family": "qwen", + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "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": false, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 32768, "output": 32768 } + "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": true, + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.26, + "output": 0.38 + } }, - "alibaba/qwen-3-30b": { - "id": "alibaba/qwen-3-30b", - "name": "Qwen3-30B-A3B", - "family": "qwen", + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.08, "output": 0.29 }, - "limit": { "context": 40960, "output": 16384 } + "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 + } }, - "alibaba/qwen3-coder-plus": { - "id": "alibaba/qwen3-coder-plus", - "name": "Qwen3 Coder Plus", - "family": "qwen", + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2026-01", + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 1000000, "output": 1000000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.45, + "output": 2.8 + } }, - "alibaba/qwen3-max": { - "id": "alibaba/qwen3-max", - "name": "Qwen3 Max", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.2, "output": 6 }, - "limit": { "context": 262144, "output": 32768 } + "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 + } }, - "alibaba/qwen3-coder-30b-a3b": { - "id": "alibaba/qwen3-coder-30b-a3b", - "name": "Qwen 3 Coder 30B A3B Instruct", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.1": { + "id": "MiniMaxAI/MiniMax-M2.1", + "name": "MiniMax M2.1", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.07, "output": 0.27 }, - "limit": { "context": 160000, "output": 32768 } - }, - "alibaba/qwen3.5-flash": { - "id": "alibaba/qwen3.5-flash", - "name": "Qwen 3.5 Flash", - "family": "qwen", + "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 + } + } + } + }, + "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-haiku-4-5@20251001": { + "id": "claude-haiku-4-5@20251001", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.001, "cache_write": 0.125 }, - "limit": { "context": 1000000, "output": 64000 } - }, - "alibaba/qwen-3-14b": { - "id": "alibaba/qwen-3-14b", - "name": "Qwen3-14B", - "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0.24 }, - "limit": { "context": 40960, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "alibaba/qwen3-vl-thinking": { - "id": "alibaba/qwen3-vl-thinking", - "name": "Qwen3 VL Thinking", - "family": "qwen", + "claude-sonnet-4-6@default": { + "id": "claude-sonnet-4-6@default", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 8.4 }, - "limit": { "context": 131072, "output": 129024 } - }, - "mistral/mistral-embed": { - "id": "mistral/mistral-embed", - "name": "Mistral Embed", - "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"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75, + "context_over_200k": { + "input": 6, + "output": 22.5, + "cache_read": 0.6, + "cache_write": 7.5 + }, + "tiers": [ + { + "input": 6, + "output": 22.5, + "cache_read": 0.6, + "cache_write": 7.5, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "mistral/devstral-small": { - "id": "mistral/devstral-small", - "name": "Devstral Small 1.1", - "family": "devstral", - "attachment": false, + "claude-3-5-haiku@20241022": { + "id": "claude-3-5-haiku@20241022", + "name": "Claude Haiku 3.5", + "family": "claude-haiku", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07-31", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "mistral/mistral-large-3": { - "id": "mistral/mistral-large-3", - "name": "Mistral Large 3", - "family": "mistral-large", + "claude-3-5-sonnet@20241022": { + "id": "claude-3-5-sonnet@20241022", + "name": "Claude Sonnet 3.5 v2", + "family": "claude-sonnet", "attachment": true, "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 256000, "output": 256000 } - }, - "mistral/codestral-embed": { - "id": "mistral/codestral-embed", - "name": "Codestral Embed", - "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, - "cost": { "input": 0.15, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } - }, - "mistral/mistral-nemo": { - "id": "mistral/mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", - "attachment": false, - "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04-30", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04, "output": 0.17 }, - "limit": { "context": 60288, "output": 16000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "mistral/mistral-medium": { - "id": "mistral/mistral-medium", - "name": "Mistral Medium 3.1", - "family": "mistral-medium", + "claude-opus-4-1@20250805": { + "id": "claude-opus-4-1@20250805", + "name": "Claude Opus 4.1", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "mistral/devstral-2": { - "id": "mistral/devstral-2", - "name": "Devstral 2", - "family": "devstral", - "attachment": false, - "reasoning": false, + "claude-sonnet-4@20250514": { + "id": "claude-sonnet-4@20250514", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-09", - "last_updated": "2025-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 256000, "output": 256000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "mistral/devstral-small-2": { - "id": "mistral/devstral-small-2", - "name": "Devstral Small 2", - "family": "devstral", - "attachment": false, - "reasoning": false, + "claude-3-7-sonnet@20250219": { + "id": "claude-3-7-sonnet@20250219", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "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": 256000, "output": 256000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "mistral/ministral-14b": { - "id": "mistral/ministral-14b", - "name": "Ministral 14B", - "family": "ministral", + "claude-opus-4@20250514": { + "id": "claude-opus-4@20250514", + "name": "Claude Opus 4", + "family": "claude-opus", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "mistral/pixtral-12b": { - "id": "mistral/pixtral-12b", - "name": "Pixtral 12B", - "family": "pixtral", + "claude-opus-4-5@20251101": { + "id": "claude-opus-4-5@20251101", + "name": "Claude Opus 4.5", + "family": "claude-opus", "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, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 128000 } - }, - "mistral/codestral": { - "id": "mistral/codestral", - "name": "Codestral (latest)", - "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, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 4096 } - }, - "mistral/ministral-8b": { - "id": "mistral/ministral-8b", - "name": "Ministral 8B (latest)", - "family": "ministral", - "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 128000, "output": 128000 } + "knowledge": "2025-03-31", + "release_date": "2025-11-01", + "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 + } }, - "mistral/mistral-small": { - "id": "mistral/mistral-small", - "name": "Mistral Small (latest)", - "family": "mistral-small", + "claude-sonnet-4-5@20250929": { + "id": "claude-sonnet-4-5@20250929", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 256000, "output": 256000 } - }, - "mistral/ministral-3b": { - "id": "mistral/ministral-3b", - "name": "Ministral 3B (latest)", - "family": "ministral", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 128000, "output": 128000 } + "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 + } }, - "mistral/pixtral-large": { - "id": "mistral/pixtral-large", - "name": "Pixtral Large (latest)", - "family": "pixtral", + "claude-opus-4-6@default": { + "id": "claude-opus-4-6@default", + "name": "Claude Opus 4.6", + "family": "claude-opus", "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, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 128000 } - }, - "mistral/magistral-small": { - "id": "mistral/magistral-small", - "name": "Magistral Small", - "family": "magistral-small", - "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-03-17", - "last_updated": "2025-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 128000, "output": 128000 } + "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, + "context_over_200k": { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5 + }, + "tiers": [ + { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "mistral/magistral-medium": { - "id": "mistral/magistral-medium", - "name": "Magistral Medium (latest)", - "family": "magistral-medium", - "attachment": false, + "claude-opus-4-7@default": { + "id": "claude-opus-4-7@default", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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": true, - "cost": { "input": 2, "output": 5 }, - "limit": { "context": 128000, "output": 16384 } - }, - "mistral/mixtral-8x22b-instruct": { - "id": "mistral/mixtral-8x22b-instruct", - "name": "Mixtral 8x22B", - "family": "mixtral", + "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, + "context_over_200k": { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5 + }, + "tiers": [ + { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } + } + } + }, + "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": { + "Qwen/Qwen3-VL-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", + "name": "Qwen3 VL 30B", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, - "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-04-17", - "last_updated": "2024-04-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 64000, "output": 64000 } + "limit": { + "context": 100000, + "output": 100000 + }, + "cost": { + "input": 0.24, + "output": 0.94 + } }, - "meta/llama-3.2-90b": { - "id": "meta/llama-3.2-90b", - "name": "Llama 3.2 90B Vision Instruct", - "family": "llama", - "attachment": true, + "Qwen/Qwen3-Embedding-8B": { + "id": "Qwen/Qwen3-Embedding-8B", + "name": "Qwen3 Embedding 8B", + "family": "text-embedding", + "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", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 128000, "output": 8192 } + "tool_call": false, + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0.12, + "output": 0.12 + } }, - "meta/llama-3.2-11b": { - "id": "meta/llama-3.2-11b", - "name": "Llama 3.2 11B Vision Instruct", - "family": "llama", - "attachment": true, + "Qwen/Qwen3-30B-A3B-Instruct-2507-FP8": { + "id": "Qwen/Qwen3-30B-A3B-Instruct-2507-FP8", + "name": "Qwen3 30B 2507", + "family": "qwen", + "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", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.16, "output": 0.16 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 64000 + }, + "cost": { + "input": 0.35, + "output": 1.42 + } }, - "meta/llama-3.1-70b": { - "id": "meta/llama-3.1-70b", - "name": "Llama 3.1 70B Instruct", - "family": "llama", + "mistralai/devstral-small-2-24b-instruct-2512": { + "id": "mistralai/devstral-small-2-24b-instruct-2512", + "name": "Devstral Small 2 24B Instruct 2512", + "family": "devstral", "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": false, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.12, + "output": 0.47 + } }, - "meta/llama-3.2-3b": { - "id": "meta/llama-3.2-3b", - "name": "Llama 3.2 3B Instruct", - "family": "llama", + "mistralai/Voxtral-Small-24B-2507": { + "id": "mistralai/Voxtral-Small-24B-2507", + "name": "Voxtral Small 24B", + "family": "voxtral", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-18", - "last_updated": "2024-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2025-03-01", + "last_updated": "2025-03-01", + "modalities": { + "input": ["audio", "text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.00236, + "output": 0.00236, + "output_audio": 2.36 + } }, - "meta/llama-3.1-8b": { - "id": "meta/llama-3.1-8b", - "name": "Llama 3.1 8B Instruct", - "family": "llama", + "mistralai/Magistral-Small-2509": { + "id": "mistralai/Magistral-Small-2509", + "name": "Magistral Small 1.2 24B", + "family": "magistral-small", "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": false, - "cost": { "input": 0.03, "output": 0.05 }, - "limit": { "context": 131072, "output": 16384 } + "tool_call": false, + "release_date": "2025-06-01", + "last_updated": "2025-06-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.59, + "output": 2.36 + } }, - "meta/llama-3.2-1b": { - "id": "meta/llama-3.2-1b", - "name": "Llama 3.2 1B Instruct", - "family": "llama", + "microsoft/Phi-4-multimodal-instruct": { + "id": "microsoft/Phi-4-multimodal-instruct", + "name": "Phi-4 15B", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-18", - "last_updated": "2024-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.24, + "output": 0.47 + } }, - "meta/llama-3.3-70b": { - "id": "meta/llama-3.3-70b", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", - "attachment": true, + "KBLab/kb-whisper-large": { + "id": "KBLab/kb-whisper-large", + "name": "KB Whisper", + "family": "whisper", + "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"] }, + "tool_call": false, + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 448, + "output": 448 + }, + "cost": { + "input": 0.00236, + "output": 0.00236, + "output_audio": 2.36 + } }, - "meta/llama-4-maverick": { - "id": "meta/llama-4-maverick", - "name": "Llama-4-Maverick-17B-128E-Instruct-FP8", + "nvidia/Llama-3.3-70B-Instruct-FP8": { + "id": "nvidia/Llama-3.3-70B-Instruct-FP8", + "name": "Llama 3.3 70B", "family": "llama", - "attachment": true, + "attachment": false, "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"] }, + "tool_call": false, + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 1.18, + "output": 1.18 + } }, - "meta/llama-4-scout": { - "id": "meta/llama-4-scout", - "name": "Llama-4-Scout-17B-16E-Instruct-FP8", - "family": "llama", - "attachment": true, + "openai/whisper-large-v3": { + "id": "openai/whisper-large-v3", + "name": "Whisper 3 Large", + "family": "whisper", + "attachment": false, "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": 4096 + }, + "cost": { + "input": 0.00236, + "output": 0.00236, + "output_audio": 2.36 + } + }, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.24, + "output": 0.94 + } }, - "inception/mercury-2": { - "id": "inception/mercury-2", - "name": "Mercury 2", - "family": "mercury", + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.024999999999999998 }, - "limit": { "context": 128000, "output": 128000 } + "interleaved": { + "field": "reasoning_content" + }, + "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": 1.47, + "output": 5.9 + } }, - "inception/mercury-coder-small": { - "id": "inception/mercury-coder-small", - "name": "Mercury Coder Small Beta", - "family": "mercury", + "intfloat/multilingual-e5-large-instruct": { + "id": "intfloat/multilingual-e5-large-instruct", + "name": "E5 Multi-Lingual Large Embeddings 0.6B", + "family": "text-embedding", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-02-26", - "last_updated": "2025-02-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 32000, "output": 16384 } + "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.12, + "output": 0.12 + } } } }, @@ -41892,54 +79601,30 @@ "name": "Synthetic", "doc": "https://synthetic.new/pricing", "models": { - "hf:moonshotai/Kimi-K2.5": { - "id": "hf:moonshotai/Kimi-K2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 262144, "output": 65536 } - }, - "hf:moonshotai/Kimi-K2-Instruct-0905": { - "id": "hf:moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi K2 0905", - "family": "kimi", - "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, - "cost": { "input": 1.2, "output": 1.2 }, - "limit": { "context": 262144, "output": 32768 } - }, - "hf:moonshotai/Kimi-K2-Thinking": { - "id": "hf:moonshotai/Kimi-K2-Thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "hf:meta-llama/Llama-3.1-405B-Instruct": { + "id": "hf:meta-llama/Llama-3.1-405B-Instruct", + "name": "Llama-3.1-405B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-07", - "last_updated": "2025-11-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 3, + "output": 3 + } }, "hf:meta-llama/Llama-4-Scout-17B-16E-Instruct": { "id": "hf:meta-llama/Llama-4-Scout-17B-16E-Instruct", @@ -41952,26 +79637,19 @@ "knowledge": "2024-08", "release_date": "2025-04-05", "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 328000, "output": 4096 } - }, - "hf:meta-llama/Llama-3.1-8B-Instruct": { - "id": "hf:meta-llama/Llama-3.1-8B-Instruct", - "name": "Llama-3.1-8B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 328000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, "hf:meta-llama/Llama-3.3-70B-Instruct": { "id": "hf:meta-llama/Llama-3.3-70B-Instruct", @@ -41984,14 +79662,23 @@ "knowledge": "2023-12", "release_date": "2024-12-06", "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.9, "output": 0.9 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.9, + "output": 0.9 + } }, - "hf:meta-llama/Llama-3.1-405B-Instruct": { - "id": "hf:meta-llama/Llama-3.1-405B-Instruct", - "name": "Llama-3.1-405B-Instruct", + "hf:meta-llama/Llama-3.1-8B-Instruct": { + "id": "hf:meta-llama/Llama-3.1-8B-Instruct", + "name": "Llama-3.1-8B-Instruct", "family": "llama", "attachment": false, "reasoning": true, @@ -42000,10 +79687,19 @@ "knowledge": "2023-12", "release_date": "2024-07-23", "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 3, "output": 3 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, "hf:meta-llama/Llama-3.1-70B-Instruct": { "id": "hf:meta-llama/Llama-3.1-70B-Instruct", @@ -42016,10 +79712,19 @@ "knowledge": "2023-12", "release_date": "2024-07-23", "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.9, "output": 0.9 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.9, + "output": 0.9 + } }, "hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": { "id": "hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8", @@ -42032,201 +79737,43 @@ "knowledge": "2024-08", "release_date": "2025-04-05", "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 0.88 }, - "limit": { "context": 524000, "output": 4096 } - }, - "hf:zai-org/GLM-4.7": { - "id": "hf:zai-org/GLM-4.7", - "name": "GLM 4.7", - "family": "glm", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 200000, "output": 64000 } - }, - "hf:zai-org/GLM-4.7-Flash": { - "id": "hf:zai-org/GLM-4.7-Flash", - "name": "GLM-4.7-Flash", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": true, - "release_date": "2026-01-18", - "last_updated": "2026-01-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.4, "cache_read": 0.06 }, - "limit": { "context": 196608, "output": 65536 } - }, - "hf:zai-org/GLM-4.6": { - "id": "hf:zai-org/GLM-4.6", - "name": "GLM 4.6", - "family": "glm", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 200000, "output": 64000 } - }, - "hf:deepseek-ai/DeepSeek-V3.1": { - "id": "hf:deepseek-ai/DeepSeek-V3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.56, "output": 1.68 }, - "limit": { "context": 128000, "output": 128000 } - }, - "hf:deepseek-ai/DeepSeek-V3-0324": { - "id": "hf:deepseek-ai/DeepSeek-V3-0324", - "name": "DeepSeek V3 (0324)", - "family": "deepseek", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.2, "output": 1.2 }, - "limit": { "context": 128000, "output": 128000 } - }, - "hf:deepseek-ai/DeepSeek-R1": { - "id": "hf:deepseek-ai/DeepSeek-R1", - "name": "DeepSeek R1", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "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": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 128000, "output": 128000 } - }, - "hf:deepseek-ai/DeepSeek-V3.1-Terminus": { - "id": "hf:deepseek-ai/DeepSeek-V3.1-Terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-09-22", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.2, "output": 1.2 }, - "limit": { "context": 128000, "output": 128000 } - }, - "hf:deepseek-ai/DeepSeek-R1-0528": { - "id": "hf:deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek R1 (0528)", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 8 }, - "limit": { "context": 128000, "output": 128000 } - }, - "hf:deepseek-ai/DeepSeek-V3.2": { - "id": "hf:deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 0.4, "cache_read": 0.27, "cache_write": 0 }, - "limit": { "context": 162816, "input": 162816, "output": 8000 } - }, - "hf:deepseek-ai/DeepSeek-V3": { - "id": "hf:deepseek-ai/DeepSeek-V3", - "name": "DeepSeek V3", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 1.25, "output": 1.25 }, - "limit": { "context": 128000, "output": 128000 } - }, - "hf:nvidia/Kimi-K2.5-NVFP4": { - "id": "hf:nvidia/Kimi-K2.5-NVFP4", - "name": "Kimi K2.5 (NVFP4)", - "family": "kimi", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 524000, + "output": 4096 + }, + "cost": { + "input": 0.22, + "output": 0.88 + } }, - "hf:MiniMaxAI/MiniMax-M2.1": { - "id": "hf:MiniMaxAI/MiniMax-M2.1", - "name": "MiniMax-M2.1", + "hf:MiniMaxAI/MiniMax-M2": { + "id": "hf:MiniMaxAI/MiniMax-M2", + "name": "MiniMax-M2", "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 196608, + "output": 131000 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, "hf:MiniMaxAI/MiniMax-M2.5": { "id": "hf:MiniMaxAI/MiniMax-M2.5", @@ -42235,45 +79782,84 @@ "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, "release_date": "2026-02-07", "last_updated": "2026-02-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.6 }, - "limit": { "context": 191488, "output": 65536 } + "limit": { + "context": 191488, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.6 + } }, - "hf:MiniMaxAI/MiniMax-M2": { - "id": "hf:MiniMaxAI/MiniMax-M2", - "name": "MiniMax-M2", + "hf:MiniMaxAI/MiniMax-M2.1": { + "id": "hf:MiniMaxAI/MiniMax-M2.1", + "name": "MiniMax-M2.1", "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 196608, "output": 131000 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, - "hf:openai/gpt-oss-120b": { - "id": "hf:openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "hf:Qwen/Qwen3.5-397B-A17B": { + "id": "hf:Qwen/Qwen3.5-397B-A17B", + "name": "Qwen3.5-97B-A17B", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 262144, + "output": 65536 + }, + "status": "beta", + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.6 + } }, "hf:Qwen/Qwen2.5-Coder-32B-Instruct": { "id": "hf:Qwen/Qwen2.5-Coder-32B-Instruct", @@ -42286,10 +79872,44 @@ "knowledge": "2024-10", "release_date": "2024-11-11", "last_updated": "2024-11-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.8, + "output": 0.8 + } + }, + "hf:Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "hf:Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen 3 235B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-04-28", + "last_updated": "2025-07-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 0.8 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, "hf:Qwen/Qwen3-235B-A22B-Thinking-2507": { "id": "hf:Qwen/Qwen3-235B-A22B-Thinking-2507", @@ -42302,10 +79922,19 @@ "knowledge": "2025-04", "release_date": "2025-07-25", "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.65, "output": 3 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.65, + "output": 3 + } }, "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct": { "id": "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct", @@ -42318,3960 +79947,5788 @@ "knowledge": "2025-04", "release_date": "2025-07-23", "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 2, + "output": 2 + } }, - "hf:Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "hf:Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen 3 235B Instruct", - "family": "qwen", + "hf:deepseek-ai/DeepSeek-V3.1": { + "id": "hf:deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.56, + "output": 1.68 + } + }, + "hf:deepseek-ai/DeepSeek-V3-0324": { + "id": "hf:deepseek-ai/DeepSeek-V3-0324", + "name": "DeepSeek V3 (0324)", + "family": "deepseek", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04-28", - "last_updated": "2025-07-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 1.2, + "output": 1.2 + } + }, + "hf:deepseek-ai/DeepSeek-V3": { + "id": "hf:deepseek-ai/DeepSeek-V3", + "name": "DeepSeek V3", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 256000, "output": 32000 } - } - } - }, - "llmgateway": { - "id": "llmgateway", - "env": ["LLMGATEWAY_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://api.llmgateway.io/v1", - "name": "LLM Gateway", - "doc": "https://llmgateway.io/docs", - "models": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt", - "attachment": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 1.25 + } + }, + "hf:deepseek-ai/DeepSeek-R1": { + "id": "hf:deepseek-ai/DeepSeek-R1", + "name": "DeepSeek R1", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "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": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } + }, + "hf:deepseek-ai/DeepSeek-R1-0528": { + "id": "hf:deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek R1 (0528)", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 3, + "output": 8 + } }, - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3 Coder 30B A3B Instruct", - "family": "qwen", + "hf:deepseek-ai/DeepSeek-V3.2": { + "id": "hf:deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-31", - "last_updated": "2025-07-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262000, "output": 8192 } + "limit": { + "context": 162816, + "input": 162816, + "output": 8000 + }, + "cost": { + "input": 0.27, + "output": 0.4, + "cache_read": 0.27, + "cache_write": 0 + } }, - "gemini-2.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", - "family": "gemini", - "attachment": true, - "reasoning": false, + "hf:deepseek-ai/DeepSeek-V3.1-Terminus": { + "id": "hf:deepseek-ai/DeepSeek-V3.1-Terminus", + "name": "DeepSeek V3.1 Terminus", + "family": "deepseek", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-22", - "last_updated": "2025-07-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09-22", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 1.2, + "output": 1.2 + } }, - "grok-4-20-multi-agent-beta-0309": { - "id": "grok-4-20-multi-agent-beta-0309", - "name": "Grok 4.20 Multi-Agent Beta (0309)", - "family": "grok", - "attachment": true, + "hf:openai/gpt-oss-120b": { + "id": "hf:openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 2, "output": 6, "cache_read": 0.2 }, - "limit": { "context": 2000000, "output": 30000 } - }, - "grok-imagine-image": { - "id": "grok-imagine-image", - "name": "Grok Imagine Image", - "family": "grok", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2026-03-02", - "last_updated": "2026-03-02", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } + "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.1, + "output": 0.1 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex mini", - "family": "gpt", - "attachment": true, + "hf:moonshotai/Kimi-K2-Thinking": { + "id": "hf:moonshotai/Kimi-K2-Thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-11-12", - "last_updated": "2025-11-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-11", + "release_date": "2025-11-07", + "last_updated": "2025-11-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, - "qwen3-235b-a22b-instruct-2507": { - "id": "qwen3-235b-a22b-instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", + "hf:moonshotai/Kimi-K2-Instruct-0905": { + "id": "hf:moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi K2 0905", + "family": "kimi", "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"] }, + "knowledge": "2024-10", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262000, "output": 8192 }, - "status": "beta" + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 1.2, + "output": 1.2 + } }, - "gpt-5.4-pro": { - "id": "gpt-5.4-pro", - "name": "GPT-5.4 Pro", - "family": "gpt", - "attachment": true, + "hf:moonshotai/Kimi-K2.5": { + "id": "hf:moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-03-01", - "last_updated": "2026-03-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 30, "output": 180 }, - "limit": { "context": 1050000, "output": 128000 } + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "Claude Opus 4.5", - "family": "claude", - "attachment": true, + "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4": { + "id": "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4", + "name": "Nemotron 3 Super 120B", + "family": "nemotron", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-11-24", - "last_updated": "2025-11-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2024-04", + "release_date": "2026-03-11", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1, + "cache_read": 0.3 + } }, - "qwen-image": { - "id": "qwen-image", - "name": "Qwen Image", - "family": "qwen", + "hf:nvidia/Kimi-K2.5-NVFP4": { + "id": "hf:nvidia/Kimi-K2.5-NVFP4", + "name": "Kimi K2.5 (NVFP4)", + "family": "kimi", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-04", - "last_updated": "2025-08-04", - "modalities": { "input": ["text"], "output": ["text", "image"] }, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, - "hermes-2-pro-llama-3-8b": { - "id": "hermes-2-pro-llama-3-8b", - "name": "Hermes 2 Pro Llama 3 8B", - "family": "nousresearch", + "hf:zai-org/GLM-4.7-Flash": { + "id": "hf:zai-org/GLM-4.7-Flash", + "name": "GLM-4.7-Flash", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2024-05-27", - "last_updated": "2024-05-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-18", + "last_updated": "2026-01-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.14, "output": 0.14 }, - "limit": { "context": 8192, "output": 8192 }, - "status": "beta" + "limit": { + "context": 196608, + "output": 65536 + }, + "cost": { + "input": 0.06, + "output": 0.4, + "cache_read": 0.06 + } }, - "pixtral-large-latest": { - "id": "pixtral-large-latest", - "name": "Pixtral Large Latest", - "family": "mistral", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "hf:zai-org/GLM-4.7": { + "id": "hf:zai-org/GLM-4.7", + "name": "GLM 4.7", + "family": "glm", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-11-18", - "last_updated": "2024-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 4, "output": 12 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "o3 Mini", - "family": "gpt", + "hf:zai-org/GLM-5.1": { + "id": "hf:zai-org/GLM-5.1", + "name": "GLM 5.1", + "family": "glm", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 16384 } + "release_date": "2026-03-27", + "last_updated": "2026-04-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 65536 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 1 + } }, - "gpt-5.4-mini": { - "id": "gpt-5.4-mini", - "name": "GPT-5.4 Mini", - "family": "gpt", - "attachment": true, + "hf:zai-org/GLM-5": { + "id": "hf:zai-org/GLM-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2026-03-17", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.75, "output": 4.5, "cache_read": 0.08 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2026-02-12", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 65536 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 1 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "GPT-5 Pro", - "family": "gpt", - "attachment": true, + "hf:zai-org/GLM-4.6": { + "id": "hf:zai-org/GLM-4.6", + "name": "GLM 4.6", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 272000 } + "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": 64000 + }, + "cost": { + "input": 0.55, + "output": 2.19 + } }, - "grok-4-fast": { - "id": "grok-4-fast", - "name": "Grok 4 Fast", - "family": "grok", + "hf:moonshotai/Kimi-K2.6": { + "id": "hf:moonshotai/Kimi-K2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } - }, - "qwen-turbo": { - "id": "qwen-turbo", - "name": "Qwen Turbo", - "family": "qwen", + "knowledge": "2025-01", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.95 + } + } + } + }, + "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": { + "upstage/solar-10_7b-instruct": { + "id": "upstage/solar-10_7b-instruct", + "name": "solar-10.7b-instruct", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2025-02-01", - "last_updated": "2025-02-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-06-05", + "last_updated": "2025-04-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 1000000, "output": 8192 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-3.1-nemotron-ultra-253b": { - "id": "llama-3.1-nemotron-ultra-253b", - "name": "Llama 3.1 Nemotron Ultra 253B", - "family": "llama", + "black-forest-labs/flux_2-klein-4b": { + "id": "black-forest-labs/flux_2-klein-4b", + "name": "FLUX.2 Klein 4B", + "family": "flux", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": true, "temperature": true, - "release_date": "2025-04-07", - "last_updated": "2025-04-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-01-14", + "last_updated": "2026-01-31", + "modalities": { + "input": ["image", "text"], + "output": ["image"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.8 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0, + "output": 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)", - "family": "gemini", - "attachment": true, + "black-forest-labs/flux.1-dev": { + "id": "black-forest-labs/flux.1-dev", + "name": "FLUX.1-dev", + "family": "flux", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-08-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 4096, + "output": 0 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-vl-max": { - "id": "qwen-vl-max", - "name": "Qwen VL Max", - "family": "qwen", - "attachment": true, + "black-forest-labs/flux_1-schnell": { + "id": "black-forest-labs/flux_1-schnell", + "name": "FLUX.1-schnell", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-02-01", - "last_updated": "2025-02-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "structured_output": false, + "temperature": false, + "knowledge": "2024-07", + "release_date": "2024-08-01", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 3.2 }, - "limit": { "context": 131072, "output": 32000 } + "limit": { + "context": 77, + "input": 77, + "output": 0 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3-vl-235b-a22b-instruct": { - "id": "qwen3-vl-235b-a22b-instruct", - "name": "Qwen3 VL 235B A22B Instruct", - "family": "qwen", + "black-forest-labs/flux_1-kontext-dev": { + "id": "black-forest-labs/flux_1-kontext-dev", + "name": "FLUX.1-Kontext-dev", "attachment": true, "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, + "open_weights": true, + "limit": { + "context": 40960, + "output": 40960 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "stepfun-ai/step-3.5-flash": { + "id": "stepfun-ai/step-3.5-flash", + "name": "Step 3.5 Flash", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-02", + "last_updated": "2026-02-02", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-opus": { - "id": "claude-3-opus", - "name": "Claude 3 Opus", - "family": "claude", + "mistralai/mistral-large-3-675b-instruct-2512": { + "id": "mistralai/mistral-large-3-675b-instruct-2512", + "name": "Mistral Large 3 675B Instruct 2512", + "family": "mistral-large", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": false, + "structured_output": true, "temperature": true, - "release_date": "2024-03-04", - "last_updated": "2024-03-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5 }, - "limit": { "context": 200000, "output": 4096 } + "knowledge": "2025-01", + "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, + "output": 0 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi", - "attachment": false, + "mistralai/devstral-2-123b-instruct-2512": { + "id": "mistralai/devstral-2-123b-instruct-2512", + "name": "Devstral-2-123B-Instruct-2512", + "family": "devstral", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-12", + "release_date": "2025-12-08", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3-coder-next": { - "id": "qwen3-coder-next", - "name": "Qwen3 Coder Next", - "family": "qwen", + "mistralai/mistral-nemotron": { + "id": "mistralai/mistral-nemotron", + "name": "mistral-nemotron", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-06-11", + "last_updated": "2025-06-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.11, "output": 0.68, "cache_read": 0.06 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-max-latest": { - "id": "qwen-max-latest", - "name": "Qwen Max Latest", - "family": "qwen", - "attachment": true, + "mistralai/mixtral-8x22b-instruct": { + "id": "mistralai/mixtral-8x22b-instruct", + "name": "Mistral: Mixtral 8x22B Instruct", + "attachment": false, "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"] }, + "release_date": "2024-04-17", + "last_updated": "2024-04-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.6, "output": 6.4 }, - "limit": { "context": 131072, "output": 32000 } - }, - "gpt-5.2-chat-latest": { - "id": "gpt-5.2-chat-latest", - "name": "GPT-5.2 Chat", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 128000, "output": 16400 } + "limit": { + "context": 65536, + "output": 13108 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-vl-plus": { - "id": "qwen-vl-plus", - "name": "Qwen VL Plus", - "family": "qwen", + "mistralai/mistral-medium-3-instruct": { + "id": "mistralai/mistral-medium-3-instruct", + "name": "Mistral Medium 3", + "family": "mistral-medium", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-02-05", - "last_updated": "2025-02-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.21, "output": 0.64 }, - "limit": { "context": 131072, "output": 32000 } + "structured_output": false, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 131072, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-max": { - "id": "qwen-max", - "name": "Qwen Max", - "family": "qwen", - "attachment": true, + "mistralai/mixtral-8x7b-instruct": { + "id": "mistralai/mixtral-8x7b-instruct", + "name": "Mistral: Mixtral 8x7B Instruct", + "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", "image"], "output": ["text"] }, + "release_date": "2023-12-10", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.6, "output": 6.4 }, - "limit": { "context": 131072, "output": 32000 } + "limit": { + "context": 32768, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-image": { - "id": "glm-image", - "name": "GLM-Image", - "family": "glm", + "mistralai/magistral-small-2506": { + "id": "mistralai/magistral-small-2506", + "name": "Magistral Small 2506", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-01-14", - "last_updated": "2025-01-14", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } - }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 32768, + "input": 32768, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-3.3-70b-instruct": { - "id": "llama-3.3-70b-instruct", - "name": "Llama 3.3 70B Instruct", - "family": "llama", + "mistralai/mistral-7b-instruct-v03": { + "id": "mistralai/mistral-7b-instruct-v03", + "name": "Mistral-7B-Instruct-v0.3", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-01", + "last_updated": "2025-04-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.4 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemma-3-1b-it": { - "id": "gemma-3-1b-it", - "name": "Gemma 3 1B IT", - "family": "gemma", + "mistralai/mistral-small-4-119b-2603": { + "id": "mistralai/mistral-small-4-119b-2603", + "name": "mistral-small-4-119b-2603", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-opus-4-20250514": { - "id": "claude-opus-4-20250514", - "name": "Claude Opus 4 (2025-05-14)", - "family": "claude", + "sarvamai/sarvam-m": { + "id": "sarvamai/sarvam-m", + "name": "sarvam-m", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5 }, - "limit": { "context": 200000, "output": 16384 } + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-3.1-pro-preview": { - "id": "gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro (Preview)", - "family": "gemini", + "microsoft/phi-4-mini-instruct": { + "id": "microsoft/phi-4-mini-instruct", + "name": "Phi-4-Mini", + "family": "phi", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-19", - "last_updated": "2026-02-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 1048576, "output": 65536 } - }, - "devstral-2512": { - "id": "devstral-2512", - "name": "Devstral 2", - "family": "mistral", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-09", - "last_updated": "2025-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262144, "output": 16384 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "seedream-4-0": { - "id": "seedream-4-0", - "name": "Seedream 4.0", - "family": "seed", + "microsoft/phi-4-multimodal-instruct": { + "id": "microsoft/phi-4-multimodal-instruct", + "name": "Phi 4 Multimodal", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-09-16", - "last_updated": "2025-09-16", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } - }, - "claude-3-7-sonnet-20250219": { - "id": "claude-3-7-sonnet-20250219", - "name": "Claude 3.7 Sonnet (2025-02-19)", - "family": "claude", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-26", + "last_updated": "2025-07-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning": { + "id": "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning", + "name": "Nemotron 3 Nano Omni", + "family": "nemotron", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-01-26", - "last_updated": "2026-01-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 32768 } + "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 + } }, - "gemma-3n-e2b-it": { - "id": "gemma-3n-e2b-it", - "name": "Gemma 3n E2B IT", - "family": "gemma", + "nvidia/usdvalidate": { + "id": "nvidia/usdvalidate", + "name": "usdvalidate", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-06-26", - "last_updated": "2025-06-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-07-24", + "last_updated": "2025-01-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-guard-4-12b": { - "id": "llama-guard-4-12b", - "name": "Llama Guard 4 12B", - "family": "llama", - "attachment": false, + "nvidia/synthetic-video-detector": { + "id": "nvidia/synthetic-video-detector", + "name": "synthetic-video-detector", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-04-30", - "last_updated": "2025-04-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-4-turbo": { - "id": "gpt-4-turbo", - "name": "GPT-4 Turbo", - "family": "gpt", + "nvidia/cosmos-transfer1-7b": { + "id": "nvidia/cosmos-transfer1-7b", + "name": "cosmos-transfer1-7b", "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2023-11-06", - "last_updated": "2023-11-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 16384 } + "tool_call": false, + "temperature": false, + "release_date": "2025-06-13", + "last_updated": "2025-06-30", + "modalities": { + "input": ["text", "image", "video"], + "output": ["video"] + }, + "open_weights": true, + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-image-max": { - "id": "qwen-image-max", - "name": "Qwen Image Max", - "family": "qwen", + "nvidia/rerank-qa-mistral-4b": { + "id": "nvidia/rerank-qa-mistral-4b", + "name": "rerank-qa-mistral-4b", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-04", - "last_updated": "2025-08-04", - "modalities": { "input": ["text"], "output": ["text", "image"] }, + "temperature": false, + "release_date": "2024-03-17", + "last_updated": "2025-01-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "mistral-large-latest": { - "id": "mistral-large-latest", - "name": "Mistral Large Latest", - "family": "mistral", + "nvidia/nv-embedcode-7b-v1": { + "id": "nvidia/nv-embedcode-7b-v1", + "name": "nv-embedcode-7b-v1", "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"] }, + "temperature": false, + "release_date": "2025-03-17", + "last_updated": "2025-05-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 4, "output": 12 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwq-plus": { - "id": "qwq-plus", - "name": "QwQ Plus", - "family": "qwen", + "nvidia/nemotron-3-super-120b-a12b": { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "Nemotron 3 Super", + "family": "nemotron", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2025-03-06", - "last_updated": "2025-03-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.8, "output": 2.4 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "nvidia/riva-translate-4b-instruct-v1_1": { + "id": "nvidia/riva-translate-4b-instruct-v1_1", + "name": "riva-translate-4b-instruct-v1_1", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "Grok 4 Fast Non-Reasoning", - "family": "grok", + "nvidia/nemotron-voicechat": { + "id": "nvidia/nemotron-voicechat", + "name": "nemotron-voicechat", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-10", - "last_updated": "2025-10-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "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 + } }, - "glm-4.7-flash": { - "id": "glm-4.7-flash", - "name": "GLM-4.7 Flash", - "family": "glm", + "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", + "family": "nemotron", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 128000 } + "knowledge": "2023-12", + "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, + "output": 0 + } }, - "grok-4": { - "id": "grok-4", - "name": "Grok 4", - "family": "grok", - "attachment": true, + "nvidia/usdcode": { + "id": "nvidia/usdcode", + "name": "usdcode", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01-01", + "last_updated": "2026-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "nvidia/llama-3_2-nemoretriever-300m-embed-v1": { + "id": "nvidia/llama-3_2-nemoretriever-300m-embed-v1", + "name": "llama-3_2-nemoretriever-300m-embed-v1", "attachment": false, "reasoning": false, - "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": false, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 256000, "output": 10000 } + "tool_call": false, + "temperature": false, + "release_date": "2025-07-24", + "last_updated": "2025-07-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "grok-4-20-beta-0309-non-reasoning": { - "id": "grok-4-20-beta-0309-non-reasoning", - "name": "Grok 4.20 Beta Non-Reasoning (0309)", - "family": "grok", - "attachment": true, + "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", + "attachment": false, "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, - "cost": { "input": 2, "output": 6, "cache_read": 0.2 }, - "limit": { "context": 2000000, "output": 30000 } - }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-02-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "qwen-plus-latest": { - "id": "qwen-plus-latest", - "name": "Qwen Plus Latest", - "family": "qwen", + "nvidia/nv-embed-v1": { + "id": "nvidia/nv-embed-v1", + "name": "nv-embed-v1", "attachment": false, "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2024-06-07", + "last_updated": "2025-07-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "nvidia/nemotron-3-nano-30b-a3b": { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "nemotron-3-nano-30b-a3b", + "family": "nemotron", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-09-09", - "last_updated": "2024-09-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2024-12", + "last_updated": "2024-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 1.2, "cache_read": 0.08 }, - "limit": { "context": 1000000, "output": 32000 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemma-3-4b-it": { - "id": "gemma-3-4b-it", - "name": "Gemma 3 4B IT", - "family": "gemma", + "nvidia/gliner-pii": { + "id": "nvidia/gliner-pii", + "name": "gliner-pii", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-03", + "last_updated": "2026-03-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "ministral-8b-2512": { - "id": "ministral-8b-2512", - "name": "Ministral 8B", - "family": "mistral", + "nvidia/bevformer": { + "id": "nvidia/bevformer", + "name": "bevformer", "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"] }, + "release_date": "2025-03-18", + "last_updated": "2025-07-20", + "modalities": { + "input": ["video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 262144, "output": 16384 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "kimi-k2-thinking-turbo": { - "id": "kimi-k2-thinking-turbo", - "name": "Kimi K2 Thinking Turbo", - "family": "kimi", + "nvidia/nemotron-mini-4b-instruct": { + "id": "nvidia/nemotron-mini-4b-instruct", + "name": "nemotron-mini-4b-instruct", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.15, "output": 8, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2024-08-21", + "last_updated": "2024-08-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "ministral-14b-2512": { - "id": "ministral-14b-2512", - "name": "Ministral 14B", - "family": "mistral", + "nvidia/cosmos-predict1-5b": { + "id": "nvidia/cosmos-predict1-5b", + "name": "cosmos-predict1-5b", "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"] }, + "temperature": false, + "release_date": "2025-03-18", + "last_updated": "2025-03-18", + "modalities": { + "input": ["text", "image", "video"], + "output": ["video"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 262144, "output": 16384 } - }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 400000, "output": 128000 } - }, - "seed-1-6-250615": { - "id": "seed-1-6-250615", - "name": "Seed 1.6 (250615)", - "family": "seed", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-06-25", - "last_updated": "2025-06-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.05 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3-30b-a3b-thinking-2507": { - "id": "qwen3-30b-a3b-thinking-2507", - "name": "Qwen3 30B A3B Thinking 2507", - "family": "qwen", + "nvidia/llama-3_3-nemotron-super-49b-v1": { + "id": "nvidia/llama-3_3-nemotron-super-49b-v1", + "name": "Llama 3.3 Nemotron Super 49B v1", + "family": "nemotron", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2025-04-07", + "last_updated": "2025-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262000, "output": 8192 } - }, - "kimi-k2": { - "id": "kimi-k2", - "name": "Kimi K2", - "family": "kimi", - "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": false, - "cost": { "input": 1, "output": 3, "cache_read": 0.5 }, - "limit": { "context": 131072, "output": 16384 } - }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude", - "attachment": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "nvidia/nvidia-nemotron-nano-9b-v2": { + "id": "nvidia/nvidia-nemotron-nano-9b-v2", + "name": "nvidia-nemotron-nano-9b-v2", + "family": "nemotron", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5 }, - "limit": { "context": 1000000, "output": 128000 } + "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, + "output": 0 + } }, - "qwen-image-edit-plus": { - "id": "qwen-image-edit-plus", - "name": "Qwen Image Edit Plus", - "family": "qwen", + "nvidia/cosmos-transfer2_5-2b": { + "id": "nvidia/cosmos-transfer2_5-2b", + "name": "cosmos-transfer2.5-2b", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "temperature": false, + "release_date": "2026-02-26", + "last_updated": "2026-02-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["video"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "Claude Sonnet 4.5 (2025-09-29)", - "family": "claude", + "nvidia/nemotron-content-safety-reasoning-4b": { + "id": "nvidia/nemotron-content-safety-reasoning-4b", + "name": "nemotron-content-safety-reasoning-4b", "attachment": false, "reasoning": true, - "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 64000 } + "tool_call": false, + "temperature": false, + "release_date": "2026-01-22", + "last_updated": "2026-01-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-4o-mini": { - "id": "gpt-4o-mini", - "name": "GPT-4o Mini", - "family": "gpt", - "attachment": false, + "nvidia/active-speaker-detection": { + "id": "nvidia/active-speaker-detection", + "name": "Active Speaker Detection", + "attachment": true, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } + "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 + } }, - "mistral-small-2506": { - "id": "mistral-small-2506", - "name": "Mistral Small 3.2", - "family": "mistral", + "nvidia/magpie-tts-zeroshot": { + "id": "nvidia/magpie-tts-zeroshot", + "name": "magpie-tts-zeroshot", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-06-20", - "last_updated": "2025-06-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-22", + "last_updated": "2025-06-12", + "modalities": { + "input": ["text", "audio"], + "output": ["audio"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen35-397b-a17b": { - "id": "qwen35-397b-a17b", - "name": "Qwen3.5 397B A17B", - "family": "qwen", + "nvidia/streampetr": { + "id": "nvidia/streampetr", + "name": "streampetr", "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-02-16", - "last_updated": "2026-02-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemma-3n-e4b-it": { - "id": "gemma-3n-e4b-it", - "name": "Gemma 3n E4B IT", - "family": "gemma", - "attachment": false, + "nvidia/sparsedrive": { + "id": "nvidia/sparsedrive", + "name": "sparsedrive", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-06-26", - "last_updated": "2025-06-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-18", + "last_updated": "2025-07-20", + "modalities": { + "input": ["video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-plus": { - "id": "qwen-plus", - "name": "Qwen Plus", - "family": "qwen", + "nvidia/nemotron-3-content-safety": { + "id": "nvidia/nemotron-3-content-safety", + "name": "nemotron-3-content-safety", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-01-25", - "last_updated": "2025-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 1.2, "cache_read": 0.08 }, - "limit": { "context": 131072, "output": 32000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "codestral-2508": { - "id": "codestral-2508", - "name": "Codestral", - "family": "mistral", - "attachment": false, + "nvidia/llama-nemotron-embed-vl-1b-v2": { + "id": "nvidia/llama-nemotron-embed-vl-1b-v2", + "name": "llama-nemotron-embed-vl-1b-v2", + "attachment": true, "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"] }, + "temperature": false, + "release_date": "2026-02-10", + "last_updated": "2026-02-10", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude", + "nvidia/studiovoice": { + "id": "nvidia/studiovoice", + "name": "studiovoice", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2024-10-03", + "last_updated": "2025-06-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", + "nvidia/llama-nemotron-rerank-vl-1b-v2": { + "id": "nvidia/llama-nemotron-rerank-vl-1b-v2", + "name": "llama-nemotron-rerank-vl-1b-v2", "attachment": true, "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2026-03-31", + "last_updated": "2026-03-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "deepseek-ai/deepseek-v3.2": { + "id": "deepseek-ai/deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 163840, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-3.1-8b-instruct": { - "id": "llama-3.1-8b-instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", + "deepseek-ai/deepseek-v3.1-terminus": { + "id": "deepseek-ai/deepseek-v3.1-terminus", + "name": "DeepSeek V3.1 Terminus", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.22, "output": 0.22 }, - "limit": { "context": 128000, "output": 2048 }, - "status": "beta" + "knowledge": "2025-01", + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen-image-plus": { - "id": "qwen-image-plus", - "name": "Qwen Image Plus", - "family": "qwen", + "openai/whisper-large-v3": { + "id": "openai/whisper-large-v3", + "name": "Whisper Large v3", + "family": "whisper", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-08-04", - "last_updated": "2025-08-04", - "modalities": { "input": ["text"], "output": ["text", "image"] }, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2023-09-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.5-airx": { - "id": "glm-4.5-airx", - "name": "GLM-4.5 AirX", - "family": "glm", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + } + }, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT-OSS-120B", + "family": "gpt-oss", + "attachment": true, + "reasoning": true, + "tool_call": false, + "temperature": true, + "knowledge": "2025-08", + "release_date": "2025-08-04", + "last_updated": "2025-08-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.5, "cache_read": 0.22 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "minimax-m2": { - "id": "minimax-m2", - "name": "MiniMax M2", + "minimaxai/minimax-m2.7": { + "id": "minimaxai/minimax-m2.7", + "name": "MiniMax-M2.7", "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-04-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1, "cache_read": 0.03 }, - "limit": { "context": 196608, "output": 131072 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "seed-1-6-flash-250715": { - "id": "seed-1-6-flash-250715", - "name": "Seed 1.6 Flash (250715)", - "family": "seed", - "attachment": true, + "minimaxai/minimax-m2.5": { + "id": "minimaxai/minimax-m2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-26", - "last_updated": "2025-07-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.07, "output": 0.3, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 16384 } + "knowledge": "2025-08", + "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 + } }, - "gpt-3.5-turbo": { - "id": "gpt-3.5-turbo", - "name": "GPT-3.5 Turbo", - "family": "gpt", + "z-ai/glm4.7": { + "id": "z-ai/glm4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2022-11-30", - "last_updated": "2022-11-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 16385, "output": 16384 } - }, - "qwen3-vl-flash": { - "id": "qwen3-vl-flash", - "name": "Qwen3 VL Flash", - "family": "qwen", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "sonar": { - "id": "sonar", - "name": "Sonar", - "family": "sonar", + "z-ai/glm-5.1": { + "id": "z-ai/glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 130000, "output": 16384 } + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3-30b-a3b-fp8": { - "id": "qwen3-30b-a3b-fp8", - "name": "Qwen3 30B A3B FP8", - "family": "qwen", + "meta/esm2-650m": { + "id": "meta/esm2-650m", + "name": "esm2-650m", "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"] }, + "release_date": "2024-08-29", + "last_updated": "2025-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.45 }, - "limit": { "context": 40960, "output": 20000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "meta/llama-3.3-70b-instruct": { + "id": "meta/llama-3.3-70b-instruct", + "name": "Llama 3.3 70b Instruct", "attachment": false, - "reasoning": true, + "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, - "cost": { "input": 0.15, "output": 0.75 }, - "limit": { "context": 131072, "output": 32766 } + "release_date": "2024-11-26", + "last_updated": "2024-11-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "minimax-text-01": { - "id": "minimax-text-01", - "name": "MiniMax Text 01", - "family": "minimax", + "meta/esmfold": { + "id": "meta/esmfold", + "name": "esmfold", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-03-15", + "last_updated": "2025-06-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 1.1 }, - "limit": { "context": 1000000, "output": 131072 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-4-scout": { - "id": "llama-4-scout", - "name": "Llama 4 Scout", + "meta/llama-3.2-90b-vision-instruct": { + "id": "meta/llama-3.2-90b-vision-instruct", + "name": "Llama-3.2-90B-Vision-Instruct", "family": "llama", - "attachment": false, + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.18, "output": 0.59 }, - "limit": { "context": 32768, "output": 16384 }, - "status": "beta" + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-2.0-flash-lite": { - "id": "gemini-2.0-flash-lite", - "name": "Gemini 2.0 Flash Lite", - "family": "gemini", - "attachment": false, + "meta/llama-3.2-11b-vision-instruct": { + "id": "meta/llama-3.2-11b-vision-instruct", + "name": "Llama 3.2 11b Vision Instruct", + "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-02-25", - "last_updated": "2025-02-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 1048576, "output": 8192 }, - "status": "deprecated" + "knowledge": "2023-12", + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "meta/llama-guard-4-12b": { + "id": "meta/llama-guard-4-12b", + "name": "Llama Guard 4 12B", + "family": "llama", "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "release_date": "2026-03-06", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 1050000, "output": 128000 } + "release_date": "2025-04-05", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "o1": { - "id": "o1", - "name": "o1", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": false, + "meta/llama-3.1-70b-instruct": { + "id": "meta/llama-3.1-70b-instruct", + "name": "Llama 3.1 70b Instruct", + "attachment": false, + "reasoning": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 16384 } + "release_date": "2024-07-16", + "last_updated": "2024-07-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "o3": { - "id": "o3", - "name": "o3", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": false, + "meta/llama-3.2-1b-instruct": { + "id": "meta/llama-3.2-1b-instruct", + "name": "Llama 3.2 1b Instruct", + "attachment": false, + "reasoning": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 16384 } + "knowledge": "2023-12", + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen2-5-vl-32b-instruct": { - "id": "qwen2-5-vl-32b-instruct", - "name": "Qwen2.5 VL 32B Instruct", - "family": "qwen", + "meta/llama-4-maverick-17b-128e-instruct": { + "id": "meta/llama-4-maverick-17b-128e-instruct", + "name": "Llama 4 Maverick 17b 128e Instruct", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-02", + "release_date": "2025-04-01", + "last_updated": "2025-04-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.4, "output": 4.2 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-3-8b-instruct": { - "id": "llama-3-8b-instruct", - "name": "Llama 3 8B Instruct", + "meta/llama-3.2-3b-instruct": { + "id": "meta/llama-3.2-3b-instruct", + "name": "Llama 3.2 3B Instruct", "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 8192, "output": 8192 } - }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "Grok 4.1 Fast Non-Reasoning", - "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 32768, + "output": 32000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-3-70b-instruct": { - "id": "llama-3-70b-instruct", - "name": "Llama 3 70B Instruct", + "meta/llama-3.1-8b-instruct": { + "id": "meta/llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.51, "output": 0.74 }, - "limit": { "context": 8192, "output": 8000 } + "limit": { + "context": 16000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.3-chat-latest": { - "id": "gpt-5.3-chat-latest", - "name": "GPT-5.3 Chat", - "family": "gpt", + "qwen/qwen-image-edit": { + "id": "qwen/qwen-image-edit", + "name": "Qwen Image Edit", + "family": "qwen", "attachment": true, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "structured_output": false, "temperature": true, - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 0, + "output": 0 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM-4.5", - "family": "glm", - "attachment": false, + "qwen/qwen3.5-122b-a10b": { + "id": "qwen/qwen3.5-122b-a10b", + "name": "Qwen3.5 122B-A10B", + "family": "qwen", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2026-02-23", + "last_updated": "2026-02-23", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "minimax-m2.1": { - "id": "minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", + "qwen/qwen2.5-coder-32b-instruct": { + "id": "qwen/qwen2.5-coder-32b-instruct", + "name": "Qwen2.5 Coder 32b Instruct", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-11-06", + "last_updated": "2024-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1.1 }, - "limit": { "context": 196608, "output": 131072 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.7-flashx": { - "id": "glm-4.7-flashx", - "name": "GLM-4.7 FlashX", - "family": "glm", - "attachment": false, + "qwen/qwen3.5-397b-a17b": { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen3.5-397B-A17B", + "family": "qwen", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.07, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 200000, "output": 128000 } + "knowledge": "2026-01", + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "sonar-reasoning-pro": { - "id": "sonar-reasoning-pro", - "name": "Sonar Reasoning Pro", - "family": "sonar", + "qwen/qwen3-next-80b-a3b-thinking": { + "id": "qwen/qwen3-next-80b-a3b-thinking", + "name": "Qwen3-Next-80B-A3B-Thinking", + "family": "qwen", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-03-07", - "last_updated": "2025-03-07", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 128000, "output": 16384 } - }, - "gemini-pro-latest": { - "id": "gemini-pro-latest", - "name": "Gemini Pro Latest", - "family": "gemini", - "attachment": true, - "reasoning": true, "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, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "veo-3.1-fast-generate-preview": { - "id": "veo-3.1-fast-generate-preview", - "name": "Veo 3.1 Fast", - "family": "gemini", + "qwen/qwen3-next-80b-a3b-instruct": { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen3-Next-80B-A3B-Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2026-03-14", - "last_updated": "2026-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 1 }, - "status": "beta" + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-haiku-20240307": { - "id": "claude-3-haiku-20240307", - "name": "Claude 3 Haiku (2024-03-07)", - "family": "claude", + "qwen/qwen-image": { + "id": "qwen/qwen-image", + "name": "Qwen Image", + "family": "qwen", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "structured_output": false, "temperature": true, - "release_date": "2024-03-04", - "last_updated": "2024-03-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 0, + "output": 0 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-4o-search-preview": { - "id": "gpt-4o-search-preview", - "name": "GPT-4o Search Preview", - "family": "gpt", - "attachment": true, + "qwen/qwen3-coder-480b-a35b-instruct": { + "id": "qwen/qwen3-coder-480b-a35b-instruct", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-4-scout-17b-instruct": { - "id": "llama-4-scout-17b-instruct", - "name": "Llama 4 Scout 17B Instruct", - "family": "llama", - "attachment": true, + "google/gemma-2-2b-it": { + "id": "google/gemma-2-2b-it", + "name": "Gemma 2 2b It", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-07-16", + "last_updated": "2024-07-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.66 }, - "limit": { "context": 8192, "output": 2048 }, - "status": "beta" + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3-235b-a22b-fp8": { - "id": "qwen3-235b-a22b-fp8", - "name": "Qwen3 235B A22B FP8", - "family": "qwen", - "attachment": false, + "google/gemma-3n-e4b-it": { + "id": "google/gemma-3n-e4b-it", + "name": "Gemma 3n E4b It", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-04-28", - "last_updated": "2025-04-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-06-03", + "last_updated": "2025-06-03", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 40960, "output": 20000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-sonnet-4-20250514": { - "id": "claude-sonnet-4-20250514", - "name": "Claude Sonnet 4 (2025-05-14)", - "family": "claude", - "attachment": false, + "google/gemma-4-31b-it": { + "id": "google/gemma-4-31b-it", + "name": "Gemma-4-31B-IT", + "family": "gemma", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2025-05-14", - "last_updated": "2025-05-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 16384 } + "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 + } }, - "grok-4-0709": { - "id": "grok-4-0709", - "name": "Grok 4 (0709)", - "family": "grok", - "attachment": false, + "google/gemma-3n-e2b-it": { + "id": "google/gemma-3n-e2b-it", + "name": "Gemma 3n E2b It", + "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 256000, "output": 256000 } + "knowledge": "2024-06", + "release_date": "2025-06-12", + "last_updated": "2025-06-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.6v-flashx": { - "id": "glm-4.6v-flashx", - "name": "GLM-4.6V FlashX", - "family": "glm", + "google/gemma-3-27b-it": { + "id": "google/gemma-3-27b-it", + "name": "Gemma-3-27B-IT", + "family": "gemma", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2024-12-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04, "output": 0.4, "cache_read": 0 }, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", - "family": "glm", + "google/google-paligemma": { + "id": "google/google-paligemma", + "name": "paligemma", + "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 + } + }, + "moonshotai/kimi-k2-instruct": { + "id": "moonshotai/kimi-k2-instruct", + "name": "Kimi K2 Instruct", + "family": "kimi", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-01", + "release_date": "2025-01-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 200000, "output": 16384 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash (Preview)", - "family": "gemini", + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 3, "cache_read": 0.05 }, - "limit": { "context": 1048576, "output": 65535 } + "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": 262144 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.4-nano": { - "id": "gpt-5.4-nano", - "name": "GPT-5.4 Nano", - "family": "gpt", - "attachment": true, + "moonshotai/kimi-k2-instruct-0905": { + "id": "moonshotai/kimi-k2-instruct-0905", + "name": "Kimi K2 0905", + "family": "kimi", + "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 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": true, "structured_output": true, "temperature": true, - "release_date": "2026-03-17", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 1.25, "cache_read": 0.02 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-07", + "release_date": "2025-11", + "last_updated": "2025-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "claude-3-5-sonnet": { - "id": "claude-3-5-sonnet", - "name": "Claude 3.5 Sonnet", - "family": "claude", + "abacusai/dracarys-llama-3_1-70b-instruct": { + "id": "abacusai/dracarys-llama-3_1-70b-instruct", + "name": "dracarys-llama-3.1-70b-instruct", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2024-06-20", - "last_updated": "2024-06-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-09-11", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "baai/bge-m3": { + "id": "baai/bge-m3", + "name": "BGE M3", + "family": "bge", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2024-01-30", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 1024 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "bytedance/seed-oss-36b-instruct": { + "id": "bytedance/seed-oss-36b-instruct", + "name": "ByteDance-Seed/Seed-OSS-36B-Instruct", + "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": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 16384 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", - "attachment": true, + "deepseek-ai/deepseek-v4-flash": { + "id": "deepseek-ai/deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.9, "cache_read": 0.05 }, - "limit": { "context": 128000, "output": 16000 } + "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.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "qwen3-vl-8b-instruct": { - "id": "qwen3-vl-8b-instruct", - "name": "Qwen3 VL 8B Instruct", - "family": "qwen", + "deepseek-ai/deepseek-v4-pro": { + "id": "deepseek-ai/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "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.74, + "output": 3.48, + "cache_read": 0.145 + } + } + } + }, + "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", + "family": "mistral-nemo", + "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": 16000, + "output": 4096 + }, + "cost": { + "input": 0.038, + "output": 0.1 + } + }, + "meta/llama-3.2-11b-vision-instruct": { + "id": "meta/llama-3.2-11b-vision-instruct", + "name": "Llama 3.2 11B Vision Instruct", + "family": "llama", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2025-10-14", - "last_updated": "2025-10-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.5 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 16000, + "output": 4096 + }, + "cost": { + "input": 0.055, + "output": 0.055 + } }, - "gpt-4": { - "id": "gpt-4", - "name": "GPT-4", - "family": "gpt", + "meta/llama-3.2-1b-instruct": { + "id": "meta/llama-3.2-1b-instruct", + "name": "Llama 3.2 1B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2023-03-14", - "last_updated": "2023-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 30, "output": 60 }, - "limit": { "context": 8192, "output": 8192 } + "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.01, + "output": 0.01 + } }, - "minimax-m2.7": { - "id": "minimax-m2.7", - "name": "MiniMax M2.7", - "family": "minimax", + "meta/llama-3.2-3b-instruct": { + "id": "meta/llama-3.2-3b-instruct", + "name": "Llama 3.2 3B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 204800, "output": 131100 } + "limit": { + "context": 16000, + "output": 4096 + }, + "cost": { + "input": 0.02, + "output": 0.02 + } }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "meta/llama-3.1-8b-instruct": { + "id": "meta/llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 1.8 }, - "limit": { "context": 262000, "output": 8192 } + "limit": { + "context": 16000, + "output": 4096 + }, + "cost": { + "input": 0.025, + "output": 0.025 + } }, - "auto": { - "id": "auto", - "name": "Auto Route", - "family": "auto", + "qwen/qwen-2.5-7b-vision-instruct": { + "id": "qwen/qwen-2.5-7b-vision-instruct", + "name": "Qwen 2.5 7B Vision Instruct", + "family": "qwen", "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "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.2, + "output": 0.2 + } }, - "qwen3-next-80b-a3b-thinking": { - "id": "qwen3-next-80b-a3b-thinking", - "name": "Qwen3 Next 80B A3B Thinking", + "qwen/qwen3-embedding-4b": { + "id": "qwen/qwen3-embedding-4b", + "name": "Qwen 3 Embedding 4B", "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2025-09-10", - "last_updated": "2025-09-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": false, + "tool_call": false, + "temperature": false, + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 6 }, - "limit": { "context": 131072, "output": 32768 }, - "status": "beta" + "limit": { + "context": 32000, + "output": 2048 + }, + "cost": { + "input": 0.01, + "output": 0 + } }, - "qwen3-vl-30b-a3b-instruct": { - "id": "qwen3-vl-30b-a3b-instruct", - "name": "Qwen3 VL 30B A3B Instruct", - "family": "qwen", + "google/gemma-3": { + "id": "google/gemma-3", + "name": "Google Gemma 3", + "family": "gemma", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2025-10-05", - "last_updated": "2025-10-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.7 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 125000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.3 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini", - "attachment": true, - "reasoning": true, + "osmosis/osmosis-structure-0.6b": { + "id": "osmosis/osmosis-structure-0.6b", + "name": "Osmosis Structure 0.6B", + "family": "osmosis", + "attachment": false, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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 + }, + "cost": { + "input": 0.1, + "output": 0.5 + } + } + } + }, + "inception": { + "id": "inception", + "env": ["INCEPTION_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.inceptionlabs.ai/v1/", + "name": "Inception", + "doc": "https://platform.inceptionlabs.ai/docs", + "models": { + "mercury-edit-2": { + "id": "mercury-edit-2", + "name": "Mercury Edit 2", + "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "release_date": "2026-03-30", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.025 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "Claude Opus 4.1", - "family": "claude", - "attachment": true, + "mercury-2": { + "id": "mercury-2", + "name": "Mercury 2", + "family": "mercury", + "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01-01", + "release_date": "2026-02-24", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5 }, - "limit": { "context": 200000, "output": 32000 } - }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini", + "limit": { + "context": 128000, + "output": 50000 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.025 + } + } + } + }, + "openai": { + "id": "openai", + "env": ["OPENAI_API_KEY"], + "npm": "@ai-sdk/openai", + "name": "OpenAI", + "doc": "https://platform.openai.com/docs/models", + "models": { + "gpt-5.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.03 }, - "limit": { "context": 1048576, "output": 65535 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "sonar-pro": { - "id": "sonar-pro", - "name": "Sonar Pro", - "family": "sonar", - "attachment": false, + "gpt-4o-2024-05-13": { + "id": "gpt-4o-2024-05-13", + "name": "GPT-4o (2024-05-13)", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-03-07", - "last_updated": "2025-03-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 5, + "output": 15 + } }, - "qwen3-235b-a22b-thinking-2507": { - "id": "qwen3-235b-a22b-thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", + "o1-mini": { + "id": "o1-mini", + "name": "o1-mini", + "family": "o-mini", "attachment": false, "reasoning": true, - "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, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262000, "output": 8192 }, - "status": "beta" - }, - "qwen-image-edit-max": { - "id": "qwen-image-edit-max", - "name": "Qwen Image Edit Max", - "family": "qwen", - "attachment": true, - "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2026-01-16", - "last_updated": "2026-01-16", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } - }, - "glm-4-32b-0414-128k": { - "id": "glm-4-32b-0414-128k", - "name": "GLM-4 32B (0414-128k)", - "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"] }, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", + "gpt-5.2-pro": { + "id": "gpt-5.2-pro", + "name": "GPT-5.2 Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": 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"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.18 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 21, + "output": 168 + } }, - "qwen3-next-80b-a3b-instruct": { - "id": "qwen3-next-80b-a3b-instruct", - "name": "Qwen3 Next 80B A3B Instruct", - "family": "qwen", + "text-embedding-3-large": { + "id": "text-embedding-3-large", + "name": "text-embedding-3-large", + "family": "text-embedding", "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-09-10", - "last_updated": "2025-09-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 129024, "output": 32768 } + "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 + } }, - "grok-4-1-fast-reasoning": { - "id": "grok-4-1-fast-reasoning", - "name": "Grok 4.1 Fast Reasoning", - "family": "grok", + "gpt-5.3-chat-latest": { + "id": "gpt-5.3-chat-latest", + "name": "GPT-5.3 Chat (latest)", + "family": "gpt", "attachment": true, - "reasoning": 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"] }, + "knowledge": "2025-08-31", + "release_date": "2026-03-03", + "last_updated": "2026-03-03", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } - }, - "gpt-4o-mini-search-preview": { - "id": "gpt-4o-mini-search-preview", - "name": "GPT-4o Mini Search Preview", - "family": "gpt", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 16384 } - }, - "qwen3-vl-plus": { - "id": "qwen3-vl-plus", - "name": "Qwen3 VL Plus", - "family": "qwen", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1.6, "cache_read": 0.04 }, - "limit": { "context": 262144, "output": 32768 } + "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 + } + } }, - "deepseek-v3.1": { - "id": "deepseek-v3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.56, "output": 1.68, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 32768 } - }, - "gemini-2.0-flash": { - "id": "gemini-2.0-flash", - "name": "Gemini 2.0 Flash", - "family": "gemini", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-02-05", - "last_updated": "2025-02-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1048576, "output": 8192 }, - "status": "deprecated" + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "custom": { - "id": "custom", - "name": "Custom Model", - "family": "auto", + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "glm-4.5-flash": { - "id": "glm-4.5-flash", - "name": "GLM-4.5 Flash", - "family": "glm", - "attachment": false, - "reasoning": false, + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-08-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } - }, - "llama-3.2-3b-instruct": { - "id": "llama-3.2-3b-instruct", - "name": "Llama 3.2 3B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2024-09-18", - "last_updated": "2024-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.05 }, - "limit": { "context": 32768, "output": 32000 }, - "status": "beta" + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "GPT-4.1 Mini", + "gpt-4-turbo": { + "id": "gpt-4-turbo", + "name": "GPT-4 Turbo", "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1000000, "output": 16384 } - }, - "qwen-image-max-2025-12-30": { - "id": "qwen-image-max-2025-12-30", - "name": "Qwen Image Max 2025-12-30", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-12-31", - "last_updated": "2025-12-31", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } - }, - "cogview-4": { - "id": "cogview-4", - "name": "CogView-4", - "family": "glm", - "attachment": false, - "reasoning": false, - "tool_call": false, "structured_output": false, - "temperature": true, - "release_date": "2025-03-04", - "last_updated": "2025-03-04", - "modalities": { "input": ["text"], "output": ["text", "image"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } - }, - "llama-3.2-11b-instruct": { - "id": "llama-3.2-11b-instruct", - "name": "Llama 3.2 11B Instruct", - "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, - "cost": { "input": 0.07, "output": 0.33 }, - "limit": { "context": 128000, "output": 16384 }, - "status": "beta" - }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-15", - "last_updated": "2026-02-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2023-12", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 202800, "output": 131100 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "veo-3.1-generate-preview": { - "id": "veo-3.1-generate-preview", - "name": "Veo 3.1", - "family": "gemini", + "text-embedding-ada-002": { + "id": "text-embedding-ada-002", + "name": "text-embedding-ada-002", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2026-03-14", - "last_updated": "2026-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2022-12", + "release_date": "2022-12-15", + "last_updated": "2022-12-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32768, "output": 1 }, - "status": "beta" + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "qwen3-vl-30b-a3b-thinking": { - "id": "qwen3-vl-30b-a3b-thinking", - "name": "Qwen3 VL 30B A3B Thinking", - "family": "qwen", + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-10-11", - "last_updated": "2025-10-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 1 }, - "limit": { "context": 131072, "output": 32768 } - }, - "llama-3.1-70b-instruct": { - "id": "llama-3.1-70b-instruct", - "name": "Llama 3.1 70B Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 128000, "output": 2048 }, - "status": "beta" + "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 + } }, - "qwen-omni-turbo": { - "id": "qwen-omni-turbo", - "name": "Qwen Omni Turbo", - "family": "qwen", + "o3-pro": { + "id": "o3-pro", + "name": "o3-pro", + "family": "o-pro", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-03-26", - "last_updated": "2025-03-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 32768, "output": 8192 } + "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-5-chat-latest": { - "id": "gpt-5-chat-latest", - "name": "GPT-5 Chat Latest", - "family": "gpt", + "gpt-4o-mini": { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "minimax-m2.1-lightning": { - "id": "minimax-m2.1-lightning", - "name": "MiniMax M2.1 Lightning", - "family": "minimax", - "attachment": false, + "o4-mini-deep-research": { + "id": "o4-mini-deep-research", + "name": "o4-mini-deep-research", + "family": "o-mini", + "attachment": true, "reasoning": true, - "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, - "cost": { "input": 0.12, "output": 0.48 }, - "limit": { "context": 196608, "output": 131072 } + "tool_call": true, + "temperature": false, + "knowledge": "2024-05", + "release_date": "2024-06-26", + "last_updated": "2024-06-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "grok-4-fast-reasoning": { - "id": "grok-4-fast-reasoning", - "name": "Grok 4 Fast Reasoning", - "family": "grok", + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "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 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt", - "attachment": false, + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o-mini", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-05", + "release_date": "2025-04-16", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.28 + } }, - "seed-1-6-250915": { - "id": "seed-1-6-250915", - "name": "Seed 1.6 (250915)", - "family": "seed", + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.05 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "qwen3-32b-fp8": { - "id": "qwen3-32b-fp8", - "name": "Qwen3 32B FP8", - "family": "qwen", - "attachment": false, + "gpt-image-1": { + "id": "gpt-image-1", + "name": "gpt-image-1", + "family": "gpt-image", + "attachment": true, "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, - "cost": { "input": 0.1, "output": 0.45 }, - "limit": { "context": 40960, "output": 20000 } - }, - "claude-3-5-haiku": { - "id": "claude-3-5-haiku", - "name": "Claude 3.5 Haiku", - "family": "claude", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-04-24", + "last_updated": "2025-04-24", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4, "cache_read": 0.08 }, - "limit": { "context": 200000, "output": 8192 }, - "status": "deprecated" - }, - "mixtral-8x7b-instruct-together": { - "id": "mixtral-8x7b-instruct-together", - "name": "Mixtral 8x7B Instruct", - "family": "mistral", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2023-12-10", - "last_updated": "2023-12-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.06, "output": 0.06 }, - "limit": { "context": 32768, "output": 16384 } + "limit": { + "context": 0, + "input": 0, + "output": 0 + } }, - "qwen-coder-plus": { - "id": "qwen-coder-plus", - "name": "Qwen Coder Plus", - "family": "qwen", - "attachment": false, - "reasoning": false, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2024-09-18", - "last_updated": "2024-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM-4.5 Air", - "family": "glm", - "attachment": false, - "reasoning": false, + "gpt-5.2-chat-latest": { + "id": "gpt-5.2-chat-latest", + "name": "GPT-5.2 Chat", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-07-25", - "last_updated": "2025-07-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 1.1, "cache_read": 0.03 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "gemini-3.1-flash-lite-preview": { - "id": "gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite (Preview)", - "family": "gemini", + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex mini", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.25, "output": 1.5, "cache_read": 0.03 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "grok-3": { - "id": "grok-3", - "name": "Grok-3", - "family": "grok", + "o1-preview": { + "id": "o1-preview", + "name": "o1-preview", + "family": "o", "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": true, + "knowledge": "2023-09", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } + }, + "gpt-4o-2024-08-06": { + "id": "gpt-4o-2024-08-06", + "name": "GPT-4o (2024-08-06)", + "family": "gpt", + "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-08-06", + "last_updated": "2024-08-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "gemini-3.1-flash-image-preview": { - "id": "gemini-3.1-flash-image-preview", - "name": "Gemini 3.1 Flash Image (Preview)", - "family": "gemini", + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-02-26", - "last_updated": "2026-02-26", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "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, - "cost": { "input": 0.25, "output": 1.5 }, - "limit": { "context": 65536, "output": 65536 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "gemini-2.5-flash-image": { - "id": "gemini-2.5-flash-image", - "name": "Gemini 2.5 Flash Image", - "family": "gemini", + "gpt-image-1-mini": { + "id": "gpt-image-1-mini", + "name": "gpt-image-1-mini", + "family": "gpt-image", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-10-02", - "last_updated": "2025-10-02", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "temperature": false, + "release_date": "2025-09-26", + "last_updated": "2025-09-26", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 30, "cache_read": 0.03 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 0, + "input": 0, + "output": 0 + } }, - "glm-4.5v": { - "id": "glm-4.5v", - "name": "GLM-4.5V", - "family": "glm", + "o1": { + "id": "o1", + "name": "o1", + "family": "o", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-11", - "last_updated": "2025-08-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.6, "output": 1.8, "cache_read": 0.11 }, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } }, - "minimax-m2.7-highspeed": { - "id": "minimax-m2.7-highspeed", - "name": "MiniMax M2.7 Highspeed", - "family": "minimax", - "attachment": false, + "gpt-5.4-pro": { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "structured_output": false, - "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.06 }, - "limit": { "context": 204800, "output": 131100 } + "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 + } + } }, - "seedream-4-5": { - "id": "seedream-4-5", - "name": "Seedream 4.5", - "family": "seed", + "gpt-3.5-turbo": { + "id": "gpt-3.5-turbo", + "name": "GPT-3.5-turbo", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, "temperature": true, - "release_date": "2025-12-03", - "last_updated": "2025-12-03", - "modalities": { "input": ["text"], "output": ["text", "image"] }, + "knowledge": "2021-09-01", + "release_date": "2023-03-01", + "last_updated": "2023-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } + "limit": { + "context": 16385, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 1.5, + "cache_read": 1.25 + } }, - "qwen3-coder-plus": { - "id": "qwen3-coder-plus", - "name": "Qwen3 Coder Plus", - "family": "qwen", + "o3-deep-research": { + "id": "o3-deep-research", + "name": "o3-deep-research", + "family": "o", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2024-05", + "release_date": "2024-06-26", + "last_updated": "2024-06-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 10, + "output": 40, + "cache_read": 2.5 + } + }, + "o3-mini": { + "id": "o3-mini", + "name": "o3-mini", + "family": "o-mini", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 6, "output": 60 }, - "limit": { "context": 1000000, "output": 66000 } + "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 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "Claude Haiku 4.5 (2025-10-01)", - "family": "claude", + "text-embedding-3-small": { + "id": "text-embedding-3-small", + "name": "text-embedding-3-small", + "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 + } + }, + "o1-pro": { + "id": "o1-pro", + "name": "o1-pro", + "family": "o-pro", + "attachment": true, + "reasoning": true, "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 + }, + "cost": { + "input": 150, + "output": 600 + } + }, + "gpt-4": { + "id": "gpt-4", + "name": "GPT-4", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": false, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-11", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 30, + "output": 60 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "GPT-5-Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.11 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "qwen3-max-2026-01-23": { - "id": "qwen3-max-2026-01-23", - "name": "Qwen3 Max 2026-01-23", - "family": "qwen", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-01-23", - "last_updated": "2026-01-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.2, "output": 6, "cache_read": 0.24 }, - "limit": { "context": 262144, "output": 65536 } - }, - "grok-imagine-image-pro": { - "id": "grok-imagine-image-pro", - "name": "Grok Imagine Image Pro", - "family": "grok", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2026-03-02", - "last_updated": "2026-03-02", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 2000, "output": 4096 } - }, - "qwen-flash": { - "id": "qwen-flash", - "name": "Qwen Flash", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-09-09", - "last_updated": "2024-09-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 1000000, "output": 32000 } - }, - "deepseek-r1-0528": { - "id": "deepseek-r1-0528", - "name": "DeepSeek R1 (0528)", - "family": "deepseek", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.8, "output": 2.4 }, - "limit": { "context": 64000, "output": 16384 }, - "status": "beta" + "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 + } + } }, - "qwen3-max": { - "id": "qwen3-max", - "name": "Qwen3 Max", - "family": "qwen", + "gpt-5.1-chat-latest": { + "id": "gpt-5.1-chat-latest", + "name": "GPT-5.1 Chat", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-09-24", - "last_updated": "2025-09-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 3, "output": 15, "cache_read": 0.6 }, - "limit": { "context": 256000, "output": 32800 } + "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 + } }, - "gpt-oss-20b": { - "id": "gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", - "attachment": false, + "gpt-5.3-codex-spark": { + "id": "gpt-5.3-codex-spark", + "name": "GPT-5.3 Codex Spark", + "family": "gpt-codex-spark", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 131072, "output": 32766 } + "limit": { + "context": 128000, + "input": 100000, + "output": 32000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "qwen2-5-vl-72b-instruct": { - "id": "qwen2-5-vl-72b-instruct", - "name": "Qwen2.5 VL 72B Instruct", - "family": "qwen", + "chatgpt-image-latest": { + "id": "chatgpt-image-latest", + "name": "chatgpt-image-latest", + "family": "gpt-image", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2025-01-26", - "last_updated": "2025-01-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.4 }, - "limit": { "context": 32768, "output": 8192 } + "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 + } }, - "gemma-3-27b": { - "id": "gemma-3-27b", - "name": "Gemma 3 27B", - "family": "gemma", + "gpt-4.1-nano": { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "family": "gpt-nano", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.27, "output": 0.27 }, - "limit": { "context": 128000, "output": 16384 } + "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.03 + } }, - "grok-4-20-beta-0309-reasoning": { - "id": "grok-4-20-beta-0309-reasoning", - "name": "Grok 4.20 Beta Reasoning (0309)", - "family": "grok", + "o3": { + "id": "o3", + "name": "o3", + "family": "o", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2026-03-09", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 6, "cache_read": 0.2 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3 32B", - "family": "qwen", - "attachment": false, - "reasoning": false, + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "GPT-5 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 32768, "output": 8192 } + "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-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "GPT-4.1 Nano", + "gpt-4o": { + "id": "gpt-4o", + "name": "GPT-4o", "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-05-13", + "last_updated": "2024-08-06", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1000000, "output": 16384 } - }, - "gemma-3-12b-it": { - "id": "gemma-3-12b-it", - "name": "Gemma 3 12B IT", - "family": "gemma", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.08, "output": 0.3 }, - "limit": { "context": 1000000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude", - "attachment": false, + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "devstral-small-2507": { - "id": "devstral-small-2507", - "name": "Devstral Small 1.1", - "family": "mistral", - "attachment": false, - "reasoning": false, + "gpt-5-chat-latest": { + "id": "gpt-5-chat-latest", + "name": "GPT-5 Chat (latest)", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "tool_call": false, "structured_output": true, "temperature": true, - "release_date": "2025-07-21", - "last_updated": "2025-07-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 131072, "output": 16384 } + "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 + } }, - "ministral-3b-2512": { - "id": "ministral-3b-2512", - "name": "Ministral 3B", - "family": "mistral", + "gpt-image-1.5": { + "id": "gpt-image-1.5", + "name": "gpt-image-1.5", + "family": "gpt-image", "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, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131072, "output": 16384 } + "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 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", + "gpt-5.5-pro": { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.28, "output": 0.42, "cache_read": 0.03 }, - "limit": { "context": 163840, "output": 16384 } - }, - "gemma-2-27b-it-together": { - "id": "gemma-2-27b-it-together", - "name": "Gemma 2 27B IT", - "family": "gemma", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2024-06-27", - "last_updated": "2024-06-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.08, "output": 0.08 }, - "limit": { "context": 8192, "output": 16384 } - }, - "qwen3-4b-fp8": { - "id": "qwen3-4b-fp8", - "name": "Qwen3 4B FP8", - "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, - "cost": { "input": 0.03, "output": 0.03 }, - "limit": { "context": 128000, "output": 20000 } - }, - "qwen3-vl-235b-a22b-thinking": { - "id": "qwen3-vl-235b-a22b-thinking", - "name": "Qwen3 VL 235B A22B Thinking", - "family": "qwen", - "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-09-23", - "last_updated": "2025-09-23", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 131072, "output": 32768 } + "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 + } + } }, - "llama-4-maverick-17b-instruct": { - "id": "llama-4-maverick-17b-instruct", - "name": "Llama 4 Maverick 17B Instruct", - "family": "llama", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.24, "output": 0.97 }, - "limit": { "context": 8192, "output": 2048 }, - "status": "beta" + "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 + } }, - "qwen3-coder-flash": { - "id": "qwen3-coder-flash", - "name": "Qwen3 Coder Flash", - "family": "qwen", - "attachment": false, + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-22", - "last_updated": "2025-07-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.5, "cache_read": 0.06 }, - "limit": { "context": 1000000, "output": 65536 } + "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 + } }, - "claude-3-haiku": { - "id": "claude-3-haiku", - "name": "Claude 3 Haiku", - "family": "claude", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": false, - "temperature": true, - "release_date": "2024-03-04", - "last_updated": "2024-03-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "gemini-2.5-flash-image-preview": { - "id": "gemini-2.5-flash-image-preview", - "name": "Gemini 2.5 Flash Image (Preview)", - "family": "gemini", + "gpt-4o-2024-11-20": { + "id": "gpt-4o-2024-11-20", + "name": "GPT-4o (2024-11-20)", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-10-02", - "last_updated": "2025-10-02", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "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 + } + } + } + }, + "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": { + "xai/grok-4-fast": { + "id": "xai/grok-4-fast", + "name": "Grok 4 Fast", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 2000000, + "output": 64000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05, + "cache_write": 0.2 + } }, - "o4-mini": { - "id": "o4-mini", - "name": "o4 Mini", - "family": "gpt", + "xai/grok-4": { + "id": "xai/grok-4", + "name": "Grok 4", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-09-09", + "last_updated": "2025-09-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 16384 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75, + "cache_write": 3 + } }, - "glm-4.5-x": { - "id": "glm-4.5-x", - "name": "GLM-4.5 X", - "family": "glm", - "attachment": false, + "openai/gpt-5.1-codex-max": { + "id": "openai/gpt-5.1-codex-max", + "name": "GPT-5.1-Codex-Max", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.2, "output": 8.9, "cache_read": 0.45 }, - "limit": { "context": 128000, "output": 16384 }, - "status": "beta" + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.1, + "output": 9, + "cache_read": 0.11 + } }, - "gemini-3-pro-image-preview": { - "id": "gemini-3-pro-image-preview", - "name": "Gemini 3 Pro Image (Preview)", - "family": "gemini", + "openai/gpt-5-chat": { + "id": "openai/gpt-5-chat", + "name": "GPT-5 Chat (latest)", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": false, "structured_output": true, "temperature": true, - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text", "image"] }, + "knowledge": "2024-09-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.2 }, - "limit": { "context": 65536, "output": 32768 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude", - "attachment": false, - "reasoning": false, + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "GPT-5.2 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 1, "output": 5, "cache_read": 0.1 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 21, + "output": 168 + } }, - "qwen25-coder-7b": { - "id": "qwen25-coder-7b", - "name": "Qwen2.5 Coder 7B", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, - "temperature": true, - "release_date": "2024-09-19", - "last_updated": "2024-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.01, "output": 0.03 }, - "limit": { "context": 32768, "output": 8192 } + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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": 128000, + "output": 32000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.03 + } }, - "seed-1-8-251228": { - "id": "seed-1-8-251228", - "name": "Seed 1.8 (251228)", - "family": "seed", + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-12-18", - "last_updated": "2025-12-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-05-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.05 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 16000, + "output": 4000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.01 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "GPT-5.3-Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 272000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "claude-3-5-sonnet-20241022": { - "id": "claude-3-5-sonnet-20241022", - "name": "Claude 3.5 Sonnet (2024-10-22)", - "family": "claude", - "attachment": false, + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 8192 }, - "status": "deprecated" + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "minimax-m2.5": { - "id": "minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, + "openai/gpt-5.1-chat": { + "id": "openai/gpt-5.1-chat", + "name": "GPT-5.1 Chat", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131100 } + "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 + } }, - "mistral-large-2512": { - "id": "mistral-large-2512", - "name": "Mistral Large 3", - "family": "mistral", + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "o4 Mini", + "family": "o-mini", "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, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 262144, "output": 16384 } - }, - "minimax-m2.5-highspeed": { - "id": "minimax-m2.5-highspeed", - "name": "MiniMax M2.5 Highspeed", - "family": "minimax", - "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131100 } + "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.28 + } }, - "glm-4.6v-flash": { - "id": "glm-4.6v-flash", - "name": "GLM-4.6V Flash", - "family": "glm", + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT-5.2-Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-08", - "last_updated": "2025-12-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-01-14", + "last_updated": "2026-01-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "qwen3-30b-a3b-instruct-2507": { - "id": "qwen3-30b-a3b-instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT-5.1-Codex-Mini", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "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": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262000, "output": 8192 } + "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 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "grok-4-1-fast": { - "id": "grok-4-1-fast", - "name": "Grok 4.1 Fast", - "family": "grok", + "openai/gpt-5-image": { + "id": "openai/gpt-5-image", + "name": "GPT-5 Image", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10-01", + "release_date": "2025-10-14", + "last_updated": "2025-10-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 10, + "cache_read": 1.25 + } }, - "gpt-5.2-pro": { - "id": "gpt-5.2-pro", - "name": "GPT-5.2 Pro", + "openai/gpt-5.1": { + "id": "openai/gpt-5.1", + "name": "GPT-5.1", "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "output": 272000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "claude-3-7-sonnet": { - "id": "claude-3-7-sonnet", - "name": "Claude 3.7 Sonnet", - "family": "claude", - "attachment": false, + "openai/gpt-5.4-pro": { + "id": "openai/gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": false, - "temperature": true, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3 }, - "limit": { "context": 200000, "output": 8192 } - } - } - }, - "groq": { - "id": "groq", - "env": ["GROQ_API_KEY"], - "npm": "@ai-sdk/groq", - "name": "Groq", - "doc": "https://console.groq.com/docs/models", - "models": { - "llama3-70b-8192": { - "id": "llama3-70b-8192", - "name": "Llama 3 70B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2023-03", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.59, "output": 0.79 }, - "limit": { "context": 8192, "output": 8192 }, - "status": "deprecated" - }, - "llama-3.3-70b-versatile": { - "id": "llama-3.3-70b-versatile", - "name": "Llama 3.3 70B Versatile", - "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, - "cost": { "input": 0.59, "output": 0.79 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180, + "cache_read": 30 + } }, - "deepseek-r1-distill-llama-70b": { - "id": "deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill Llama 70B", - "family": "deepseek-thinking", - "attachment": false, + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "GPT-5 Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.75, "output": 0.99 }, - "limit": { "context": 131072, "output": 8192 }, - "status": "deprecated" - }, - "gemma2-9b-it": { - "id": "gemma2-9b-it", - "name": "Gemma 2 9B", - "family": "gemma", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2024-06-27", - "last_updated": "2024-06-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 8192, "output": 8192 }, - "status": "deprecated" - }, - "llama-3.1-8b-instant": { - "id": "llama-3.1-8b-instant", - "name": "Llama 3.1 8B Instant", - "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, - "cost": { "input": 0.05, "output": 0.08 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2024-10-01", + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "qwen-qwq-32b": { - "id": "qwen-qwq-32b", - "name": "Qwen QwQ 32B", - "family": "qwen", - "attachment": false, + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT-5", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-11-27", - "last_updated": "2024-11-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.29, "output": 0.39 }, - "limit": { "context": 131072, "output": 16384 }, - "status": "deprecated" - }, - "llama-guard-3-8b": { - "id": "llama-guard-3-8b", - "name": "Llama Guard 3 8B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 8192, "output": 8192 }, - "status": "deprecated" - }, - "mistral-saba-24b": { - "id": "mistral-saba-24b", - "name": "Mistral Saba 24B", - "family": "mistral", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-02-06", - "last_updated": "2025-02-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-09-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "audio", "image", "video"], + "output": ["text", "audio", "image"] + }, "open_weights": false, - "cost": { "input": 0.79, "output": 0.79 }, - "limit": { "context": 32768, "output": 32768 }, - "status": "deprecated" - }, - "whisper-large-v3": { - "id": "whisper-large-v3", - "name": "Whisper Large V3", - "family": "whisper", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2023-09", - "release_date": "2023-09-01", - "last_updated": "2025-09-05", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 448, "output": 448 } - }, - "whisper-large-v3-turbo": { - "id": "whisper-large-v3-turbo", - "name": "Whisper Large v3 Turbo", - "family": "whisper", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 448, "output": 448 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "llama3-8b-8192": { - "id": "llama3-8b-8192", - "name": "Llama 3 8B", - "family": "llama", - "attachment": false, + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "GPT-4.1 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-03", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.08 }, - "limit": { "context": 8192, "output": 8192 }, - "status": "deprecated" - }, - "allam-2-7b": { - "id": "allam-2-7b", - "name": "ALLaM-2-7b", - "family": "allam", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4096, "output": 4096 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 65536 } + "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, + "cache_read": 0.125 + } }, - "openai/gpt-oss-safeguard-20b": { - "id": "openai/gpt-oss-safeguard-20b", - "name": "Safety GPT OSS 20B", - "family": "gpt-oss", - "attachment": false, + "google/gemini-3-flash-preview": { + "id": "google/gemini-3-flash-preview", + "name": "Gemini 3 Flash", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-03-05", - "last_updated": "2025-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.075, "output": 0.3, "cache_read": 0.037 }, - "limit": { "context": 131072, "output": 65536 } + "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": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "cache_write": 1 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", - "attachment": false, + "google/gemini-3-pro-preview": { + "id": "google/gemini-3-pro-preview", + "name": "Gemini 3 Pro", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 131072, "output": 65536 } - }, - "canopylabs/orpheus-arabic-saudi": { - "id": "canopylabs/orpheus-arabic-saudi", - "name": "Orpheus Arabic Saudi", - "family": "canopylabs", - "attachment": false, - "reasoning": false, - "tool_call": false, "temperature": true, - "knowledge": "2025-12-16", - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text"], "output": ["audio"] }, + "knowledge": "2025-01", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 40, "output": 0 }, - "limit": { "context": 4000, "output": 50000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "cache_write": 4.5 + } }, - "canopylabs/orpheus-v1-english": { - "id": "canopylabs/orpheus-v1-english", - "name": "Orpheus V1 English", - "family": "canopylabs", - "attachment": false, - "reasoning": false, - "tool_call": false, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2025-12-19", - "release_date": "2025-12-19", - "last_updated": "2025-12-19", - "modalities": { "input": ["text"], "output": ["audio"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4000, "output": 50000 } - }, - "meta-llama/llama-guard-4-12b": { - "id": "meta-llama/llama-guard-4-12b", - "name": "Llama Guard 4 12B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 131072, "output": 1024 }, - "status": "deprecated" + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.075, + "cache_write": 0.55 + } }, - "meta-llama/llama-4-scout-17b-16e-instruct": { - "id": "meta-llama/llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17B", - "family": "llama", - "attachment": false, - "reasoning": false, + "anthropic/claude-haiku-4-5": { + "id": "anthropic/claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.11, "output": 0.34 }, - "limit": { "context": 131072, "output": 8192 } - }, - "meta-llama/llama-prompt-guard-2-22m": { - "id": "meta-llama/llama-prompt-guard-2-22m", - "name": "Llama Prompt Guard 2 22M", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.03, "output": 0.03 }, - "limit": { "context": 512, "output": 512 } + "knowledge": "2025-02-01", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 62000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "meta-llama/llama-4-maverick-17b-128e-instruct": { - "id": "meta-llama/llama-4-maverick-17b-128e-instruct", - "name": "Llama 4 Maverick 17B", - "family": "llama", - "attachment": false, - "reasoning": false, + "anthropic/claude-sonnet-4-6": { + "id": "anthropic/claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 131072, "output": 8192 }, - "status": "deprecated" - }, - "meta-llama/llama-prompt-guard-2-86m": { - "id": "meta-llama/llama-prompt-guard-2-86m", - "name": "Llama Prompt Guard 2 86M", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 512, "output": 512 } + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "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, + "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 + } + } }, - "qwen/qwen3-32b": { - "id": "qwen/qwen3-32b", - "name": "Qwen3 32B", - "family": "qwen", - "attachment": false, + "anthropic/claude-3-7-sonnet": { + "id": "anthropic/claude-3-7-sonnet", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-11-08", - "release_date": "2024-12-23", - "last_updated": "2024-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.29, "output": 0.59 }, - "limit": { "context": 131072, "output": 40960 } + "knowledge": "2024-01", + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "groq/compound-mini": { - "id": "groq/compound-mini", - "name": "Compound Mini", - "family": "groq", - "attachment": false, + "anthropic/claude-opus-4-5": { + "id": "anthropic/claude-opus-4-5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-09-04", - "release_date": "2025-09-04", - "last_updated": "2025-09-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-11-24", + "last_updated": "2025-11-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "groq/compound": { - "id": "groq/compound", - "name": "Compound", - "family": "groq", - "attachment": false, + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Claude Opus 4", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-09-04", - "release_date": "2025-09-04", - "last_updated": "2025-09-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "moonshotai/kimi-k2-instruct-0905": { - "id": "moonshotai/kimi-k2-instruct-0905", - "name": "Kimi K2 Instruct 0905", - "family": "kimi", - "attachment": false, - "reasoning": false, + "anthropic/claude-opus-4-6": { + "id": "anthropic/claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 262144, "output": 16384 } + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "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 + } + } }, - "moonshotai/kimi-k2-instruct": { - "id": "moonshotai/kimi-k2-instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", - "attachment": false, - "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-14", - "last_updated": "2025-07-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 131072, "output": 16384 }, - "status": "deprecated" - } - } - }, - "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": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", + "openai/gpt-5.2-chat": { + "id": "openai/gpt-5.2-chat", + "name": "GPT-5.2 Chat", "family": "gpt-codex", - "attachment": false, + "attachment": true, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } - }, - "text-embedding-3-large": { - "id": "text-embedding-3-large", - "name": "text-embedding-3-large", - "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"] }, + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.13, "output": 0 }, - "limit": { "context": 8191, "output": 3072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex Mini", - "family": "gpt-codex", - "attachment": false, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, "reasoning": true, "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"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "phi-4-multimodal": { - "id": "phi-4-multimodal", - "name": "Phi-4-multimodal", - "family": "phi", + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "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, - "cost": { "input": 0.08, "output": 0.32, "input_audio": 4 }, - "limit": { "context": 128000, "output": 4096 } - }, - "cohere-embed-v3-multilingual": { - "id": "cohere-embed-v3-multilingual", - "name": "Embed v3 Multilingual", - "family": "cohere-embed", - "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": false, - "release_date": "2023-11-07", - "last_updated": "2023-11-07", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 512, "output": 1024 } + "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, + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + }, + "tiers": [ + { + "input": 5, + "output": 22.5, + "cache_read": 0.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "gpt-5.4-pro": { - "id": "gpt-5.4-pro", - "name": "GPT-5.4 Pro", + "openai/gpt-5-pro": { + "id": "openai/gpt-5-pro", + "name": "GPT-5 Pro", "family": "gpt-pro", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, + "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"] }, + "knowledge": "2024-09-30", + "release_date": "2025-10-06", + "last_updated": "2025-10-06", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 180 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "cohere-embed-v3-english": { - "id": "cohere-embed-v3-english", - "name": "Embed v3 English", - "family": "cohere-embed", - "attachment": false, + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", + "attachment": true, "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, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 512, "output": 1024 } + "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 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "o3-mini", - "family": "o-mini", - "attachment": false, + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2024-05", - "release_date": "2024-12-20", - "last_updated": "2025-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31, + "cache_write": 2.375, + "context_over_200k": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + }, + "tiers": [ + { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "gpt-5.4-mini": { - "id": "gpt-5.4-mini", - "name": "GPT-5.4 Mini", - "family": "gpt-mini", + "anthropic/claude-opus-4-1": { + "id": "anthropic/claude-opus-4-1", + "name": "Claude Opus 4.1", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 0.75, "output": 4.5, "cache_read": 0.075 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "GPT-5 Pro", - "family": "gpt-pro", + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + }, + "anthropic/claude-sonnet-4-5": { + "id": "anthropic/claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + } + } + }, + "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": { + "openai-gpt-4o-mini": { + "id": "openai-gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "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, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "output": 272000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.075 + } }, - "gpt-3.5-turbo-0613": { - "id": "gpt-3.5-turbo-0613", - "name": "GPT-3.5 Turbo 0613", - "family": "gpt", + "multi-qa-mpnet-base-dot-v1": { + "id": "multi-qa-mpnet-base-dot-v1", + "name": "Multi-QA-mpnet-base-dot-v1", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2021-08", - "release_date": "2023-06-13", - "last_updated": "2023-06-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 4 }, - "limit": { "context": 16384, "output": 16384 } + "temperature": false, + "release_date": "2021-08-30", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512, + "output": 768 + }, + "cost": { + "input": 0.009, + "output": 0 + } }, - "deepseek-v3-0324": { - "id": "deepseek-v3-0324", - "name": "DeepSeek-V3-0324", - "family": "deepseek", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": false, - "reasoning": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 2.7 + } + }, + "nemotron-3-nano-omni": { + "id": "nemotron-3-nano-omni", + "name": "Nemotron Nano 3 Omni", + "family": "nemotron", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-28", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.14, "output": 4.56 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 0.9 + } }, - "meta-llama-3.1-8b-instruct": { - "id": "meta-llama-3.1-8b-instruct", - "name": "Meta-Llama-3.1-8B-Instruct", + "llama3-8b-instruct": { + "id": "llama3-8b-instruct", + "name": "Llama 3.1 Instruct (8B)", "family": "llama", "attachment": false, "reasoning": false, @@ -46280,581 +85737,775 @@ "knowledge": "2023-12", "release_date": "2024-07-23", "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.61 }, - "limit": { "context": 128000, "output": 32768 } - }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": true, - "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2025-12-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } - }, - "deepseek-r1": { - "id": "deepseek-r1", - "name": "DeepSeek-R1", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.198, + "output": 0.198 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", + "anthropic-claude-opus-4.7": { + "id": "anthropic-claude-opus-4.7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2026-01-31", + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 272000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "llama-3.3-70b-instruct": { - "id": "llama-3.3-70b-instruct", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "anthropic-claude-sonnet-4": { + "id": "anthropic-claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 0.71, "output": 0.71 }, - "limit": { "context": 128000, "output": 32768 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75, + "tiers": [ + { + "input": 6, + "output": 22.5, + "cache_read": 0.3, + "cache_write": 3.75, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 6, + "output": 22.5, + "cache_read": 0.3, + "cache_write": 3.75 + } + } }, - "phi-3-mini-128k-instruct": { - "id": "phi-3-mini-128k-instruct", - "name": "Phi-3-mini-instruct (128k)", - "family": "phi", + "wan2-2-t2v-a14b": { + "id": "wan2-2-t2v-a14b", + "name": "Wan2.2-T2V-A14B", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-07-28", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["video"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 100, + "output": 1 + }, + "cost": { + "input": 0.6, + "output": 0 + } }, - "phi-3-small-8k-instruct": { - "id": "phi-3-small-8k-instruct", - "name": "Phi-3-small-instruct (8k)", - "family": "phi", + "qwen-2.5-14b-instruct": { + "id": "qwen-2.5-14b-instruct", + "name": "Qwen 2.5 14B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2024-09-19", + "last_updated": "2024-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 8192, "output": 2048 } + "limit": { + "context": 131072, + "output": 131072 + } }, - "claude-opus-4-5": { - "id": "claude-opus-4-5", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "openai-gpt-5.4": { + "id": "openai-gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-08-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "qwen3.5-397b-a17b": { + "id": "qwen3.5-397b-a17b", + "name": "Qwen 3.5 397B A17B", + "family": "qwen3.5", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": true, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-02-06", - "last_updated": "2026-02-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-15", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 262144, "output": 262144 }, - "provider": { - "npm": "@ai-sdk/openai-compatible", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models", - "shape": "completions" + "limit": { + "context": 262144, + "output": 81920 + }, + "cost": { + "input": 0.55, + "output": 3.5 } }, - "gpt-4-turbo": { - "id": "gpt-4-turbo", - "name": "GPT-4 Turbo", - "family": "gpt", + "openai-o3": { + "id": "openai-o3", + "name": "o3", + "family": "o", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-11-06", - "last_updated": "2024-04-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "e5-large-v2": { + "id": "e5-large-v2", + "name": "E5 Large v2", + "family": "text-embedding", + "attachment": false, "reasoning": false, - "tool_call": 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, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "tool_call": false, + "temperature": false, + "release_date": "2023-05-19", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512, + "output": 1024 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "Grok 4 Fast (Non-Reasoning)", - "family": "grok", + "openai-gpt-5.2-pro": { + "id": "openai-gpt-5.2-pro", + "name": "GPT-5.2 pro", + "family": "gpt-pro", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 21, + "output": 168 + } }, - "grok-4": { - "id": "grok-4", - "name": "Grok 4", - "family": "grok", + "glm-5": { + "id": "glm-5", + "name": "GLM 5", + "family": "glm", "attachment": false, "reasoning": true, "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, - "cost": { "input": 3, "output": 15, "reasoning": 15, "cache_read": 0.75 }, - "limit": { "context": 256000, "output": 64000 } + "interleaved": { + "field": "reasoning_content" + }, + "release_date": "2026-02-11", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 202752, + "output": 128000 + }, + "cost": { + "input": 1, + "output": 3.2 + } }, - "gpt-3.5-turbo-1106": { - "id": "gpt-3.5-turbo-1106", - "name": "GPT-3.5 Turbo 1106", - "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"] }, + "openai-gpt-5.4-nano": { + "id": "openai-gpt-5.4-nano", + "name": "GPT-5.4 nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 1, "output": 2 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "phi-4-mini": { - "id": "phi-4-mini", - "name": "Phi-4-mini", - "family": "phi", + "mistral-7b-instruct-v0.3": { + "id": "mistral-7b-instruct-v0.3", + "name": "Mistral 7B Instruct v0.3", + "family": "mistral", "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, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 128000, "output": 4096 } - }, - "phi-4-reasoning": { - "id": "phi-4-reasoning", - "name": "Phi-4-reasoning", - "family": "phi", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-05-22", + "last_updated": "2024-05-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 32000, "output": 4096 } + "limit": { + "context": 32768, + "output": 32768 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "llama3.3-70b-instruct": { + "id": "llama3.3-70b-instruct", + "name": "Llama 3.3 Instruct 70B", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 1.5, "cache_read": 0.02 }, - "limit": { "context": 256000, "output": 10000 } + "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.65, + "output": 0.65 + } }, - "codestral-2501": { - "id": "codestral-2501", - "name": "Codestral 25.01", - "family": "codestral", + "mistral-3-14B": { + "id": "mistral-3-14B", + "name": "Ministral 3 14B Instruct", + "family": "ministral", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 256000 } + "release_date": "2025-12-15", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt-codex", + "deepseek-r1-distill-llama-70b": { + "id": "deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } - }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 272000, "output": 128000 } - }, - "gpt-4-turbo-vision": { - "id": "gpt-4-turbo-vision", - "name": "GPT-4 Turbo Vision", - "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, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2025-01-30", + "last_updated": "2025-01-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.99, + "output": 0.99 + } }, - "mistral-large-2411": { - "id": "mistral-large-2411", - "name": "Mistral Large 24.11", - "family": "mistral-large", + "alibaba-qwen3-32b": { + "id": "alibaba-qwen3-32b", + "name": "Qwen3-32B", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 32768 } + "release_date": "2025-04-30", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131000, + "output": 40960 + }, + "cost": { + "input": 0.25, + "output": 0.55 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", + "anthropic-claude-opus-4.5": { + "id": "anthropic-claude-opus-4.5", + "name": "Claude Opus 4.5", "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "context_over_200k": { "input": 10, "output": 37.5, "cache_read": 1, "cache_write": 12.5 } - }, - "limit": { "context": 200000, "output": 128000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "cache_write": 6.25 } }, - "gpt-4o-mini": { - "id": "gpt-4o-mini", - "name": "GPT-4o mini", - "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6, "cache_read": 0.08 }, - "limit": { "context": 128000, "output": 16384 } - }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1 Codex Max", - "family": "gpt-codex", + "openai-o1": { + "id": "openai-o1", + "name": "o1", + "family": "o", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2023-09", + "release_date": "2024-12-05", + "last_updated": "2024-12-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", + "anthropic-claude-3-opus": { + "id": "anthropic-claude-3-opus", + "name": "Claude 3 Opus", + "family": "claude-opus", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-05", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2023-08", + "release_date": "2024-02-29", + "last_updated": "2024-02-29", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 200000, + "output": 4096 + }, + "status": "deprecated", + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } + }, + "stable-diffusion-3.5-large": { + "id": "stable-diffusion-3.5-large", + "name": "Stable Diffusion 3.5 Large", + "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 + }, + "cost": { + "input": 0.08, + "output": 0 + } }, - "codex-mini": { - "id": "codex-mini", - "name": "Codex Mini", - "family": "gpt-codex-mini", + "openai-gpt-5-nano": { + "id": "openai-gpt-5-nano", + "name": "GPT-5 nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2024-04", - "release_date": "2025-05-16", - "last_updated": "2025-05-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-05-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.375 }, - "limit": { "context": 200000, "output": 100000 } - }, - "phi-4-mini-reasoning": { - "id": "phi-4-mini-reasoning", - "name": "Phi-4-mini-reasoning", - "family": "phi", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "llama-4-scout-17b-16e-instruct": { - "id": "llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17B 16E Instruct", + "llama-4-maverick": { + "id": "llama-4-maverick", + "name": "Llama 4 Maverick 17B 128E Instruct", "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"] }, + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.78 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.25, + "output": 0.87 + } }, - "llama-3.2-11b-vision-instruct": { - "id": "llama-3.2-11b-vision-instruct", - "name": "Llama-3.2-11B-Vision-Instruct", - "family": "llama", + "anthropic-claude-4.5-sonnet": { + "id": "anthropic-claude-4.5-sonnet", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.37, "output": 0.37 }, - "limit": { "context": 128000, "output": 8192 } + "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.3, + "cache_write": 3.75, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 6, + "output": 22.5, + "cache_read": 0.3, + "cache_write": 3.75 + } + } }, - "phi-3-mini-4k-instruct": { - "id": "phi-3-mini-4k-instruct", - "name": "Phi-3-mini-instruct (4k)", - "family": "phi", + "qwen3-embedding-0.6b": { + "id": "qwen3-embedding-0.6b", + "name": "Qwen3 Embedding 0.6B", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06-03", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 4096, "output": 1024 } + "limit": { + "context": 8000, + "output": 1024 + }, + "status": "beta", + "cost": { + "input": 0.04, + "output": 0 + } }, - "phi-3-medium-4k-instruct": { - "id": "phi-3-medium-4k-instruct", - "name": "Phi-3-medium-instruct (4k)", - "family": "phi", + "anthropic-claude-4.5-haiku": { + "id": "anthropic-claude-4.5-haiku", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, + "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, + "cache_read": 1, + "cache_write": 1.25 + } + }, + "gte-large-en-v1.5": { + "id": "gte-large-en-v1.5", + "name": "GTE Large (v1.5)", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-03-27", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 4096, "output": 1024 } + "limit": { + "context": 8192, + "output": 1024 + }, + "cost": { + "input": 0.09, + "output": 0 + } }, - "model-router": { - "id": "model-router", - "name": "Model Router", - "family": "model-router", + "openai-gpt-4.1": { + "id": "openai-gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, - "release_date": "2025-05-19", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.14, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "gpt-3.5-turbo-instruct": { - "id": "gpt-3.5-turbo-instruct", - "name": "GPT-3.5 Turbo Instruct", - "family": "gpt", + "anthropic-claude-3.5-haiku": { + "id": "anthropic-claude-3.5-haiku", + "name": "Claude 3.5 Haiku", + "family": "claude-haiku", "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, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 4096, "output": 4096 } - }, - "gpt-5.1-chat": { - "id": "gpt-5.1-chat", - "name": "GPT-5.1 Chat", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, "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", "audio"], "output": ["text", "image", "audio"] }, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2024-11-05", + "last_updated": "2024-11-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", + "openai-gpt-5.2": { + "id": "openai-gpt-5.2", + "name": "GPT-5.2", "family": "gpt", "attachment": true, "reasoning": true, @@ -46862,455 +86513,802 @@ "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"] }, + "release_date": "2025-12-11", + "last_updated": "2025-12-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 15, "cache_read": 0.25 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "o1": { - "id": "o1", - "name": "o1", - "family": "o", + "deepseek-3.2": { + "id": "deepseek-3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, "reasoning": true, "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, - "cost": { "input": 15, "output": 60, "cache_read": 7.5 }, - "limit": { "context": 200000, "output": 100000 } + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-12-02", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 1.6 + } }, - "o3": { - "id": "o3", - "name": "o3", - "family": "o", - "attachment": true, + "nemotron-3-nano-30b": { + "id": "nemotron-3-nano-30b", + "name": "Nemotron 3 Nano 30B A3B", + "family": "nemotron", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 200000, "output": 100000 } + "temperature": true, + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "Grok 4.1 Fast (Non-Reasoning)", - "family": "grok", + "anthropic-claude-opus-4": { + "id": "anthropic-claude-opus-4", + "name": "Claude Opus 4", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-06-27", - "last_updated": "2025-06-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 }, - "status": "beta" + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "mai-ds-r1": { - "id": "mai-ds-r1", - "name": "MAI-DS-R1", - "family": "mai", + "openai-gpt-oss-20b": { + "id": "openai-gpt-oss-20b", + "name": "gpt-oss-20b", + "family": "gpt-oss", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, "knowledge": "2024-06", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2025-08-05", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.45 + } }, - "mistral-small-2503": { - "id": "mistral-small-2503", - "name": "Mistral Small 3.1", - "family": "mistral-small", - "attachment": true, + "qwen3-coder-flash": { + "id": "qwen3-coder-flash", + "name": "Qwen3 Coder Flash", + "family": "qwen", + "attachment": false, "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, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 32768 } + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.45, + "output": 1.7 + } }, - "gpt-5-chat": { - "id": "gpt-5-chat", - "name": "GPT-5 Chat", - "family": "gpt-codex", - "attachment": true, + "openai-o3-mini": { + "id": "openai-o3-mini", + "name": "o3-mini", + "family": "o-mini", + "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2024-10-24", - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-05", + "release_date": "2024-12-20", + "last_updated": "2025-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "cohere-command-r-plus-08-2024": { - "id": "cohere-command-r-plus-08-2024", - "name": "Command R+", - "family": "command-r", + "openai-gpt-oss-120b": { + "id": "openai-gpt-oss-120b", + "name": "gpt-oss-120b", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 4000 } - }, - "meta-llama-3-70b-instruct": { - "id": "meta-llama-3-70b-instruct", - "name": "Meta-Llama-3-70B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-08-05", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.68, "output": 3.54 }, - "limit": { "context": 8192, "output": 2048 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.7 + } }, - "phi-3.5-mini-instruct": { - "id": "phi-3.5-mini-instruct", - "name": "Phi-3.5-mini-instruct", - "family": "phi", - "attachment": false, + "gemma-4-31B-it": { + "id": "gemma-4-31B-it", + "name": "Gemma 4 31B", + "family": "gemma", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-22", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.13, "output": 0.52 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.18, + "output": 0.5 + } }, - "meta-llama-3-8b-instruct": { - "id": "meta-llama-3-8b-instruct", - "name": "Meta-Llama-3-8B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, + "nemotron-nano-12b-v2-vl": { + "id": "nemotron-nano-12b-v2-vl", + "name": "Nemotron Nano 12B v2 VL", + "family": "nemotron", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-12-01", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.61 }, - "limit": { "context": 8192, "output": 2048 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "grok-3-mini": { - "id": "grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": false, + "anthropic-claude-4.1-opus": { + "id": "anthropic-claude-4.1-opus", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.5, "reasoning": 0.5, "cache_read": 0.075 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "claude-opus-4-1": { - "id": "claude-opus-4-1", - "name": "Claude Opus 4.1", - "family": "claude-opus", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.95, + "output": 4 + } + }, + "openai-gpt-image-2": { + "id": "openai-gpt-image-2", + "name": "GPT Image 2", + "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 + } + }, + "anthropic-claude-4.6-sonnet": { + "id": "anthropic-claude-4.6-sonnet", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "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.3, + "cache_write": 3.75, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 6, + "output": 22.5, + "cache_read": 0.3, + "cache_write": 3.75 + } } }, - "gpt-5.4-nano": { - "id": "gpt-5.4-nano", - "name": "GPT-5.4 Nano", - "family": "gpt-nano", + "openai-gpt-5-mini": { + "id": "openai-gpt-5-mini", + "name": "GPT-5 mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2024-05-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.25, "cache_read": 0.02 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "gpt-4-32k": { - "id": "gpt-4-32k", - "name": "GPT-4 32K", - "family": "gpt", - "attachment": false, - "reasoning": false, + "anthropic-claude-haiku-4.5": { + "id": "anthropic-claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-03-14", - "last_updated": "2023-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-02-28", + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 60, "output": 120 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 1, + "cache_write": 1.25 + } }, - "mistral-medium-2505": { - "id": "mistral-medium-2505", - "name": "Mistral Medium 3", - "family": "mistral-medium", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", + "attachment": false, + "reasoning": true, + "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.74, + "output": 3.48 + } + }, + "ministral-3-8b-instruct-2512": { + "id": "ministral-3-8b-instruct-2512", + "name": "Ministral 3 8B", + "family": "ministral", "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, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-12-15", + "last_updated": "2025-12-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + } }, - "gpt-4": { - "id": "gpt-4", - "name": "GPT-4", - "family": "gpt", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax-m2.5", "attachment": false, + "reasoning": true, + "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": 204800, + "output": 128000 + }, + "status": "beta", + "cost": { + "input": 0.3, + "output": 1.2 + } + }, + "openai-gpt-image-1": { + "id": "openai-gpt-image-1", + "name": "GPT Image 1", + "family": "gpt-image", + "attachment": true, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2023-11", - "release_date": "2023-03-14", - "last_updated": "2023-03-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "release_date": "2025-04-24", + "last_updated": "2025-04-24", + "modalities": { + "input": ["text", "image"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 60, "output": 120 }, - "limit": { "context": 8192, "output": 8192 } + "limit": { + "context": 0, + "output": 0 + }, + "cost": { + "input": 5, + "output": 40, + "cache_read": 1.25 + } }, - "gpt-5.3-chat": { - "id": "gpt-5.3-chat", - "name": "GPT-5.3 Chat", - "family": "gpt-codex", + "openai-gpt-5.5": { + "id": "openai-gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, "temperature": false, - "knowledge": "2025-08-31", - "release_date": "2026-03-03", - "last_updated": "2026-03-03", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-12-01", + "release_date": "2026-04-23", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "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 + } + } }, - "llama-3.2-90b-vision-instruct": { - "id": "llama-3.2-90b-vision-instruct", - "name": "Llama-3.2-90B-Vision-Instruct", - "family": "llama", - "attachment": true, - "reasoning": false, + "nvidia-nemotron-3-super-120b": { + "id": "nvidia-nemotron-3-super-120b", + "name": "Nemotron-3-Super-120B", + "family": "nemotron", + "attachment": false, + "reasoning": true, "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"] }, + "knowledge": "2026-02", + "release_date": "2026-03-11", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.04, "output": 2.04 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 256000, + "output": 32768 + }, + "status": "beta", + "cost": { + "input": 0.3, + "output": 0.65 + } }, - "deepseek-v3.2-speciale": { - "id": "deepseek-v3.2-speciale", - "name": "DeepSeek-V3.2-Speciale", - "family": "deepseek", - "attachment": false, + "openai-gpt-5.4-pro": { + "id": "openai-gpt-5.4-pro", + "name": "GPT-5.4 pro", + "family": "gpt-pro", + "attachment": true, "reasoning": true, - "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, - "cost": { "input": 0.58, "output": 1.68 }, - "limit": { "context": 128000, "output": 128000 } + "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": 400000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180 + } }, - "text-embedding-ada-002": { - "id": "text-embedding-ada-002", - "name": "text-embedding-ada-002", + "all-mini-lm-l6-v2": { + "id": "all-mini-lm-l6-v2", + "name": "All-MiniLM-L6-v2", "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, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8192, "output": 1536 } - }, - "ministral-3b": { - "id": "ministral-3b", - "name": "Ministral 3B", - "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"] }, + "temperature": false, + "release_date": "2021-08-30", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 256, + "output": 384 + }, + "cost": { + "input": 0.009, + "output": 0 + } }, - "mistral-nemo": { - "id": "mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", + "bge-m3": { + "id": "bge-m3", + "name": "BGE M3", + "family": "bge", "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"] }, + "tool_call": false, + "temperature": false, + "release_date": "2024-01-30", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 8192, + "output": 1024 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "gpt-5.2-chat": { - "id": "gpt-5.2-chat", - "name": "GPT-5.2 Chat", + "openai-gpt-5.1-codex-max": { + "id": "openai-gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2024-09-30", + "release_date": "2025-11-13", + "last_updated": "2025-11-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", + "anthropic-claude-opus-4.6": { + "id": "anthropic-claude-opus-4.6", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "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": 0.5, + "cache_write": 6.25, + "tier": { + "type": "context", + "size": 200000 + } + } + ], + "context_over_200k": { + "input": 10, + "output": 37.5, + "cache_read": 0.5, + "cache_write": 6.25 + } + } }, - "gpt-3.5-turbo-0301": { - "id": "gpt-3.5-turbo-0301", - "name": "GPT-3.5 Turbo 0301", + "openai-gpt-4o": { + "id": "openai-gpt-4o", + "name": "GPT-4o", "family": "gpt", - "attachment": false, + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2021-08", - "release_date": "2023-03-01", - "last_updated": "2023-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-09", + "release_date": "2024-05-13", + "last_updated": "2024-08-06", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 4096, "output": 4096 } - }, - "phi-4": { - "id": "phi-4", - "name": "Phi-4", - "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, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "grok-4-1-fast-reasoning": { - "id": "grok-4-1-fast-reasoning", - "name": "Grok 4.1 Fast (Reasoning)", - "family": "grok", + "openai-gpt-5.4-mini": { + "id": "openai-gpt-5.4-mini", + "name": "GPT-5.4 mini", + "family": "gpt-mini", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-06-27", - "last_updated": "2025-06-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 }, - "status": "beta" + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", + "openai-gpt-5": { + "id": "openai-gpt-5", + "name": "GPT-5", "family": "gpt", "attachment": true, "reasoning": true, @@ -47318,5527 +87316,8539 @@ "structured_output": true, "temperature": false, "knowledge": "2024-09-30", - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text", "image", "audio"], "output": ["text", "image", "audio"] }, + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "deepseek-v3.1": { - "id": "deepseek-v3.1", - "name": "DeepSeek-V3.1", - "family": "deepseek", + "arcee-trinity-large-thinking": { + "id": "arcee-trinity-large-thinking", + "name": "Trinity Large Thinking", + "family": "trinity", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.56, "output": 1.68 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 256000, + "output": 128000 + }, + "status": "beta", + "cost": { + "input": 0.25, + "output": 0.9, + "cache_read": 0.06 + } }, - "cohere-command-r-08-2024": { - "id": "cohere-command-r-08-2024", - "name": "Command R", - "family": "command-r", + "mistral-nemo-instruct-2407": { + "id": "mistral-nemo-instruct-2407", + "name": "Mistral Nemo Instruct", + "family": "mistral", "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"] }, + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "status": "deprecated", + "cost": { + "input": 0.3, + "output": 0.3 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "GPT-4.1 mini", - "family": "gpt-mini", - "attachment": true, + "deepseek-v3": { + "id": "deepseek-v3", + "name": "DeepSeek V3", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-05", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "knowledge": "2024-07", + "release_date": "2024-12-26", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 131072 + } }, - "phi-3-medium-128k-instruct": { - "id": "phi-3-medium-128k-instruct", - "name": "Phi-3-medium-instruct (128k)", - "family": "phi", + "bge-reranker-v2-m3": { + "id": "bge-reranker-v2-m3", + "name": "BGE Reranker v2 M3", + "family": "bge", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-03-12", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 8192, + "output": 1 + }, + "cost": { + "input": 0.01, + "output": 0 + } }, - "meta-llama-3.1-405b-instruct": { - "id": "meta-llama-3.1-405b-instruct", - "name": "Meta-Llama-3.1-405B-Instruct", - "family": "llama", - "attachment": false, - "reasoning": false, + "anthropic-claude-3.7-sonnet": { + "id": "anthropic-claude-3.7-sonnet", + "name": "Claude 3.7 Sonnet", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 5.33, "output": 16 }, - "limit": { "context": 128000, "output": 32768 } + "knowledge": "2024-11", + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text", "image"], + "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 + } }, - "phi-3.5-moe-instruct": { - "id": "phi-3.5-moe-instruct", - "name": "Phi-3.5-MoE-instruct", - "family": "phi", + "qwen3-tts-voicedesign": { + "id": "qwen3-tts-voicedesign", + "name": "Qwen3 TTS VoiceDesign", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-04-21", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, "open_weights": true, - "cost": { "input": 0.16, "output": 0.64 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 32768, + "output": 1 + } }, - "grok-4-fast-reasoning": { - "id": "grok-4-fast-reasoning", - "name": "Grok 4 Fast (Reasoning)", - "family": "grok", + "openai-gpt-image-1.5": { + "id": "openai-gpt-image-1.5", + "name": "GPT Image 1.5", + "family": "gpt-image", "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-09-19", - "last_updated": "2025-09-19", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5, "cache_read": 0.05 }, - "limit": { "context": 2000000, "output": 30000 } + "limit": { + "context": 0, + "output": 0 + }, + "cost": { + "input": 5, + "output": 10, + "cache_read": 1 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", + "openai-gpt-5.3-codex": { + "id": "openai-gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.01 }, - "limit": { "context": 272000, "output": 128000 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "cohere-command-a": { - "id": "cohere-command-a", - "name": "Command A", - "family": "command-a", - "attachment": false, - "reasoning": true, + "anthropic-claude-3.5-sonnet": { + "id": "anthropic-claude-3.5-sonnet", + "name": "Claude 3.5 Sonnet", + "family": "claude-sonnet", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "output": 8000 } + "knowledge": "2024-04", + "release_date": "2024-06-20", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "grok-3": { - "id": "grok-3", - "name": "Grok 3", - "family": "grok", + "fal-ai/fast-sdxl": { + "id": "fal-ai/fast-sdxl", + "name": "Fast SDXL", + "family": "stable-diffusion", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-11", - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.75 }, - "limit": { "context": 131072, "output": 8192 } + "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 + } }, - "phi-4-reasoning-plus": { - "id": "phi-4-reasoning-plus", - "name": "Phi-4-reasoning-plus", - "family": "phi", + "fal-ai/flux/schnell": { + "id": "fal-ai/flux/schnell", + "name": "FLUX.1 [schnell]", + "family": "flux", "attachment": false, - "reasoning": true, + "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"] }, + "temperature": false, + "release_date": "2024-08-01", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": true, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 32000, "output": 4096 } + "limit": { + "context": 0, + "output": 0 + } }, - "cohere-embed-v-4-0": { - "id": "cohere-embed-v-4-0", - "name": "Embed v4", - "family": "cohere-embed", - "attachment": true, + "fal-ai/elevenlabs/tts/multilingual-v2": { + "id": "fal-ai/elevenlabs/tts/multilingual-v2", + "name": "ElevenLabs Multilingual TTS v2", + "family": "elevenlabs", + "attachment": false, "reasoning": false, "tool_call": false, "temperature": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2023-08-22", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } + }, + "fal-ai/stable-audio-25/text-to-audio": { + "id": "fal-ai/stable-audio-25/text-to-audio", + "name": "Stable Audio 2.5 (Text-to-Audio)", + "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 + } + } + } + }, + "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": { + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax M2.5", + "family": "minimax", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-09", + "release_date": "2025-02-11", + "last_updated": "2025-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.12, "output": 0 }, - "limit": { "context": 128000, "output": 1536 } + "limit": { + "context": 194000, + "output": 4096 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "llama-4-maverick-17b-128e-instruct-fp8": { - "id": "llama-4-maverick-17b-128e-instruct-fp8", - "name": "Llama 4 Maverick 17B 128E Instruct FP8", - "family": "llama", - "attachment": true, + "GLM-5-FP8": { + "id": "GLM-5-FP8", + "name": "GLM 5 FP8", + "family": "glm", + "attachment": false, "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"] }, + "knowledge": "2025-05", + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.85, + "output": 3.1 + } }, - "deepseek-r1-0528": { - "id": "deepseek-r1-0528", - "name": "DeepSeek-R1-0528", - "family": "deepseek-thinking", + "DeepSeek-V3.2": { + "id": "DeepSeek-V3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, "knowledge": "2024-07", - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.35, "output": 5.4 }, - "limit": { "context": 163840, "output": 163840 } + "limit": { + "context": 127000, + "output": 4096 + }, + "cost": { + "input": 0.55, + "output": 1.65 + } }, - "phi-3-small-128k-instruct": { - "id": "phi-3-small-128k-instruct", - "name": "Phi-3-small-instruct (128k)", - "family": "phi", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT OSS 120B", + "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": 129000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } + }, + "Kimi-K2.5": { + "id": "Kimi-K2.5", + "name": "Kimi K2 Instruct", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4096 } - }, - "meta-llama-3.1-70b-instruct": { - "id": "meta-llama-3.1-70b-instruct", - "name": "Meta-Llama-3.1-70B-Instruct", - "family": "llama", + "limit": { + "context": 254000, + "output": 32768 + }, + "cost": { + "input": 0.55, + "output": 2.75 + } + } + } + }, + "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-coder-plus": { + "id": "qwen3-coder-plus", + "name": "Qwen3 Coder Plus", + "family": "qwen", "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 2.68, "output": 3.54 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "gpt-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "GPT-4.1 nano", - "family": "gpt-nano", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-05", - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1047576, "output": 32768 } + "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 + } }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "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, + "output": 0, + "cache_read": 0, + "cache_write": 0 } }, - "o1-preview": { - "id": "o1-preview", - "name": "o1-preview", - "family": "o", + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 16.5, "output": 66, "cache_read": 8.25 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek-V3.2", - "family": "deepseek", + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.58, "output": 1.68 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 196608, + "output": 24576 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "gpt-3.5-turbo-0125": { - "id": "gpt-3.5-turbo-0125", - "name": "GPT-3.5 Turbo 0125", - "family": "gpt", + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2021-08", - "release_date": "2024-01-25", - "last_updated": "2024-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 16384, "output": 16384 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "text-embedding-3-small": { - "id": "text-embedding-3-small", - "name": "text-embedding-3-small", - "family": "text-embedding", + "qwen3-max-2026-01-23": { + "id": "qwen3-max-2026-01-23", + "name": "Qwen3 Max", + "family": "qwen", "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, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 8191, "output": 1536 } - }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "GPT-5-Codex", - "family": "gpt-codex", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } - }, - "o4-mini": { - "id": "o4-mini", - "name": "o4-mini", - "family": "o-mini", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.28 }, - "limit": { "context": 200000, "output": 100000 } - }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, - "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-02-31", - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-01-23", + "last_updated": "2026-01-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 }, - "provider": { - "npm": "@ai-sdk/anthropic", - "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt-codex", + "qwen3-coder-next": { + "id": "qwen3-coder-next", + "name": "Qwen3 Coder Next", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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", "audio"], "output": ["text", "image", "audio"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "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 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "o1-mini": { - "id": "o1-mini", - "name": "o1-mini", - "family": "o-mini", + "qwen3.5-plus": { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": false, - "knowledge": "2023-09", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4, "cache_read": 0.55 }, - "limit": { "context": 128000, "output": 65536 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } } } }, - "aihubmix": { - "id": "aihubmix", - "env": ["AIHUBMIX_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://aihubmix.com/v1", - "name": "AIHubMix", - "doc": "https://docs.aihubmix.com", + "mistral": { + "id": "mistral", + "env": ["MISTRAL_API_KEY"], + "npm": "@ai-sdk/mistral", + "name": "Mistral", + "doc": "https://docs.mistral.ai/getting-started/models/", "models": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2-Codex", - "family": "gpt-codex", + "mistral-small-latest": { + "id": "mistral-small-latest", + "name": "Mistral Small (latest)", + "family": "mistral-small", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "gemini-3-pro-preview-search": { - "id": "gemini-3-pro-preview-search", - "name": "Gemini 3 Pro Preview Search", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, + "mistral-nemo": { + "id": "mistral-nemo", + "name": "Mistral Nemo", + "family": "mistral-nemo", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.5 }, - "limit": { "context": 1000000, "output": 65000 } + "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 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1 Codex Mini", - "family": "gpt-codex", + "mistral-large-2512": { + "id": "mistral-large-2512", + "name": "Mistral Large 3", + "family": "mistral-large", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-15", - "last_updated": "2025-11-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.03 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "qwen3-235b-a22b-instruct-2507": { - "id": "qwen3-235b-a22b-instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", + "labs-devstral-small-2512": { + "id": "labs-devstral-small-2512", + "name": "Devstral Small 2", + "family": "devstral", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 1.12 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3.5-plus": { - "id": "qwen3.5-plus", - "name": "Qwen 3.5 Plus", - "family": "qwen", + "devstral-2512": { + "id": "devstral-2512", + "name": "Devstral 2", + "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.4, + "output": 2 + } + }, + "magistral-medium-latest": { + "id": "magistral-medium-latest", + "name": "Magistral Medium (latest)", + "family": "magistral-medium", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.11, "output": 0.66 }, - "limit": { "context": 1000000, "output": 65536 } + "knowledge": "2025-06", + "release_date": "2025-03-17", + "last_updated": "2025-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2, + "output": 5 + } }, - "deepseek-v3.2-fast": { - "id": "deepseek-v3.2-fast", - "name": "DeepSeek-V3.2-Fast", - "family": "deepseek", + "open-mixtral-8x7b": { + "id": "open-mixtral-8x7b", + "name": "Mixtral 8x7B", + "family": "mixtral", "attachment": false, "reasoning": false, - "tool_call": false, - "knowledge": "2024-07", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-01", + "release_date": "2023-12-11", + "last_updated": "2023-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.1, "output": 3.29 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.7, + "output": 0.7 + } }, - "gpt-5-pro": { - "id": "gpt-5-pro", - "name": "GPT-5-Pro", - "family": "gpt-pro", + "pixtral-large-latest": { + "id": "pixtral-large-latest", + "name": "Pixtral Large (latest)", + "family": "pixtral", "attachment": true, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 7, "output": 28, "cache_read": 3.5 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "qwen3-coder-next": { - "id": "qwen3-coder-next", - "name": "Qwen3 Coder Next", - "family": "qwen", + "mistral-large-2411": { + "id": "mistral-large-2411", + "name": "Mistral Large 2.1", + "family": "mistral-large", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2026-02-04", - "last_updated": "2026-02-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2024-11-01", + "last_updated": "2024-11-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.14, "output": 0.55 }, - "limit": { "context": 262144, "input": 262144, "output": 65536 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", - "attachment": true, - "reasoning": true, + "codestral-latest": { + "id": "codestral-latest", + "name": "Codestral (latest)", + "family": "codestral", + "attachment": false, + "reasoning": false, "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, - "cost": { "input": 5, "output": 20, "cache_read": 2.5 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "claude-opus-4-5": { - "id": "claude-opus-4-5", - "name": "Claude Opus 4.5", + "mistral-large-latest": { + "id": "mistral-large-latest", + "name": "Mistral Large (latest)", + "family": "mistral-large", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-11-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 32000 } + "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 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": true, - "reasoning": true, + "mistral-small-2506": { + "id": "mistral-small-2506", + "name": "Mistral Small 3.2", + "family": "mistral-small", + "attachment": false, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-07", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-03", + "release_date": "2025-06-20", + "last_updated": "2025-06-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "pixtral-12b": { + "id": "pixtral-12b", + "name": "Pixtral 12B", + "family": "pixtral", "attachment": true, - "reasoning": 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", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 12, "cache_read": 0.5 }, - "limit": { "context": 1000000, "output": 65000 } + "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 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "coding-glm-5-free": { - "id": "coding-glm-5-free", - "name": "Coding-GLM-5-Free", - "family": "glm", + "ministral-8b-latest": { + "id": "ministral-8b-latest", + "name": "Ministral 8B (latest)", + "family": "ministral", "attachment": false, - "reasoning": true, + "reasoning": false, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "mistral-embed": { + "id": "mistral-embed", + "name": "Mistral Embed", + "family": "mistral-embed", + "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2023-09", - "release_date": "2024-05-13", - "last_updated": "2024-08-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "release_date": "2023-12-11", + "last_updated": "2023-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10, "cache_read": 1.25 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 8000, + "output": 3072 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5-Mini", - "family": "gpt-mini", - "attachment": true, + "magistral-small": { + "id": "magistral-small", + "name": "Magistral Small", + "family": "magistral-small", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.75 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-06", + "release_date": "2025-03-17", + "last_updated": "2025-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "mistral-small-2603": { + "id": "mistral-small-2603", + "name": "Mistral Small 4", + "family": "mistral-small", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, + "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": 5, - "output": 25, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22, "cache_read": 0.6, "cache_write": 7.5 } + "input": 0.15, + "output": 0.6 + } + }, + "ministral-3b-latest": { + "id": "ministral-3b-latest", + "name": "Ministral 3B (latest)", + "family": "ministral", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-04", + "modalities": { + "input": ["text"], + "output": ["text"] }, - "limit": { "context": 200000, "output": 128000 } + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1-Codex-Max", - "attachment": true, - "reasoning": true, + "open-mixtral-8x22b": { + "id": "open-mixtral-8x22b", + "name": "Mixtral 8x22B", + "family": "mixtral", + "attachment": false, + "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-04-17", + "last_updated": "2024-04-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", + "mistral-medium-2604": { + "id": "mistral-medium-2604", + "name": "Mistral Medium 3.5", + "family": "mistral-medium", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "release_date": "2026-04-29", + "last_updated": "2026-04-29", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 }, - "limit": { "context": 200000, "output": 64000 } + "cost": { + "input": 1.5, + "output": 7.5 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", - "attachment": true, + "devstral-small-2505": { + "id": "devstral-small-2505", + "name": "Devstral Small 2505", + "family": "devstral", + "attachment": false, "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, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } + "knowledge": "2025-05", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "deepseek-v3.2-think": { - "id": "deepseek-v3.2-think", - "name": "DeepSeek-V3.2-Think", - "family": "deepseek", + "devstral-medium-2507": { + "id": "devstral-medium-2507", + "name": "Devstral Medium", + "family": "devstral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-07-10", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.45 }, - "limit": { "context": 131000, "output": 64000 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "minimax-m2.1": { - "id": "minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", + "open-mistral-7b": { + "id": "open-mistral-7b", + "name": "Mistral 7B", + "family": "mistral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2023-09-27", + "last_updated": "2023-09-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.29, "output": 1.15 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 8000, + "output": 8000 + }, + "cost": { + "input": 0.25, + "output": 0.25 + } }, - "claude-sonnet-4-6-think": { - "id": "claude-sonnet-4-6-think", - "name": "Claude Sonnet 4.6 Think", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "devstral-medium-latest": { + "id": "devstral-medium-latest", + "name": "Devstral 2 (latest)", + "family": "devstral", + "attachment": false, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { - "input": 3, - "output": 15, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22.5, "cache_read": 0.6, "cache_write": 7.5 } + "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 }, - "limit": { "context": 200000, "output": 64000 } + "cost": { + "input": 0.4, + "output": 2 + } }, - "claude-opus-4-6-think": { - "id": "claude-opus-4-6-think", - "name": "Claude Opus 4.6 Think", - "family": "claude-opus", + "mistral-medium-2505": { + "id": "mistral-medium-2505", + "name": "Mistral Medium 3", + "family": "mistral-medium", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 5, - "output": 25, - "cache_read": 0.3, - "cache_write": 3.75, - "context_over_200k": { "input": 6, "output": 22, "cache_read": 0.6, "cache_write": 7.5 } + "limit": { + "context": 131072, + "output": 131072 }, - "limit": { "context": 200000, "output": 128000 } + "cost": { + "input": 0.4, + "output": 2 + } }, - "coding-glm-4.7-free": { - "id": "coding-glm-4.7-free", - "name": "Coding GLM 4.7 Free", - "family": "glm", + "devstral-small-2507": { + "id": "devstral-small-2507", + "name": "Devstral Small", + "family": "devstral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-05", + "release_date": "2025-07-10", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "claude-opus-4-1": { - "id": "claude-opus-4-1", - "name": "Claude Opus 4.1", - "family": "claude-opus", + "mistral-medium-2508": { + "id": "mistral-medium-2508", + "name": "Mistral Medium 3.1", + "family": "mistral-medium", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "knowledge": "2025-05", + "release_date": "2025-08-12", + "last_updated": "2025-08-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 16.5, "output": 82.5, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", + "mistral-medium-latest": { + "id": "mistral-medium-latest", + "name": "Mistral Medium (latest)", + "family": "mistral-medium", "attachment": true, "reasoning": true, "tool_call": true, + "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"] }, + "release_date": "2026-04-29", + "last_updated": "2026-04-29", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.14, "output": 0.41 }, - "limit": { "context": 128000, "output": 32768 } - }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 1.5, + "output": 7.5 + } + } + } + }, + "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", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.82, "output": 3.29 }, - "limit": { "context": 262144, "output": 131000 } - }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 5, "cache_read": 0.31 }, - "limit": { "context": 2000000, "output": 65000 } + "release_date": "2025-04-01", + "last_updated": "2025-04-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.74, + "output": 0.74 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", - "attachment": true, + "mistral-7b-instruct-v0.3": { + "id": "mistral-7b-instruct-v0.3", + "name": "Mistral-7B-Instruct-v0.3", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3, "cache_read": 0.02 }, - "limit": { "context": 1000000, "output": 65000 } + "release_date": "2025-04-01", + "last_updated": "2025-04-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.11, + "output": 0.11 + } }, - "qwen3-235b-a22b-thinking-2507": { - "id": "qwen3-235b-a22b-thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3-32B", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-30", - "last_updated": "2025-07-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-16", + "last_updated": "2025-07-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.28, "output": 2.8 }, - "limit": { "context": 262144, "output": 262144 } - }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.09, + "output": 0.25 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", + "qwen2.5-vl-72b-instruct": { + "id": "qwen2.5-vl-72b-instruct", + "name": "Qwen2.5-VL-72B-Instruct", "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-15", - "last_updated": "2025-11-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } - }, - "coding-glm-4.7": { - "id": "coding-glm-4.7", - "name": "Coding-GLM-4.7", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "interleaved": { "field": "reasoning_details" }, + "reasoning": false, + "tool_call": false, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-31", + "last_updated": "2025-03-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1.1, "cache_read": 0.548 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 1.01, + "output": 1.01 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "GPT-4.1 mini", - "family": "gpt-mini", - "attachment": true, + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3-Coder-30B-A3B-Instruct", + "attachment": false, "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, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "release_date": "2025-10-28", + "last_updated": "2025-10-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.07, + "output": 0.26 + } }, - "coding-minimax-m2.1-free": { - "id": "coding-minimax-m2.1-free", - "name": "Coding MiniMax M2.1 Free", - "family": "minimax", + "gpt-oss-20b": { + "id": "gpt-oss-20b", + "name": "gpt-oss-20b", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.18 + } }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, + "mistral-small-3.2-24b-instruct-2506": { + "id": "mistral-small-3.2-24b-instruct-2506", + "name": "Mistral-Small-3.2-24B-Instruct-2506", + "attachment": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.88, "output": 2.82 }, - "limit": { "context": 204800, "output": 131072 } + "release_date": "2025-07-16", + "last_updated": "2025-07-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.31 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5-Nano", - "family": "gpt-nano", + "qwen3.5-9b": { + "id": "qwen3.5-9b", + "name": "Qwen3.5-9B", "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": 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, - "cost": { "input": 0.5, "output": 2, "cache_read": 0.25 }, - "limit": { "context": 128000, "output": 16384 } + "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.1, + "output": 0.15 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "gpt-oss-120b", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_details" }, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1.1, "cache_read": 0.548 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.09, + "output": 0.47 + } }, - "qwen3-max-2026-01-23": { - "id": "qwen3-max-2026-01-23", - "name": "Qwen3 Max", - "family": "qwen", + "mistral-nemo-instruct-2407": { + "id": "mistral-nemo-instruct-2407", + "name": "Mistral-Nemo-Instruct-2407", "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, - "cost": { "input": 0.34, "output": 1.37 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2024-11-20", + "last_updated": "2024-11-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.14, + "output": 0.14 + } }, - "Kimi-K2-0905": { - "id": "Kimi-K2-0905", - "name": "Kimi K2 0905", - "family": "kimi", + "llama-3.1-8b-instruct": { + "id": "llama-3.1-8b-instruct", + "name": "Llama-3.1-8B-Instruct", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-06-11", + "last_updated": "2025-06-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 262144, "output": 262144 } - }, - "gpt-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "GPT-4.1 nano", - "family": "gpt-nano", - "attachment": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.11, + "output": 0.11 + } + } + } + }, + "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": { + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", + "attachment": false, "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, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.03 }, - "limit": { "context": 1047576, "output": 32768 } - }, - "claude-sonnet-4-5": { - "id": "claude-sonnet-4-5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 3.3, "output": 16.5, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-07-29", + "last_updated": "2026-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.2, + "output": 0.8 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek-V3.2", - "family": "deepseek", + "zai-org/GLM-5.1": { + "id": "zai-org/GLM-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 0.45 }, - "limit": { "context": 131000, "output": 64000 } + "limit": { + "context": 202752, + "output": 202752 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "GPT-5-Codex", - "family": "gpt-codex", + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "GLM-5", + "family": "glm", "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "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": 202752 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.5 + } }, - "o4-mini": { - "id": "o4-mini", - "name": "o4-mini", - "family": "o-mini", + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": false, - "knowledge": "2024-09", - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.5, "output": 6, "cache_read": 0.75 }, - "limit": { "context": 200000, "output": 65536 } - }, - "claude-haiku-4-5": { - "id": "claude-haiku-4-5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, - "reasoning": 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, - "cost": { "input": 1.1, "output": 5.5, "cache_read": 0.11, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2024-08-01", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 0.6 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt-codex", - "attachment": true, - "reasoning": true, + "meta-llama/Llama-3.1-8B-Instruct": { + "id": "meta-llama/Llama-3.1-8B-Instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-15", - "last_updated": "2025-11-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.13 }, - "limit": { "context": 400000, "output": 128000 } + "release_date": "2024-08-01", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "minimax-m2.5": { - "id": "minimax-m2.5", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", "name": "MiniMax-M2.5", "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.29, "output": 1.15 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } } } }, - "minimax-cn-coding-plan": { - "id": "minimax-cn-coding-plan", - "env": ["MINIMAX_API_KEY"], - "npm": "@ai-sdk/anthropic", - "api": "https://api.minimaxi.com/anthropic/v1", - "name": "MiniMax Coding Plan (minimaxi.com)", - "doc": "https://platform.minimaxi.com/docs/coding-plan/intro", + "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": { - "MiniMax-M2.7": { - "id": "MiniMax-M2.7", - "name": "MiniMax-M2.7", + "minimax-m2.7": { + "id": "minimax-m2.7", + "name": "MiniMax-m2.7", "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, "release_date": "2026-03-18", "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 202752, + "output": 196072 + }, + "cost": { + "input": 0.47, + "output": 1.4 + } }, - "MiniMax-M2.1": { - "id": "MiniMax-M2.1", - "name": "MiniMax-M2.1", - "family": "minimax", - "attachment": false, + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 204800, "output": 131072 } + "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": 200000 + }, + "cost": { + "input": 1.09, + "output": 5.43 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "qwen3-235b-a22b-instruct-2507": { + "id": "qwen3-235b-a22b-instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.062, + "output": 0.408 + } }, - "MiniMax-M2": { - "id": "MiniMax-M2", - "name": "MiniMax-M2", - "family": "minimax", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 196608, "output": 128000 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.55, + "output": 2.76 + } }, - "MiniMax-M2.5-highspeed": { - "id": "MiniMax-M2.5-highspeed", - "name": "MiniMax-M2.5-highspeed", - "family": "minimax", + "deepseek-v3-0324": { + "id": "deepseek-v3-0324", + "name": "DeepSeek V3 0324", + "family": "deepseek", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.551, + "output": 1.654 + } }, - "MiniMax-M2.7-highspeed": { - "id": "MiniMax-M2.7-highspeed", - "name": "MiniMax-M2.7-highspeed", - "family": "minimax", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM 4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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": { - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3-Coder-30B-A3B-Instruct", - "attachment": false, - "reasoning": false, + "limit": { + "context": 198000, + "output": 198000 + }, + "cost": { + "input": 0.45, + "output": 2.23 + } + }, + "claude-opus4-7": { + "id": "claude-opus4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-10-28", - "last_updated": "2025-10-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.26 }, - "limit": { "context": 262144, "output": 262144 } + "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.6, + "output": 27.99, + "cache_read": 0.56, + "cache_write": 6.99 + } }, - "mistral-nemo-instruct-2407": { - "id": "mistral-nemo-instruct-2407", - "name": "Mistral-Nemo-Instruct-2407", + "glm-5": { + "id": "glm-5", + "name": "GLM 5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-11-20", - "last_updated": "2024-11-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.14, "output": 0.14 }, - "limit": { "context": 65536, "output": 65536 } + "limit": { + "context": 202752, + "output": 202752 + }, + "cost": { + "input": 1.08, + "output": 3.44 + } }, - "deepseek-r1-distill-llama-70b": { - "id": "deepseek-r1-distill-llama-70b", - "name": "DeepSeek-R1-Distill-Llama-70B", + "nova-pro-v1": { + "id": "nova-pro-v1", + "name": "Nova Pro 1.0", + "family": "nova-pro", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-01-30", - "last_updated": "2025-01-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.74, "output": 0.74 }, - "limit": { "context": 131072, "output": 131072 } + "knowledge": "2024-04", + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 300000, + "output": 5000 + }, + "cost": { + "input": 1.016, + "output": 4.061 + } }, - "llama-3.1-8b-instruct": { - "id": "llama-3.1-8b-instruct", - "name": "Llama-3.1-8B-Instruct", + "devstral-2512": { + "id": "devstral-2512", + "name": "Devstral 2 2512", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-06-11", - "last_updated": "2025-06-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.11, "output": 0.11 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "gpt-oss-120b", + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3 32B", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2025-04-29", + "last_updated": "2025-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.47 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.099, + "output": 0.33 + } }, - "qwen2.5-coder-32b-instruct": { - "id": "qwen2.5-coder-32b-instruct", - "name": "Qwen2.5-Coder-32B-Instruct", + "codestral-2508": { + "id": "codestral-2508", + "name": "Codestral 2508", + "family": "mistral", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03", + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.96, "output": 0.96 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.3, + "output": 0.9, + "cache_read": 0.03 + } }, - "qwen2.5-vl-72b-instruct": { - "id": "qwen2.5-vl-72b-instruct", - "name": "Qwen2.5-VL-72B-Instruct", + "claude-4-5-sonnet": { + "id": "claude-4-5-sonnet", + "name": "Claude 4.5 Sonnet", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-03-31", - "last_updated": "2025-03-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.01, "output": 1.01 }, - "limit": { "context": 32768, "output": 32768 } + "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": 200000 + }, + "cost": { + "input": 3.259, + "output": 16.296 + } }, - "mistral-7b-instruct-v0.3": { - "id": "mistral-7b-instruct-v0.3", - "name": "Mistral-7B-Instruct-v0.3", + "kimi-k2-instruct": { + "id": "kimi-k2-instruct", + "name": "Kimi K2 Instruct", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-01", - "last_updated": "2025-04-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.11, "output": 0.11 }, - "limit": { "context": 65536, "output": 65536 } - }, - "gpt-oss-20b": { - "id": "gpt-oss-20b", - "name": "gpt-oss-20b", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-07-11", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.18 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.551, + "output": 2.646 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3-32B", + "nemotron-3-super-120b-a12b": { + "id": "nemotron-3-super-120b-a12b", + "name": "Nemotron 3 Super 120B A12B", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-16", - "last_updated": "2025-07-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.25 }, - "limit": { "context": 32768, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.266, + "output": 0.799 + } }, - "mistral-small-3.2-24b-instruct-2506": { - "id": "mistral-small-3.2-24b-instruct-2506", - "name": "Mistral-Small-3.2-24B-Instruct-2506", - "attachment": true, - "reasoning": false, + "minimax-m2": { + "id": "minimax-m2", + "name": "MiniMax-M2", + "family": "minimax", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-16", - "last_updated": "2025-07-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.31 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 400000, + "output": 400000 + }, + "cost": { + "input": 0.39, + "output": 1.57 + } }, - "mixtral-8x7b-instruct-v0.1": { - "id": "mixtral-8x7b-instruct-v0.1", - "name": "Mixtral-8x7B-Instruct-v0.1", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-01", - "last_updated": "2025-04-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 32768, "output": 32768 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65535 + }, + "cost": { + "input": 1.654, + "output": 11.024 + } }, - "meta-llama-3_3-70b-instruct": { - "id": "meta-llama-3_3-70b-instruct", - "name": "Meta-Llama-3_3-70B-Instruct", - "attachment": false, - "reasoning": false, + "claude-opus4-6": { + "id": "claude-opus4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-01", - "last_updated": "2025-04-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.74, "output": 0.74 }, - "limit": { "context": 131072, "output": 131072 } - } - } - }, - "minimax-cn": { - "id": "minimax-cn", - "env": ["MINIMAX_API_KEY"], - "npm": "@ai-sdk/anthropic", - "api": "https://api.minimaxi.com/anthropic/v1", - "name": "MiniMax (minimaxi.com)", - "doc": "https://platform.minimaxi.com/docs/guides/quickstart", - "models": { - "MiniMax-M2.7": { - "id": "MiniMax-M2.7", - "name": "MiniMax-M2.7", - "family": "minimax", + "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": 1000000 + }, + "cost": { + "input": 5.98, + "output": 29.89 + } + }, + "devstral-small-2512": { + "id": "devstral-small-2512", + "name": "Devstral Small 2 2512", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "MiniMax-M2.1": { - "id": "MiniMax-M2.1", + "minimax-m2.1": { + "id": "minimax-m2.1", "name": "MiniMax-M2.1", "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, "release_date": "2025-12-23", "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 196000, + "output": 196000 + }, + "cost": { + "input": 0.34, + "output": 1.34 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax-M2.5", - "family": "minimax", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-04-14", + "last_updated": "2026-04-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1.31, + "output": 4.1, + "cache_read": 0.24 + } }, - "MiniMax-M2": { - "id": "MiniMax-M2", - "name": "MiniMax-M2", - "family": "minimax", + "glm-4.5": { + "id": "glm-4.5", + "name": "GLM 4.5", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-27", - "last_updated": "2025-10-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-29", + "last_updated": "2025-07-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196608, "output": 128000 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.67, + "output": 2.46 + } }, - "MiniMax-M2.5-highspeed": { - "id": "MiniMax-M2.5-highspeed", - "name": "MiniMax-M2.5-highspeed", - "family": "minimax", + "claude-opus4-5": { + "id": "claude-opus4-5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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": 200000 + }, + "cost": { + "input": 5.98, + "output": 29.89 + } + }, + "claude-sonnet-4": { + "id": "claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2025-03", + "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 + }, + "cost": { + "input": 3.307, + "output": 16.536 + } + }, + "qwen3-next-80b-a3b-thinking": { + "id": "qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-13", - "last_updated": "2026-02-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-11", + "last_updated": "2025-09-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.164, + "output": 1.311 + } }, - "MiniMax-M2.7-highspeed": { - "id": "MiniMax-M2.7-highspeed", - "name": "MiniMax-M2.7-highspeed", - "family": "minimax", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM 4.5 Air", + "family": "glm-air", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-08-01", + "last_updated": "2025-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.4, "cache_read": 0.06, "cache_write": 0.375 }, - "limit": { "context": 204800, "output": 131072 } - } - } - }, - "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": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", - "attachment": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.22, + "output": 1.34 + } + }, + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-thinking", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.14, "output": 1.14 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "interleaved": { + "field": "reasoning_content" + }, + "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": 256000 + }, + "cost": { + "input": 0.81, + "output": 3.54, + "cache_read": 0.2 + } }, - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "Claude Opus 4.5", - "family": "claude-opus", - "attachment": true, + "qwen3-coder-next": { + "id": "qwen3-coder-next", + "name": "Qwen3 Coder Next 80B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.71, "output": 3.57 }, - "limit": { "context": 200000, "output": 32000 } + "knowledge": "2025-04", + "release_date": "2026-02-04", + "last_updated": "2026-02-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 65536 + }, + "cost": { + "input": 0.158, + "output": 0.84 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "claude-4-6-sonnet": { + "id": "claude-4-6-sonnet", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-11", - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.57, "output": 3.43 }, - "limit": { "context": 1000000, "output": 65000 } + "limit": { + "context": 1000000, + "output": 1000000 + }, + "cost": { + "input": 3.59, + "output": 17.92 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5-Mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": true, + "qwen3-coder-480b-a35b-instruct": { + "id": "qwen3-coder-480b-a35b-instruct", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "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, - "cost": { "input": 0.04, "output": 0.29 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2025-01", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.441, + "output": 1.984 + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, + "mixtral-8x7B-instruct-v0.1": { + "id": "mixtral-8x7B-instruct-v0.1", + "name": "Mixtral 8x7B Instruct v0.1", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "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, - "cost": { "input": 0.43, "output": 2.14 }, - "limit": { "context": 200000, "output": 64000 } + "knowledge": "2023-09", + "release_date": "2023-12-11", + "last_updated": "2023-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.438, + "output": 0.68 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", - "attachment": true, + "hermes-4-70b": { + "id": "hermes-4-70b", + "name": "Hermes 4 70B", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.07, "output": 0.43, "context_over_200k": { "input": 0.07, "output": 0.43 } }, - "limit": { "context": 1048576, "output": 65536 } + "knowledge": "2023-12", + "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.116, + "output": 0.358 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", - "attachment": true, + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 0.09, "output": 0.71, "context_over_200k": { "input": 0.09, "output": 0.71 } }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.32, + "output": 1.18 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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.266, + "output": 0.444 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", + "intellect-3": { + "id": "intellect-3", + "name": "INTELLECT 3", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07-31", - "release_date": "2025-10-01", - "last_updated": "2025-10-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.71 }, - "limit": { "context": 200000, "output": 64000 } - } - } - }, - "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-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "knowledge": "2025-11", + "release_date": "2025-11-26", + "last_updated": "2025-11-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.219, + "output": 1.202 + } + }, + "glm-4.7-flash": { + "id": "glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-08-08", + "last_updated": "2025-08-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 203000, + "output": 203000 + }, + "cost": { + "input": 0.09, + "output": 0.53 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT Oss 120b", + "family": "gpt-oss", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-01", + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "kimi-k2-thinking-turbo": { - "id": "kimi-k2-thinking-turbo", - "name": "Kimi K2 Thinking Turbo", - "family": "kimi-thinking", + "qwen-2.5-72b-instruct": { + "id": "qwen-2.5-72b-instruct", + "name": "Qwen2.5 72B Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "knowledge": "2024-06", + "release_date": "2024-09-19", + "last_updated": "2024-09-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.15, "output": 8, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0.062, + "output": 0.231 + } }, - "kimi-k2-0905-preview": { - "id": "kimi-k2-0905-preview", - "name": "Kimi K2 0905", - "family": "kimi", + "deepseek-r1-0528": { + "id": "deepseek-r1-0528", + "name": "DeepSeek R1 0528", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-07", + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.585, + "output": 2.307 + } }, - "kimi-k2-turbo-preview": { - "id": "kimi-k2-turbo-preview", - "name": "Kimi K2 Turbo", - "family": "kimi", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT 4.1", + "family": "gpt", "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, - "cost": { "input": 2.4, "output": 10, "cache_read": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2024-06", + "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.354, + "output": 9.417 + } }, - "kimi-k2-0711-preview": { - "id": "kimi-k2-0711-preview", - "name": "Kimi K2 0711", - "family": "kimi", - "attachment": false, - "reasoning": false, + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-14", - "last_updated": "2025-07-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-12", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 16384 } - } - } - }, - "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": { - "qwen2-5-72b-instruct": { - "id": "qwen2-5-72b-instruct", - "name": "Qwen2.5 72B Instruct", - "family": "qwen", + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.656, + "output": 2.731 + } + }, + "llama-3.1-405b-instruct": { + "id": "llama-3.1-405b-instruct", + "name": "Llama 3.1 405B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1.4, "output": 5.6 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3-Coder 30B-A3B Instruct", + "qwen3.5-122b-a10b": { + "id": "qwen3.5-122b-a10b", + "name": "Qwen3.5 122B A10B", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2026-01", + "release_date": "2026-02-24", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.45, "output": 2.25 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.444, + "output": 3.106 + } }, - "qwen3-8b": { - "id": "qwen3-8b", - "name": "Qwen3 8B", - "family": "qwen", + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.18, "output": 0.7, "reasoning": 2.1 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.089, + "output": 0.275 + } }, - "qwen-mt-plus": { - "id": "qwen-mt-plus", - "name": "Qwen-MT Plus", - "family": "qwen", - "attachment": false, + "mistral-large-2512": { + "id": "mistral-large-2512", + "name": "Mistral Large 3 2512", + "family": "mistral-large", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.46, "output": 7.37 }, - "limit": { "context": 16384, "output": 8192 } + "knowledge": "2025-12", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "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 + } }, - "qwen3.5-plus": { - "id": "qwen3.5-plus", - "name": "Qwen3.5 Plus", + "qwen3.5-397b-a17b": { + "id": "qwen3.5-397b-a17b", + "name": "Qwen3.5 397B A17B", "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", + "knowledge": "2026-01", "release_date": "2026-02-16", "last_updated": "2026-02-16", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 2.4, "reasoning": 2.4 }, - "limit": { "context": 1000000, "output": 65536 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 250000, + "output": 250000 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "qwen2-5-omni-7b": { - "id": "qwen2-5-omni-7b", - "name": "Qwen2.5-Omni 7B", - "family": "qwen", + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-12", - "last_updated": "2024-12", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text", "audio"] }, + "knowledge": "2025-05", + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.1, "output": 0.4, "input_audio": 6.76 }, - "limit": { "context": 32768, "output": 2048 } + "limit": { + "context": 1048576, + "output": 384000 + }, + "cost": { + "input": 0.133, + "output": 0.266, + "cache_read": 0.028 + } }, - "qwen-turbo": { - "id": "qwen-turbo", - "name": "Qwen Turbo", - "family": "qwen", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-11-01", - "last_updated": "2025-04-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0.2, "reasoning": 0.5 }, - "limit": { "context": 1000000, "output": 16384 } + "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.553, + "output": 3.106, + "cache_read": 0.145 + } }, - "qwen-vl-max": { - "id": "qwen-vl-max", - "name": "Qwen-VL Max", + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3 Coder 30B A3B Instruct", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-04-08", - "last_updated": "2025-08-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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.053, + "output": 0.222 + } + } + } + }, + "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": { + "nex-agi/DeepSeek-V3.1-Nex-N1": { + "id": "nex-agi/DeepSeek-V3.1-Nex-N1", + "name": "nex-agi/DeepSeek-V3.1-Nex-N1", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-01-01", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 3.2 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.5, + "output": 2 + } }, - "qwen-omni-turbo-realtime": { - "id": "qwen-omni-turbo-realtime", - "name": "Qwen-Omni Turbo Realtime", + "Qwen/Qwen2.5-VL-72B-Instruct": { + "id": "Qwen/Qwen2.5-VL-72B-Instruct", + "name": "Qwen/Qwen2.5-VL-72B-Instruct", "family": "qwen", - "attachment": false, + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-05-08", - "last_updated": "2025-05-08", - "modalities": { "input": ["text", "image", "audio"], "output": ["text", "audio"] }, + "release_date": "2025-01-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 1.07, "input_audio": 4.44, "output_audio": 8.89 }, - "limit": { "context": 32768, "output": 2048 } + "limit": { + "context": 131000, + "output": 4000 + }, + "cost": { + "input": 0.59, + "output": 0.59 + } }, - "qwen-vl-plus": { - "id": "qwen-vl-plus", - "name": "Qwen-VL Plus", + "Qwen/Qwen3-VL-32B-Thinking": { + "id": "Qwen/Qwen3-VL-32B-Thinking", + "name": "Qwen/Qwen3-VL-32B-Thinking", "family": "qwen", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-01-25", - "last_updated": "2025-08-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-21", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.21, "output": 0.63 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.2, + "output": 1.5 + } }, - "qwen-max": { - "id": "qwen-max", - "name": "Qwen Max", + "Qwen/Qwen3-30B-A3B-Thinking-2507": { + "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", + "name": "Qwen/Qwen3-30B-A3B-Thinking-2507", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "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"] }, + "release_date": "2025-07-31", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.6, "output": 6.4 }, - "limit": { "context": 32768, "output": 8192 } + "limit": { + "context": 262000, + "output": 131000 + }, + "cost": { + "input": 0.09, + "output": 0.3 + } }, - "qvq-max": { - "id": "qvq-max", - "name": "QVQ Max", - "family": "qvq", - "attachment": false, + "Qwen/Qwen3-VL-235B-A22B-Thinking": { + "id": "Qwen/Qwen3-VL-235B-A22B-Thinking", + "name": "Qwen/Qwen3-VL-235B-A22B-Thinking", + "family": "qwen", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 4.8 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.45, + "output": 3.5 + } }, - "qwen-plus-character-ja": { - "id": "qwen-plus-character-ja", - "name": "Qwen Plus Character (Japanese)", + "Qwen/Qwen2.5-7B-Instruct": { + "id": "Qwen/Qwen2.5-7B-Instruct", + "name": "Qwen/Qwen2.5-7B-Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-01", - "last_updated": "2024-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 1.4 }, - "limit": { "context": 8192, "output": 512 } + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.05, + "output": 0.05 + } }, - "qwq-plus": { - "id": "qwq-plus", - "name": "QwQ Plus", + "Qwen/Qwen2.5-Coder-32B-Instruct": { + "id": "Qwen/Qwen2.5-Coder-32B-Instruct", + "name": "Qwen/Qwen2.5-Coder-32B-Instruct", "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-03-05", - "last_updated": "2025-03-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-11-11", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 2.4 }, - "limit": { "context": 131072, "output": 8192 } + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } }, - "qwen3-omni-flash": { - "id": "qwen3-omni-flash", - "name": "Qwen3-Omni Flash", + "Qwen/Qwen3-VL-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", + "name": "Qwen/Qwen3-VL-30B-A3B-Instruct", "family": "qwen", - "attachment": false, - "reasoning": true, + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": 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"] }, + "release_date": "2025-10-05", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.43, "output": 1.66, "input_audio": 3.81, "output_audio": 15.11 }, - "limit": { "context": 65536, "output": 16384 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.29, + "output": 1 + } }, - "qwen3-14b": { - "id": "qwen3-14b", - "name": "Qwen3 14B", + "Qwen/QwQ-32B": { + "id": "Qwen/QwQ-32B", + "name": "Qwen/QwQ-32B", "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 1.4, "reasoning": 4.2 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-03-06", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.15, + "output": 0.58 + } }, - "qwen-plus": { - "id": "qwen-plus", - "name": "Qwen Plus", + "Qwen/Qwen3-235B-A22B": { + "id": "Qwen/Qwen3-235B-A22B", + "name": "Qwen/Qwen3-235B-A22B", "family": "qwen", "attachment": false, - "reasoning": true, + "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"] }, + "release_date": "2025-04-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.2, "reasoning": 4 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.35, + "output": 1.42 + } }, - "qwen2-5-7b-instruct": { - "id": "qwen2-5-7b-instruct", - "name": "Qwen2.5 7B Instruct", + "Qwen/Qwen3-Omni-30B-A3B-Captioner": { + "id": "Qwen/Qwen3-Omni-30B-A3B-Captioner", + "name": "Qwen/Qwen3-Omni-30B-A3B-Captioner", "family": "qwen", - "attachment": false, + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.175, "output": 0.7 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "qwen2-5-32b-instruct": { - "id": "qwen2-5-32b-instruct", - "name": "Qwen2.5 32B Instruct", + "Qwen/Qwen3-VL-8B-Thinking": { + "id": "Qwen/Qwen3-VL-8B-Thinking", + "name": "Qwen/Qwen3-VL-8B-Thinking", "family": "qwen", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.8 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-10-15", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.18, + "output": 2 + } }, - "qwen3-omni-flash-realtime": { - "id": "qwen3-omni-flash-realtime", - "name": "Qwen3-Omni Flash Realtime", + "Qwen/Qwen2.5-VL-7B-Instruct": { + "id": "Qwen/Qwen2.5-VL-7B-Instruct", + "name": "Qwen/Qwen2.5-VL-7B-Instruct", "family": "qwen", - "attachment": false, + "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": 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"] }, + "release_date": "2025-01-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.52, "output": 1.99, "input_audio": 4.57, "output_audio": 18.13 }, - "limit": { "context": 65536, "output": 16384 } + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.05, + "output": 0.05 + } }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen3-Coder 480B-A35B Instruct", + "Qwen/Qwen3-Next-80B-A3B-Instruct": { + "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "name": "Qwen/Qwen3-Next-80B-A3B-Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.5, "output": 7.5 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2025-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.14, + "output": 1.4 + } }, - "qwen3-next-80b-a3b-thinking": { - "id": "qwen3-next-80b-a3b-thinking", - "name": "Qwen3-Next 80B-A3B (Thinking)", + "Qwen/Qwen3-8B": { + "id": "Qwen/Qwen3-8B", + "name": "Qwen/Qwen3-8B", "family": "qwen", "attachment": false, - "reasoning": true, + "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, - "cost": { "input": 0.5, "output": 6 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-04-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.06, + "output": 0.06 + } }, - "qwen3-vl-30b-a3b": { - "id": "qwen3-vl-30b-a3b", - "name": "Qwen3-VL 30B-A3B", + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", + "name": "Qwen/Qwen3-30B-A3B-Instruct-2507", "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8, "reasoning": 2.4 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-07-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.09, + "output": 0.3 + } }, - "qwen3-next-80b-a3b-instruct": { - "id": "qwen3-next-80b-a3b-instruct", - "name": "Qwen3-Next 80B-A3B Instruct", + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen/Qwen3-235B-A22B-Instruct-2507", "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, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 131072, "output": 32768 } + "release_date": "2025-07-23", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.09, + "output": 0.6 + } }, - "qwen-mt-turbo": { - "id": "qwen-mt-turbo", - "name": "Qwen-MT Turbo", + "Qwen/Qwen3-32B": { + "id": "Qwen/Qwen3-32B", + "name": "Qwen/Qwen3-32B", "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-01", - "last_updated": "2025-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-04-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.16, "output": 0.49 }, - "limit": { "context": 16384, "output": 8192 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "qwen3-vl-plus": { - "id": "qwen3-vl-plus", - "name": "Qwen3-VL Plus", + "Qwen/Qwen3-Coder-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", + "name": "Qwen/Qwen3-Coder-30B-A3B-Instruct", "family": "qwen", "attachment": false, - "reasoning": true, + "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", "image"], "output": ["text"] }, + "release_date": "2025-08-01", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.6, "reasoning": 4.8 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "qwen3-235b-a22b": { - "id": "qwen3-235b-a22b", - "name": "Qwen3 235B-A22B", + "Qwen/Qwen3-Omni-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-Omni-30B-A3B-Instruct", + "name": "Qwen/Qwen3-Omni-30B-A3B-Instruct", "family": "qwen", - "attachment": false, - "reasoning": true, + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.8, "reasoning": 8.4 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "qwen2-5-vl-7b-instruct": { - "id": "qwen2-5-vl-7b-instruct", - "name": "Qwen2.5-VL 7B Instruct", + "Qwen/Qwen3-14B": { + "id": "Qwen/Qwen3-14B", + "name": "Qwen/Qwen3-14B", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 1.05 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-04-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "qwen-vl-ocr": { - "id": "qwen-vl-ocr", - "name": "Qwen-VL OCR", + "Qwen/Qwen2.5-72B-Instruct-128K": { + "id": "Qwen/Qwen2.5-72B-Instruct-128K", + "name": "Qwen/Qwen2.5-72B-Instruct-128K", "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-10-28", - "last_updated": "2025-04-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.72, "output": 0.72 }, - "limit": { "context": 34096, "output": 4096 } + "limit": { + "context": 131000, + "output": 4000 + }, + "cost": { + "input": 0.59, + "output": 0.59 + } }, - "qwen-omni-turbo": { - "id": "qwen-omni-turbo", - "name": "Qwen-Omni Turbo", + "Qwen/Qwen2.5-32B-Instruct": { + "id": "Qwen/Qwen2.5-32B-Instruct", + "name": "Qwen/Qwen2.5-32B-Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": 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"] }, + "release_date": "2024-09-19", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.27, "input_audio": 4.44, "output_audio": 8.89 }, - "limit": { "context": 32768, "output": 2048 } + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } }, - "qwen3.5-397b-a17b": { - "id": "qwen3.5-397b-a17b", - "name": "Qwen3.5 397B-A17B", + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen/Qwen3-235B-A22B-Thinking-2507", "family": "qwen", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 3.6, "reasoning": 3.6 }, - "limit": { "context": 262144, "output": 65536 } + "release_date": "2025-07-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.13, + "output": 0.6 + } }, - "qwen3-livetranslate-flash-realtime": { - "id": "qwen3-livetranslate-flash-realtime", - "name": "Qwen3-LiveTranslate Flash Realtime", + "Qwen/Qwen3-Omni-30B-A3B-Thinking": { + "id": "Qwen/Qwen3-Omni-30B-A3B-Thinking", + "name": "Qwen/Qwen3-Omni-30B-A3B-Thinking", "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text", "audio"] }, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 10, "output": 10, "input_audio": 10, "output_audio": 38 }, - "limit": { "context": 53248, "output": 4096 } + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.1, + "output": 0.4 + } }, - "qwen3-coder-plus": { - "id": "qwen3-coder-plus", - "name": "Qwen3 Coder Plus", + "Qwen/Qwen2.5-VL-32B-Instruct": { + "id": "Qwen/Qwen2.5-VL-32B-Instruct", + "name": "Qwen/Qwen2.5-VL-32B-Instruct", "family": "qwen", - "attachment": false, + "attachment": true, "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": true, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 1048576, "output": 65536 } + "release_date": "2025-03-24", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.27, + "output": 0.27 + } }, - "qwen-flash": { - "id": "qwen-flash", - "name": "Qwen Flash", + "Qwen/Qwen3-Next-80B-A3B-Thinking": { + "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", + "name": "Qwen/Qwen3-Next-80B-A3B-Thinking", "family": "qwen", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2025-09-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "qwen3-max": { - "id": "qwen3-max", - "name": "Qwen3 Max", + "Qwen/Qwen3-VL-235B-A22B-Instruct": { + "id": "Qwen/Qwen3-VL-235B-A22B-Instruct", + "name": "Qwen/Qwen3-VL-235B-A22B-Instruct", "family": "qwen", - "attachment": false, + "attachment": true, "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"] }, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 6 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.3, + "output": 1.5 + } }, - "qwen2-5-vl-72b-instruct": { - "id": "qwen2-5-vl-72b-instruct", - "name": "Qwen2.5-VL 72B Instruct", + "Qwen/Qwen2.5-14B-Instruct": { + "id": "Qwen/Qwen2.5-14B-Instruct", + "name": "Qwen/Qwen2.5-14B-Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2.8, "output": 8.4 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2024-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3 32B", + "Qwen/Qwen3-VL-30B-A3B-Thinking": { + "id": "Qwen/Qwen3-VL-30B-A3B-Thinking", + "name": "Qwen/Qwen3-VL-30B-A3B-Thinking", "family": "qwen", - "attachment": false, + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2025-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.8, "reasoning": 8.4 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2025-10-11", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.29, + "output": 1 + } }, - "qwen3-asr-flash": { - "id": "qwen3-asr-flash", - "name": "Qwen3-ASR Flash", + "Qwen/Qwen3-VL-32B-Instruct": { + "id": "Qwen/Qwen3-VL-32B-Instruct", + "name": "Qwen/Qwen3-VL-32B-Instruct", "family": "qwen", - "attachment": false, + "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"] }, + "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": false, - "cost": { "input": 0.035, "output": 0.035 }, - "limit": { "context": 53248, "output": 4096 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "qwen3-coder-flash": { - "id": "qwen3-coder-flash", - "name": "Qwen3 Coder Flash", + "Qwen/Qwen3-VL-8B-Instruct": { + "id": "Qwen/Qwen3-VL-8B-Instruct", + "name": "Qwen/Qwen3-VL-8B-Instruct", "family": "qwen", - "attachment": false, + "attachment": true, "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"] }, + "release_date": "2025-10-15", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.18, + "output": 0.68 + } }, - "qwen2-5-14b-instruct": { - "id": "qwen2-5-14b-instruct", - "name": "Qwen2.5 14B Instruct", + "Qwen/Qwen3-Coder-480B-A35B-Instruct": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "name": "Qwen/Qwen3-Coder-480B-A35B-Instruct", "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-09", - "last_updated": "2024-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 1.4 }, - "limit": { "context": 131072, "output": 8192 } + "release_date": "2025-07-31", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.25, + "output": 1 + } }, - "qwen3-vl-235b-a22b": { - "id": "qwen3-vl-235b-a22b", - "name": "Qwen3-VL 235B-A22B", + "Qwen/Qwen2.5-72B-Instruct": { + "id": "Qwen/Qwen2.5-72B-Instruct", + "name": "Qwen/Qwen2.5-72B-Instruct", "family": "qwen", "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0.7, "output": 2.8, "reasoning": 8.4 }, - "limit": { "context": 131072, "output": 32768 } - } - } - }, - "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": { - "gemini-2.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "gemini-2.5-flash-lite", - "family": "gemini-flash-lite", - "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "release_date": "2024-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4, "cache_read": 0.025 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.59, + "output": 0.59 + } }, - "anthropic--claude-4.6-sonnet": { - "id": "anthropic--claude-4.6-sonnet", - "name": "anthropic--claude-4.6-sonnet", - "family": "claude-sonnet", - "attachment": true, + "stepfun-ai/Step-3.5-Flash": { + "id": "stepfun-ai/Step-3.5-Flash", + "name": "stepfun-ai/Step-3.5-Flash", + "family": "step", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-02-11", + "last_updated": "2026-02-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "anthropic--claude-4.5-haiku": { - "id": "anthropic--claude-4.5-haiku", - "name": "anthropic--claude-4.5-haiku", - "family": "claude-haiku", - "attachment": true, - "reasoning": true, + "zai-org/GLM-4.5": { + "id": "zai-org/GLM-4.5", + "name": "zai-org/GLM-4.5", + "family": "glm", + "attachment": false, + "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"] }, + "release_date": "2025-07-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "anthropic--claude-4-opus": { - "id": "anthropic--claude-4-opus", - "name": "anthropic--claude-4-opus", - "family": "claude-opus", + "zai-org/GLM-5V-Turbo": { + "id": "zai-org/GLM-5V-Turbo", + "name": "zai-org/GLM-5V-Turbo", + "family": "glm", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_write": 0 + } }, - "anthropic--claude-3-opus": { - "id": "anthropic--claude-3-opus", - "name": "anthropic--claude-3-opus", - "family": "claude-opus", - "attachment": true, - "reasoning": false, + "zai-org/GLM-4.7": { + "id": "zai-org/GLM-4.7", + "name": "zai-org/GLM-4.7", + "family": "glm", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-02-29", - "last_updated": "2024-02-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "gpt-5", - "family": "gpt", - "attachment": true, + "zai-org/GLM-5.1": { + "id": "zai-org/GLM-5.1", + "name": "zai-org/GLM-5.1", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "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, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "release_date": "2026-04-08", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_write": 0 + } }, - "anthropic--claude-3-sonnet": { - "id": "anthropic--claude-3-sonnet", - "name": "anthropic--claude-3-sonnet", - "family": "claude-sonnet", - "attachment": true, + "zai-org/GLM-4.5-Air": { + "id": "zai-org/GLM-4.5-Air", + "name": "zai-org/GLM-4.5-Air", + "family": "glm-air", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-08-31", - "release_date": "2024-03-04", - "last_updated": "2024-03-04", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2025-07-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 4096 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.86 + } }, - "anthropic--claude-4.5-opus": { - "id": "anthropic--claude-4.5-opus", - "name": "anthropic--claude-4.5-opus", - "family": "claude-opus", - "attachment": true, + "zai-org/GLM-5": { + "id": "zai-org/GLM-5", + "name": "zai-org/GLM-5", + "family": "glm", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 200000, "output": 64000 } - }, - "anthropic--claude-3-haiku": { - "id": "anthropic--claude-3-haiku", - "name": "anthropic--claude-3-haiku", - "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, - "cost": { "input": 0.25, "output": 1.25, "cache_read": 0.03, "cache_write": 0.3 }, - "limit": { "context": 200000, "output": 4096 } + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 1, + "output": 3.2 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "gpt-5-mini", - "family": "gpt-mini", + "zai-org/GLM-4.6V": { + "id": "zai-org/GLM-4.6V", + "name": "zai-org/GLM-4.6V", + "family": "glm", "attachment": true, "reasoning": true, "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"] }, + "structured_output": false, + "temperature": true, + "release_date": "2025-12-07", + "last_updated": "2025-12-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2, "cache_read": 0.025 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "gpt-4.1", - "family": "gpt", - "attachment": true, + "zai-org/GLM-4.6": { + "id": "zai-org/GLM-4.6", + "name": "zai-org/GLM-4.6", + "family": "glm", + "attachment": false, "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, - "cost": { "input": 2, "output": 8, "cache_read": 0.5 }, - "limit": { "context": 1047576, "output": 32768 } - }, - "sonar-deep-research": { - "id": "sonar-deep-research", - "name": "sonar-deep-research", - "family": "sonar-deep-research", - "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2025-02-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-10-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8, "reasoning": 3 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 205000, + "output": 205000 + }, + "cost": { + "input": 0.5, + "output": 1.9 + } }, - "sonar": { - "id": "sonar", - "name": "sonar", - "family": "sonar", - "attachment": false, + "zai-org/GLM-4.5V": { + "id": "zai-org/GLM-4.5V", + "name": "zai-org/GLM-4.5V", + "family": "glm", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-09-01", - "release_date": "2024-01-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.14, + "output": 0.86 + } }, - "anthropic--claude-4.5-sonnet": { - "id": "anthropic--claude-4.5-sonnet", - "name": "anthropic--claude-4.5-sonnet", - "family": "claude-sonnet", - "attachment": true, - "reasoning": true, + "meta-llama/Meta-Llama-3.1-8B-Instruct": { + "id": "meta-llama/Meta-Llama-3.1-8B-Instruct", + "name": "meta-llama/Meta-Llama-3.1-8B-Instruct", + "family": "llama", + "attachment": false, + "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"] }, + "release_date": "2025-04-23", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 33000, + "output": 4000 + }, + "cost": { + "input": 0.06, + "output": 0.06 + } }, - "anthropic--claude-3.7-sonnet": { - "id": "anthropic--claude-3.7-sonnet", - "name": "anthropic--claude-3.7-sonnet", - "family": "claude-sonnet", - "attachment": true, + "inclusionAI/Ring-flash-2.0": { + "id": "inclusionAI/Ring-flash-2.0", + "name": "inclusionAI/Ring-flash-2.0", + "family": "ring", + "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10-31", - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2025-09-29", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "gemini-2.5-pro", - "family": "gemini-pro", - "attachment": true, - "reasoning": true, + "inclusionAI/Ling-mini-2.0": { + "id": "inclusionAI/Ling-mini-2.0", + "name": "inclusionAI/Ling-mini-2.0", + "family": "ling", + "attachment": false, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-25", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2025-09-10", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.07, + "output": 0.28 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "gemini-2.5-flash", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "inclusionAI/Ling-flash-2.0": { + "id": "inclusionAI/Ling-flash-2.0", + "name": "inclusionAI/Ling-flash-2.0", + "family": "ling", + "attachment": false, + "reasoning": false, "tool_call": true, "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-25", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2025-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.03, "input_audio": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "sonar-pro": { - "id": "sonar-pro", - "name": "sonar-pro", - "family": "sonar-pro", - "attachment": true, + "tencent/Hunyuan-A13B-Instruct": { + "id": "tencent/Hunyuan-A13B-Instruct", + "name": "tencent/Hunyuan-A13B-Instruct", + "family": "hunyuan", + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-09-01", - "release_date": "2024-01-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-06-30", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "gpt-4.1-mini", - "family": "gpt-mini", - "attachment": true, + "tencent/Hunyuan-MT-7B": { + "id": "tencent/Hunyuan-MT-7B", + "name": "tencent/Hunyuan-MT-7B", + "family": "hunyuan", + "attachment": false, "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"] }, + "release_date": "2025-09-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 1.6, "cache_read": 0.1 }, - "limit": { "context": 1047576, "output": 32768 } + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "gpt-5-nano", - "family": "gpt-nano", - "attachment": true, + "deepseek-ai/DeepSeek-V3.1": { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "deepseek-ai/DeepSeek-V3.1", + "family": "deepseek", + "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2025-08-25", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4, "cache_read": 0.005 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "anthropic--claude-4.6-opus": { - "id": "anthropic--claude-4.6-opus", - "name": "anthropic--claude-4.6-opus", - "family": "claude-opus", + "deepseek-ai/deepseek-vl2": { + "id": "deepseek-ai/deepseek-vl2", + "name": "deepseek-ai/deepseek-vl2", + "family": "deepseek", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-03-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2024-12-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 4000, + "output": 4000 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "anthropic--claude-3.5-sonnet": { - "id": "anthropic--claude-3.5-sonnet", - "name": "anthropic--claude-3.5-sonnet", - "family": "claude-sonnet", - "attachment": true, + "deepseek-ai/DeepSeek-V3": { + "id": "deepseek-ai/DeepSeek-V3", + "name": "deepseek-ai/DeepSeek-V3", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-04-30", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "release_date": "2024-12-26", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 8192 } + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.25, + "output": 1 + } }, - "anthropic--claude-4-sonnet": { - "id": "anthropic--claude-4-sonnet", - "name": "anthropic--claude-4-sonnet", - "family": "claude-sonnet", - "attachment": true, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { + "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + "family": "qwen", + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2025-01-20", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }, - "limit": { "context": 200000, "output": 64000 } - } - } - }, - "mistral": { - "id": "mistral", - "env": ["MISTRAL_API_KEY"], - "npm": "@ai-sdk/mistral", - "name": "Mistral", - "doc": "https://docs.mistral.ai/getting-started/models/", - "models": { - "devstral-small-2505": { - "id": "devstral-small-2505", - "name": "Devstral Small 2505", - "family": "devstral", + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.18, + "output": 0.18 + } + }, + "deepseek-ai/DeepSeek-R1": { + "id": "deepseek-ai/DeepSeek-R1", + "name": "deepseek-ai/DeepSeek-R1", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-05-28", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.5, + "output": 2.18 + } }, - "pixtral-large-latest": { - "id": "pixtral-large-latest", - "name": "Pixtral Large (latest)", - "family": "pixtral", - "attachment": true, - "reasoning": false, + "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { + "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + "family": "qwen", + "attachment": false, + "reasoning": true, "tool_call": true, + "structured_output": 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, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-01-20", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "mistral-small-2603": { - "id": "mistral-small-2603", - "name": "Mistral Small 4", - "family": "mistral-small", - "attachment": true, + "deepseek-ai/DeepSeek-V3.2-Exp": { + "id": "deepseek-ai/DeepSeek-V3.2-Exp", + "name": "deepseek-ai/DeepSeek-V3.2-Exp", + "family": "deepseek", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 256000, "output": 256000 } + "release_date": "2025-10-10", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 0.41 + } }, - "ministral-3b-latest": { - "id": "ministral-3b-latest", - "name": "Ministral 3B (latest)", - "family": "ministral", + "deepseek-ai/DeepSeek-V3.2": { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "deepseek-ai/DeepSeek-V3.2", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-10-01", - "last_updated": "2024-10-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.04, "output": 0.04 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-12-03", + "last_updated": "2025-12-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 0.42 + } }, - "magistral-small": { - "id": "magistral-small", - "name": "Magistral Small", - "family": "magistral-small", + "deepseek-ai/DeepSeek-V3.1-Terminus": { + "id": "deepseek-ai/DeepSeek-V3.1-Terminus", + "name": "deepseek-ai/DeepSeek-V3.1-Terminus", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-03-17", - "last_updated": "2025-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-09-29", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 164000, + "output": 164000 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "devstral-2512": { - "id": "devstral-2512", - "name": "Devstral 2", - "family": "devstral", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "openai/gpt-oss-20b", + "family": "gpt-oss", "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, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-08-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 8000 + }, + "cost": { + "input": 0.04, + "output": 0.18 + } }, - "codestral-latest": { - "id": "codestral-latest", - "name": "Codestral (latest)", - "family": "codestral", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "openai/gpt-oss-120b", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 256000, "output": 4096 } + "release_date": "2025-08-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 8000 + }, + "cost": { + "input": 0.05, + "output": 0.45 + } }, - "mistral-large-latest": { - "id": "mistral-large-latest", - "name": "Mistral Large (latest)", - "family": "mistral-large", - "attachment": true, + "baidu/ERNIE-4.5-300B-A47B": { + "id": "baidu/ERNIE-4.5-300B-A47B", + "name": "baidu/ERNIE-4.5-300B-A47B", + "family": "ernie", + "attachment": false, "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, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 262144, "output": 262144 } + "release_date": "2025-07-02", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.28, + "output": 1.1 + } }, - "devstral-medium-latest": { - "id": "devstral-medium-latest", - "name": "Devstral 2 (latest)", - "family": "devstral", + "THUDM/GLM-Z1-9B-0414": { + "id": "THUDM/GLM-Z1-9B-0414", + "name": "THUDM/GLM-Z1-9B-0414", + "family": "glm-z", "attachment": false, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262144, "output": 262144 } - }, - "mistral-embed": { - "id": "mistral-embed", - "name": "Mistral Embed", - "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"] }, + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8000, "output": 3072 } + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.086, + "output": 0.086 + } }, - "mistral-large-2411": { - "id": "mistral-large-2411", - "name": "Mistral Large 2.1", - "family": "mistral-large", + "THUDM/GLM-4-9B-0414": { + "id": "THUDM/GLM-4-9B-0414", + "name": "THUDM/GLM-4-9B-0414", + "family": "glm", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-11", - "release_date": "2024-11-01", - "last_updated": "2024-11-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0.086, + "output": 0.086 + } }, - "mistral-small-2506": { - "id": "mistral-small-2506", - "name": "Mistral Small 3.2", - "family": "mistral-small", + "THUDM/GLM-4-32B-0414": { + "id": "THUDM/GLM-4-32B-0414", + "name": "THUDM/GLM-4-32B-0414", + "family": "glm", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": 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, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 33000, + "output": 33000 + }, + "cost": { + "input": 0.27, + "output": 0.27 + } }, - "devstral-medium-2507": { - "id": "devstral-medium-2507", - "name": "Devstral Medium", - "family": "devstral", + "THUDM/GLM-Z1-32B-0414": { + "id": "THUDM/GLM-Z1-32B-0414", + "name": "THUDM/GLM-Z1-32B-0414", + "family": "glm-z", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-07-10", - "last_updated": "2025-07-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-04-18", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.14, + "output": 0.57 + } }, - "magistral-medium-latest": { - "id": "magistral-medium-latest", - "name": "Magistral Medium (latest)", - "family": "magistral-medium", + "moonshotai/Kimi-K2-Thinking": { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "moonshotai/Kimi-K2-Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-06", - "release_date": "2025-03-17", - "last_updated": "2025-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 5 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2025-11-07", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.55, + "output": 2.5 + } }, - "labs-devstral-small-2512": { - "id": "labs-devstral-small-2512", - "name": "Devstral Small 2", - "family": "devstral", + "moonshotai/Kimi-K2.6": { + "id": "moonshotai/Kimi-K2.6", + "name": "moonshotai/Kimi-K2.6", + "family": "kimi", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-12", - "release_date": "2025-12-09", - "last_updated": "2025-12-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "mistral-medium-latest": { - "id": "mistral-medium-latest", - "name": "Mistral Medium (latest)", - "family": "mistral-medium", + "moonshotai/Kimi-K2-Instruct": { + "id": "moonshotai/Kimi-K2-Instruct", + "name": "moonshotai/Kimi-K2-Instruct", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-05-07", - "last_updated": "2025-05-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2025-07-13", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.58, + "output": 2.29 + } }, - "mistral-medium-2505": { - "id": "mistral-medium-2505", - "name": "Mistral Medium 3", - "family": "mistral-medium", - "attachment": true, + "moonshotai/Kimi-K2-Instruct-0905": { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "moonshotai/Kimi-K2-Instruct-0905", + "family": "kimi", + "attachment": false, "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"] }, + "release_date": "2025-09-08", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "mistral-nemo": { - "id": "mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "moonshotai/Kimi-K2.5", + "family": "kimi", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.45, + "output": 2.25 + } }, - "open-mixtral-8x22b": { - "id": "open-mixtral-8x22b", - "name": "Mixtral 8x22B", - "family": "mixtral", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMaxAI/MiniMax-M2.5", + "family": "minimax", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-04-17", - "last_updated": "2024-04-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2, "output": 6 }, - "limit": { "context": 64000, "output": 64000 } + "release_date": "2026-02-15", + "last_updated": "2026-02-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 197000, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "ministral-8b-latest": { - "id": "ministral-8b-latest", - "name": "Ministral 8B (latest)", - "family": "ministral", + "MiniMaxAI/MiniMax-M2.1": { + "id": "MiniMaxAI/MiniMax-M2.1", + "name": "MiniMaxAI/MiniMax-M2.1", + "family": "minimax", "attachment": false, "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"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2025-12-23", + "last_updated": "2025-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 197000, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "open-mixtral-8x7b": { - "id": "open-mixtral-8x7b", - "name": "Mixtral 8x7B", - "family": "mixtral", + "ByteDance-Seed/Seed-OSS-36B-Instruct": { + "id": "ByteDance-Seed/Seed-OSS-36B-Instruct", + "name": "ByteDance-Seed/Seed-OSS-36B-Instruct", + "family": "seed", "attachment": false, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-01", - "release_date": "2023-12-11", - "last_updated": "2023-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 32000, "output": 32000 } - }, - "pixtral-12b": { - "id": "pixtral-12b", - "name": "Pixtral 12B", - "family": "pixtral", - "attachment": true, + "release_date": "2025-09-04", + "last_updated": "2025-11-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.21, + "output": 0.57 + } + } + } + }, + "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": { + "alibaba/qwen3-coder-plus": { + "id": "alibaba/qwen3-coder-plus", + "name": "Qwen3 Coder Plus", + "family": "qwen", + "attachment": false, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 1000000 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "mistral-small-latest": { - "id": "mistral-small-latest", - "name": "Mistral Small (latest)", - "family": "mistral-small", + "alibaba/qwen3.6-27b": { + "id": "alibaba/qwen3.6-27b", + "name": "Qwen 3.6 27B", + "family": "qwen3.6", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 256000, "output": 256000 } + "release_date": "2026-04-22", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.6, + "output": 3.5999999999999996 + } }, - "open-mistral-7b": { - "id": "open-mistral-7b", - "name": "Mistral 7B", - "family": "mistral", + "alibaba/qwen3-embedding-8b": { + "id": "alibaba/qwen3-embedding-8b", + "name": "Qwen3 Embedding 8B", + "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": false, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0 + } + }, + "alibaba/qwen-3-30b": { + "id": "alibaba/qwen-3-30b", + "name": "Qwen3-30B-A3B", + "family": "qwen", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2023-09-27", - "last_updated": "2023-09-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 0.25 }, - "limit": { "context": 8000, "output": 8000 } + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 40960, + "output": 16384 + }, + "cost": { + "input": 0.08, + "output": 0.29 + } }, - "devstral-small-2507": { - "id": "devstral-small-2507", - "name": "Devstral Small", - "family": "devstral", + "alibaba/qwen-3-235b": { + "id": "alibaba/qwen-3-235b", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-07-10", - "last_updated": "2025-07-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "output": 128000 } + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 40960, + "output": 16384 + }, + "cost": { + "input": 0.13, + "output": 0.6 + } }, - "mistral-medium-2508": { - "id": "mistral-medium-2508", - "name": "Mistral Medium 3.1", - "family": "mistral-medium", + "alibaba/qwen3.5-flash": { + "id": "alibaba/qwen3.5-flash", + "name": "Qwen 3.5 Flash", + "family": "qwen", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-05", - "release_date": "2025-08-12", - "last_updated": "2025-08-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-24", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262144, "output": 262144 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.001, + "cache_write": 0.125 + } }, - "mistral-large-2512": { - "id": "mistral-large-2512", - "name": "Mistral Large 3", - "family": "mistral-large", + "alibaba/qwen3.6-plus": { + "id": "alibaba/qwen3.6-plus", + "name": "Qwen 3.6 Plus", + "family": "qwen", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "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.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2-Codex", - "family": "gpt-codex", + "release_date": "2026-04-02", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.09999999999999999, + "cache_write": 0.625 + } + }, + "alibaba/qwen3-max": { + "id": "alibaba/qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", "attachment": false, - "reasoning": 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"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 1.2, + "output": 6 + } }, - "gpt-5.1-codex-mini": { - "id": "gpt-5.1-codex-mini", - "name": "GPT-5.1-Codex-mini", - "family": "gpt-codex", + "alibaba/qwen3-embedding-0.6b": { + "id": "alibaba/qwen3-embedding-0.6b", + "name": "Qwen3 Embedding 0.6B", + "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": false, - "knowledge": "2024-09-30", - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 128000, "output": 128000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.01, + "output": 0 + } }, - "claude-opus-4.6": { - "id": "claude-opus-4.6", - "name": "Claude Opus 4.6", - "family": "claude-opus", - "attachment": true, + "alibaba/qwen-3-32b": { + "id": "alibaba/qwen-3-32b", + "name": "Qwen 3.32B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 144000, "input": 128000, "output": 64000 } - }, - "gpt-5.4-mini": { - "id": "gpt-5.4-mini", - "name": "GPT-5.4 mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": true, - "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"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 40960, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", + "alibaba/qwen-3.6-max-preview": { + "id": "alibaba/qwen-3.6-max-preview", + "name": "Qwen 3.6 Max Preview", + "family": "qwen", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 128000 } + "release_date": "2026-04-20", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 240000, + "output": 64000 + }, + "cost": { + "input": 1.3, + "output": 7.8, + "cache_read": 0.26, + "cache_write": 1.625 + } }, - "claude-haiku-4.5": { - "id": "claude-haiku-4.5", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, + "alibaba/qwen3-next-80b-a3b-thinking": { + "id": "alibaba/qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 144000, "input": 128000, "output": 32000 } + "knowledge": "2025-09", + "release_date": "2025-09-12", + "last_updated": "2025-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 1.5 + } }, - "gemini-3.1-pro-preview": { - "id": "gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", + "alibaba/qwen3-vl-thinking": { + "id": "alibaba/qwen3-vl-thinking", + "name": "Qwen3 VL Thinking", + "family": "qwen", "attachment": true, "reasoning": true, "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"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 128000, "output": 64000 } + "knowledge": "2025-09", + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 129024 + }, + "cost": { + "input": 0.7, + "output": 8.4 + } }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro Preview", - "family": "gemini-pro", + "alibaba/qwen3-235b-a22b-thinking": { + "id": "alibaba/qwen3-235b-a22b-thinking", + "name": "Qwen3 235B A22B Thinking 2507", + "family": "qwen", "attachment": true, "reasoning": true, "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", "audio", "video"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 128000, "output": 64000 } + "limit": { + "context": 262114, + "output": 262114 + }, + "cost": { + "input": 0.3, + "output": 2.9 + } }, - "gpt-4o": { - "id": "gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "alibaba/qwen3-next-80b-a3b-instruct": { + "id": "alibaba/qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": 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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 64000, "output": 4096 } + "knowledge": "2025-04", + "release_date": "2025-09-12", + "last_updated": "2025-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.09, + "output": 1.1 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "alibaba/qwen3-coder-next": { + "id": "alibaba/qwen3-coder-next", + "name": "Qwen3 Coder Next", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-08-27", - "last_updated": "2025-08-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-22", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 128000, "output": 64000 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.5, + "output": 1.2 + } }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3-Codex", - "family": "gpt-codex", + "alibaba/qwen3-embedding-4b": { + "id": "alibaba/qwen3-embedding-4b", + "name": "Qwen3 Embedding 4B", + "family": "qwen", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": false, - "knowledge": "2025-08-31", - "release_date": "2026-02-24", - "last_updated": "2026-02-24", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5-mini", - "family": "gpt-mini", - "attachment": true, + "alibaba/qwen3-max-thinking": { + "id": "alibaba/qwen3-max-thinking", + "name": "Qwen 3 Max Thinking", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-08-13", - "last_updated": "2025-08-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 264000, "input": 128000, "output": 64000 } + "knowledge": "2025-01", + "release_date": "2025-01", + "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 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1-Codex-max", - "family": "gpt-codex", + "alibaba/qwen3-vl-235b-a22b-instruct": { + "id": "alibaba/qwen3-vl-235b-a22b-instruct", + "name": "Qwen3 VL 235B A22B Instruct", + "family": "qwen", "attachment": true, - "reasoning": true, - "tool_call": true, - "temperature": false, - "knowledge": "2024-09-30", - "release_date": "2025-12-04", - "last_updated": "2025-12-04", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2025-09-24", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 128000, "output": 128000 } + "limit": { + "context": 131072, + "output": 129024 + }, + "cost": { + "input": 0.39999999999999997, + "output": 1.5999999999999999 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", - "attachment": true, + "alibaba/qwen3-coder": { + "id": "alibaba/qwen3-coder", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", + "attachment": false, "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"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 64000, "output": 16384 } + "limit": { + "context": 262144, + "output": 66536 + }, + "cost": { + "input": 0.38, + "output": 1.53 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", + "alibaba/qwen3-max-preview": { + "id": "alibaba/qwen3-max-preview", + "name": "Qwen3 Max Preview", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "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"] }, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 1.2, + "output": 6, + "cache_read": 0.24 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash", - "family": "gemini-flash", + "alibaba/qwen3.5-plus": { + "id": "alibaba/qwen3.5-plus", + "name": "Qwen 3.5 Plus", + "family": "qwen", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-02-16", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 128000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0.4, + "output": 2.4, + "cache_read": 0.04, + "cache_write": 0.5 + } }, - "claude-sonnet-4.6": { - "id": "claude-sonnet-4.6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "alibaba/qwen-3-14b": { + "id": "alibaba/qwen-3-14b", + "name": "Qwen3-14B", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "input": 128000, "output": 32000 } + "limit": { + "context": 40960, + "output": 16384 + }, + "cost": { + "input": 0.06, + "output": 0.24 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", + "alibaba/qwen3-vl-instruct": { + "id": "alibaba/qwen3-vl-instruct", + "name": "Qwen3 VL Instruct", + "family": "qwen", "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "input": 128000, "output": 64000 } + "knowledge": "2025-04", + "release_date": "2025-09-24", + "last_updated": "2025-09-24", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 129024 + }, + "cost": { + "input": 0.7, + "output": 2.8 + } }, - "claude-sonnet-4": { - "id": "claude-sonnet-4", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", - "attachment": true, + "alibaba/qwen3-coder-30b-a3b": { + "id": "alibaba/qwen3-coder-30b-a3b", + "name": "Qwen 3 Coder 30B A3B Instruct", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 216000, "input": 128000, "output": 16000 } + "limit": { + "context": 160000, + "output": 32768 + }, + "cost": { + "input": 0.07, + "output": 0.27 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", + "perplexity/sonar-pro": { + "id": "perplexity/sonar-pro", + "name": "Sonar Pro", + "family": "sonar-pro", "attachment": true, - "reasoning": 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"] }, + "temperature": true, + "knowledge": "2025-09", + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 264000, "input": 128000, "output": 64000 } + "limit": { + "context": 200000, + "output": 8000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", + "perplexity/sonar": { + "id": "perplexity/sonar", + "name": "Sonar", + "family": "sonar", "attachment": true, - "reasoning": true, + "reasoning": false, "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"] }, + "temperature": true, + "knowledge": "2025-02", + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 264000, "input": 128000, "output": 64000 } + "limit": { + "context": 127000, + "output": 8000 + }, + "cost": { + "input": 1, + "output": 1 + } }, - "claude-opus-4.5": { - "id": "claude-opus-4.5", - "name": "Claude Opus 4.5", - "family": "claude-opus", - "attachment": true, + "perplexity/sonar-reasoning": { + "id": "perplexity/sonar-reasoning", + "name": "Sonar Reasoning", + "family": "sonar-reasoning", + "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-24", - "last_updated": "2025-08-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-09", + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 160000, "input": 128000, "output": 32000 } + "limit": { + "context": 127000, + "output": 8000 + }, + "cost": { + "input": 1, + "output": 5 + } }, - "claude-opus-41": { - "id": "claude-opus-41", - "name": "Claude Opus 4.1", - "family": "claude-opus", - "attachment": true, + "perplexity/sonar-reasoning-pro": { + "id": "perplexity/sonar-reasoning-pro", + "name": "Sonar Reasoning Pro", + "family": "sonar-reasoning", + "attachment": false, "reasoning": true, "tool_call": false, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-09", + "release_date": "2025-02-19", + "last_updated": "2025-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 80000, "output": 16000 } + "limit": { + "context": 127000, + "output": 8000 + }, + "cost": { + "input": 2, + "output": 8 + } }, - "claude-sonnet-4.5": { - "id": "claude-sonnet-4.5", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", - "attachment": true, + "deepseek/deepseek-v3.2-thinking": { + "id": "deepseek/deepseek-v3.2-thinking", + "name": "DeepSeek V3.2 Thinking", + "family": "deepseek-thinking", + "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, - "knowledge": "2025-03-31", + "knowledge": "2024-07", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.28, + "output": 0.42, + "cache_read": 0.03 + } + }, + "deepseek/deepseek-v3.2-exp": { + "id": "deepseek/deepseek-v3.2-exp", + "name": "DeepSeek V3.2 Exp", + "family": "deepseek", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-09", "release_date": "2025-09-29", "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 144000, "input": 128000, "output": 32000 } + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 0.27, + "output": 0.4 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1-Codex", - "family": "gpt-codex", + "deepseek/deepseek-v3.1": { + "id": "deepseek/deepseek-v3.1", + "name": "DeepSeek-V3.1", + "family": "deepseek", "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 400000, "input": 128000, "output": 128000 } - } - } - }, - "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": { - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3-Coder 30B-A3B Instruct", - "family": "qwen", + "limit": { + "context": 163840, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 1 + } + }, + "deepseek/deepseek-v4-flash": { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-04", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-23", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 0.14, + "output": 0.28, + "cache_read": 0.028 + } }, - "qwen3-235b-a22b-instruct-2507": { - "id": "qwen3-235b-a22b-instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", - "attachment": true, - "reasoning": false, + "deepseek/deepseek-v4-pro": { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek", + "attachment": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-01", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-23", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.75, "output": 2.25 }, - "limit": { "context": 260000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 384000 + }, + "cost": { + "input": 1.74, + "output": 3.48, + "cache_read": 0.145 + } }, - "qwen3-embedding-8b": { - "id": "qwen3-embedding-8b", - "name": "Qwen3 Embedding 8B", - "family": "qwen", + "deepseek/deepseek-v3.2": { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": false, - "release_date": "2025-25-11", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 32768, "output": 4096 } + "limit": { + "context": 163842, + "output": 8000 + }, + "cost": { + "input": 0.27, + "output": 0.4, + "cache_read": 0.22 + } }, - "mistral-nemo-instruct-2407": { - "id": "mistral-nemo-instruct-2407", - "name": "Mistral Nemo Instruct 2407", - "family": "mistral-nemo", - "attachment": true, + "deepseek/deepseek-v3": { + "id": "deepseek/deepseek-v3", + "name": "DeepSeek V3 0324", + "family": "deepseek", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-07-25", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2024-07", + "release_date": "2024-12-26", + "last_updated": "2024-12-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 163840, + "output": 16384 + }, + "cost": { + "input": 0.77, + "output": 0.77 + } }, - "deepseek-r1-distill-llama-70b": { - "id": "deepseek-r1-distill-llama-70b", - "name": "DeepSeek R1 Distill Llama 70B", - "family": "deepseek-thinking", + "deepseek/deepseek-v3.1-terminus": { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "DeepSeek V3.1 Terminus", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-01-20", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-09-22", + "last_updated": "2025-09-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.9, "output": 0.9 }, - "limit": { "context": 32000, "output": 8196 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.27, + "output": 1 + } }, - "devstral-2-123b-instruct-2512": { - "id": "devstral-2-123b-instruct-2512", - "name": "Devstral 2 123B Instruct (2512)", - "family": "devstral", + "deepseek/deepseek-r1": { + "id": "deepseek/deepseek-r1", + "name": "DeepSeek-R1", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-01-07", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 256000, "output": 16384 } + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-05-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "llama-3.3-70b-instruct": { - "id": "llama-3.3-70b-instruct", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", - "attachment": true, + "arcee-ai/trinity-mini": { + "id": "arcee-ai/trinity-mini", + "name": "Trinity Mini", + "family": "trinity", + "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-12-06", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.9, "output": 0.9 }, - "limit": { "context": 100000, "output": 16384 } - }, - "gemma-3-27b-it": { - "id": "gemma-3-27b-it", - "name": "Gemma-3-27B-IT", - "family": "gemma", - "attachment": true, - "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2024-12-01", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-12", + "last_updated": "2025-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.5 }, - "limit": { "context": 40000, "output": 8192 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.15 + } }, - "llama-3.1-8b-instruct": { - "id": "llama-3.1-8b-instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", + "arcee-ai/trinity-large-thinking": { + "id": "arcee-ai/trinity-large-thinking", + "name": "Trinity Large Thinking", + "family": "trinity", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2025-01-01", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 262100, + "output": 80000 + }, + "cost": { + "input": 0.25, + "output": 0.8999999999999999 + } }, - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "GPT-OSS 120B", - "family": "gpt-oss", - "attachment": true, + "arcee-ai/trinity-large-preview": { + "id": "arcee-ai/trinity-large-preview", + "name": "Trinity Large Preview", + "family": "trinity", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2026-03-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 32768 } + "knowledge": "2024-10", + "release_date": "2025-01", + "last_updated": "2025-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131000, + "output": 131000 + }, + "cost": { + "input": 0.25, + "output": 1 + } }, - "bge-multilingual-gemma2": { - "id": "bge-multilingual-gemma2", - "name": "BGE Multilingual Gemma2", - "family": "gemma", + "recraft/recraft-v3": { + "id": "recraft/recraft-v3", + "name": "Recraft V3", + "family": "recraft", "attachment": false, "reasoning": false, "tool_call": false, "temperature": false, - "release_date": "2024-07-26", - "last_updated": "2025-06-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-10", + "last_updated": "2024-10", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0 }, - "limit": { "context": 8191, "output": 3072 } - }, - "pixtral-12b-2409": { - "id": "pixtral-12b-2409", - "name": "Pixtral 12B 2409", - "family": "pixtral", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2024-09-25", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "output": 4096 } - }, - "voxtral-small-24b-2507": { - "id": "voxtral-small-24b-2507", - "name": "Voxtral Small 24B 2507", - "family": "voxtral", - "attachment": true, - "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-07-01", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.35 }, - "limit": { "context": 32000, "output": 16384 } + "limit": { + "context": 512, + "output": 0 + } }, - "whisper-large-v3": { - "id": "whisper-large-v3", - "name": "Whisper Large v3", - "family": "whisper", + "recraft/recraft-v2": { + "id": "recraft/recraft-v2", + "name": "Recraft V2", + "family": "recraft", "attachment": false, "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, - "cost": { "input": 0.003, "output": 0 }, - "limit": { "context": 0, "output": 8192 } + "release_date": "2024-03", + "last_updated": "2024-03", + "modalities": { + "input": ["text"], + "output": ["image"] + }, + "open_weights": false, + "limit": { + "context": 512, + "output": 0 + } }, - "qwen3.5-397b-a17b": { - "id": "qwen3.5-397b-a17b", - "name": "Qwen3.5 397B A17B", - "family": "qwen", + "voyage/voyage-3-large": { + "id": "voyage/voyage-3-large", + "name": "voyage-3-large", + "family": "voyage", "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-03-17", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 256000, "output": 16384 } + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.18, + "output": 0 + } }, - "mistral-small-3.2-24b-instruct-2506": { - "id": "mistral-small-3.2-24b-instruct-2506", - "name": "Mistral Small 3.2 24B Instruct (2506)", - "family": "mistral-small", + "voyage/voyage-4-large": { + "id": "voyage/voyage-4-large", + "name": "voyage-4-large", + "family": "voyage", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "release_date": "2025-06-20", - "last_updated": "2026-03-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.35 }, - "limit": { "context": 128000, "output": 32768 } - } - } - }, - "iflowcn": { - "id": "iflowcn", - "env": ["IFLOW_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://apis.iflow.cn/v1", - "name": "iFlow", - "doc": "https://platform.iflow.cn/en/docs", - "models": { - "deepseek-r1": { - "id": "deepseek-r1", - "name": "DeepSeek-R1", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32000 } + "release_date": "2026-03-06", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "output": 0 + } }, - "qwen3-max-preview": { - "id": "qwen3-max-preview", - "name": "Qwen3-Max-Preview", - "family": "qwen", + "voyage/voyage-3.5-lite": { + "id": "voyage/voyage-3.5-lite", + "name": "voyage-3.5-lite", + "family": "voyage", "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"] }, + "tool_call": false, + "temperature": false, + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "deepseek-v3": { - "id": "deepseek-v3", - "name": "DeepSeek-V3", - "family": "deepseek", + "voyage/voyage-code-3": { + "id": "voyage/voyage-code-3", + "name": "voyage-code-3", + "family": "voyage", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-26", - "last_updated": "2024-12-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32000 } + "tool_call": false, + "temperature": false, + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.18, + "output": 0 + } }, - "kimi-k2-0905": { - "id": "kimi-k2-0905", - "name": "Kimi-K2-0905", - "family": "kimi", + "voyage/voyage-finance-2": { + "id": "voyage/voyage-finance-2", + "name": "voyage-finance-2", + "family": "voyage", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "release_date": "2024-03", + "last_updated": "2024-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 64000 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.12, + "output": 0 + } }, - "kimi-k2": { - "id": "kimi-k2", - "name": "Kimi-K2", - "family": "kimi", + "voyage/voyage-4-lite": { + "id": "voyage/voyage-4-lite", + "name": "voyage-4-lite", + "family": "voyage", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-06", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 64000 } + "limit": { + "context": 32000, + "output": 0 + } }, - "qwen3-235b": { - "id": "qwen3-235b", - "name": "Qwen3-235B-A22B", - "family": "qwen", + "voyage/voyage-4": { + "id": "voyage/voyage-4", + "name": "voyage-4", + "family": "voyage", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32000 } + "release_date": "2026-03-06", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "output": 0 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", - "family": "glm", + "voyage/voyage-code-2": { + "id": "voyage/voyage-code-2", + "name": "voyage-code-2", + "family": "voyage", "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2025-11-13", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2024-01", + "last_updated": "2024-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.12, + "output": 0 + } }, - "qwen3-235b-a22b-instruct": { - "id": "qwen3-235b-a22b-instruct", - "name": "Qwen3-235B-A22B-Instruct", - "family": "qwen", + "voyage/voyage-law-2": { + "id": "voyage/voyage-law-2", + "name": "voyage-law-2", + "family": "voyage", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 64000 } + "tool_call": false, + "temperature": false, + "release_date": "2024-03", + "last_updated": "2024-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.12, + "output": 0 + } }, - "qwen3-235b-a22b-thinking-2507": { - "id": "qwen3-235b-a22b-thinking-2507", - "name": "Qwen3-235B-A22B-Thinking", - "family": "qwen", + "voyage/voyage-3.5": { + "id": "voyage/voyage-3.5", + "name": "voyage-3.5", + "family": "voyage", "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 64000 } - }, - "qwen3-vl-plus": { - "id": "qwen3-vl-plus", - "name": "Qwen3-VL-Plus", - "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"] }, + "tool_call": false, + "temperature": false, + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.06, + "output": 0 + } }, - "qwen3-coder-plus": { - "id": "qwen3-coder-plus", - "name": "Qwen3-Coder-Plus", - "family": "qwen", + "morph/morph-v3-large": { + "id": "morph/morph-v3-large", + "name": "Morph v3 Large", + "family": "morph", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 64000 } + "tool_call": false, + "temperature": false, + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "output": 32000 + }, + "cost": { + "input": 0.9, + "output": 1.9 + } }, - "qwen3-max": { - "id": "qwen3-max", - "name": "Qwen3-Max", - "family": "qwen", + "morph/morph-v3-fast": { + "id": "morph/morph-v3-fast", + "name": "Morph v3 Fast", + "family": "morph", "attachment": false, "reasoning": false, + "tool_call": false, + "temperature": false, + "release_date": "2024-08-15", + "last_updated": "2024-08-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16000, + "output": 16000 + }, + "cost": { + "input": 0.8, + "output": 1.2 + } + }, + "zai/glm-5v-turbo": { + "id": "zai/glm-5v-turbo", + "name": "GLM 5V Turbo", + "family": "glm", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-01", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 32000 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24 + } }, - "qwen3-32b": { - "id": "qwen3-32b", - "name": "Qwen3-32B", - "family": "qwen", + "zai/glm-4.7": { + "id": "zai/glm-4.7", + "name": "GLM 4.7", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, "knowledge": "2024-10", - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32000 } + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 202752, + "output": 120000 + }, + "cost": { + "input": 0.43, + "output": 1.75, + "cache_read": 0.08 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek-V3.2-Exp", - "family": "deepseek", + "zai/glm-5": { + "id": "zai/glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-02-12", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 64000 } - } - } - }, - "venice": { - "id": "venice", - "env": ["VENICE_API_KEY"], - "npm": "venice-ai-sdk-provider", - "name": "Venice AI", - "doc": "https://docs.venice.ai", - "models": { - "qwen3-235b-a22b-instruct-2507": { - "id": "qwen3-235b-a22b-instruct-2507", - "name": "Qwen 3 235B A22B Instruct 2507", - "family": "qwen", + "limit": { + "context": 202800, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2 + } + }, + "zai/glm-4.7-flashx": { + "id": "zai/glm-4.7-flashx", + "name": "GLM 4.7 FlashX", + "family": "glm-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-04-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-01", + "last_updated": "2025-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.75 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 128000 + }, + "cost": { + "input": 0.06, + "output": 0.4, + "cache_read": 0.01 + } }, - "qwen3-coder-480b-a35b-instruct-turbo": { - "id": "qwen3-coder-480b-a35b-instruct-turbo", - "name": "Qwen 3 Coder 480B Turbo", - "family": "qwen", - "attachment": false, - "reasoning": false, + "zai/glm-5.1": { + "id": "zai/glm-5.1", + "name": "GLM 5.1", + "family": "glm", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-02-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 1.5, "cache_read": 0.04 }, - "limit": { "context": 256000, "output": 65536 } + "release_date": "2026-04-07", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 202752, + "output": 202752 + }, + "cost": { + "input": 1.4, + "output": 4.4, + "cache_read": 0.26 + } }, - "aion-labs.aion-2-0": { - "id": "aion-labs.aion-2-0", - "name": "Aion 2.0", - "family": "o", - "attachment": false, - "reasoning": false, - "tool_call": false, + "zai/glm-4.6v-flash": { + "id": "zai/glm-4.6v-flash", + "name": "GLM-4.6V-Flash", + "family": "glm", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2026-03-24", - "last_updated": "2026-03-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 2, "cache_read": 0.25 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 24000 + } }, - "qwen3-next-80b": { - "id": "qwen3-next-80b", - "name": "Qwen 3 Next 80b", - "family": "qwen", + "zai/glm-4.5": { + "id": "zai/glm-4.5", + "name": "GLM 4.5", + "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": true, "temperature": true, "knowledge": "2025-07", - "release_date": "2025-04-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.35, "output": 1.9 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "zai/glm-4.5-air": { + "id": "zai/glm-4.5-air", + "name": "GLM 4.5 Air", + "family": "glm-air", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-12-10", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.75, "output": 3.2, "cache_read": 0.375 }, - "limit": { "context": 256000, "output": 65536 } + "limit": { + "context": 128000, + "output": 96000 + }, + "cost": { + "input": 0.2, + "output": 1.1 + } }, - "zai-org-glm-4.7": { - "id": "zai-org-glm-4.7", - "name": "GLM 4.7", + "zai/glm-5-turbo": { + "id": "zai/glm-5-turbo", + "name": "GLM 5 Turbo", "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-12-24", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 2.65, "cache_read": 0.11 }, - "limit": { "context": 198000, "output": 16384 } + "release_date": "2026-03-15", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 202800, + "output": 131100 + }, + "cost": { + "input": 1.2, + "output": 4, + "cache_read": 0.24 + } }, - "openai-gpt-53-codex": { - "id": "openai-gpt-53-codex", - "name": "GPT-5.3 Codex", - "family": "gpt-codex", + "zai/glm-4.5v": { + "id": "zai/glm-4.5v", + "name": "GLM 4.5V", + "family": "glm", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.19, "output": 17.5, "cache_read": 0.219 }, - "limit": { "context": 400000, "output": 128000 } + "knowledge": "2025-08", + "release_date": "2025-08-11", + "last_updated": "2025-08-11", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 66000, + "output": 66000 + }, + "cost": { + "input": 0.6, + "output": 1.8 + } }, - "qwen3-5-35b-a3b": { - "id": "qwen3-5-35b-a3b", - "name": "Qwen 3.5 35B A3B", - "family": "qwen", - "attachment": true, + "zai/glm-4.6": { + "id": "zai/glm-4.6", + "name": "GLM 4.6", + "family": "glm", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": true, "temperature": true, - "release_date": "2026-02-25", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3125, "output": 1.25, "cache_read": 0.15625 }, - "limit": { "context": 256000, "output": 65536 } + "limit": { + "context": 200000, + "output": 96000 + }, + "cost": { + "input": 0.45, + "output": 1.8 + } }, - "olafangensan-glm-4.7-flash-heretic": { - "id": "olafangensan-glm-4.7-flash-heretic", - "name": "GLM 4.7 Flash Heretic", - "family": "glm-flash", - "attachment": false, + "zai/glm-4.6v": { + "id": "zai/glm-4.6v", + "name": "GLM-4.6V", + "family": "glm", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-04", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.14, "output": 0.8 }, - "limit": { "context": 200000, "output": 24000 } + "knowledge": "2024-10", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 24000 + }, + "cost": { + "input": 0.3, + "output": 0.9, + "cache_read": 0.05 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "zai/glm-4.7-flash": { + "id": "zai/glm-4.7-flash", + "name": "GLM 4.7 Flash", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-13", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1.87, "cache_read": 0.03 }, - "limit": { "context": 256000, "output": 10000 } + "limit": { + "context": 200000, + "output": 131000 + }, + "cost": { + "input": 0.07, + "output": 0.39999999999999997 + } }, - "openai-gpt-4o-2024-11-20": { - "id": "openai-gpt-4o-2024-11-20", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "cohere/command-a": { + "id": "cohere/command-a", + "name": "Command A", + "family": "command", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-28", - "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.125, "output": 12.5 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "output": 8000 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "grok-4-20-beta": { - "id": "grok-4-20-beta", - "name": "Grok 4.20 Beta", - "family": "grok-beta", - "attachment": true, + "cohere/embed-v4.0": { + "id": "cohere/embed-v4.0", + "name": "Embed v4.0", + "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": 8192, + "output": 1536 + }, + "cost": { + "input": 0.12, + "output": 0 + } + }, + "prime-intellect/intellect-3": { + "id": "prime-intellect/intellect-3", + "name": "INTELLECT 3", + "family": "intellect", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-11-26", + "last_updated": "2025-11-26", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2.5, - "output": 7.5, - "cache_read": 0.25, - "context_over_200k": { "input": 5, "output": 15, "cache_read": 0.25 } + "limit": { + "context": 131072, + "output": 131072 }, - "limit": { "context": 2000000, "output": 128000 } + "cost": { + "input": 0.2, + "output": 1.1 + } }, - "grok-4-20-multi-agent-beta": { - "id": "grok-4-20-multi-agent-beta", - "name": "Grok 4.20 Multi-Agent Beta", - "family": "grok-beta", + "xai/grok-4.3": { + "id": "xai/grok-4.3", + "name": "Grok 4.3", + "family": "grok", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": true, + "tool_call": true, "temperature": true, - "release_date": "2026-03-12", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-04-30", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { - "input": 2.5, - "output": 7.5, - "cache_read": 0.25, - "context_over_200k": { "input": 5, "output": 15, "cache_read": 0.25 } + "limit": { + "context": 1000000, + "output": 1000000 }, - "limit": { "context": 2000000, "output": 128000 } + "cost": { + "input": 1.25, + "output": 2.5, + "cache_read": 0.19999999999999998 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "xai/grok-4.20-non-reasoning": { + "id": "xai/grok-4.20-non-reasoning", + "name": "Grok 4.20 Non-Reasoning", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-05", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-09", + "last_updated": "2026-03-23", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 6, "output": 30, "cache_read": 0.6, "cache_write": 7.5 }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.19999999999999998 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", + "xai/grok-4.20-non-reasoning-beta": { + "id": "xai/grok-4.20-non-reasoning-beta", + "name": "Grok 4.20 Beta Non-Reasoning", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-17", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-11", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.6, "output": 18, "cache_read": 0.36, "cache_write": 4.5 }, - "limit": { "context": 1000000, "output": 64000 } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.19999999999999998 + } }, - "openai-gpt-54-pro": { - "id": "openai-gpt-54-pro", - "name": "GPT-5.4 Pro", - "family": "gpt-pro", + "xai/grok-4.20-reasoning": { + "id": "xai/grok-4.20-reasoning", + "name": "Grok 4.20 Reasoning", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-03-05", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-09", + "last_updated": "2026-03-23", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 37.5, "output": 225, "context_over_200k": { "input": 75, "output": 337.5 } }, - "limit": { "context": 1000000, "output": 128000 } + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.19999999999999998 + } }, - "kimi-k2-5": { - "id": "kimi-k2-5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": true, + "xai/grok-imagine-image": { + "id": "xai/grok-imagine-image", + "name": "Grok Imagine Image", + "family": "grok", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2026-01-28", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text"], + "output": ["text", "image"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } + }, + "xai/grok-4.20-multi-agent-beta": { + "id": "xai/grok-4.20-multi-agent-beta", + "name": "Grok 4.20 Multi Agent Beta", + "family": "grok", + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2024-04", - "release_date": "2026-01-27", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.56, "output": 3.5, "cache_read": 0.11 }, - "limit": { "context": 256000, "output": 65536 } + "release_date": "2026-03-11", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.19999999999999998 + } }, - "claude-opus-45": { - "id": "claude-opus-45", - "name": "Claude Opus 4.5", - "family": "claude-opus", - "attachment": true, + "xai/grok-imagine-image-pro": { + "id": "xai/grok-imagine-image-pro", + "name": "Grok Imagine Image Pro", + "family": "grok", + "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "release_date": "2026-01-28", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text"], + "output": ["text", "image"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + } + }, + "xai/grok-4-fast-reasoning": { + "id": "xai/grok-4-fast-reasoning", + "name": "Grok 4 Fast Reasoning", + "family": "grok", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-03", - "release_date": "2025-12-06", - "last_updated": "2026-01-28", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 6, "output": 30, "cache_read": 0.6, "cache_write": 7.5 }, - "limit": { "context": 198000, "output": 49500 } + "limit": { + "context": 2000000, + "output": 256000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "llama-3.2-3b": { - "id": "llama-3.2-3b", - "name": "Llama 3.2 3B", - "family": "llama", + "xai/grok-4.1-fast-non-reasoning": { + "id": "xai/grok-4.1-fast-non-reasoning", + "name": "Grok 4.1 Fast Non-Reasoning", + "family": "grok", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-10-03", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-10", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "qwen3-5-9b": { - "id": "qwen3-5-9b", - "name": "Qwen 3.5 9B", - "family": "qwen", + "xai/grok-4.20-reasoning-beta": { + "id": "xai/grok-4.20-reasoning-beta", + "name": "Grok 4.20 Beta Reasoning", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-03-05", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.15 }, - "limit": { "context": 256000, "output": 65536 } + "release_date": "2026-03-11", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.19999999999999998 + } }, - "minimax-m27": { - "id": "minimax-m27", - "name": "MiniMax M2.7", - "family": "minimax", + "xai/grok-4.20-multi-agent": { + "id": "xai/grok-4.20-multi-agent", + "name": "Grok 4.20 Multi-Agent", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.375, "output": 1.5, "cache_read": 0.075 }, - "limit": { "context": 198000, "output": 32768 } + "release_date": "2026-03-09", + "last_updated": "2026-03-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 2000000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.19999999999999998 + } }, - "venice-uncensored": { - "id": "venice-uncensored", - "name": "Venice Uncensored 1.1", - "family": "venice", + "xai/grok-4.1-fast-reasoning": { + "id": "xai/grok-4.1-fast-reasoning", + "name": "Grok 4.1 Fast Reasoning", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-03-18", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.9 }, - "limit": { "context": 32000, "output": 8192 } + "knowledge": "2024-10", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "openai-gpt-oss-120b": { - "id": "openai-gpt-oss-120b", - "name": "OpenAI GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, + "xai/grok-4-fast-non-reasoning": { + "id": "xai/grok-4-fast-non-reasoning", + "name": "Grok 4 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, "knowledge": "2025-07", - "release_date": "2025-11-06", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.07, "output": 0.3 }, - "limit": { "context": 128000, "output": 16384 } + "release_date": "2025-09-19", + "last_updated": "2025-09-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 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", - "attachment": true, - "reasoning": true, + "xai/grok-3": { + "id": "xai/grok-3", + "name": "Grok 3", + "family": "grok", + "attachment": false, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-12-19", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7, "output": 3.75, "cache_read": 0.07 }, - "limit": { "context": 256000, "output": 65536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "openai-gpt-52": { - "id": "openai-gpt-52", - "name": "GPT-5.2", - "family": "gpt", + "xai/grok-3-mini": { + "id": "xai/grok-3-mini", + "name": "Grok 3 Mini", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-08-31", - "release_date": "2025-12-13", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.19, "output": 17.5, "cache_read": 0.219 }, - "limit": { "context": 256000, "output": 65536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "reasoning": 0.5, + "cache_read": 0.075 + } }, - "gemini-3-1-pro-preview": { - "id": "gemini-3-1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", + "xai/grok-2-vision": { + "id": "xai/grok-2-vision", + "name": "Grok 2 Vision", + "family": "grok", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-19", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image", "audio", "video"], "output": ["text"] }, + "knowledge": "2024-08", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 10, + "cache_read": 2 + } + }, + "xai/grok-4": { + "id": "xai/grok-4", + "name": "Grok 4", + "family": "grok", + "attachment": false, + "reasoning": true, + "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 + }, "cost": { - "input": 2.5, + "input": 3, "output": 15, - "cache_read": 0.5, - "cache_write": 0.5, - "context_over_200k": { "input": 5, "output": 22.5, "cache_read": 0.5 } - }, - "limit": { "context": 1000000, "output": 32768 } + "reasoning": 15, + "cache_read": 0.75 + } }, - "qwen3-coder-480b-a35b-instruct": { - "id": "qwen3-coder-480b-a35b-instruct", - "name": "Qwen 3 Coder 480b", - "family": "qwen", + "xai/grok-code-fast-1": { + "id": "xai/grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-04-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.75, "output": 3 }, - "limit": { "context": 256000, "output": 65536 } + "knowledge": "2023-10", + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "zai-org-glm-4.6": { - "id": "zai-org-glm-4.6", - "name": "GLM 4.6", - "family": "glm", + "xai/grok-3-fast": { + "id": "xai/grok-3-fast", + "name": "Grok 3 Fast", + "family": "grok", "attachment": false, "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2024-04-01", - "last_updated": "2026-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.85, "output": 2.75, "cache_read": 0.3 }, - "limit": { "context": 198000, "output": 16384 } + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 1.25 + } }, - "qwen3-235b-a22b-thinking-2507": { - "id": "qwen3-235b-a22b-thinking-2507", - "name": "Qwen 3 235B A22B Thinking 2507", - "family": "qwen", + "xai/grok-3-mini-fast": { + "id": "xai/grok-3-mini-fast", + "name": "Grok 3 Mini Fast", + "family": "grok", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-04-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.45, "output": 3.5 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.6, + "output": 4, + "reasoning": 4, + "cache_read": 0.15 + } }, - "google-gemma-3-27b-it": { - "id": "google-gemma-3-27b-it", - "name": "Google Gemma 3 27B Instruct", - "family": "gemma", - "attachment": true, + "nvidia/nemotron-3-super-120b-a12b": { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "NVIDIA Nemotron 3 Super 120B A12B", + "family": "nemotron", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-11-04", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.12, "output": 0.2 }, - "limit": { "context": 198000, "output": 16384 } + "release_date": "2026-03-18", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.15, + "output": 0.65 + } }, - "qwen3-4b": { - "id": "qwen3-4b", - "name": "Venice Small", - "family": "qwen", + "nvidia/nemotron-3-nano-30b-a3b": { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "Nemotron 3 Nano 30B A3B", + "family": "nemotron", "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "knowledge": "2024-07", - "release_date": "2025-04-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.05, "output": 0.15 }, - "limit": { "context": 32000, "output": 4096 } - }, - "hermes-3-llama-3.1-405b": { - "id": "hermes-3-llama-3.1-405b", - "name": "Hermes 3 Llama 3.1 405b", - "family": "hermes", - "attachment": false, - "reasoning": false, "tool_call": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2025-09-25", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.1, "output": 3 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2024-12", + "last_updated": "2024-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.06, + "output": 0.24 + } }, - "claude-sonnet-45": { - "id": "claude-sonnet-45", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", + "nvidia/nemotron-nano-12b-v2-vl": { + "id": "nvidia/nemotron-nano-12b-v2-vl", + "name": "Nvidia Nemotron Nano 12B V2 VL", + "family": "nemotron", "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-01-15", - "last_updated": "2026-01-28", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-12", + "last_updated": "2024-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.75, "output": 18.75, "cache_read": 0.375, "cache_write": 4.69 }, - "limit": { "context": 198000, "output": 49500 } + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "llama-3.3-70b": { - "id": "llama-3.3-70b", - "name": "Llama 3.3 70B", - "family": "llama", + "nvidia/nemotron-nano-9b-v2": { + "id": "nvidia/nemotron-nano-9b-v2", + "name": "Nvidia Nemotron Nano 9B V2", + "family": "nemotron", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2025-04-06", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.7, "output": 2.8 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-10", + "release_date": "2025-08-18", + "last_updated": "2025-08-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.04, + "output": 0.16 + } }, - "mistral-31-24b": { - "id": "mistral-31-24b", - "name": "Venice Medium", - "family": "mistral", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": true, + "inception/mercury-edit-2": { + "id": "inception/mercury-edit-2", + "name": "Mercury Edit 2", + "attachment": false, + "reasoning": true, + "tool_call": false, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-03-18", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 128000, "output": 4096 } + "release_date": "2026-03-30", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.025 + } }, - "zai-org-glm-5": { - "id": "zai-org-glm-5", - "name": "GLM 5", - "family": "glm", + "inception/mercury-2": { + "id": "inception/mercury-2", + "name": "Mercury 2", + "family": "mercury", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 198000, "output": 32000 } + "release_date": "2026-02-24", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 0.75, + "cache_read": 0.024999999999999998 + } }, - "minimax-m25": { - "id": "minimax-m25", - "name": "MiniMax M2.5", - "family": "minimax", + "inception/mercury-coder-small": { + "id": "inception/mercury-coder-small", + "name": "Mercury Coder Small Beta", + "family": "mercury", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.34, "output": 1.19, "cache_read": 0.04 }, - "limit": { "context": 198000, "output": 32768 } + "release_date": "2025-02-26", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 32000, + "output": 16384 + }, + "cost": { + "input": 0.25, + "output": 1 + } }, - "openai-gpt-54": { - "id": "openai-gpt-54", - "name": "GPT-5.4", + "openai/gpt-5.1-codex-max": { + "id": "openai/gpt-5.1-codex-max", + "name": "GPT 5.1 Codex Max", "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-03-05", - "last_updated": "2026-03-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.13, "output": 18.8, "cache_read": 0.313 }, - "limit": { "context": 1000000, "output": 131072 } - }, - "nvidia-nemotron-3-nano-30b-a3b": { - "id": "nvidia-nemotron-3-nano-30b-a3b", - "name": "NVIDIA Nemotron 3 Nano 30B", - "family": "nemotron", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "deepseek-v3.2": { - "id": "deepseek-v3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", - "attachment": false, + "openai/gpt-5.2-chat": { + "id": "openai/gpt-5.2-chat", + "name": "GPT-5.2 Chat", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-10", - "release_date": "2025-12-04", - "last_updated": "2026-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.33, "output": 0.48, "cache_read": 0.16 }, - "limit": { "context": 160000, "output": 32768 } + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 111616, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.18 + } }, - "venice-uncensored-role-play": { - "id": "venice-uncensored-role-play", - "name": "Venice Role Play Uncensored", - "family": "venice", - "attachment": true, + "openai/gpt-4o-mini-search-preview": { + "id": "openai/gpt-4o-mini-search-preview", + "name": "GPT 4o Mini Search Preview", + "family": "gpt-mini", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, + "tool_call": false, + "structured_output": false, "temperature": true, - "release_date": "2026-02-20", - "last_updated": "2026-03-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2023-09", + "release_date": "2025-01", + "last_updated": "2025-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "input": 111616, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "qwen3-vl-235b-a22b": { - "id": "qwen3-vl-235b-a22b", - "name": "Qwen3 VL 235B", - "family": "qwen", + "openai/codex-mini": { + "id": "openai/codex-mini", + "name": "Codex Mini", + "family": "gpt-codex-mini", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01-16", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.25, "output": 1.5 }, - "limit": { "context": 256000, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2025-05-16", + "last_updated": "2025-05-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 100000, + "output": 100000 + }, + "cost": { + "input": 1.5, + "output": 6, + "cache_read": 0.38 + } }, - "grok-41-fast": { - "id": "grok-41-fast", - "name": "Grok 4.1 Fast", - "family": "grok", + "openai/gpt-5-chat": { + "id": "openai/gpt-5-chat", + "name": "GPT-5 Chat", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-12-01", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.625, "cache_read": 0.0625 }, - "limit": { "context": 1000000, "output": 30000 } + "limit": { + "context": 128000, + "input": 111616, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "openai-gpt-4o-mini-2024-07-18": { - "id": "openai-gpt-4o-mini-2024-07-18", - "name": "GPT-4o Mini", - "family": "gpt-mini", + "openai/gpt-5.3-chat": { + "id": "openai/gpt-5.3-chat", + "name": "GPT-5.3 Chat", + "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-02-28", + "release_date": "2026-03-03", "last_updated": "2026-03-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1875, "output": 0.75, "cache_read": 0.09375 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "input": 111616, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "zai-org-glm-4.7-flash": { - "id": "zai-org-glm-4.7-flash", - "name": "GLM 4.7 Flash", - "family": "glm-flash", - "attachment": false, + "openai/gpt-5.2-pro": { + "id": "openai/gpt-5.2-pro", + "name": "GPT 5.2 ", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01-29", - "last_updated": "2026-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.125, "output": 0.5 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-10", + "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": 21, + "output": 168 + } }, - "mistral-small-3-2-24b-instruct": { - "id": "mistral-small-3-2-24b-instruct", - "name": "Mistral Small 3.2 24B Instruct", - "family": "mistral-small", + "openai/text-embedding-3-large": { + "id": "openai/text-embedding-3-large", + "name": "text-embedding-3-large", + "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, + "input": 6656, + "output": 1536 + }, + "cost": { + "input": 0.13, + "output": 0 + } + }, + "openai/gpt-5.5": { + "id": "openai/gpt-5.5", + "name": "GPT 5.5", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2026-01-15", - "last_updated": "2026-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.09375, "output": 0.25 }, - "limit": { "context": 256000, "output": 16384 } + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "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 + } }, - "openai-gpt-52-codex": { - "id": "openai-gpt-52-codex", - "name": "GPT-5.2 Codex", - "family": "gpt-codex", + "openai/gpt-5.3-codex": { + "id": "openai/gpt-5.3-codex", + "name": "GPT 5.3 Codex", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2025-01-15", - "last_updated": "2026-03-12", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-02-24", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.19, "output": 17.5, "cache_read": 0.219 }, - "limit": { "context": 256000, "output": 65536 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "minimax-m21": { - "id": "minimax-m21", - "name": "MiniMax M2.1", - "family": "minimax", + "openai/text-embedding-ada-002": { + "id": "openai/text-embedding-ada-002", + "name": "text-embedding-ada-002", + "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, + "input": 6656, + "output": 1536 + }, + "cost": { + "input": 0.1, + "output": 0 + } + }, + "openai/gpt-5.2": { + "id": "openai/gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2025-12-01", - "last_updated": "2026-03-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.35, "output": 1.5, "cache_read": 0.04 }, - "limit": { "context": 198000, "output": 32768 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, + "knowledge": "2024-10", + "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.75, + "output": 14, + "cache_read": 0.18 + } + }, + "openai/o3-pro": { + "id": "openai/o3-pro", + "name": "o3 Pro", + "family": "o-pro", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 131072, "output": 32768 } + "temperature": false, + "knowledge": "2024-10", + "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": 20, + "output": 80 + } }, - "zai-org/GLM-4.5-Air": { - "id": "zai-org/GLM-4.5-Air", - "name": "GLM 4.5 Air", - "family": "glm-air", - "attachment": false, - "reasoning": false, + "openai/gpt-5.4-mini": { + "id": "openai/gpt-5.4-mini", + "name": "GPT 5.4 Mini", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.5 }, - "limit": { "context": 131072, "output": 131072 } + "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 + } }, - "zai-org/GLM-4.5-FP8": { - "id": "zai-org/GLM-4.5-FP8", - "name": "GLM 4.5 FP8", - "family": "glm", - "attachment": false, + "openai/gpt-5.4-nano": { + "id": "openai/gpt-5.4-nano", + "name": "GPT 5.4 Nano", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 131072, "output": 131072 } + "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.19999999999999998, + "output": 1.25, + "cache_read": 0.02 + } }, - "deepseek-ai/DeepSeek-V3.1": { - "id": "deepseek-ai/DeepSeek-V3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", - "attachment": false, + "openai/gpt-5.2-codex": { + "id": "openai/gpt-5.2-codex", + "name": "GPT-5.2-Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-12", + "last_updated": "2025-12", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 75000, "output": 163840 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "deepseek-ai/DeepSeek-V3-0324": { - "id": "deepseek-ai/DeepSeek-V3-0324", - "name": "DeepSeek V3 0324", - "family": "deepseek", - "attachment": false, - "reasoning": false, + "openai/gpt-5.1-codex-mini": { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex mini", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-05-16", + "last_updated": "2025-05-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 75000, "output": 163840 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.03 + } }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek R1 0528", - "family": "deepseek-thinking", - "attachment": false, + "openai/gpt-5.1-thinking": { + "id": "openai/gpt-5.1-thinking", + "name": "GPT 5.1 Thinking", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2.15 }, - "limit": { "context": 75000, "output": 163840 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen3 235B A22B Thinking 2507", - "family": "qwen", - "attachment": false, + "openai/gpt-5.4-pro": { + "id": "openai/gpt-5.4-pro", + "name": "GPT 5.4 Pro", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262144, "output": 131072 } + "release_date": "2026-03-05", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct 2507", - "family": "qwen", + "openai/gpt-3.5-turbo": { + "id": "openai/gpt-3.5-turbo", + "name": "GPT-3.5 Turbo", + "family": "gpt", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.3 }, - "limit": { "context": 262144, "output": 131072 } + "knowledge": "2021-09", + "release_date": "2023-03-01", + "last_updated": "2023-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 16385, + "input": 12289, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "openai/o3-deep-research": { + "id": "openai/o3-deep-research", + "name": "o3-deep-research", + "family": "o", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2024-10", + "release_date": "2024-06-26", + "last_updated": "2024-06-26", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "input": 100000, + "output": 100000 + }, + "cost": { + "input": 10, + "output": 40, + "cache_read": 2.5 + } + }, + "openai/text-embedding-3-small": { + "id": "openai/text-embedding-3-small", + "name": "text-embedding-3-small", + "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, + "input": 6656, + "output": 1536 + }, + "cost": { + "input": 0.02, + "output": 0 + } + }, + "openai/gpt-5.4": { + "id": "openai/gpt-5.4", + "name": "GPT 5.4", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-23", - "last_updated": "2025-08-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-05", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "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": { - "Kimi-K2.5": { - "id": "Kimi-K2.5", - "name": "Kimi K2 Instruct", - "family": "kimi", + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + } + }, + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2024-10", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.75 }, - "limit": { "context": 261000, "output": 32768 } + "limit": { + "context": 131072, + "input": 98304, + "output": 32768 + }, + "cost": { + "input": 0.07, + "output": 0.3 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", - "name": "MiniMax M2.5", - "family": "minimax", - "attachment": false, - "reasoning": false, + "openai/gpt-5-pro": { + "id": "openai/gpt-5-pro", + "name": "GPT-5 pro", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2024-10", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 196000, "output": 4096 } + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 128000, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "GLM-5-FP8": { - "id": "GLM-5-FP8", - "name": "GLM 5 FP8", - "family": "glm", + "openai/gpt-oss-safeguard-20b": { + "id": "openai/gpt-oss-safeguard-20b", + "name": "gpt-oss-safeguard-20b", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2024-10", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.85, "output": 3.1 }, - "limit": { "context": 202000, "output": 131072 } + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "input": 65536, + "output": 65536 + }, + "cost": { + "input": 0.08, + "output": 0.3, + "cache_read": 0.04 + } }, - "DeepSeek-V3.2": { - "id": "DeepSeek-V3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2024-10", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 1.65 }, - "limit": { "context": 163000, "output": 4096 } - } - } - }, - "github-models": { - "id": "github-models", - "env": ["GITHUB_TOKEN"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://models.github.ai/inference", - "name": "GitHub Models", - "doc": "https://docs.github.com/en/github-models", - "models": { - "mistral-ai/codestral-2501": { - "id": "mistral-ai/codestral-2501", - "name": "Codestral 25.01", - "family": "codestral", - "attachment": false, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.1, + "output": 0.5 + } + }, + "openai/gpt-5.5-pro": { + "id": "openai/gpt-5.5-pro", + "name": "GPT 5.5 Pro", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 32000, "output": 8192 } + "limit": { + "context": 1000000, + "input": 872000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180 + } }, - "mistral-ai/mistral-large-2411": { - "id": "mistral-ai/mistral-large-2411", - "name": "Mistral Large 24.11", - "family": "mistral-large", + "openai/gpt-3.5-turbo-instruct": { + "id": "openai/gpt-3.5-turbo-instruct", + "name": "GPT-3.5 Turbo Instruct", + "family": "gpt", "attachment": false, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2021-09", + "release_date": "2023-03-01", + "last_updated": "2023-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "input": 4096, + "output": 4096 + }, + "cost": { + "input": 1.5, + "output": 2 + } + }, + "openai/gpt-5.1-instant": { + "id": "openai/gpt-5.1-instant", + "name": "GPT-5.1 Instant", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "input": 111616, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "mistral-ai/mistral-small-2503": { - "id": "mistral-ai/mistral-small-2503", - "name": "Mistral Small 3.1", - "family": "mistral-small", - "attachment": false, + "openai/gpt-5.1-codex": { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "family": "gpt", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "mistral-ai/mistral-medium-2505": { - "id": "mistral-ai/mistral-medium-2505", - "name": "Mistral Medium 3 (25.05)", - "family": "mistral-medium", - "attachment": false, - "reasoning": true, + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "GPT-4.1 mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-09", - "release_date": "2025-05-01", - "last_updated": "2025-05-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "mistral-ai/ministral-3b": { - "id": "mistral-ai/ministral-3b", - "name": "Ministral 3B", - "family": "ministral", - "attachment": false, - "reasoning": true, + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "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 + } }, - "mistral-ai/mistral-nemo": { - "id": "mistral-ai/mistral-nemo", - "name": "Mistral Nemo", - "family": "mistral-nemo", - "attachment": false, + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT-5", + "family": "gpt", + "attachment": true, "reasoning": true, "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 + } + }, + "openai/gpt-4o": { + "id": "openai/gpt-4o", + "name": "GPT-4o", + "family": "gpt", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "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 + } }, - "ai21-labs/ai21-jamba-1.5-mini": { - "id": "ai21-labs/ai21-jamba-1.5-mini", - "name": "AI21 Jamba 1.5 Mini", - "family": "jamba", - "attachment": false, + "openai/o3": { + "id": "openai/o3", + "name": "o3", + "family": "o", + "attachment": true, "reasoning": true, "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 + } + }, + "openai/gpt-4.1-nano": { + "id": "openai/gpt-4.1-nano", + "name": "GPT-4.1 nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-08-29", - "last_updated": "2024-08-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 4096 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.03 + } }, - "ai21-labs/ai21-jamba-1.5-large": { - "id": "ai21-labs/ai21-jamba-1.5-large", - "name": "AI21 Jamba 1.5 Large", - "family": "jamba", + "openai/gpt-5-codex": { + "id": "openai/gpt-5-codex", + "name": "GPT-5-Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-08-29", - "last_updated": "2024-08-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 256000, "output": 4096 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, "openai/o3-mini": { "id": "openai/o3-mini", - "name": "OpenAI o3-mini", + "name": "o3-mini", "family": "o-mini", "attachment": false, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2024-04", - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-05", + "release_date": "2024-12-20", + "last_updated": "2025-01-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "openai/gpt-4o": { - "id": "openai/gpt-4o", - "name": "GPT-4o", - "family": "gpt", + "openai/o1": { + "id": "openai/o1", + "name": "o1", + "family": "o", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "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 + } + }, + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "o4-mini", + "family": "o-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.28 + } }, "openai/gpt-4o-mini": { "id": "openai/gpt-4o-mini", @@ -52847,12332 +95857,21442 @@ "attachment": true, "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-10", + "knowledge": "2023-09", "release_date": "2024-07-18", "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT-4.1", + "openai/gpt-4-turbo": { + "id": "openai/gpt-4-turbo", + "name": "GPT-4 Turbo", "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"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "openai/o1": { - "id": "openai/o1", - "name": "OpenAI o1", - "family": "o", - "attachment": false, + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": false, - "knowledge": "2023-10", - "release_date": "2024-09-12", - "last_updated": "2024-12-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-05-30", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "openai/o3": { - "id": "openai/o3", - "name": "OpenAI o3", - "family": "o", - "attachment": false, + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, "reasoning": true, + "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 + } + }, + "amazon/titan-embed-text-v2": { + "id": "amazon/titan-embed-text-v2", + "name": "Titan Text Embeddings V2", + "family": "titan-embed", + "attachment": false, + "reasoning": false, "tool_call": false, "temperature": false, - "knowledge": "2024-04", - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-04", + "last_updated": "2024-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.02, + "output": 0 + } + }, + "amazon/nova-2-lite": { + "id": "amazon/nova-2-lite", + "name": "Nova 2 Lite", + "family": "nova", + "attachment": true, + "reasoning": true, + "tool_call": false, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-12-01", + "last_updated": "2024-12-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 1000000, + "output": 1000000 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "GPT-4.1-mini", - "family": "gpt-mini", + "amazon/nova-pro": { + "id": "amazon/nova-pro", + "name": "Nova Pro", + "family": "nova-pro", "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"] }, + "knowledge": "2024-10", + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 300000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 3.2, + "cache_read": 0.2 + } }, - "openai/gpt-4.1-nano": { - "id": "openai/gpt-4.1-nano", - "name": "GPT-4.1-nano", - "family": "gpt-nano", + "amazon/nova-lite": { + "id": "amazon/nova-lite", + "name": "Nova Lite", + "family": "nova-lite", "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"] }, + "knowledge": "2024-10", + "release_date": "2024-12-03", + "last_updated": "2024-12-03", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 300000, + "output": 8192 + }, + "cost": { + "input": 0.06, + "output": 0.24, + "cache_read": 0.015 + } }, - "openai/o1-preview": { - "id": "openai/o1-preview", - "name": "OpenAI o1-preview", - "family": "o", + "amazon/nova-micro": { + "id": "amazon/nova-micro", + "name": "Nova Micro", + "family": "nova-micro", "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": false, - "knowledge": "2023-10", - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.035, + "output": 0.14, + "cache_read": 0.00875 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "OpenAI o4-mini", - "family": "o-mini", + "mistral/mistral-nemo": { + "id": "mistral/mistral-nemo", + "name": "Mistral Nemo", + "family": "mistral-nemo", "attachment": false, - "reasoning": true, - "tool_call": false, - "temperature": false, + "reasoning": false, + "tool_call": true, + "temperature": true, "knowledge": "2024-04", - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 60288, + "output": 16000 + }, + "cost": { + "input": 0.04, + "output": 0.17 + } }, - "openai/o1-mini": { - "id": "openai/o1-mini", - "name": "OpenAI o1-mini", - "family": "o-mini", + "mistral/ministral-14b": { + "id": "mistral/ministral-14b", + "name": "Ministral 14B", + "family": "ministral", + "attachment": true, + "reasoning": false, + "tool_call": false, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.2, + "output": 0.2 + } + }, + "mistral/codestral-embed": { + "id": "mistral/codestral-embed", + "name": "Codestral Embed", + "family": "codestral-embed", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, "temperature": false, - "knowledge": "2023-10", - "release_date": "2024-09-12", - "last_updated": "2024-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 65536 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.15, + "output": 0 + } }, - "microsoft/phi-3-mini-128k-instruct": { - "id": "microsoft/phi-3-mini-128k-instruct", - "name": "Phi-3-mini instruct (128k)", - "family": "phi", - "attachment": false, - "reasoning": true, + "mistral/mistral-medium": { + "id": "mistral/mistral-medium", + "name": "Mistral Medium 3.1", + "family": "mistral-medium", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-10", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "microsoft/phi-3-small-8k-instruct": { - "id": "microsoft/phi-3-small-8k-instruct", - "name": "Phi-3-small instruct (8k)", - "family": "phi", + "mistral/mistral-embed": { + "id": "mistral/mistral-embed", + "name": "Mistral Embed", + "family": "mistral-embed", "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2048 } + "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": 8192, + "output": 1536 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "microsoft/phi-4-reasoning": { - "id": "microsoft/phi-4-reasoning", - "name": "Phi-4-Reasoning", - "family": "phi", + "mistral/devstral-2": { + "id": "mistral/devstral-2", + "name": "Devstral 2", + "family": "devstral", "attachment": false, - "reasoning": true, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-10", + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + } }, - "microsoft/phi-4-mini-reasoning": { - "id": "microsoft/phi-4-mini-reasoning", - "name": "Phi-4-mini-reasoning", - "family": "phi", - "attachment": false, - "reasoning": true, - "tool_call": true, + "mistral/mistral-large-3": { + "id": "mistral/mistral-large-3", + "name": "Mistral Large 3", + "family": "mistral-large", + "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"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "knowledge": "2024-10", + "release_date": "2025-12-02", + "last_updated": "2025-12-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "microsoft/phi-3-mini-4k-instruct": { - "id": "microsoft/phi-3-mini-4k-instruct", - "name": "Phi-3-mini instruct (4k)", - "family": "phi", + "mistral/devstral-small-2": { + "id": "mistral/devstral-small-2", + "name": "Devstral Small 2", + "family": "devstral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4096, "output": 1024 } + "knowledge": "2024-10", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + } }, - "microsoft/phi-3-medium-4k-instruct": { - "id": "microsoft/phi-3-medium-4k-instruct", - "name": "Phi-3-medium instruct (4k)", - "family": "phi", + "mistral/devstral-small": { + "id": "mistral/devstral-small", + "name": "Devstral Small 1.1", + "family": "devstral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 4096, "output": 1024 } + "knowledge": "2024-10", + "release_date": "2025-05-07", + "last_updated": "2025-05-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 64000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "microsoft/phi-3.5-vision-instruct": { - "id": "microsoft/phi-3.5-vision-instruct", - "name": "Phi-3.5-vision instruct (128k)", - "family": "phi", + "mistral/ministral-8b": { + "id": "mistral/ministral-8b", + "name": "Ministral 8B (latest)", + "family": "ministral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } - }, - "microsoft/mai-ds-r1": { - "id": "microsoft/mai-ds-r1", - "name": "MAI-DS-R1", - "family": "mai", - "attachment": false, - "reasoning": true, - "tool_call": true, - "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 65536, "output": 8192 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "microsoft/phi-3.5-mini-instruct": { - "id": "microsoft/phi-3.5-mini-instruct", - "name": "Phi-3.5-mini instruct (128k)", - "family": "phi", + "mistral/magistral-medium": { + "id": "mistral/magistral-medium", + "name": "Magistral Medium (latest)", + "family": "magistral-medium", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-03-17", + "last_updated": "2025-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2, + "output": 5 + } }, - "microsoft/phi-4": { - "id": "microsoft/phi-4", - "name": "Phi-4", - "family": "phi", - "attachment": false, + "mistral/mistral-small": { + "id": "mistral/mistral-small", + "name": "Mistral Small (latest)", + "family": "mistral-small", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2026-03-16", + "last_updated": "2026-03-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 16000, "output": 4096 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "microsoft/phi-3-medium-128k-instruct": { - "id": "microsoft/phi-3-medium-128k-instruct", - "name": "Phi-3-medium instruct (128k)", - "family": "phi", + "mistral/magistral-small": { + "id": "mistral/magistral-small", + "name": "Magistral Small", + "family": "magistral-small", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-03-17", + "last_updated": "2025-03-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "microsoft/phi-3.5-moe-instruct": { - "id": "microsoft/phi-3.5-moe-instruct", - "name": "Phi-3.5-MoE instruct (128k)", - "family": "phi", - "attachment": false, - "reasoning": true, + "mistral/pixtral-12b": { + "id": "mistral/pixtral-12b", + "name": "Pixtral 12B", + "family": "pixtral", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-08-20", - "last_updated": "2024-08-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2024-09-01", + "last_updated": "2024-09-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "microsoft/phi-4-multimodal-instruct": { - "id": "microsoft/phi-4-multimodal-instruct", - "name": "Phi-4-multimodal-instruct", - "family": "phi", + "mistral/mixtral-8x22b-instruct": { + "id": "mistral/mixtral-8x22b-instruct", + "name": "Mixtral 8x22B", + "family": "mixtral", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-04-17", + "last_updated": "2024-04-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 64000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "microsoft/phi-3-small-128k-instruct": { - "id": "microsoft/phi-3-small-128k-instruct", - "name": "Phi-3-small instruct (128k)", - "family": "phi", - "attachment": false, - "reasoning": true, + "mistral/pixtral-large": { + "id": "mistral/pixtral-large", + "name": "Pixtral Large (latest)", + "family": "pixtral", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2024-04-23", - "last_updated": "2024-04-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-11", + "release_date": "2024-11-01", + "last_updated": "2024-11-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "microsoft/phi-4-mini-instruct": { - "id": "microsoft/phi-4-mini-instruct", - "name": "Phi-4-mini-instruct", - "family": "phi", + "mistral/ministral-3b": { + "id": "mistral/ministral-3b", + "name": "Ministral 3B (latest)", + "family": "ministral", "attachment": false, - "reasoning": true, + "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"] }, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "cohere/cohere-command-r-plus-08-2024": { - "id": "cohere/cohere-command-r-plus-08-2024", - "name": "Cohere Command R+ 08-2024", - "family": "command-r", + "mistral/codestral": { + "id": "mistral/codestral", + "name": "Codestral (latest)", + "family": "codestral", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-08-01", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "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 + } }, - "cohere/cohere-command-r": { - "id": "cohere/cohere-command-r", - "name": "Cohere Command R", - "family": "command-r", + "meta/llama-3.2-1b": { + "id": "meta/llama-3.2-1b", + "name": "Llama 3.2 1B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-03-11", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "cohere/cohere-command-r-08-2024": { - "id": "cohere/cohere-command-r-08-2024", - "name": "Cohere Command R 08-2024", - "family": "command-r", + "meta/llama-3.1-8b": { + "id": "meta/llama-3.1-8b", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-08-01", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.03, + "output": 0.05 + } }, - "cohere/cohere-command-r-plus": { - "id": "cohere/cohere-command-r-plus", - "name": "Cohere Command R+", - "family": "command-r", - "attachment": false, + "meta/llama-3.2-90b": { + "id": "meta/llama-3.2-90b", + "name": "Llama 3.2 90B Vision Instruct", + "family": "llama", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-04-04", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.72, + "output": 0.72 + } }, - "cohere/cohere-command-a": { - "id": "cohere/cohere-command-a", - "name": "Cohere Command A", - "family": "command-a", + "meta/llama-3.2-3b": { + "id": "meta/llama-3.2-3b", + "name": "Llama 3.2 3B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, - "tool_call": true, + "reasoning": false, + "tool_call": false, "temperature": true, - "knowledge": "2024-03", - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "deepseek/deepseek-v3-0324": { - "id": "deepseek/deepseek-v3-0324", - "name": "DeepSeek-V3-0324", - "family": "deepseek", - "attachment": false, - "reasoning": true, + "meta/llama-3.2-11b": { + "id": "meta/llama-3.2-11b", + "name": "Llama 3.2 11B Vision Instruct", + "family": "llama", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2023-12", + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.16, + "output": 0.16 + } }, - "deepseek/deepseek-r1": { - "id": "deepseek/deepseek-r1", - "name": "DeepSeek-R1", - "family": "deepseek-thinking", + "meta/llama-3.1-70b": { + "id": "meta/llama-3.1-70b", + "name": "Llama 3.1 70B Instruct", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 65536, "output": 8192 } + "knowledge": "2023-12", + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 0.4 + } }, - "deepseek/deepseek-r1-0528": { - "id": "deepseek/deepseek-r1-0528", - "name": "DeepSeek-R1-0528", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": true, + "meta/llama-3.3-70b": { + "id": "meta/llama-3.3-70b", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-06", - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-12", + "release_date": "2024-12-06", + "last_updated": "2024-12-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 65536, "output": 8192 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "xai/grok-3-mini": { - "id": "xai/grok-3-mini", - "name": "Grok 3 Mini", - "family": "grok", - "attachment": false, - "reasoning": true, + "meta/llama-4-maverick": { + "id": "meta/llama-4-maverick", + "name": "Llama-4-Maverick-17B-128E-Instruct-FP8", + "family": "llama", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-09", - "last_updated": "2024-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "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": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "xai/grok-3": { - "id": "xai/grok-3", - "name": "Grok 3", - "family": "grok", - "attachment": false, - "reasoning": true, + "meta/llama-4-scout": { + "id": "meta/llama-4-scout", + "name": "Llama-4-Scout-17B-16E-Instruct-FP8", + "family": "llama", + "attachment": true, + "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-12-09", - "last_updated": "2024-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "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": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "core42/jais-30b-chat": { - "id": "core42/jais-30b-chat", - "name": "JAIS 30b Chat", - "family": "jais", - "attachment": false, + "vercel/v0-1.5-md": { + "id": "vercel/v0-1.5-md", + "name": "v0-1.5-md", + "family": "v0", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-03", - "release_date": "2023-08-30", - "last_updated": "2023-08-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2048 } + "release_date": "2025-06-09", + "last_updated": "2025-06-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "meta/meta-llama-3.1-8b-instruct": { - "id": "meta/meta-llama-3.1-8b-instruct", - "name": "Meta-Llama-3.1-8B-Instruct", - "family": "llama", - "attachment": false, + "vercel/v0-1.0-md": { + "id": "vercel/v0-1.0-md", + "name": "v0-1.0-md", + "family": "v0", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 32000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "meta/llama-3.3-70b-instruct": { - "id": "meta/llama-3.3-70b-instruct", - "name": "Llama-3.3-70B-Instruct", - "family": "llama", - "attachment": false, + "minimax/minimax-m2.7": { + "id": "minimax/minimax-m2.7", + "name": "Minimax M2.7", + "family": "minimax", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 204800, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06, + "cache_write": 0.375 + } }, - "meta/llama-4-scout-17b-16e-instruct": { - "id": "meta/llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17B 16E Instruct", - "family": "llama", - "attachment": false, + "minimax/minimax-m2.7-highspeed": { + "id": "minimax/minimax-m2.7-highspeed", + "name": "MiniMax M2.7 High Speed", + "family": "minimax", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 204800, + "output": 131100 + }, + "cost": { + "input": 0.6, + "output": 2.4, + "cache_read": 0.06, + "cache_write": 0.375 + } }, - "meta/llama-3.2-11b-vision-instruct": { - "id": "meta/llama-3.2-11b-vision-instruct", - "name": "Llama-3.2-11B-Vision-Instruct", - "family": "llama", + "minimax/minimax-m2": { + "id": "minimax/minimax-m2", + "name": "MiniMax M2", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-25", - "last_updated": "2024-09-25", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 262114, + "output": 262114 + }, + "cost": { + "input": 0.27, + "output": 1.15, + "cache_read": 0.03, + "cache_write": 0.38 + } }, - "meta/meta-llama-3-70b-instruct": { - "id": "meta/meta-llama-3-70b-instruct", - "name": "Meta-Llama-3-70B-Instruct", - "family": "llama", + "minimax/minimax-m2.1": { + "id": "minimax/minimax-m2.1", + "name": "MiniMax M2.1", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2048 } + "knowledge": "2024-10", + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03, + "cache_write": 0.38 + } }, - "meta/meta-llama-3-8b-instruct": { - "id": "meta/meta-llama-3-8b-instruct", - "name": "Meta-Llama-3-8B-Instruct", - "family": "llama", + "minimax/minimax-m2.1-lightning": { + "id": "minimax/minimax-m2.1-lightning", + "name": "MiniMax M2.1 Lightning", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-04-18", - "last_updated": "2024-04-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 8192, "output": 2048 } + "knowledge": "2024-10", + "release_date": "2025-10-27", + "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.38 + } }, - "meta/llama-3.2-90b-vision-instruct": { - "id": "meta/llama-3.2-90b-vision-instruct", - "name": "Llama-3.2-90B-Vision-Instruct", - "family": "llama", + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2024-09-25", - "last_updated": "2024-09-25", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2026-02-12", + "last_updated": "2026-02-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 204800, + "output": 131000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.03, + "cache_write": 0.375 + } }, - "meta/meta-llama-3.1-405b-instruct": { - "id": "meta/meta-llama-3.1-405b-instruct", - "name": "Meta-Llama-3.1-405B-Instruct", - "family": "llama", + "minimax/minimax-m2.5-highspeed": { + "id": "minimax/minimax-m2.5-highspeed", + "name": "MiniMax M2.5 High Speed", + "family": "minimax", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "release_date": "2026-02-12", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 0, + "output": 0 + }, + "cost": { + "input": 0.6, + "output": 2.4, + "cache_read": 0.03, + "cache_write": 0.375 + } }, - "meta/llama-4-maverick-17b-128e-instruct-fp8": { - "id": "meta/llama-4-maverick-17b-128e-instruct-fp8", - "name": "Llama 4 Maverick 17B 128E Instruct FP8", - "family": "llama", + "kwaipilot/kat-coder-pro-v1": { + "id": "kwaipilot/kat-coder-pro-v1", + "name": "KAT-Coder-Pro V1", + "family": "kat-coder", "attachment": false, "reasoning": true, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-12", - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2024-10", + "release_date": "2025-10-24", + "last_updated": "2025-10-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 32000 + } }, - "meta/meta-llama-3.1-70b-instruct": { - "id": "meta/meta-llama-3.1-70b-instruct", - "name": "Meta-Llama-3.1-70B-Instruct", - "family": "llama", + "kwaipilot/kat-coder-pro-v2": { + "id": "kwaipilot/kat-coder-pro-v2", + "name": "Kat Coder Pro V2", + "family": "kat-coder", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } - } - } - }, - "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": { - "claude-opus-4-thinking": { - "id": "claude-opus-4-thinking", - "name": "Claude 4 Opus Thinking", + "release_date": "2026-03-27", + "last_updated": "2026-03-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } + }, + "google/gemini-2.5-flash-lite-preview-09-2025": { + "id": "google/gemini-2.5-flash-lite-preview-09-2025", + "name": "Gemini 2.5 Flash Lite Preview 09-25", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-07-15", - "last_updated": "2025-07-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.01 + } }, - "qwen3-coder-30b-a3b-instruct": { - "id": "qwen3-coder-30b-a3b-instruct", - "name": "Qwen3 Coder 30B A3B Instruct", - "attachment": false, - "reasoning": false, + "google/gemini-3.1-flash-lite-preview": { + "id": "google/gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-03-03", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 1000000, + "output": 65000 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "cache_write": 1 + } }, - "brave-research": { - "id": "brave-research", - "name": "Brave (Research)", + "google/gemini-3-pro-image": { + "id": "google/gemini-3-pro-image", + "name": "Nano Banana Pro (Gemini 3 Pro Image)", + "family": "gemini-pro", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2023-03-02", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-03", + "release_date": "2025-09", + "last_updated": "2025-09", + "modalities": { + "input": ["text"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 5, "output": 5 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 65536, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 120 + } }, - "jamba-large-1.7": { - "id": "jamba-large-1.7", - "name": "Jamba Large 1.7", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "google/gemini-3.1-pro-preview": { + "id": "google/gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-02-19", + "last_updated": "2026-02-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.989, "output": 7.99 }, - "limit": { "context": 256000, "input": 256000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2 + } }, - "gemini-2.5-flash-lite": { - "id": "gemini-2.5-flash-lite", - "name": "Gemini 2.5 Flash Lite", + "google/gemini-3-pro-preview": { + "id": "google/gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", "attachment": true, "reasoning": true, + "tool_call": 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": 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": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + } + } + }, + "google/imagen-4.0-ultra-generate-001": { + "id": "google/imagen-4.0-ultra-generate-001", + "name": "Imagen 4 Ultra", + "family": "imagen", + "attachment": false, + "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-24", + "last_updated": "2025-05-24", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 480, + "output": 0 + } }, - "azure-o3-mini": { - "id": "azure-o3-mini", - "name": "Azure o3-mini", + "google/gemini-embedding-001": { + "id": "google/gemini-embedding-001", + "name": "Gemini Embedding 001", + "family": "gemini-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.088, "output": 4.3996 }, - "limit": { "context": 200000, "input": 200000, "output": 65536 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.15, + "output": 0 + } }, - "claude-sonnet-4-thinking:8192": { - "id": "claude-sonnet-4-thinking:8192", - "name": "Claude 4 Sonnet Thinking (8K)", + "google/gemma-4-31b-it": { + "id": "google/gemma-4-31b-it", + "name": "Gemma 4 31B IT", + "family": "gemma", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-04-02", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.14, + "output": 0.39999999999999997 + } }, - "ernie-x1-32k": { - "id": "ernie-x1-32k", - "name": "Ernie X1 32k", - "attachment": true, + "google/gemini-2.5-flash-image": { + "id": "google/gemini-2.5-flash-image", + "name": "Nano Banana (Gemini 2.5 Flash Image)", + "family": "gemini-flash", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-05-08", - "last_updated": "2025-05-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-03-20", + "modalities": { + "input": ["text"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.33, "output": 1.32 }, - "limit": { "context": 32000, "input": 32000, "output": 16384 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "exa-answer": { - "id": "exa-answer", - "name": "Exa (Answer)", + "google/text-embedding-005": { + "id": "google/text-embedding-005", + "name": "Text Embedding 005", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-06-04", - "last_updated": "2025-06-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-08", + "last_updated": "2024-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 2.5 }, - "limit": { "context": 4096, "input": 4096, "output": 4096 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.03, + "output": 0 + } }, - "KAT-Coder-Pro-V1": { - "id": "KAT-Coder-Pro-V1", - "name": "KAT Coder Pro V1", + "google/text-multilingual-embedding-002": { + "id": "google/text-multilingual-embedding-002", + "name": "Text Multilingual Embedding 002", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-10-28", - "last_updated": "2025-10-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-03", + "last_updated": "2024-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 6 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.03, + "output": 0 + } }, - "ernie-4.5-turbo-128k": { - "id": "ernie-4.5-turbo-128k", - "name": "Ernie 4.5 Turbo 128k", + "google/gemini-3.1-flash-image-preview": { + "id": "google/gemini-3.1-flash-image-preview", + "name": "Gemini 3.1 Flash Image Preview (Nano Banana 2)", + "family": "gemini", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2025-05-08", - "last_updated": "2025-05-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-02-26", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.132, "output": 0.55 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.5, + "output": 3 + } }, - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "Claude 4.5 Opus", + "google/gemini-3.1-flash-lite": { + "id": "google/gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "family": "gemini", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-05-07", + "last_updated": "2026-05-08", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 1000000, + "output": 65000 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.03 + } }, - "deepclaude": { - "id": "deepclaude", - "name": "DeepClaude", + "google/gemini-3-flash": { + "id": "google/gemini-3-flash", + "name": "Gemini 3 Flash", + "family": "gemini-flash", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-01", - "last_updated": "2025-02-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05 + } }, - "Llama-3.3-70B-Forgotten-Abomination-v5.0": { - "id": "Llama-3.3-70B-Forgotten-Abomination-v5.0", - "name": "Llama 3.3 70B Forgotten Abomination v5.0", + "google/imagen-4.0-generate-001": { + "id": "google/imagen-4.0-generate-001", + "name": "Imagen 4", + "family": "imagen", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-05-22", + "last_updated": "2025-05-22", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 480, + "output": 0 + } }, - "qwen-image": { - "id": "qwen-image", - "name": "Qwen Image", + "google/gemini-2.5-flash-preview-09-2025": { + "id": "google/gemini-2.5-flash-preview-09-2025", + "name": "Gemini 2.5 Flash Preview 09-25", + "family": "gemini-flash", "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "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": 0.383 + } + }, + "google/gemini-embedding-2": { + "id": "google/gemini-embedding-2", + "name": "Gemini Embedding 2", + "family": "gemini-embedding", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["image"] }, + "release_date": "2026-03-10", + "last_updated": "2026-03-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 0, + "output": 0 + } }, - "gemini-2.5-pro-exp-03-25": { - "id": "gemini-2.5-pro-exp-03-25", - "name": "Gemini 2.5 Pro Experimental 0325", + "google/gemma-4-26b-a4b-it": { + "id": "google/gemma-4-26b-a4b-it", + "name": "Gemma 4 26B A4B IT", + "family": "gemma", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2026-04-02", + "last_updated": "2026-04-03", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.13, + "output": 0.39999999999999997 + } }, - "mistral-small-31-24b-instruct": { - "id": "mistral-small-31-24b-instruct", - "name": "Mistral Small 31 24b Instruct", - "attachment": true, + "google/imagen-4.0-fast-generate-001": { + "id": "google/imagen-4.0-fast-generate-001", + "name": "Imagen 4 Fast", + "family": "imagen", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 128000, "input": 128000, "output": 131072 } - }, - "claude-sonnet-4-thinking:1024": { - "id": "claude-sonnet-4-thinking:1024", - "name": "Claude 4 Sonnet Thinking (1K)", - "attachment": true, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06", + "last_updated": "2025-06", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "limit": { + "context": 480, + "output": 0 + } }, - "claude-opus-4-1-thinking": { - "id": "claude-opus-4-1-thinking", - "name": "Claude 4.1 Opus Thinking", + "google/gemini-2.5-flash-lite": { + "id": "google/gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.01 + } }, - "jamba-large-1.6": { - "id": "jamba-large-1.6", - "name": "Jamba Large 1.6", + "google/gemini-2.5-flash-image-preview": { + "id": "google/gemini-2.5-flash-image-preview", + "name": "Nano Banana Preview (Gemini 2.5 Flash Image Preview)", + "family": "gemini-flash", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-03-20", + "modalities": { + "input": ["text"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 1.989, "output": 7.99 }, - "limit": { "context": 256000, "input": 256000, "output": 4096 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 2.5 + } }, - "universal-summarizer": { - "id": "universal-summarizer", - "name": "Universal Summarizer", - "attachment": false, + "google/gemini-2.0-flash-lite": { + "id": "google/gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2023-05-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 30, "output": 30 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "Llama-3.3-70B-Bigger-Body": { - "id": "Llama-3.3-70B-Bigger-Body", - "name": "Llama 3.3 70B Bigger Body", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.03, + "input_audio": 1 + } }, - "doubao-seed-2-0-pro-260215": { - "id": "doubao-seed-2-0-pro-260215", - "name": "Doubao Seed 2.0 Pro", - "attachment": false, + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } + } + }, + "google/gemini-2.0-flash": { + "id": "google/gemini-2.0-flash", + "name": "Gemini 2.0 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.782, "output": 3.876 }, - "limit": { "context": 256000, "input": 256000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "Llama-3.3-70B-Progenitor-V3.3": { - "id": "Llama-3.3-70B-Progenitor-V3.3", - "name": "Llama 3.3 70B Progenitor V3.3", + "moonshotai/kimi-k2-turbo": { + "id": "moonshotai/kimi-k2-turbo", + "name": "Kimi K2 Turbo", + "family": "kimi", "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"] }, + "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": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 2.4, + "output": 10 + } }, - "claude-opus-4-1-thinking:32768": { - "id": "claude-opus-4-1-thinking:32768", - "name": "Claude 4.1 Opus Thinking (32K)", + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "interleaved": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-01-26", + "last_updated": "2026-01-26", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.6, + "output": 1.2 + } }, - "doubao-seed-1-6-thinking-250615": { - "id": "doubao-seed-1-6-thinking-250615", - "name": "Doubao Seed 1.6 Thinking", + "moonshotai/kimi-k2-thinking-turbo": { + "id": "moonshotai/kimi-k2-thinking-turbo", + "name": "Kimi K2 Thinking Turbo", + "family": "kimi-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-15", - "last_updated": "2025-06-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "interleaved": true, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.204, "output": 2.04 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } + "limit": { + "context": 262114, + "output": 262114 + }, + "cost": { + "input": 1.15, + "output": 8, + "cache_read": 0.15 + } }, - "Llama-3.3-70B-Fallen-v1": { - "id": "Llama-3.3-70B-Fallen-v1", - "name": "Llama 3.3 70B Fallen v1", + "moonshotai/kimi-k2-0905": { + "id": "moonshotai/kimi-k2-0905", + "name": "Kimi K2 0905", + "family": "kimi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-09-05", + "last_updated": "2025-09-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.5 + } }, - "glm-zero-preview": { - "id": "glm-zero-preview", - "name": "GLM Zero Preview", + "moonshotai/kimi-k2.6": { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-04-20", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262000, + "output": 262000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } + }, + "moonshotai/kimi-k2-thinking": { + "id": "moonshotai/kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "interleaved": true, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2025-11-06", + "last_updated": "2025-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.802, "output": 1.802 }, - "limit": { "context": 8000, "input": 8000, "output": 4096 } + "limit": { + "context": 216144, + "output": 216144 + }, + "cost": { + "input": 0.47, + "output": 2, + "cache_read": 0.14 + } }, - "Llama-3.3-70B-MS-Nevoria": { - "id": "Llama-3.3-70B-MS-Nevoria", - "name": "Llama 3.3 70B MS Nevoria", + "moonshotai/kimi-k2": { + "id": "moonshotai/kimi-k2", + "name": "Kimi K2 Instruct", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-07-14", + "last_updated": "2025-07-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "status": "deprecated", + "cost": { + "input": 1, + "output": 3 + } }, - "qwen-turbo": { - "id": "qwen-turbo", - "name": "Qwen Turbo", + "interfaze/interfaze-beta": { + "id": "interfaze/interfaze-beta", + "name": "Interfaze Beta", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-10-07", + "last_updated": "2026-04-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04998, "output": 0.2006 }, - "limit": { "context": 1000000, "input": 1000000, "output": 8192 } + "limit": { + "context": 1000000, + "output": 32000 + }, + "cost": { + "input": 1.5, + "output": 3.5 + } }, - "glm-z1-air": { - "id": "glm-z1-air", - "name": "GLM Z1 Air", - "attachment": false, + "anthropic/claude-3.5-sonnet-20240620": { + "id": "anthropic/claude-3.5-sonnet-20240620", + "name": "Claude 3.5 Sonnet (2024-06-20)", + "family": "claude-sonnet", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-06-20", + "last_updated": "2024-06-20", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.07 }, - "limit": { "context": 32000, "input": 32000, "output": 16384 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "deepseek-v3-0324": { - "id": "deepseek-v3-0324", - "name": "DeepSeek Chat 0324", - "attachment": false, - "reasoning": false, + "anthropic/claude-opus-4.6": { + "id": "anthropic/claude-opus-4.6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-03-24", - "last_updated": "2025-03-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "interleaved": true, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-02", + "last_updated": "2026-02", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "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)", + "anthropic/claude-opus-4.7": { + "id": "anthropic/claude-opus-4.7", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } - }, - "qwq-32b": { - "id": "qwq-32b", - "name": "Qwen: QwQ 32B", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2026-04-16", + "last_updated": "2026-04-16", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25599999, "output": 0.30499999 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "command-a-reasoning-08-2025": { - "id": "command-a-reasoning-08-2025", - "name": "Cohere Command A (08/2025)", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-22", - "last_updated": "2025-08-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "anthropic/claude-opus-4.5": { + "id": "anthropic/claude-opus-4.5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": 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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 256000, "input": 256000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 18.75 + } }, - "GLM-4.5-Air-Derestricted-Iceblink-ReExtract": { - "id": "GLM-4.5-Air-Derestricted-Iceblink-ReExtract", - "name": "GLM 4.5 Air Derestricted Iceblink ReExtract", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-12", - "last_updated": "2025-12-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "anthropic/claude-haiku-4.5": { + "id": "anthropic/claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 131072, "input": 131072, "output": 98304 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "Llama-3.3-70B-Mokume-Gane-R1": { - "id": "Llama-3.3-70B-Mokume-Gane-R1", - "name": "Llama 3.3 70B Mokume Gane R1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "anthropic/claude-sonnet-4.6": { + "id": "anthropic/claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": true, + "temperature": true, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "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 + } + } }, - "doubao-1-5-thinking-vision-pro-250428": { - "id": "doubao-1-5-thinking-vision-pro-250428", - "name": "Doubao 1.5 Thinking Vision Pro", + "anthropic/claude-3-opus": { + "id": "anthropic/claude-3-opus", + "name": "Claude Opus 3", + "family": "claude-opus", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-15", - "last_updated": "2025-05-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2023-08-31", + "release_date": "2024-02-29", + "last_updated": "2024-02-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.55, "output": 1.43 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "Llama-3.3+(3v3.3)-70B-TenyxChat-DaybreakStorywriter": { - "id": "Llama-3.3+(3v3.3)-70B-TenyxChat-DaybreakStorywriter", - "name": "Llama 3.3+ 70B TenyxChat DaybreakStorywriter", - "attachment": false, + "anthropic/claude-3.5-haiku": { + "id": "anthropic/claude-3.5-haiku", + "name": "Claude Haiku 3.5", + "family": "claude-haiku", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "deepseek-r1": { - "id": "deepseek-r1", - "name": "DeepSeek R1", - "attachment": false, + "anthropic/claude-opus-4": { + "id": "anthropic/claude-opus-4", + "name": "Claude Opus 4", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.7 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } - }, - "QwQ-32B-ArliAI-RpR-v1": { - "id": "QwQ-32B-ArliAI-RpR-v1", - "name": "QwQ 32b Arli V1", - "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": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } - }, - "GLM-4.6-Derestricted-v5": { - "id": "GLM-4.6-Derestricted-v5", - "name": "GLM 4.6 Derestricted v5", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.4, "output": 1.5 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "qwen-max": { - "id": "qwen-max", - "name": "Qwen 2.5 Max", - "attachment": false, + "anthropic/claude-3-haiku": { + "id": "anthropic/claude-3-haiku", + "name": "Claude Haiku 3", + "family": "claude-haiku", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-04-03", - "last_updated": "2024-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 1.5997, "output": 6.392 }, - "limit": { "context": 32000, "input": 32000, "output": 8192 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 0.25, + "output": 1.25, + "cache_read": 0.03, + "cache_write": 0.3 + } }, - "glm-4": { - "id": "glm-4", - "name": "GLM-4", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-01-16", - "last_updated": "2024-01-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "anthropic/claude-sonnet-4.5": { + "id": "anthropic/claude-sonnet-4.5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 14.994, "output": 14.994 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "qvq-max": { - "id": "qvq-max", - "name": "Qwen: QvQ Max", + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-28", - "last_updated": "2025-03-28", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 1.4, "output": 5.3 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "claude-opus-4-20250514": { - "id": "claude-opus-4-20250514", - "name": "Claude 4 Opus", + "anthropic/claude-3.5-sonnet": { + "id": "anthropic/claude-3.5-sonnet", + "name": "Claude Sonnet 3.5 v2", + "family": "claude-sonnet", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-14", - "last_updated": "2025-05-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04-30", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "gemini-2.5-flash-preview-04-17": { - "id": "gemini-2.5-flash-preview-04-17", - "name": "Gemini 2.5 Flash Preview", + "anthropic/claude-3.7-sonnet": { + "id": "anthropic/claude-3.7-sonnet", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-17", - "last_updated": "2025-04-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "claude-opus-4-thinking:32000": { - "id": "claude-opus-4-thinking:32000", - "name": "Claude 4 Opus Thinking (32K)", + "anthropic/claude-opus-4.1": { + "id": "anthropic/claude-opus-4.1", + "name": "Claude Opus 4", + "family": "claude-opus", "attachment": true, "reasoning": true, "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"] }, + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "qwen-long": { - "id": "qwen-long", - "name": "Qwen Long 10M", + "xiaomi/mimo-v2.5-pro": { + "id": "xiaomi/mimo-v2.5-pro", + "name": "MiMo V2.5 Pro", + "family": "mimo-v2.5-pro", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-25", - "last_updated": "2025-01-25", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1003, "output": 0.408 }, - "limit": { "context": 10000000, "input": 10000000, "output": 8192 } - }, - "Llama-3.3-70B-GeneticLemonade-Opus": { - "id": "Llama-3.3-70B-GeneticLemonade-Opus", - "name": "Llama 3.3 70B GeneticLemonade Opus", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-04-22", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1050000, + "output": 131000 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.19999999999999998 + } }, - "doubao-1.5-pro-32k": { - "id": "doubao-1.5-pro-32k", - "name": "Doubao 1.5 Pro 32k", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-22", - "last_updated": "2025-01-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "xiaomi/mimo-v2.5": { + "id": "xiaomi/mimo-v2.5", + "name": "MiMo M2.5", + "family": "mimo-v2.5", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-04-22", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1343, "output": 0.3349 }, - "limit": { "context": 32000, "input": 32000, "output": 8192 } + "limit": { + "context": 1050000, + "output": 131100 + }, + "cost": { + "input": 0.39999999999999997, + "output": 2, + "cache_read": 0.08 + } }, - "Llama-3.3-70B-Forgotten-Safeword-3.6": { - "id": "Llama-3.3-70B-Forgotten-Safeword-3.6", - "name": "Llama 3.3 70B Forgotten Safeword 3.6", + "xiaomi/mimo-v2-pro": { + "id": "xiaomi/mimo-v2-pro", + "name": "MiMo V2 Pro", + "family": "mimo", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-18", + "last_updated": "2026-03-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.19999999999999998 + } }, - "grok-3-mini-fast-beta": { - "id": "grok-3-mini-fast-beta", - "name": "Grok 3 Mini Fast Beta", + "xiaomi/mimo-v2-flash": { + "id": "xiaomi/mimo-v2-flash", + "name": "MiMo V2 Flash", + "family": "mimo", "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": false, - "cost": { "input": 0.6, "output": 4 }, - "limit": { "context": 131072, "input": 131072, "output": 131072 } - }, - "claude-3-7-sonnet-20250219": { - "id": "claude-3-7-sonnet-20250219", - "name": "Claude 3.7 Sonnet", - "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-12-17", + "last_updated": "2025-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 16000 } + "limit": { + "context": 262144, + "output": 32000 + }, + "cost": { + "input": 0.1, + "output": 0.29 + } }, - "Llama-3.3-70B-ArliAI-RPMax-v3": { - "id": "Llama-3.3-70B-ArliAI-RPMax-v3", - "name": "Llama 3.3 70B ArliAI RPMax v3", + "bytedance/seed-1.6": { + "id": "bytedance/seed-1.6", + "name": "Seed 1.6", + "family": "seed", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-09", + "last_updated": "2025-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 256000, + "output": 32000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.05 + } }, - "gemini-2.0-flash-thinking-exp-1219": { - "id": "gemini-2.0-flash-thinking-exp-1219", - "name": "Gemini 2.0 Flash Thinking 1219", + "bytedance/seed-1.8": { + "id": "bytedance/seed-1.8", + "name": "Seed 1.8", + "family": "seed", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-19", - "last_updated": "2024-12-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1003, "output": 0.408 }, - "limit": { "context": 32767, "input": 32767, "output": 8192 } - }, - "gemini-2.5-flash-preview-05-20": { - "id": "gemini-2.5-flash-preview-05-20", - "name": "Gemini 2.5 Flash 0520", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 1048000, "input": 1048000, "output": 65536 } - }, - "gemini-3-pro-preview": { - "id": "gemini-3-pro-preview", - "name": "Gemini 3 Pro", - "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-10", + "last_updated": "2025-10", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.05 + } }, - "MiniMax-M1": { - "id": "MiniMax-M1", - "name": "MiniMax M1", + "meituan/longcat-flash-chat": { + "id": "meituan/longcat-flash-chat", + "name": "LongCat Flash Chat", + "family": "longcat", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-16", - "last_updated": "2025-06-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1394, "output": 1.3328 }, - "limit": { "context": 1000000, "input": 1000000, "output": 131072 } - }, - "chroma": { - "id": "chroma", - "name": "Chroma", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, "temperature": true, - "release_date": "2025-08-12", - "last_updated": "2025-08-12", - "modalities": { "input": ["text"], "output": ["image"] }, + "knowledge": "2024-10", + "release_date": "2025-08-30", + "last_updated": "2025-08-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 128000, + "output": 8192 + } }, - "azure-o1": { - "id": "azure-o1", - "name": "Azure o1", + "meituan/longcat-flash-thinking": { + "id": "meituan/longcat-flash-thinking", + "name": "LongCat Flash Thinking", + "family": "longcat", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-17", - "last_updated": "2024-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.994, "output": 59.993 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } - }, - "claude-3-7-sonnet-thinking:128000": { - "id": "claude-3-7-sonnet-thinking:128000", - "name": "Claude 3.7 Sonnet Thinking (128K)", - "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-09-23", + "last_updated": "2025-09-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 1.5 + } }, - "venice-uncensored:web": { - "id": "venice-uncensored:web", - "name": "Venice Uncensored Web", + "meituan/longcat-flash-thinking-2601": { + "id": "meituan/longcat-flash-thinking-2601", + "name": "LongCat Flash Thinking 2601", + "family": "longcat", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2024-05-01", - "last_updated": "2024-05-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-03-13", + "last_updated": "2026-03-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 80000, "input": 80000, "output": 16384 } + "limit": { + "context": 32768, + "output": 32768 + } }, - "deepseek-r1-sambanova": { - "id": "deepseek-r1-sambanova", - "name": "DeepSeek R1 Fast", + "bfl/flux-pro-1.0-fill": { + "id": "bfl/flux-pro-1.0-fill", + "name": "FLUX.1 Fill [pro]", + "family": "flux", "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"] }, + "temperature": false, + "release_date": "2024-10", + "last_updated": "2024-10", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 4.998, "output": 6.987 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 512, + "output": 0 + } }, - "qwen25-vl-72b-instruct": { - "id": "qwen25-vl-72b-instruct", - "name": "Qwen25 VL 72b", - "attachment": true, + "bfl/flux-pro-1.1": { + "id": "bfl/flux-pro-1.1", + "name": "FLUX1.1 [pro]", + "family": "flux", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-05-10", - "last_updated": "2025-05-10", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-10", + "last_updated": "2024-10", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.69989, "output": 0.69989 }, - "limit": { "context": 32000, "input": 32000, "output": 32768 } + "limit": { + "context": 512, + "output": 0 + } }, - "brave-pro": { - "id": "brave-pro", - "name": "Brave (Pro)", + "bfl/flux-kontext-pro": { + "id": "bfl/flux-kontext-pro", + "name": "FLUX.1 Kontext Pro", + "family": "flux", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2023-03-02", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06", + "last_updated": "2025-06", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 5, "output": 5 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "limit": { + "context": 512, + "output": 0 + } }, - "glm-4-airx": { - "id": "glm-4-airx", - "name": "GLM-4 AirX", + "bfl/flux-kontext-max": { + "id": "bfl/flux-kontext-max", + "name": "FLUX.1 Kontext Max", + "family": "flux", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-06-05", - "last_updated": "2024-06-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.006, "output": 2.006 }, - "limit": { "context": 8000, "input": 8000, "output": 4096 } - }, - "deepseek-chat": { - "id": "deepseek-chat", - "name": "DeepSeek V3/Deepseek Chat", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "release_date": "2025-02-27", - "last_updated": "2025-02-27", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "temperature": false, + "release_date": "2025-06", + "last_updated": "2025-06", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 512, + "output": 0 + } }, - "Llama-3.3-70B-Cu-Mai-R1": { - "id": "Llama-3.3-70B-Cu-Mai-R1", - "name": "Llama 3.3 70B Cu Mai R1", + "bfl/flux-pro-1.1-ultra": { + "id": "bfl/flux-pro-1.1-ultra", + "name": "FLUX1.1 [pro] Ultra", + "family": "flux", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "release_date": "2024-11", + "last_updated": "2024-11", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } - }, - "deepseek-chat-cheaper": { - "id": "deepseek-chat-cheaper", - "name": "DeepSeek V3/Chat Cheaper", - "attachment": true, - "reasoning": false, + "limit": { + "context": 512, + "output": 0 + } + } + } + }, + "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": { + "id": "MiniMax-M2", + "name": "MiniMax-M2", + "family": "minimax", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "temperature": true, + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "ernie-5.0-thinking-latest": { - "id": "ernie-5.0-thinking-latest", - "name": "Ernie 5.0 Thinking", - "attachment": true, + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } - }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "Claude Sonnet 4.5", - "attachment": true, - "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "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 + } }, - "claude-opus-4-1-thinking:1024": { - "id": "claude-opus-4-1-thinking:1024", - "name": "Claude 4.1 Opus Thinking (1K)", - "attachment": true, + "MiniMax-M2.7": { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "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 + } }, - "qwen-plus": { - "id": "qwen-plus", - "name": "Qwen Plus", + "MiniMax-M2.7-highspeed": { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "family": "minimax", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2024-01-25", - "last_updated": "2024-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3995, "output": 1.2002 }, - "limit": { "context": 995904, "input": 995904, "output": 32768 } + "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 + } }, - "ernie-x1-32k-preview": { - "id": "ernie-x1-32k-preview", - "name": "Ernie X1 32k", + "MiniMax-M2.1": { + "id": "MiniMax-M2.1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.33, "output": 1.32 }, - "limit": { "context": 32000, "input": 32000, "output": 16384 } + "reasoning": true, + "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 + } }, - "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.1": { - "id": "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.1", - "name": "Llama 3.3 70B Omega Directive Unslop v2.1", + "MiniMax-M2.5-highspeed": { + "id": "MiniMax-M2.5-highspeed", + "name": "MiniMax-M2.5-highspeed", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } - }, - "gemini-2.5-pro-preview-06-05": { - "id": "gemini-2.5-pro-preview-06-05", - "name": "Gemini 2.5 Pro Preview 0605", + "reasoning": true, + "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.06, + "cache_write": 0.375 + } + } + } + }, + "llmgateway": { + "id": "llmgateway", + "env": ["LLMGATEWAY_API_KEY"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://api.llmgateway.io/v1", + "name": "LLM Gateway", + "doc": "https://llmgateway.io/docs", + "models": { + "gpt-4o-mini-search-preview": { + "id": "gpt-4o-mini-search-preview", + "name": "GPT-4o Mini Search Preview", + "family": "gpt", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "claude-sonnet-4-thinking:64000": { - "id": "claude-sonnet-4-thinking:64000", - "name": "Claude 4 Sonnet Thinking (64K)", + "grok-4-1-fast-reasoning": { + "id": "grok-4-1-fast-reasoning", + "name": "Grok 4.1 Fast Reasoning", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "glm-z1-airx": { - "id": "glm-z1-airx", - "name": "GLM Z1 AirX", + "qwen3-235b-a22b-instruct-2507": { + "id": "qwen3-235b-a22b-instruct-2507", + "name": "Qwen3 235B A22B Instruct (2507)", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": true, "structured_output": true, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 32000, "input": 32000, "output": 16384 } - }, - "qwen3-vl-235b-a22b-instruct-original": { - "id": "qwen3-vl-235b-a22b-instruct-original", - "name": "Qwen3 VL 235B A22B Instruct Original", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.2 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "temperature": true, + "release_date": "2025-07-08", + "last_updated": "2025-07-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 2.4 + } }, - "yi-lightning": { - "id": "yi-lightning", - "name": "Yi Lightning", + "llama-4-scout": { + "id": "llama-4-scout", + "name": "Llama 4 Scout", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2024-10-16", - "last_updated": "2024-10-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2006, "output": 0.2006 }, - "limit": { "context": 12000, "input": 12000, "output": 4096 } + "temperature": true, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 16384 + }, + "status": "beta", + "cost": { + "input": 0.18, + "output": 0.59 + } }, - "sonar-deep-research": { - "id": "sonar-deep-research", - "name": "Perplexity Deep Research", + "hermes-2-pro-llama-3-8b": { + "id": "hermes-2-pro-llama-3-8b", + "name": "Hermes 2 Pro Llama 3 8B", + "family": "hermes", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-02-25", - "last_updated": "2025-02-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3.4, "output": 13.6 }, - "limit": { "context": 60000, "input": 60000, "output": 128000 } + "temperature": true, + "release_date": "2024-05-27", + "last_updated": "2024-05-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.14, + "output": 0.14 + } }, - "Llama-3.3-70B-Ignition-v0.1": { - "id": "Llama-3.3-70B-Ignition-v0.1", - "name": "Llama 3.3 70B Ignition v0.1", + "qwen-coder-plus": { + "id": "qwen-coder-plus", + "name": "Qwen Coder Plus", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.5, + "output": 1 + } }, - "kimi-k2-instruct-fast": { - "id": "kimi-k2-instruct-fast", - "name": "Kimi K2 0711 Fast", + "auto": { + "id": "auto", + "name": "Auto Route", + "family": "auto", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-15", - "last_updated": "2025-07-15", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 2 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } - }, - "gemini-2.5-pro-preview-05-06": { - "id": "gemini-2.5-pro-preview-05-06", - "name": "Gemini 2.5 Pro Preview 0506", - "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-06", - "last_updated": "2025-05-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gemini-2.5-flash-preview-05-20:thinking": { - "id": "gemini-2.5-flash-preview-05-20:thinking", - "name": "Gemini 2.5 Flash 0520 Thinking", + "glm-4.6v-flashx": { + "id": "glm-4.6v-flashx", + "name": "GLM-4.6V FlashX", + "family": "glm", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-20", - "last_updated": "2025-05-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 3.5 }, - "limit": { "context": 1048000, "input": 1048000, "output": 65536 } - }, - "auto-model-premium": { - "id": "auto-model-premium", - "name": "Auto model (Premium)", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 1000000, "input": 1000000, "output": 1000000 } - }, - "glm-4.1v-thinking-flash": { - "id": "glm-4.1v-thinking-flash", - "name": "GLM 4.1V Thinking Flash", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 64000, "input": 64000, "output": 8192 } - }, - "claude-3-5-haiku-20241022": { - "id": "claude-3-5-haiku-20241022", - "name": "Claude 3.5 Haiku", - "attachment": true, - "reasoning": false, "tool_call": true, "structured_output": true, - "release_date": "2024-10-22", - "last_updated": "2024-10-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.8, "output": 4 }, - "limit": { "context": 200000, "input": 200000, "output": 8192 } + "limit": { + "context": 128000, + "output": 16000 + }, + "cost": { + "input": 0.04, + "output": 0.4, + "cache_read": 0 + } }, - "sonar": { - "id": "sonar", - "name": "Perplexity Simple", + "gemma-2-27b-it-together": { + "id": "gemma-2-27b-it-together", + "name": "Gemma 2 27B IT", + "family": "gemma", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.003, "output": 1.003 }, - "limit": { "context": 127000, "input": 127000, "output": 128000 } + "temperature": true, + "release_date": "2024-06-27", + "last_updated": "2024-06-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 16384 + }, + "cost": { + "input": 0.08, + "output": 0.08 + } }, - "auto-model": { - "id": "auto-model", - "name": "Auto model", + "codestral-2508": { + "id": "codestral-2508", + "name": "Codestral", + "family": "mistral", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 1000000, "input": 1000000, "output": 1000000 } - }, - "gemini-2.0-flash-001": { - "id": "gemini-2.0-flash-001", - "name": "Gemini 2.0 Flash", - "attachment": true, - "reasoning": false, - "tool_call": true, "structured_output": true, - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1003, "output": 0.408 }, - "limit": { "context": 1000000, "input": 1000000, "output": 8192 } - }, - "Llama-3.3-70B-Mhnnn-x1": { - "id": "Llama-3.3-70B-Mhnnn-x1", - "name": "Llama 3.3 70B Mhnnn x1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "temperature": true, + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "step-2-16k-exp": { - "id": "step-2-16k-exp", - "name": "Step-2 16k Exp", + "gemma-3-1b-it": { + "id": "gemma-3-1b-it", + "name": "Gemma 3 1B IT", + "family": "gemma", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2024-07-05", - "last_updated": "2024-07-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 7.004, "output": 19.992 }, - "limit": { "context": 16000, "input": 16000, "output": 8192 } + "temperature": true, + "release_date": "2025-03-12", + "last_updated": "2025-03-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.08, + "output": 0.3 + } }, - "Llama-3.3-70B-Legion-V2.1": { - "id": "Llama-3.3-70B-Legion-V2.1", - "name": "Llama 3.3 70B Legion V2.1", + "glm-4-32b-0414-128k": { + "id": "glm-4-32b-0414-128k", + "name": "GLM-4 32B (0414-128k)", + "family": "glm", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "Llama-3.3+(3.1v3.3)-70B-New-Dawn-v1.1": { - "id": "Llama-3.3+(3.1v3.3)-70B-New-Dawn-v1.1", - "name": "Llama 3.3+ 70B New Dawn v1.1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "seed-1-6-flash-250715": { + "id": "seed-1-6-flash-250715", + "name": "Seed 1.6 Flash (250715)", + "family": "seed", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-26", + "last_updated": "2025-07-26", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.07, + "output": 0.3, + "cache_read": 0.01 + } }, - "doubao-1-5-thinking-pro-vision-250415": { - "id": "doubao-1-5-thinking-pro-vision-250415", - "name": "Doubao 1.5 Thinking Pro Vision", + "seed-1-6-250615": { + "id": "seed-1-6-250615", + "name": "Seed 1.6 (250615)", + "family": "seed", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 2.4 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-06-25", + "last_updated": "2025-06-25", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.05 + } }, - "gemini-2.0-flash-lite": { - "id": "gemini-2.0-flash-lite", - "name": "Gemini 2.0 Flash Lite", + "qwen3-vl-235b-a22b-thinking": { + "id": "qwen3-vl-235b-a22b-thinking", + "name": "Qwen3 VL 235B A22B Thinking", + "family": "qwen", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-11", - "last_updated": "2024-12-11", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0748, "output": 0.306 }, - "limit": { "context": 1000000, "input": 1000000, "output": 8192 } + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 2.4 + } }, - "claude-sonnet-4-5-20250929-thinking": { - "id": "claude-sonnet-4-5-20250929-thinking", - "name": "Claude Sonnet 4.5 Thinking", + "qwen3-vl-30b-a3b-thinking": { + "id": "qwen3-vl-30b-a3b-thinking", + "name": "Qwen3 VL 30B A3B Thinking", + "family": "qwen", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "temperature": true, + "release_date": "2025-10-02", + "last_updated": "2025-10-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "yi-large": { - "id": "yi-large", - "name": "Yi Large", - "attachment": false, + "qwen2-5-vl-32b-instruct": { + "id": "qwen2-5-vl-32b-instruct", + "name": "Qwen2.5 VL 32B Instruct", + "family": "qwen", + "attachment": true, + "reasoning": false, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-03-15", + "last_updated": "2025-03-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.3 + } + }, + "qwen3-vl-8b-instruct": { + "id": "qwen3-vl-8b-instruct", + "name": "Qwen3 VL 8B Instruct", + "family": "qwen", + "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3.196, "output": 3.196 }, - "limit": { "context": 32000, "input": 32000, "output": 4096 } + "temperature": true, + "release_date": "2025-08-19", + "last_updated": "2025-08-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "Gemma-3-27B-Nidum-Uncensored": { - "id": "Gemma-3-27B-Nidum-Uncensored", - "name": "Gemma 3 27B Nidum Uncensored", + "claude-3-7-sonnet": { + "id": "claude-3-7-sonnet", + "name": "Claude 3.7 Sonnet", + "family": "claude", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "structured_output": false, - "release_date": "2025-08-08", - "last_updated": "2025-08-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-02-24", + "last_updated": "2025-02-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 96000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3 + } }, - "claude-opus-4-thinking:32768": { - "id": "claude-opus-4-thinking:32768", - "name": "Claude 4 Opus Thinking (32K)", + "gemini-pro-latest": { + "id": "gemini-pro-latest", + "name": "Gemini Pro Latest", + "family": "gemini", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } - }, - "Llama-3.3-70B-Cirrus-x1": { - "id": "Llama-3.3-70B-Cirrus-x1", - "name": "Llama 3.3 70B Cirrus x1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } - }, - "Gemma-3-27B-CardProjector-v4": { - "id": "Gemma-3-27B-CardProjector-v4", - "name": "Gemma 3 27B CardProjector v4", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2026-02-27", + "last_updated": "2026-02-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2 + } }, - "Qwen2.5-32B-EVA-v0.2": { - "id": "Qwen2.5-32B-EVA-v0.2", - "name": "Qwen 2.5 32b EVA", + "claude-3-5-haiku": { + "id": "claude-3-5-haiku", + "name": "Claude 3.5 Haiku", + "family": "claude", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-09-01", - "last_updated": "2024-09-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.493, "output": 0.493 }, - "limit": { "context": 24576, "input": 24576, "output": 8192 } - }, - "sonar-reasoning-pro": { - "id": "sonar-reasoning-pro", - "name": "Perplexity Reasoning Pro", - "attachment": false, - "reasoning": true, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.006, "output": 7.9985 }, - "limit": { "context": 127000, "input": 127000, "output": 128000 } + "limit": { + "context": 200000, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08 + } }, - "v0-1.5-lg": { - "id": "v0-1.5-lg", - "name": "v0 1.5 LG", - "attachment": false, + "qwen-max-latest": { + "id": "qwen-max-latest", + "name": "Qwen Max Latest", + "family": "qwen", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-04", - "last_updated": "2025-07-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 15, "output": 75 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 1.6, + "output": 6.4 + } }, - "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", + "glm-4.6v-flash": { + "id": "glm-4.6v-flash", + "name": "GLM-4.6V Flash", + "family": "glm", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "temperature": true, + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16000 + }, + "status": "beta", + "cost": { + "input": 0, + "output": 0 + } }, - "azure-gpt-4-turbo": { - "id": "azure-gpt-4-turbo", - "name": "Azure gpt-4-turbo", + "qwen3-30b-a3b-instruct-2507": { + "id": "qwen3-30b-a3b-instruct-2507", + "name": "Qwen3 30B A3B Instruct (2507)", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2023-11-06", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 9.996, "output": 30.005 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-08", + "last_updated": "2025-07-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "deepseek-reasoner": { - "id": "deepseek-reasoner", - "name": "DeepSeek Reasoner", + "minimax-text-01": { + "id": "minimax-text-01", + "name": "MiniMax Text 01", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, "structured_output": false, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.7 }, - "limit": { "context": 64000, "input": 64000, "output": 65536 } + "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 + } }, - "gemini-2.5-flash-nothinking": { - "id": "gemini-2.5-flash-nothinking", - "name": "Gemini 2.5 Flash (No Thinking)", + "qwen3-32b-fp8": { + "id": "qwen3-32b-fp8", + "name": "Qwen3 32B FP8", + "family": "qwen", + "attachment": false, + "reasoning": true, + "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": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } + }, + "llama-4-scout-17b-instruct": { + "id": "llama-4-scout-17b-instruct", + "name": "Llama 4 Scout 17B Instruct", + "family": "llama", "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "temperature": true, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.17, + "output": 0.66 + } }, - "Gemma-3-27B-ArliAI-RPMax-v3": { - "id": "Gemma-3-27B-ArliAI-RPMax-v3", - "name": "Gemma 3 27B RPMax v3", + "qwen3-4b-fp8": { + "id": "qwen3-4b-fp8", + "name": "Qwen3 4B FP8", + "family": "qwen", "attachment": false, + "reasoning": true, + "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": 8192 + }, + "cost": { + "input": 0.03, + "output": 0.05 + } + }, + "ministral-8b-2512": { + "id": "ministral-8b-2512", + "name": "Ministral 8B", + "family": "mistral", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-07-03", - "last_updated": "2025-07-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "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 + } }, - "v0-1.0-md": { - "id": "v0-1.0-md", - "name": "v0 1.0 MD", - "attachment": false, + "gemma-3-27b": { + "id": "gemma-3-27b", + "name": "Gemma 3 27B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-07-04", - "last_updated": "2025-07-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } + "temperature": true, + "release_date": "2025-03-12", + "last_updated": "2025-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.27, + "output": 0.27 + } }, - "step-3": { - "id": "step-3", - "name": "Step-3", + "qwen3-vl-flash": { + "id": "qwen3-vl-flash", + "name": "Qwen3 VL Flash", + "family": "qwen", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-31", - "last_updated": "2025-07-31", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-09", + "last_updated": "2025-10-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2499, "output": 0.6494 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } + "limit": { + "context": 1000000, + "output": 32000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.01 + } }, - "brave": { - "id": "brave", - "name": "Brave (Answers)", + "llama-3.1-70b-instruct": { + "id": "llama-3.1-70b-instruct", + "name": "Llama 3.1 70B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2023-03-02", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 5, "output": 5 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "temperature": true, + "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 + } }, - "ernie-x1-turbo-32k": { - "id": "ernie-x1-turbo-32k", - "name": "Ernie X1 Turbo 32k", + "seed-1-8-251228": { + "id": "seed-1-8-251228", + "name": "Seed 1.8 (251228)", + "family": "seed", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-08", - "last_updated": "2025-05-08", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.165, "output": 0.66 }, - "limit": { "context": 32000, "input": 32000, "output": 16384 } + "reasoning": true, + "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": true, + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.05 + } }, - "glm-4-air": { - "id": "glm-4-air", - "name": "GLM-4 Air", + "qwen3-235b-a22b-thinking-2507": { + "id": "qwen3-235b-a22b-thinking-2507", + "name": "Qwen3 235B A22B Thinking (2507)", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-06-05", - "last_updated": "2024-06-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2006, "output": 0.2006 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-08", + "last_updated": "2025-07-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 2.4 + } }, - "GLM-4.5-Air-Derestricted": { - "id": "GLM-4.5-Air-Derestricted", - "name": "GLM 4.5 Air Derestricted", + "seed-1-6-250915": { + "id": "seed-1-6-250915", + "name": "Seed 1.6 (250915)", + "family": "seed", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 256000, + "output": 8192 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.05 + } + }, + "glm-4.5-x": { + "id": "glm-4.5-x", + "name": "GLM-4.5 X", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 202600, "input": 202600, "output": 98304 } - }, - "grok-3-fast-beta": { - "id": "grok-3-fast-beta", - "name": "Grok 3 Fast Beta", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-17", - "last_updated": "2025-02-17", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 131072, "input": 131072, "output": 131072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "status": "beta", + "cost": { + "input": 2.2, + "output": 8.9, + "cache_read": 0.45 + } }, - "claude-sonnet-4-20250514": { - "id": "claude-sonnet-4-20250514", - "name": "Claude 4 Sonnet", - "attachment": true, - "reasoning": false, + "qwen3-30b-a3b-thinking-2507": { + "id": "qwen3-30b-a3b-thinking-2507", + "name": "Qwen3 30B A3B Thinking (2507)", + "family": "qwen", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } + "temperature": true, + "release_date": "2025-07-08", + "last_updated": "2025-07-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "claude-3-7-sonnet-thinking:1024": { - "id": "claude-3-7-sonnet-thinking:1024", - "name": "Claude 3.7 Sonnet Thinking (1K)", + "grok-4-fast-reasoning": { + "id": "grok-4-fast-reasoning", + "name": "Grok 4 Fast Reasoning", + "family": "grok", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "doubao-seed-code-preview-latest": { - "id": "doubao-seed-code-preview-latest", - "name": "Doubao Seed Code Preview", - "attachment": false, + "deepseek-v3.1": { + "id": "deepseek-v3.1", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } - }, - "grok-3-beta": { - "id": "grok-3-beta", - "name": "Grok 3 Beta", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 131072, "input": 131072, "output": 131072 } + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.56, + "output": 1.68, + "cache_read": 0.11 + } }, - "claude-3-7-sonnet-reasoner": { - "id": "claude-3-7-sonnet-reasoner", - "name": "Claude 3.7 Sonnet Reasoner", + "ministral-3b-2512": { + "id": "ministral-3b-2512", + "name": "Ministral 3B", + "family": "mistral", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-03-29", - "last_updated": "2025-03-29", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "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 + } }, - "gemini-2.0-pro-exp-02-05": { - "id": "gemini-2.0-pro-exp-02-05", - "name": "Gemini 2.0 Pro 0205", + "qwen-plus-latest": { + "id": "qwen-plus-latest", + "name": "Qwen Plus Latest", + "family": "qwen", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-05", - "last_updated": "2025-02-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.989, "output": 7.956 }, - "limit": { "context": 2097152, "input": 2097152, "output": 8192 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "glm-4-long": { - "id": "glm-4-long", - "name": "GLM-4 Long", + "llama-3.1-nemotron-ultra-253b": { + "id": "llama-3.1-nemotron-ultra-253b", + "name": "Llama 3.1 Nemotron Ultra 253B", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-08-01", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2006, "output": 0.2006 }, - "limit": { "context": 1000000, "input": 1000000, "output": 4096 } + "structured_output": 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": 8192 + }, + "cost": { + "input": 0.6, + "output": 1.8 + } }, - "venice-uncensored": { - "id": "venice-uncensored", - "name": "Venice Uncensored", - "attachment": false, + "llama-4-maverick-17b-instruct": { + "id": "llama-4-maverick-17b-instruct", + "name": "Llama 4 Maverick 17B Instruct", + "family": "llama", + "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "temperature": true, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.24, + "output": 0.97 + } }, - "Gemma-3-27B-Big-Tiger-v3": { - "id": "Gemma-3-27B-Big-Tiger-v3", - "name": "Gemma 3 27B Big Tiger v3", + "grok-4-0709": { + "id": "grok-4-0709", + "name": "Grok 4 (0709)", + "family": "grok", "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"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "doubao-seed-2-0-mini-260215": { - "id": "doubao-seed-2-0-mini-260215", - "name": "Doubao Seed 2.0 Mini", + "qwen3-30b-a3b-fp8": { + "id": "qwen3-30b-a3b-fp8", + "name": "Qwen3 30B A3B FP8", + "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, + "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": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } + }, + "minimax-m2.1-lightning": { + "id": "minimax-m2.1-lightning", + "name": "MiniMax M2.1 Lightning", + "family": "minimax", + "attachment": false, + "reasoning": true, "tool_call": false, "structured_output": false, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0493, "output": 0.4845 }, - "limit": { "context": 256000, "input": 256000, "output": 32000 } + "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 + } }, - "gemini-2.0-flash-thinking-exp-01-21": { - "id": "gemini-2.0-flash-thinking-exp-01-21", - "name": "Gemini 2.0 Flash Thinking 0121", + "qwen3-max-2026-01-23": { + "id": "qwen3-max-2026-01-23", + "name": "Qwen3 Max (2026-01-23)", + "family": "qwen", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-21", - "last_updated": "2025-01-21", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2026-01-23", + "last_updated": "2026-01-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 1.003 }, - "limit": { "context": 1000000, "input": 1000000, "output": 8192 } + "limit": { + "context": 256000, + "output": 32800 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.6 + } }, - "Llama-3.3-70B-Damascus-R1": { - "id": "Llama-3.3-70B-Damascus-R1", - "name": "Damascus R1", + "llama-3.2-3b-instruct": { + "id": "llama-3.2-3b-instruct", + "name": "Llama 3.2 3B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "structured_output": true, + "temperature": true, + "release_date": "2024-09-18", + "last_updated": "2024-09-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32000 + }, + "cost": { + "input": 0.03, + "output": 0.05 + } + }, + "qwen3-coder-next": { + "id": "qwen3-coder-next", + "name": "Qwen3 Coder Next", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-15", + "last_updated": "2025-10-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.8, + "output": 4 + } }, - "doubao-1-5-thinking-pro-250415": { - "id": "doubao-1-5-thinking-pro-250415", - "name": "Doubao 1.5 Thinking Pro", + "gpt-4o-search-preview": { + "id": "gpt-4o-search-preview", + "name": "GPT-4o Search Preview", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-04-17", - "last_updated": "2025-04-17", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.4 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "asi1-mini": { - "id": "asi1-mini", - "name": "ASI1 Mini", + "custom": { + "id": "custom", + "name": "Custom Model", + "family": "auto", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 1, "output": 1 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "doubao-seed-2-0-code-preview-260215": { - "id": "doubao-seed-2-0-code-preview-260215", - "name": "Doubao Seed 2.0 Code Preview", - "attachment": false, + "qwen3-vl-30b-a3b-instruct": { + "id": "qwen3-vl-30b-a3b-instruct", + "name": "Qwen3 VL 30B A3B Instruct", + "family": "qwen", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.782, "output": 3.893 }, - "limit": { "context": 256000, "input": 256000, "output": 128000 } + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-10-02", + "last_updated": "2025-10-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.1 + } }, - "exa-research-pro": { - "id": "exa-research-pro", - "name": "Exa (Research Pro)", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-04", - "last_updated": "2025-06-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 2.5 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 16384 + }, + "cost": { + "input": 0.28, + "output": 0.42, + "cache_read": 0.03 + } }, - "GLM-4.5-Air-Derestricted-Iceblink-v2": { - "id": "GLM-4.5-Air-Derestricted-Iceblink-v2", - "name": "GLM 4.5 Air Derestricted Iceblink v2", + "qwen3-235b-a22b-fp8": { + "id": "qwen3-235b-a22b-fp8", + "name": "Qwen3 235B A22B FP8", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 158600, "input": 158600, "output": 65536 } + "reasoning": true, + "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": 8192 + }, + "cost": { + "input": 0.5, + "output": 2.5 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "attachment": true, + "gpt-oss-20b": { + "id": "gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", + "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 131072, + "output": 32766 + }, + "cost": { + "input": 0.1, + "output": 0.5 + } }, - "Llama-3.3-70B-Nova": { - "id": "Llama-3.3-70B-Nova", - "name": "Llama 3.3 70B Nova", + "kimi-k2": { + "id": "kimi-k2", + "name": "Kimi K2", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "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": 16384 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.5 + } }, - "Gemma-3-27B-it": { - "id": "Gemma-3-27B-it", - "name": "Gemma 3 27B IT", + "llama-3-8b-instruct": { + "id": "llama-3-8b-instruct", + "name": "Llama 3 8B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } - }, - "claude-opus-4-thinking:8192": { - "id": "claude-opus-4-thinking:8192", - "name": "Claude 4 Opus Thinking (8K)", - "attachment": true, - "reasoning": true, - "tool_call": true, "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "temperature": true, + "release_date": "2025-04-03", + "last_updated": "2025-04-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "claude-3-5-sonnet-20240620": { - "id": "claude-3-5-sonnet-20240620", - "name": "Claude 3.5 Sonnet Old", + "qwen3-vl-235b-a22b-instruct": { + "id": "qwen3-vl-235b-a22b-instruct", + "name": "Qwen3 VL 235B A22B Instruct", + "family": "qwen", "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, - "release_date": "2024-06-20", - "last_updated": "2024-06-20", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 8192 } + "temperature": true, + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 2.4 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "Claude 4.1 Opus", - "attachment": true, - "reasoning": false, + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, "tool_call": true, "structured_output": true, + "temperature": true, "release_date": "2025-08-05", "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 131072, + "output": 32766 + }, + "cost": { + "input": 0.15, + "output": 0.75 + } }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "attachment": true, - "reasoning": true, + "qwen25-coder-7b": { + "id": "qwen25-coder-7b", + "name": "Qwen2.5 Coder 7B", + "family": "qwen", + "attachment": false, + "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-06-05", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "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": 131072, + "output": 8192 + }, + "cost": { + "input": 0.05, + "output": 0.05 + } }, - "sonar-pro": { - "id": "sonar-pro", - "name": "Perplexity Pro", + "llama-3.1-8b-instruct": { + "id": "llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 128000 } + "tool_call": true, + "structured_output": 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": 2048 + }, + "status": "beta", + "cost": { + "input": 0.22, + "output": 0.22 + } }, - "sarvan-medium": { - "id": "sarvan-medium", - "name": "Sarvam Medium", + "llama-3-70b-instruct": { + "id": "llama-3-70b-instruct", + "name": "Llama 3 70B Instruct", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 0.75 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "structured_output": true, + "temperature": true, + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8000 + }, + "cost": { + "input": 0.51, + "output": 0.74 + } }, - "hunyuan-t1-latest": { - "id": "hunyuan-t1-latest", - "name": "Hunyuan T1", + "deepseek-r1-0528": { + "id": "deepseek-r1-0528", + "name": "DeepSeek R1 (0528)", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, "structured_output": false, - "release_date": "2025-03-22", - "last_updated": "2025-03-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 64000, + "output": 16384 + }, + "status": "beta", + "cost": { + "input": 0.8, + "output": 2.4 + } + }, + "glm-4.5-airx": { + "id": "glm-4.5-airx", + "name": "GLM-4.5 AirX", + "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, - "cost": { "input": 0.17, "output": 0.66 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.1, + "output": 4.5, + "cache_read": 0.22 + } }, - "Llama-3.3-70B-RAWMAW": { - "id": "Llama-3.3-70B-RAWMAW", - "name": "Llama 3.3 70B RAWMAW", + "ministral-14b-2512": { + "id": "ministral-14b-2512", + "name": "Ministral 14B", + "family": "mistral", + "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 + } + }, + "llama-3.2-11b-instruct": { + "id": "llama-3.2-11b-instruct", + "name": "Llama 3.2 11B Instruct", + "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 + } + }, + "claude-3-opus": { + "id": "claude-3-opus", + "name": "Claude 3 Opus", + "family": "claude", + "attachment": true, + "reasoning": false, + "tool_call": true, "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2024-03-04", + "last_updated": "2024-03-04", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5 + } }, - "kimi-thinking-preview": { - "id": "kimi-thinking-preview", - "name": "Kimi Thinking Preview", + "minimax-m2.7": { + "id": "minimax-m2.7", + "name": "MiniMax-M2.7", + "family": "minimax", + "attachment": false, + "reasoning": true, + "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 + } + }, + "grok-4-20-beta-0309-non-reasoning": { + "id": "grok-4-20-beta-0309-non-reasoning", + "name": "Grok 4.20 (Non-Reasoning)", + "family": "grok", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-07", - "last_updated": "2025-05-07", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-09", + "last_updated": "2026-03-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 31.46, "output": 31.46 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 12, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "claude-sonnet-4-thinking:32768": { - "id": "claude-sonnet-4-thinking:32768", - "name": "Claude 4 Sonnet Thinking (32K)", + "qwen3-coder-plus": { + "id": "qwen3-coder-plus", + "name": "Qwen3 Coder Plus", + "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 + }, + "cost": { + "input": 1, + "output": 5 + } + }, + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "family": "claude-haiku", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "gemini-2.5-pro-preview-03-25": { - "id": "gemini-2.5-pro-preview-03-25", - "name": "Gemini 2.5 Pro Preview 0325", + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "family": "claude-opus", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-03-31", + "release_date": "2025-11-01", + "last_updated": "2025-11-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "gemini-2.5-flash-preview-09-2025": { - "id": "gemini-2.5-flash-preview-09-2025", - "name": "Gemini 2.5 Flash Preview (09/2025)", + "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-25", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "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", "pdf"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "Llama-3.3-70B-Electra-R1": { - "id": "Llama-3.3-70B-Electra-R1", - "name": "Llama 3.3 70B Electra R1", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi-k2.5", "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "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 + } + }, + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": 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": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } - }, - "Llama-3.3-70B-ArliAI-RPMax-v2": { - "id": "Llama-3.3-70B-ArliAI-RPMax-v2", - "name": "Llama 3.3 70B ArliAI RPMax v2", - "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": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "GLM-4.5-Air-Derestricted-Steam": { - "id": "GLM-4.5-Air-Derestricted-Steam", - "name": "GLM 4.5 Air Derestricted Steam", - "attachment": false, + "mistral-large-2512": { + "id": "mistral-large-2512", + "name": "Mistral Large 3", + "family": "mistral-large", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 220600, "input": 220600, "output": 65536 } + "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 + } }, - "doubao-seed-1-8-251215": { - "id": "doubao-seed-1-8-251215", - "name": "Doubao Seed 1.8", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-15", - "last_updated": "2025-12-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.612, "output": 6.12 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "reasoning": true, + "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 + } }, - "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.0": { - "id": "Llama-3.3-70B-The-Omega-Directive-Unslop-v2.0", - "name": "Llama 3.3 70B Omega Directive Unslop v2.0", + "minimax-m2.7-highspeed": { + "id": "minimax-m2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "reasoning": true, + "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 + } }, - "GLM-4.5-Air-Derestricted-Steam-ReExtract": { - "id": "GLM-4.5-Air-Derestricted-Steam-ReExtract", - "name": "GLM 4.5 Air Derestricted Steam ReExtract", + "mimo-v2.5-pro": { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-12", - "last_updated": "2025-12-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 131072, "input": 131072, "output": 65536 } + "reasoning": true, + "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 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "exa-research": { - "id": "exa-research", - "name": "Exa (Research)", - "attachment": false, + "gemma-3n-e4b-it": { + "id": "gemma-3n-e4b-it", + "name": "Gemma 3n 4B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-06-04", - "last_updated": "2025-06-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.5, "output": 2.5 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "azure-gpt-4o": { - "id": "azure-gpt-4o", - "name": "Azure gpt-4o", + "claude-3-5-sonnet-20241022": { + "id": "claude-3-5-sonnet-20241022", + "name": "Claude Sonnet 3.5 v2", + "family": "claude-sonnet", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04-30", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.499, "output": 9.996 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "study_gpt-chatgpt-4o-latest": { - "id": "study_gpt-chatgpt-4o-latest", - "name": "Study Mode", + "gpt-5.2-pro": { + "id": "gpt-5.2-pro", + "name": "GPT-5.2 Pro", + "family": "gpt-pro", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "structured_output": false, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 4.998, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 21, + "output": 168 + } }, - "Llama-3.3-70B-Aurora-Borealis": { - "id": "Llama-3.3-70B-Aurora-Borealis", - "name": "Llama 3.3 70B Aurora Borealis", + "qwq-plus": { + "id": "qwq-plus", + "name": "QwQ Plus", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 2.4 + } }, - "Baichuan4-Turbo": { - "id": "Baichuan4-Turbo", - "name": "Baichuan 4 Turbo", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "gemini-3.1-flash-lite-preview": { + "id": "gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 2.42, "output": 2.42 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "input_audio": 0.5 + } }, - "Baichuan4-Air": { - "id": "Baichuan4-Air", - "name": "Baichuan 4 Air", + "qwen-vl-plus": { + "id": "qwen-vl-plus", + "name": "Qwen-VL Plus", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.157, "output": 0.157 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.21, + "output": 0.63 + } }, - "KAT-Coder-Exp-72B-1010": { - "id": "KAT-Coder-Exp-72B-1010", - "name": "KAT Coder Exp 72B 1010", + "glm-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-10-28", - "last_updated": "2025-10-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.2 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "reasoning": true, + "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": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2, + "cache_write": 0 + } }, - "gemini-2.0-flash-exp-image-generation": { - "id": "gemini-2.0-flash-exp-image-generation", - "name": "Gemini Text + Image", + "devstral-2512": { + "id": "devstral-2512", + "name": "Devstral 2", + "family": "devstral", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 32767, "input": 32767, "output": 8192 } + "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.4, + "output": 2 + } }, - "Llama-3.3-70B-Dark-Ages-v0.1": { - "id": "Llama-3.3-70B-Dark-Ages-v0.1", - "name": "Llama 3.3 70B Dark Ages v0.1", + "qwen3-32b": { + "id": "qwen3-32b", + "name": "Qwen3 32B", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "reasoning": true, + "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 + }, + "cost": { + "input": 0.7, + "output": 2.8, + "reasoning": 8.4 + } }, - "claude-opus-4-1-thinking:8192": { - "id": "claude-opus-4-1-thinking:8192", - "name": "Claude 4.1 Opus Thinking (8K)", + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "Magistral-Small-2506": { - "id": "Magistral-Small-2506", - "name": "Magistral Small 2506", + "glm-4.7-flashx": { + "id": "glm-4.7-flashx", + "name": "GLM-4.7-FlashX", + "family": "glm-flash", "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": false, - "cost": { "input": 0.4, "output": 1.4 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "reasoning": true, + "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 + } }, - "Llama-3.3-70B-MiraiFanfare": { - "id": "Llama-3.3-70B-MiraiFanfare", - "name": "Llama 3.3 70b Mirai Fanfare", - "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"] }, + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.493, "output": 0.493 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 18, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "glm-4-flash": { - "id": "glm-4-flash", - "name": "GLM-4 Flash", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-08-01", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1003, "output": 0.1003 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "qwen35-397b-a17b": { + "id": "qwen35-397b-a17b", + "name": "Qwen3.5 397B-A17B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2026-02-15", + "last_updated": "2026-02-15", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "Llama-3.3-70B-Shakudo": { - "id": "Llama-3.3-70B-Shakudo", - "name": "Llama 3.3 70B Shakudo", + "qwen-max": { + "id": "qwen-max", + "name": "Qwen Max", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 1.6, + "output": 6.4 + } }, - "gemini-2.0-pro-reasoner": { - "id": "gemini-2.0-pro-reasoner", - "name": "Gemini 2.0 Pro Reasoner", - "attachment": false, + "gpt-5.3-chat-latest": { + "id": "gpt-5.3-chat-latest", + "name": "GPT-5.3 Chat (latest)", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-05", - "last_updated": "2025-02-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 1.292, "output": 4.998 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "Llama-3.3-70B-Fallen-R1-v1": { - "id": "Llama-3.3-70B-Fallen-R1-v1", - "name": "Llama 3.3 70B Fallen R1 v1", - "attachment": false, + "gemini-2.0-flash": { + "id": "gemini-2.0-flash", + "name": "Gemini 2.0 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "gemini-2.5-flash-lite-preview-06-17": { - "id": "gemini-2.5-flash-lite-preview-06-17", - "name": "Gemini 2.5 Flash Lite Preview", + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-17", - "last_updated": "2025-06-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "input_audio": 1 + } }, - "doubao-seed-1-6-flash-250615": { - "id": "doubao-seed-1-6-flash-250615", - "name": "Doubao Seed 1.6 Flash", + "qwen-plus": { + "id": "qwen-plus", + "name": "Qwen Plus", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-15", - "last_updated": "2025-06-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.0374, "output": 0.374 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.2, + "reasoning": 4 + } }, - "claude-opus-4-5-20251101:thinking": { - "id": "claude-opus-4-5-20251101:thinking", - "name": "Claude 4.5 Opus Thinking", + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "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, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "Llama-3.3-70B-Strawberrylemonade-v1.2": { - "id": "Llama-3.3-70B-Strawberrylemonade-v1.2", - "name": "Llama 3.3 70B StrawberryLemonade v1.2", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "qwen3.6-35b-a3b": { + "id": "qwen3.6-35b-a3b", + "name": "Qwen3.6 35B-A3B", + "family": "qwen", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2026-04-17", + "last_updated": "2026-04-17", + "modalities": { + "input": ["text", "image", "video", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.248, + "output": 1.485 + } }, - "Llama-3.3-70B-Magnum-v4-SE": { - "id": "Llama-3.3-70B-Magnum-v4-SE", - "name": "Llama 3.3 70B Magnum v4 SE", + "qwen-omni-turbo": { + "id": "qwen-omni-turbo", + "name": "Qwen-Omni Turbo", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 32768, + "output": 2048 + }, + "cost": { + "input": 0.07, + "output": 0.27, + "input_audio": 4.44, + "output_audio": 8.89 + } }, - "MiniMax-M2": { - "id": "MiniMax-M2", - "name": "MiniMax M2", - "attachment": false, + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-10-25", - "last_updated": "2025-10-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.17, "output": 1.53 }, - "limit": { "context": 200000, "input": 200000, "output": 131072 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "doubao-seed-1-6-250615": { - "id": "doubao-seed-1-6-250615", - "name": "Doubao Seed 1.6", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-15", - "last_updated": "2025-06-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.204, "output": 0.51 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "Llama-3.3-70B-StrawberryLemonade-v1.0": { - "id": "Llama-3.3-70B-StrawberryLemonade-v1.0", - "name": "Llama 3.3 70B StrawberryLemonade v1.0", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "Meta-Llama-3-1-8B-Instruct-FP8": { - "id": "Meta-Llama-3-1-8B-Instruct-FP8", - "name": "Llama 3.1 8B (decentralized)", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "mimo-v2-omni": { + "id": "mimo-v2-omni", + "name": "MiMo-V2-Omni", + "family": "mimo", + "attachment": true, + "reasoning": true, + "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", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.02, "output": 0.03 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08 + } }, - "claude-opus-4-1-thinking:32000": { - "id": "claude-opus-4-1-thinking:32000", - "name": "Claude 4.1 Opus Thinking (32K)", + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "GLM-4.5-Air-Derestricted-Iceblink-v2-ReExtract": { - "id": "GLM-4.5-Air-Derestricted-Iceblink-v2-ReExtract", - "name": "GLM 4.5 Air Derestricted Iceblink v2 ReExtract", + "minimax-m2": { + "id": "minimax-m2", + "name": "MiniMax-M2", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-12", - "last_updated": "2025-12-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 131072, "input": 131072, "output": 65536 } + "reasoning": true, + "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": 196608, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "gemini-3-pro-preview-thinking": { - "id": "gemini-3-pro-preview-thinking", - "name": "Gemini 3 Pro Thinking", + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 12 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "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", - "attachment": true, + "qwen-flash": { + "id": "qwen-flash", + "name": "Qwen Flash", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 1000000, + "output": 32768 + }, + "cost": { + "input": 0.05, + "output": 0.4 + } }, - "Llama-3.3-70B-Vulpecula-R1": { - "id": "Llama-3.3-70B-Vulpecula-R1", - "name": "Llama 3.3 70B Vulpecula R1", - "attachment": false, + "gpt-4-turbo": { + "id": "gpt-4-turbo", + "name": "GPT-4 Turbo", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2023-12", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "doubao-1.5-vision-pro-32k": { - "id": "doubao-1.5-vision-pro-32k", - "name": "Doubao 1.5 Vision Pro 32k", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-22", - "last_updated": "2025-01-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.459, "output": 1.377 }, - "limit": { "context": 32000, "input": 32000, "output": 8192 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125, + "context_over_200k": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + }, + "tiers": [ + { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "deepseek-reasoner-cheaper": { - "id": "deepseek-reasoner-cheaper", - "name": "Deepseek R1 Cheaper", - "attachment": false, + "mimo-v2.5": { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08, + "context_over_200k": { + "input": 0.8, + "output": 4, + "cache_read": 0.16 + }, + "tiers": [ + { + "input": 0.8, + "output": 4, + "cache_read": 0.16, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } + }, + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "Grok 4.1 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.4, "output": 1.7 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "ernie-x1.1-preview": { - "id": "ernie-x1.1-preview", - "name": "ERNIE X1.1", + "sonar-pro": { + "id": "sonar-pro", + "name": "Sonar Pro", + "family": "sonar-pro", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-09-10", - "last_updated": "2025-09-10", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 64000, "input": 64000, "output": 8192 } + "limit": { + "context": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15 + } }, - "KAT-Coder-Air-V1": { - "id": "KAT-Coder-Air-V1", - "name": "KAT Coder Air V1", - "attachment": false, + "pixtral-large-latest": { + "id": "pixtral-large-latest", + "name": "Pixtral Large (latest)", + "family": "pixtral", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-10-28", - "last_updated": "2025-10-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + } + }, + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.1, "output": 0.2 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "mercury-coder-small": { - "id": "mercury-coder-small", - "name": "Mercury Coder Small", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-26", - "last_updated": "2025-02-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "grok-4-20-beta-0309-reasoning": { + "id": "grok-4-20-beta-0309-reasoning", + "name": "Grok 4.20 (Reasoning)", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-09", + "last_updated": "2026-03-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 12, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 12, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "doubao-1.5-pro-256k": { - "id": "doubao-1.5-pro-256k", - "name": "Doubao 1.5 Pro 256k", - "attachment": false, + "gpt-4o-mini": { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-12", - "last_updated": "2025-03-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.799, "output": 1.445 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "glm-4-plus": { - "id": "glm-4-plus", - "name": "GLM-4 Plus", + "qwen3.6-plus": { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-08-01", - "last_updated": "2024-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 7.497, "output": 7.497 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "cache_write": 0.625, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.2, + "cache_write": 2.5, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "Baichuan-M2": { - "id": "Baichuan-M2", - "name": "Baichuan M2 32B Medical", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 15.73, "output": 15.73 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "auto-model-standard": { - "id": "auto-model-standard", - "name": "Auto model (Standard)", + "qwen3-max": { + "id": "qwen3-max", + "name": "Qwen3 Max", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 1000000, "input": 1000000, "output": 1000000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 1.2, + "output": 6 + } }, - "Gemma-3-27B-it-Abliterated": { - "id": "Gemma-3-27B-it-Abliterated", - "name": "Gemma 3 27B IT Abliterated", + "minimax-m2.1": { + "id": "minimax-m2.1", + "name": "MiniMax-M2.1", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-03", - "last_updated": "2025-07-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.42, "output": 0.42 }, - "limit": { "context": 32768, "input": 32768, "output": 96000 } + "reasoning": true, + "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 + } }, - "learnlm-1.5-pro-experimental": { - "id": "learnlm-1.5-pro-experimental", - "name": "Gemini LearnLM Experimental", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-05-14", - "last_updated": "2024-05-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": true, + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3.502, "output": 10.506 }, - "limit": { "context": 32767, "input": 32767, "output": 8192 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 6, + "output": 24, + "cache_read": 1.3, + "cache_write": 0 + } }, - "claude-opus-4-thinking:1024": { - "id": "claude-opus-4-thinking:1024", - "name": "Claude 4 Opus Thinking (1K)", + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o-mini", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-05-22", - "last_updated": "2025-05-22", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-05", + "release_date": "2025-04-16", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 14.994, "output": 75.004 }, - "limit": { "context": 200000, "input": 200000, "output": 32000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.28 + } }, - "gemini-2.5-flash-preview-04-17:thinking": { - "id": "gemini-2.5-flash-preview-04-17:thinking", - "name": "Gemini 2.5 Flash Preview Thinking", + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 nano", + "family": "gpt-nano", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-17", - "last_updated": "2025-04-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 3.5 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "v0-1.5-md": { - "id": "v0-1.5-md", - "name": "v0 1.5 MD", + "glm-4.5": { + "id": "glm-4.5", + "name": "GLM-4.5", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-04", - "last_updated": "2025-07-04", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } + "reasoning": true, + "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 + } }, - "Llama-3.3-70B-Electranova-v1.0": { - "id": "Llama-3.3-70B-Electranova-v1.0", - "name": "Llama 3.3 70B Electranova v1.0", - "attachment": false, + "mistral-large-latest": { + "id": "mistral-large-latest", + "name": "Mistral Large (latest)", + "family": "mistral-large", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "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 + } }, - "Llama-3.3+(3.1v3.3)-70B-Hanami-x1": { - "id": "Llama-3.3+(3.1v3.3)-70B-Hanami-x1", - "name": "Llama 3.3+ 70B Hanami x1", + "mistral-small-2506": { + "id": "mistral-small-2506", + "name": "Mistral Small 3.2", + "family": "mistral-small", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "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.1, + "output": 0.3 + } }, - "phi-4-multimodal-instruct": { - "id": "phi-4-multimodal-instruct", - "name": "Phi 4 Multimodal", - "attachment": false, + "gemma-3-12b-it": { + "id": "gemma-3-12b-it", + "name": "Gemma 3 12B", + "family": "gemma", + "attachment": true, "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": false, - "cost": { "input": 0.07, "output": 0.11 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "structured_output": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "Claude Haiku 4.5", + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } - }, - "ernie-4.5-8k-preview": { - "id": "ernie-4.5-8k-preview", - "name": "Ernie 4.5 8k Preview", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.66, "output": 2.6 }, - "limit": { "context": 8000, "input": 8000, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "claude-3-7-sonnet-thinking:32768": { - "id": "claude-3-7-sonnet-thinking:32768", - "name": "Claude 3.7 Sonnet Thinking (32K)", + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-07-15", - "last_updated": "2025-07-15", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } - }, - "qwen3-max-2026-01-23": { - "id": "qwen3-max-2026-01-23", - "name": "Qwen3 Max 2026-01-23", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-26", - "last_updated": "2026-01-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2002, "output": 6.001 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.03, + "input_audio": 1 + } }, - "claude-3-7-sonnet-thinking:8192": { - "id": "claude-3-7-sonnet-thinking:8192", - "name": "Claude 3.7 Sonnet Thinking (8K)", + "gpt-5.2-chat-latest": { + "id": "gpt-5.2-chat-latest", + "name": "GPT-5.2 Chat", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 64000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "Llama-3.3-70B-Incandescent-Malevolence": { - "id": "Llama-3.3-70B-Incandescent-Malevolence", - "name": "Llama 3.3 70B Incandescent Malevolence", - "attachment": false, + "gemma-3n-e2b-it": { + "id": "gemma-3n-e2b-it", + "name": "Gemma 3n 2B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "step-2-mini": { - "id": "step-2-mini", - "name": "Step-2 Mini", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-05", - "last_updated": "2024-07-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex mini", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.2006, "output": 0.408 }, - "limit": { "context": 8000, "input": 8000, "output": 4096 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "auto-model-basic": { - "id": "auto-model-basic", - "name": "Auto model (Basic)", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-06-01", - "last_updated": "2024-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "grok-4-fast": { + "id": "grok-4-fast", + "name": "Grok 4 Fast", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 1000000, "input": 1000000, "output": 1000000 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "claude-sonnet-4-thinking": { - "id": "claude-sonnet-4-thinking", - "name": "Claude 4 Sonnet Thinking", + "gemini-3.1-flash-lite": { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 1000000, "input": 1000000, "output": 64000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "input_audio": 0.5 + } }, - "Llama-3.3-70B-GeneticLemonade-Unleashed-v3": { - "id": "Llama-3.3-70B-GeneticLemonade-Unleashed-v3", - "name": "Llama 3.3 70B GeneticLemonade Unleashed v3", + "qwen3-next-80b-a3b-thinking": { + "id": "qwen3-next-80b-a3b-thinking", + "name": "Qwen3-Next 80B-A3B (Thinking)", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "reasoning": true, + "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 + }, + "cost": { + "input": 0.5, + "output": 6 + } }, - "step-r1-v-mini": { - "id": "step-r1-v-mini", - "name": "Step R1 V Mini", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-08", - "last_updated": "2025-04-08", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2023-10", + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 11 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "glm-4-plus-0111": { - "id": "glm-4-plus-0111", - "name": "GLM 4 Plus 0111", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-19", - "last_updated": "2025-02-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 9.996, "output": 9.996 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "z-image-turbo": { - "id": "z-image-turbo", - "name": "Z Image Turbo", + "gemma-3-4b-it": { + "id": "gemma-3-4b-it", + "name": "Gemma 3 4B", + "family": "gemma", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, "temperature": true, - "release_date": "2025-11-27", - "last_updated": "2025-11-27", - "modalities": { "input": ["text"], "output": ["image"] }, - "open_weights": false, - "limit": { "context": 0, "output": 0 } - }, - "Llama-3.3-70B-Sapphira-0.2": { - "id": "Llama-3.3-70B-Sapphira-0.2", - "name": "Llama 3.3 70B Sapphira 0.2", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-math-v2": { - "id": "deepseek-math-v2", - "name": "DeepSeek Math V2", + "kimi-k2-thinking-turbo": { + "id": "kimi-k2-thinking-turbo", + "name": "Kimi K2 Thinking Turbo", + "family": "kimi-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-03", - "last_updated": "2025-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "reasoning": true, + "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": 1.15, + "output": 8, + "cache_read": 0.15 + } }, - "azure-gpt-4o-mini": { - "id": "azure-gpt-4o-mini", - "name": "Azure gpt-4o-mini", + "o1": { + "id": "o1", + "name": "o1", + "family": "o", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1496, "output": 0.595 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } - }, - "Mistral-Nemo-12B-Instruct-2407": { - "id": "Mistral-Nemo-12B-Instruct-2407", - "name": "Mistral Nemo 12B Instruct 2407", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 0.01, "output": 0.01 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } }, - "jamba-mini-1.6": { - "id": "jamba-mini-1.6", - "name": "Jamba Mini 1.6", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM-4.5-Air", + "family": "glm-air", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1989, "output": 0.408 }, - "limit": { "context": 256000, "input": 256000, "output": 4096 } + "reasoning": true, + "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 + } }, - "qwen3-vl-235b-a22b-thinking": { - "id": "qwen3-vl-235b-a22b-thinking", - "name": "Qwen3 VL 235B A22B Thinking", + "gpt-5.4-pro": { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.5, "output": 6 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180 + } }, - "Llama-3.3-70B-ArliAI-RPMax-v1.4": { - "id": "Llama-3.3-70B-ArliAI-RPMax-v1.4", - "name": "Llama 3.3 70B RPMax v1.4", + "gpt-3.5-turbo": { + "id": "gpt-3.5-turbo", + "name": "GPT-3.5-turbo", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2021-09-01", + "release_date": "2023-03-01", + "last_updated": "2023-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 16385, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 1.5, + "cache_read": 1.25 + } }, - "Llama-3.3-70B-Anthrobomination": { - "id": "Llama-3.3-70B-Anthrobomination", - "name": "Llama 3.3 70B Anthrobomination", + "o3-mini": { + "id": "o3-mini", + "name": "o3-mini", + "family": "o-mini", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "glm-4-air-0111": { - "id": "glm-4-air-0111", - "name": "GLM 4 Air 0111", + "qwen-vl-max": { + "id": "qwen-vl-max", + "name": "Qwen-VL Max", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-11", - "last_updated": "2025-01-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.1394, "output": 0.1394 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.8, + "output": 3.2 + } }, - "jamba-mini": { - "id": "jamba-mini", - "name": "Jamba Mini", + "sonar": { + "id": "sonar", + "name": "Sonar", + "family": "sonar", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1989, "output": 0.408 }, - "limit": { "context": 256000, "input": 256000, "output": 4096 } - }, - "ernie-5.0-thinking-preview": { - "id": "ernie-5.0-thinking-preview", - "name": "Ernie 5.0 Thinking Preview", - "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-09-01", + "release_date": "2024-01-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 1, + "output": 1 + } }, - "Gemma-3-27B-Glitter": { - "id": "Gemma-3-27B-Glitter", - "name": "Gemma 3 27B Glitter", + "qwen3-coder-flash": { + "id": "qwen3-coder-flash", + "name": "Qwen3 Coder Flash", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 1000000, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 1.5 + } }, - "hidream": { - "id": "hidream", - "name": "Hidream", + "grok-4-3": { + "id": "grok-4-3", + "name": "Grok 4.3", + "family": "grok", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["image"] }, + "release_date": "2026-05-01", + "last_updated": "2026-05-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "limit": { "context": 0, "output": 0 } + "limit": { + "context": 1000000, + "output": 30000 + }, + "cost": { + "input": 1.25, + "output": 2.5, + "cache_read": 0.2, + "context_over_200k": { + "input": 2.5, + "output": 5, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2.5, + "output": 5, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "glm-4.1v-thinking-flashx": { - "id": "glm-4.1v-thinking-flashx", - "name": "GLM 4.1V Thinking FlashX", + "glm-4.5v": { + "id": "glm-4.5v", + "name": "GLM-4.5V", + "family": "glm", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 64000, "input": 64000, "output": 8192 } - }, - "phi-4-mini-instruct": { - "id": "phi-4-mini-instruct", - "name": "Phi 4 Mini", - "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": false, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } - }, - "Llama-3.3-70B-Sapphira-0.1": { - "id": "Llama-3.3-70B-Sapphira-0.1", - "name": "Llama 3.3 70B Sapphira 0.1", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "reasoning": true, + "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 + } }, - "yi-medium-200k": { - "id": "yi-medium-200k", - "name": "Yi Medium 200k", + "deepseek-v4-flash": { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "family": "deepseek-flash", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-03-01", - "last_updated": "2024-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.499, "output": 2.499 }, - "limit": { "context": 200000, "input": 200000, "output": 4096 } + "reasoning": true, + "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.028 + } }, - "jamba-mini-1.7": { - "id": "jamba-mini-1.7", - "name": "Jamba Mini 1.7", + "grok-4": { + "id": "grok-4", + "name": "Grok 4", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "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, - "cost": { "input": 0.1989, "output": 0.408 }, - "limit": { "context": 256000, "input": 256000, "output": 4096 } - }, - "gemini-3-pro-image-preview": { - "id": "gemini-3-pro-image-preview", - "name": "Gemini 3 Pro Image", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-18", - "last_updated": "2025-11-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 12 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "reasoning": 15, + "cache_read": 0.75 + } }, - "fastgpt": { - "id": "fastgpt", - "name": "Web Answer", + "qwen3-next-80b-a3b-instruct": { + "id": "qwen3-next-80b-a3b-instruct", + "name": "Qwen3-Next 80B-A3B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2023-08-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 7.5, "output": 7.5 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "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 + }, + "cost": { + "input": 0.5, + "output": 2 + } }, - "GLM-4.5-Air-Derestricted-Iceblink": { - "id": "GLM-4.5-Air-Derestricted-Iceblink", - "name": "GLM 4.5 Air Derestricted Iceblink", - "attachment": false, + "gpt-4": { + "id": "gpt-4", + "name": "GPT-4", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2023-11", + "release_date": "2023-11-06", + "last_updated": "2024-04-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 131072, "input": 131072, "output": 98304 } + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 30, + "output": 60 + } }, - "Llama-3.3-70B-Predatorial-Extasy": { - "id": "Llama-3.3-70B-Predatorial-Extasy", - "name": "Llama 3.3 70B Predatorial Extasy", + "glm-4.6": { + "id": "glm-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "reasoning": true, + "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 + } }, - "claude-3-7-sonnet-thinking": { - "id": "claude-3-7-sonnet-thinking", - "name": "Claude 3.7 Sonnet Thinking", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, - "release_date": "2025-02-24", - "last_updated": "2025-02-24", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 16000 } - }, - "Llama-3.3-70B-Magnum-v4-SE-Cirrus-x1-SLERP": { - "id": "Llama-3.3-70B-Magnum-v4-SE-Cirrus-x1-SLERP", - "name": "Llama 3.3 70B Magnum v4 SE Cirrus x1 SLERP", - "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": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "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": 262144 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "claude-3-5-sonnet-20241022": { - "id": "claude-3-5-sonnet-20241022", - "name": "Claude 3.5 Sonnet", + "glm-4.6v": { + "id": "glm-4.6v", + "name": "GLM-4.6V", + "family": "glm", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.992, "output": 14.994 }, - "limit": { "context": 200000, "input": 200000, "output": 8192 } + "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 + } }, - "gemini-exp-1206": { - "id": "gemini-exp-1206", - "name": "Gemini 2.0 Pro 1206", + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "Claude Opus 4.1", + "family": "claude-opus", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.258, "output": 4.998 }, - "limit": { "context": 2097152, "input": 2097152, "output": 8192 } - }, - "doubao-seed-2-0-lite-260215": { - "id": "doubao-seed-2-0-lite-260215", - "name": "Doubao Seed 2.0 Lite", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1462, "output": 0.8738 }, - "limit": { "context": 256000, "input": 256000, "output": 32000 } - }, - "jamba-large": { - "id": "jamba-large", - "name": "Jamba Large", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 1.989, "output": 7.99 }, - "limit": { "context": 256000, "input": 256000, "output": 4096 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "hunyuan-turbos-20250226": { - "id": "hunyuan-turbos-20250226", - "name": "Hunyuan Turbo S", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-27", - "last_updated": "2025-02-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.187, "output": 0.374 }, - "limit": { "context": 24000, "input": 24000, "output": 8192 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + } }, - "ernie-4.5-turbo-vl-32k": { - "id": "ernie-4.5-turbo-vl-32k", - "name": "Ernie 4.5 Turbo VL 32k", + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-08", - "last_updated": "2025-05-08", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.495, "output": 1.43 }, - "limit": { "context": 32000, "input": 32000, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 1, + "output": 5, + "cache_read": 0.1, + "cache_write": 1.25 + } }, - "grok-3-mini-beta": { - "id": "grok-3-mini-beta", - "name": "Grok 3 Mini Beta", + "glm-4.5-flash": { + "id": "glm-4.5-flash", + "name": "GLM-4.5-Flash", + "family": "glm-flash", "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": false, - "cost": { "input": 0.3, "output": 0.5 }, - "limit": { "context": 131072, "input": 131072, "output": 131072 } + "reasoning": true, + "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, + "cache_read": 0, + "cache_write": 0 + } }, - "qwen3-30b-a3b-instruct-2507": { - "id": "qwen3-30b-a3b-instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", + "qwen3-vl-plus": { + "id": "qwen3-vl-plus", + "name": "Qwen3-VL Plus", + "family": "qwen", "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"] }, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0.2, + "output": 1.6, + "reasoning": 4.8 + } }, - "Llama-3.3-70B-Argunaut-1-SFT": { - "id": "Llama-3.3-70B-Argunaut-1-SFT", - "name": "Llama 3.3 70B Argunaut 1 SFT", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "grok-4-1-fast": { + "id": "grok-4-1-fast", + "name": "Grok 4.1 Fast", + "family": "grok", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "abacusai/Dracarys-72B-Instruct": { - "id": "abacusai/Dracarys-72B-Instruct", - "name": "Llama 3.1 70B Dracarys 2", - "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"] }, + "claude-sonnet-4-20250514": { + "id": "claude-sonnet-4-20250514", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "THUDM/GLM-Z1-32B-0414": { - "id": "THUDM/GLM-Z1-32B-0414", - "name": "GLM Z1 32B 0414", - "family": "glm-z", + "qwen3-coder-480b-a35b-instruct": { + "id": "qwen3-coder-480b-a35b-instruct", + "name": "Qwen3-Coder 480B-A35B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + }, + "cost": { + "input": 1.5, + "output": 7.5 + } + }, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 1000000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 25, + "cache_read": 0.5, + "cache_write": 6.25 + } }, - "THUDM/GLM-Z1-9B-0414": { - "id": "THUDM/GLM-Z1-9B-0414", - "name": "GLM Z1 9B 0414", - "family": "glm-z", + "deepseek-v4-pro": { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek-thinking", "attachment": false, + "reasoning": true, + "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.74, + "output": 3.48, + "cache_read": 0.145 + } + }, + "gpt-4.1-nano": { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "family": "gpt-nano", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": 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"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 32000, "input": 32000, "output": 8000 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.03 + } }, - "THUDM/GLM-4-32B-0414": { - "id": "THUDM/GLM-4-32B-0414", - "name": "GLM 4 32B 0414", - "family": "glm", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "claude-3-7-sonnet-20250219": { + "id": "claude-3-7-sonnet-20250219", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "THUDM/GLM-Z1-Rumination-32B-0414": { - "id": "THUDM/GLM-Z1-Rumination-32B-0414", - "name": "GLM Z1 Rumination 32B 0414", - "family": "glm-z", + "qwen3-coder-30b-a3b-instruct": { + "id": "qwen3-coder-30b-a3b-instruct", + "name": "Qwen3-Coder 30B-A3B Instruct", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 32000, "input": 32000, "output": 65536 } + "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 + }, + "cost": { + "input": 0.45, + "output": 2.25 + } }, - "THUDM/GLM-4-9B-0414": { - "id": "THUDM/GLM-4-9B-0414", - "name": "GLM 4 9B 0414", - "family": "glm", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax-M2.5", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 32000, "input": 32000, "output": 8000 } + "reasoning": true, + "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 + } }, - "unsloth/gemma-3-1b-it": { - "id": "unsloth/gemma-3-1b-it", - "name": "Gemma 3 1B IT", - "family": "unsloth", + "mimo-v2-pro": { + "id": "mimo-v2-pro", + "name": "MiMo-V2-Pro", + "family": "mimo", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.1003, "output": 0.1003 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3, + "cache_read": 0.2, + "context_over_200k": { + "input": 2, + "output": 6, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 2, + "output": 6, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 256000 + } + } + ] + } }, - "unsloth/gemma-3-27b-it": { - "id": "unsloth/gemma-3-27b-it", - "name": "Gemma 3 27B IT", - "family": "unsloth", + "o3": { + "id": "o3", + "name": "o3", + "family": "o", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.2992, "output": 0.2992 }, - "limit": { "context": 128000, "input": 128000, "output": 96000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "unsloth/gemma-3-4b-it": { - "id": "unsloth/gemma-3-4b-it", - "name": "Gemma 3 4B IT", - "family": "unsloth", + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "GPT-5 Pro", + "family": "gpt-pro", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.2006, "output": 0.2006 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 400000, + "input": 272000, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "unsloth/gemma-3-12b-it": { - "id": "unsloth/gemma-3-12b-it", - "name": "Gemma 3 12B IT", - "family": "unsloth", + "gpt-4o": { + "id": "gpt-4o", + "name": "GPT-4o", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 0.272, "output": 0.272 }, - "limit": { "context": 128000, "input": 128000, "output": 131072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "shisa-ai/shisa-v2-llama3.3-70b": { - "id": "shisa-ai/shisa-v2-llama3.3-70b", - "name": "Shisa V2 Llama 3.3 70B", - "family": "llama", + "minimax-m2.5-highspeed": { + "id": "minimax-m2.5-highspeed", + "name": "MiniMax-M2.5-highspeed", + "family": "minimax", "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": false, - "cost": { "input": 0.5, "output": 0.5 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "reasoning": true, + "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.06, + "cache_write": 0.375 + } }, - "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", - "family": "llama", + "qwen-turbo": { + "id": "qwen-turbo", + "name": "Qwen Turbo", + "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.5, "output": 0.5 }, - "limit": { "context": 32768, "input": 32768, "output": 4096 } + "limit": { + "context": 1000000, + "output": 16384 + }, + "cost": { + "input": 0.05, + "output": 0.2, + "reasoning": 0.5 + } }, - "openai/gpt-5.2-codex": { - "id": "openai/gpt-5.2-codex", - "name": "GPT 5.2 Codex", - "family": "gpt-codex", + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-01-14", - "last_updated": "2026-01-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "openai/o1-pro": { - "id": "openai/o1-pro", - "name": "OpenAI o1 Pro", - "family": "o-pro", + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "family": "gemini-flash-lite", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-25", - "last_updated": "2025-01-25", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 150, "output": 600 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } - }, - "openai/o3-mini-low": { - "id": "openai/o3-mini-low", - "name": "OpenAI o3-mini (Low)", - "family": "o-mini", - "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.01, + "input_audio": 0.3 + } }, - "openai/gpt-5.1-codex-mini": { - "id": "openai/gpt-5.1-codex-mini", - "name": "GPT 5.1 Codex Mini", - "family": "gpt-codex-mini", + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "openai/o3-mini": { - "id": "openai/o3-mini", - "name": "OpenAI o3-mini", - "family": "o-mini", + "glm-4.7-flash": { + "id": "glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm-flash", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + } + }, + "mimo-v2-flash": { + "id": "mimo-v2-flash", + "name": "MiMo-V2-Flash", + "family": "mimo", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01 + } + }, + "qwen3.6-max-preview": { + "id": "qwen3.6-max-preview", + "name": "Qwen3.6 Max Preview", + "family": "qwen", + "attachment": false, + "reasoning": true, + "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, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 1.3, + "output": 7.8, + "cache_read": 0.13, + "cache_write": 1.625 + } }, - "openai/gpt-5-pro": { - "id": "openai/gpt-5-pro", - "name": "GPT 5 Pro", - "family": "gpt-pro", + "gpt-5-chat-latest": { + "id": "gpt-5-chat-latest", + "name": "GPT-5 Chat (latest)", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": false, - "structured_output": false, + "structured_output": true, + "temperature": true, + "knowledge": "2024-09-30", "release_date": "2025-08-07", "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 120 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10 + } }, - "openai/gpt-5": { - "id": "openai/gpt-5", - "name": "GPT 5", - "family": "gpt", + "claude-opus-4-20250514": { + "id": "claude-opus-4-20250514", + "name": "Claude Opus 4", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "openai/chatgpt-4o-latest": { - "id": "openai/chatgpt-4o-latest", - "name": "ChatGPT 4o", - "family": "gpt", - "attachment": true, + "qwen2-5-vl-72b-instruct": { + "id": "qwen2-5-vl-72b-instruct", + "name": "Qwen2.5-VL 72B Instruct", + "family": "qwen", + "attachment": false, "reasoning": false, "tool_call": true, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 2.8, + "output": 8.4 + } + }, + "gpt-5.5-pro": { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, "structured_output": true, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 4.998, "output": 14.993999999999998 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180, + "context_over_200k": { + "input": 60, + "output": 270 + }, + "tiers": [ + { + "input": 60, + "output": 270, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "openai/gpt-4-turbo": { - "id": "openai/gpt-4-turbo", - "name": "GPT-4 Turbo", + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2023-11-06", - "last_updated": "2024-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 10, "output": 30 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "openai/gpt-4o": { - "id": "openai/gpt-4o", - "name": "GPT-4o", - "family": "gpt", - "attachment": true, + "devstral-small-2507": { + "id": "devstral-small-2507", + "name": "Devstral Small", + "family": "devstral", + "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.499, "output": 9.996 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "tool_call": true, + "temperature": true, + "knowledge": "2025-05", + "release_date": "2025-07-10", + "last_updated": "2025-07-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "openai/o3-mini-high": { - "id": "openai/o3-mini-high", - "name": "OpenAI o3-mini (High)", - "family": "o-mini", + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-01-31", - "last_updated": "2025-01-31", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.64, "output": 2.588 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "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 + } }, - "openai/gpt-5-mini": { - "id": "openai/gpt-5-mini", - "name": "GPT 5 Mini", - "family": "gpt-mini", + "gemini-2.0-flash-lite": { + "id": "gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite", + "family": "gemini-flash-lite", "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } - }, - "openai/gpt-4-turbo-preview": { - "id": "openai/gpt-4-turbo-preview", - "name": "GPT-4 Turbo Preview", - "family": "gpt", - "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2023-11-06", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 9.996, "output": 30.004999999999995 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "openai/gpt-4o-mini": { - "id": "openai/gpt-4o-mini", - "name": "GPT-4o mini", + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", "family": "gpt-mini", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.1496, "output": 0.595 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "openai/gpt-5.1-codex-max": { - "id": "openai/gpt-5.1-codex-max", - "name": "GPT 5.1 Codex Max", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 20 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "openai/gpt-4.1": { - "id": "openai/gpt-4.1", - "name": "GPT 4.1", - "family": "gpt", - "attachment": true, + "grok-3": { + "id": "grok-3", + "name": "Grok 3", + "family": "grok", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-09-10", - "last_updated": "2025-09-10", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 1047576, "input": 1047576, "output": 32768 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "openai/gpt-5.1-chat-latest": { - "id": "openai/gpt-5.1-chat-latest", - "name": "GPT 5.1 Chat (Latest)", - "family": "gpt", + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "Grok 4 Fast (Non-Reasoning)", + "family": "grok", "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 400000, "output": 16384 } - }, - "openai/gpt-3.5-turbo": { - "id": "openai/gpt-3.5-turbo", - "name": "GPT-3.5 Turbo", - "family": "gpt", - "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2022-11-30", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 16385, "input": 16385, "output": 4096 } - }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, - "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.25 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "openai/gpt-5.1-chat": { - "id": "openai/gpt-5.1-chat", - "name": "GPT 5.1 Chat", - "family": "gpt", + "sonar-reasoning-pro": { + "id": "sonar-reasoning-pro", + "name": "Sonar Reasoning Pro", + "family": "sonar-reasoning", "attachment": true, "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } - }, - "openai/o1": { - "id": "openai/o1", - "name": "OpenAI o1", - "family": "o", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-17", - "last_updated": "2024-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.993999999999998, "output": 59.993 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } - }, - "openai/o3": { - "id": "openai/o3", - "name": "OpenAI o3", - "family": "o", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } - }, - "openai/gpt-4o-search-preview": { - "id": "openai/gpt-4o-search-preview", - "name": "GPT-4o Search Preview", - "family": "gpt", + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 2, + "output": 8 + } + } + } + }, + "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.0-flash": { + "id": "gemini-2.0-flash", + "name": "Gemini 2.0 Flash", + "family": "gemini-flash", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-05-13", - "last_updated": "2024-05-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.47, "output": 5.88 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.025 + } }, - "openai/o4-mini-high": { - "id": "openai/o4-mini-high", - "name": "OpenAI o4-mini high", - "family": "o-mini", - "attachment": false, + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } - }, - "openai/gpt-4o-2024-11-20": { - "id": "openai/gpt-4o-2024-11-20", - "name": "GPT-4o (2024-11-20)", - "family": "gpt", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-11-20", - "last_updated": "2024-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "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 + } + } }, - "openai/gpt-5.2-chat": { - "id": "openai/gpt-5.2-chat", - "name": "GPT 5.2 Chat", - "family": "gpt", + "gemini-flash-latest": { + "id": "gemini-flash-latest", + "name": "Gemini Flash Latest", + "family": "gemini-flash", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-01", - "last_updated": "2026-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "input": 400000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.075, + "cache_write": 0.383 + } }, - "openai/gpt-5.2": { - "id": "openai/gpt-5.2", - "name": "GPT 5.2", - "family": "gpt", + "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", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-01-01", - "last_updated": "2026-01-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 65536, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "openai/o4-mini-deep-research": { - "id": "openai/o4-mini-deep-research", - "name": "OpenAI o4-mini Deep Research", - "family": "o-mini", - "attachment": false, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.075, + "cache_write": 0.383 + } }, - "openai/gpt-5.1": { - "id": "openai/gpt-5.1", - "name": "GPT 5.1", - "family": "gpt", + "gemini-2.5-flash-preview-09-2025": { + "id": "gemini-2.5-flash-preview-09-2025", + "name": "Gemini 2.5 Flash Preview 09-25", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.075, + "cache_write": 0.383 + } }, - "openai/gpt-4o-mini-search-preview": { - "id": "openai/gpt-4o-mini-search-preview", - "name": "GPT-4o mini Search Preview", - "family": "gpt-mini", + "zai-org/glm-5-maas": { + "id": "zai-org/glm-5-maas", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.088, "output": 0.35 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } - }, - "openai/gpt-4.1-mini": { - "id": "openai/gpt-4.1-mini", - "name": "GPT 4.1 Mini", - "family": "gpt-mini", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.6 }, - "limit": { "context": 1047576, "input": 1047576, "output": 32768 } - }, - "openai/o3-pro-2025-06-10": { - "id": "openai/o3-pro-2025-06-10", - "name": "OpenAI o3-pro (2025-06-10)", - "family": "o-pro", + "reasoning": true, + "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": true, + "limit": { + "context": 202752, + "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": 1, + "output": 3.2, + "cache_read": 0.1 + } + }, + "zai-org/glm-4.7-maas": { + "id": "zai-org/glm-4.7-maas", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, - "release_date": "2025-06-10", - "last_updated": "2025-06-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "temperature": true, + "knowledge": "2025-04", + "release_date": "2026-01-06", + "last_updated": "2026-01-06", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "output": 128000 + }, + "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 + } }, - "openai/gpt-5-chat-latest": { - "id": "openai/gpt-5-chat-latest", - "name": "GPT 5 Chat", - "family": "gpt", - "attachment": true, + "deepseek-ai/deepseek-v3.2-maas": { + "id": "deepseek-ai/deepseek-v3.2-maas", + "name": "DeepSeek V3.2", + "family": "deepseek", + "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-12-17", + "last_updated": "2026-04-04", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 65536 + }, + "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 + } }, - "openai/gpt-5-nano": { - "id": "openai/gpt-5-nano", - "name": "GPT 5 Nano", - "family": "gpt-nano", - "attachment": true, + "deepseek-ai/deepseek-v3.1-maas": { + "id": "deepseek-ai/deepseek-v3.1-maas", + "name": "DeepSeek V3.1", + "family": "deepseek", + "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-07", - "last_updated": "2025-08-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0.4 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "tool_call": true, + "structured_output": true, + "temperature": true, + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text", "pdf"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 32768 + }, + "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 + } }, - "openai/gpt-oss-safeguard-20b": { - "id": "openai/gpt-oss-safeguard-20b", - "name": "GPT OSS Safeguard 20B", + "openai/gpt-oss-120b-maas": { + "id": "openai/gpt-oss-120b-maas", + "name": "GPT OSS 120B", "family": "gpt-oss", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-10-29", - "last_updated": "2025-10-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.075, "output": 0.3 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "tool_call": 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 + }, + "cost": { + "input": 0.09, + "output": 0.36 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", + "openai/gpt-oss-20b-maas": { + "id": "openai/gpt-oss-20b-maas", "name": "GPT OSS 20B", "family": "gpt-oss", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "temperature": true, "release_date": "2025-08-05", "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.04, "output": 0.15 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32768 + }, + "cost": { + "input": 0.07, + "output": 0.25 + } }, - "openai/gpt-5.1-2025-11-13": { - "id": "openai/gpt-5.1-2025-11-13", - "name": "GPT-5.1 (2025-11-13)", - "family": "gpt", + "meta/llama-3.3-70b-instruct-maas": { + "id": "meta/llama-3.3-70b-instruct-maas", + "name": "Llama 3.3 70B Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 1000000, "input": 1000000, "output": 32768 } - }, - "openai/gpt-4o-2024-08-06": { - "id": "openai/gpt-4o-2024-08-06", - "name": "GPT-4o (2024-08-06)", - "family": "gpt", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-08-06", - "last_updated": "2024-08-06", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.499, "output": 9.996 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "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 + }, + "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 + } }, - "openai/gpt-4.1-nano": { - "id": "openai/gpt-4.1-nano", - "name": "GPT 4.1 Nano", - "family": "gpt-nano", + "meta/llama-4-maverick-17b-128e-instruct-maas": { + "id": "meta/llama-4-maverick-17b-128e-instruct-maas", + "name": "Llama 4 Maverick 17B 128E Instruct", + "family": "llama", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-14", - "last_updated": "2025-04-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1047576, "input": 1047576, "output": 32768 } + "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 + } }, - "openai/o1-preview": { - "id": "openai/o1-preview", - "name": "OpenAI o1-preview", - "family": "o", + "qwen/qwen3-235b-a22b-instruct-2507-maas": { + "id": "qwen/qwen3-235b-a22b-instruct-2507-maas", + "name": "Qwen3 235B A22B Instruct", + "family": "qwen", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2024-09-12", - "last_updated": "2024-09-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 14.993999999999998, "output": 59.993 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } - }, - "openai/gpt-5-codex": { - "id": "openai/gpt-5-codex", - "name": "GPT-5 Codex", - "family": "gpt-codex", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-15", - "last_updated": "2025-09-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "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 + }, + "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 + } }, - "openai/o4-mini": { - "id": "openai/o4-mini", - "name": "OpenAI o4-mini", - "family": "o-mini", + "moonshotai/kimi-k2-thinking-maas": { + "id": "moonshotai/kimi-k2-thinking-maas", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + }, + "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 + } + }, + "gemini-flash-lite-latest": { + "id": "gemini-flash-lite-latest", + "name": "Gemini Flash-Lite Latest", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "openai/o3-deep-research": { - "id": "openai/o3-deep-research", - "name": "OpenAI o3 Deep Research", - "family": "o", - "attachment": false, + "gemini-2.5-pro-preview-05-06": { + "id": "gemini-2.5-pro-preview-05-06", + "name": "Gemini 2.5 Pro Preview 05-06", + "family": "gemini-pro", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-05-06", + "last_updated": "2025-05-06", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 9.996, "output": 19.992 }, - "limit": { "context": 200000, "input": 200000, "output": 100000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31 + } }, - "openai/gpt-5.1-codex": { - "id": "openai/gpt-5.1-codex", - "name": "GPT 5.1 Codex", - "family": "gpt-codex", + "claude-haiku-4-5@20251001": { + "id": "claude-haiku-4-5@20251001", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-13", - "last_updated": "2025-11-13", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "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 + } }, - "openai/gpt-5.2-pro": { - "id": "openai/gpt-5.2-pro", - "name": "GPT 5.2 Pro", - "family": "gpt-pro", + "gemini-3.1-pro-preview-customtools": { + "id": "gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2026-01-01", - "last_updated": "2026-01-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 21, "output": 168 }, - "limit": { "context": 400000, "input": 400000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 18, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "CrucibleLab/L3.3-70B-Loki-V2.0": { - "id": "CrucibleLab/L3.3-70B-Loki-V2.0", - "name": "L3.3 70B Loki v2.0", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-22", - "last_updated": "2026-01-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "claude-sonnet-4-6@default": { + "id": "claude-sonnet-4-6@default", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75, + "context_over_200k": { + "input": 6, + "output": 22.5, + "cache_read": 0.6, + "cache_write": 7.5 + }, + "tiers": [ + { + "input": 6, + "output": 22.5, + "cache_read": 0.6, + "cache_write": 7.5, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "microsoft/MAI-DS-R1-FP8": { - "id": "microsoft/MAI-DS-R1-FP8", - "name": "Microsoft DeepSeek R1", - "family": "deepseek", + "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-25", + "family": "gemini-flash-lite", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", "release_date": "2025-09-25", "last_updated": "2025-09-25", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "microsoft/wizardlm-2-8x22b": { - "id": "microsoft/wizardlm-2-8x22b", - "name": "WizardLM-2 8x22B", - "family": "gpt", + "claude-3-5-haiku@20241022": { + "id": "claude-3-5-haiku@20241022", + "name": "Claude Haiku 3.5", + "family": "claude-haiku", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } + "limit": { + "context": 200000, + "output": 8192 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "cohere/command-r-plus-08-2024": { - "id": "cohere/command-r-plus-08-2024", - "name": "Cohere: Command R+", - "family": "command-r", - "attachment": false, - "reasoning": false, + "gemini-3.1-flash-lite-preview": { + "id": "gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": false, - "release_date": "2024-08-30", - "last_updated": "2024-08-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 2.856, "output": 14.246 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "input_audio": 0.5 + } }, - "cohere/command-r": { - "id": "cohere/command-r", - "name": "Cohere: Command R", - "family": "command-r", - "attachment": false, + "claude-3-5-sonnet@20241022": { + "id": "claude-3-5-sonnet@20241022", + "name": "Claude Sonnet 3.5 v2", + "family": "claude-sonnet", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-03-11", - "last_updated": "2024-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-04-30", + "release_date": "2024-10-22", + "last_updated": "2024-10-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.476, "output": 1.428 }, - "limit": { "context": 128000, "input": 128000, "output": 4096 } + "limit": { + "context": 200000, + "output": 8192 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "x-ai/grok-4-fast": { - "id": "x-ai/grok-4-fast", - "name": "Grok 4 Fast", - "family": "grok", + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-09-20", - "last_updated": "2025-09-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "input": 2000000, "output": 131072 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 2, + "output": 12, + "cache_read": 0.2, + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + }, + "tiers": [ + { + "input": 4, + "output": 18, + "cache_read": 0.4, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "x-ai/grok-4-fast:thinking": { - "id": "x-ai/grok-4-fast:thinking", - "name": "Grok 4 Fast Thinking", - "family": "grok", + "claude-opus-4-1@20250805": { + "id": "claude-opus-4-1@20250805", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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/google-vertex/anthropic" + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } + }, + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "input": 2000000, "output": 131072 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 3, + "cache_read": 0.05, + "input_audio": 1 + } }, - "x-ai/grok-4.1-fast": { - "id": "x-ai/grok-4.1-fast", - "name": "Grok 4.1 Fast", - "family": "grok", + "gemini-2.5-flash-preview-05-20": { + "id": "gemini-2.5-flash-preview-05-20", + "name": "Gemini 2.5 Flash Preview 05-20", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "input": 2000000, "output": 131072 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.0375 + } }, - "x-ai/grok-code-fast-1": { - "id": "x-ai/grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "gemini-embedding-001": { + "id": "gemini-embedding-001", + "name": "Gemini Embedding 001", + "family": "gemini", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-08-28", - "last_updated": "2025-08-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-05", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 256000, "input": 256000, "output": 131072 } + "limit": { + "context": 2048, + "output": 3072 + }, + "cost": { + "input": 0.15, + "output": 0 + } }, - "x-ai/grok-4.1-fast-reasoning": { - "id": "x-ai/grok-4.1-fast-reasoning", - "name": "Grok 4.1 Fast Reasoning", - "family": "grok", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-20", - "last_updated": "2025-11-20", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "input": 2000000, "output": 131072 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125, + "context_over_200k": { + "input": 2.5, + "output": 15, + "cache_read": 0.25 + }, + "tiers": [ + { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "x-ai/grok-4-07-09": { - "id": "x-ai/grok-4-07-09", - "name": "Grok 4", - "family": "grok", + "gemini-2.5-pro-preview-06-05": { + "id": "gemini-2.5-pro-preview-06-05", + "name": "Gemini 2.5 Pro Preview 06-05", + "family": "gemini-pro", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 256000, "input": 256000, "output": 131072 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31 + } }, - "anthropic/claude-opus-4.6:thinking:max": { - "id": "anthropic/claude-opus-4.6:thinking:max", - "name": "Claude 4.6 Opus Thinking Max", - "family": "claude-opus", + "claude-sonnet-4@20250514": { + "id": "claude-sonnet-4@20250514", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "anthropic/claude-opus-4.6": { - "id": "anthropic/claude-opus-4.6", - "name": "Claude 4.6 Opus", - "family": "claude-opus", + "gemini-3.1-flash-lite": { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "family": "gemini-flash-lite", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.25, + "output": 1.5, + "cache_read": 0.025, + "input_audio": 0.5 + } }, - "anthropic/claude-sonnet-4.6:thinking": { - "id": "anthropic/claude-sonnet-4.6:thinking", - "name": "Claude Sonnet 4.6 Thinking", + "claude-3-7-sonnet@20250219": { + "id": "claude-3-7-sonnet@20250219", + "name": "Claude Sonnet 3.7", "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2.992, "output": 14.993999999999998 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "anthropic/claude-opus-4.6:thinking:medium": { - "id": "anthropic/claude-opus-4.6:thinking:medium", - "name": "Claude 4.6 Opus Thinking Medium", + "claude-opus-4@20250514": { + "id": "claude-opus-4@20250514", + "name": "Claude Opus 4", "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } - }, - "anthropic/claude-sonnet-4.6": { - "id": "anthropic/claude-sonnet-4.6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 2.992, "output": 14.993999999999998 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } + "limit": { + "context": 200000, + "output": 32000 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "anthropic/claude-opus-4.6:thinking": { - "id": "anthropic/claude-opus-4.6:thinking", - "name": "Claude 4.6 Opus Thinking", + "claude-opus-4-5@20251101": { + "id": "claude-opus-4-5@20251101", + "name": "Claude Opus 4.5", "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-03-31", + "release_date": "2025-11-01", + "last_updated": "2025-11-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } + "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 + } }, - "anthropic/claude-opus-4.6:thinking:low": { - "id": "anthropic/claude-opus-4.6:thinking:low", - "name": "Claude 4.6 Opus Thinking Low", - "family": "claude-opus", + "gemini-2.5-flash-preview-04-17": { + "id": "gemini-2.5-flash-preview-04-17", + "name": "Gemini 2.5 Flash Preview 04-17", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-04-17", + "last_updated": "2025-04-17", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 4.998, "output": 25.007 }, - "limit": { "context": 1000000, "input": 1000000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.0375 + } }, - "raifle/sorcererlm-8x22b": { - "id": "raifle/sorcererlm-8x22b", - "name": "SorcererLM 8x22B", - "family": "mixtral", + "claude-sonnet-4-5@20250929": { + "id": "claude-sonnet-4-5@20250929", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 4.505, "output": 4.505 }, - "limit": { "context": 16000, "input": 16000, "output": 8192 } - }, - "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", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } - }, - "NousResearch 2/hermes-4-70b": { - "id": "NousResearch 2/hermes-4-70b", - "name": "Hermes 4 Medium", - "family": "nousresearch", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-03", - "last_updated": "2025-07-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2006, "output": 0.39949999999999997 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } - }, - "NousResearch 2/hermes-4-405b:thinking": { - "id": "NousResearch 2/hermes-4-405b:thinking", - "name": "Hermes 4 Large (Thinking)", - "family": "nousresearch", - "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } - }, - "NousResearch 2/hermes-3-llama-3.1-70b": { - "id": "NousResearch 2/hermes-3-llama-3.1-70b", - "name": "Hermes 3 70B", - "family": "nousresearch", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-07", - "last_updated": "2026-01-07", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.408, "output": 0.408 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } - }, - "NousResearch 2/Hermes-4-70B:thinking": { - "id": "NousResearch 2/Hermes-4-70B:thinking", - "name": "Hermes 4 (Thinking)", - "family": "nousresearch", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-17", - "last_updated": "2025-09-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.2006, "output": 0.39949999999999997 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 64000 + }, + "provider": { + "npm": "@ai-sdk/google-vertex/anthropic" + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "NousResearch 2/hermes-4-405b": { - "id": "NousResearch 2/hermes-4-405b", - "name": "Hermes 4 Large", - "family": "nousresearch", - "attachment": false, - "reasoning": false, + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } - }, - "NousResearch 2/DeepHermes-3-Mistral-24B-Preview": { - "id": "NousResearch 2/DeepHermes-3-Mistral-24B-Preview", - "name": "DeepHermes-3 Mistral 24B (Preview)", - "family": "nousresearch", - "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"] }, + "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, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.01, + "input_audio": 0.3 + } }, - "deepseek/deepseek-v3.2:thinking": { - "id": "deepseek/deepseek-v3.2:thinking", - "name": "DeepSeek V3.2 Thinking", - "family": "deepseek", + "claude-opus-4-6@default": { + "id": "claude-opus-4-6@default", + "name": "Claude Opus 4.6", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 0.27999999999999997, "output": 0.42000000000000004 }, - "limit": { "context": 163000, "input": 163000, "output": 65536 } + "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, + "context_over_200k": { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5 + }, + "tiers": [ + { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } }, - "deepseek/deepseek-prover-v2-671b": { - "id": "deepseek/deepseek-prover-v2-671b", - "name": "DeepSeek Prover v2 671B", - "family": "deepseek", - "attachment": false, + "gemini-2.0-flash-lite": { + "id": "gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-30", - "last_updated": "2025-04-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 2.5 }, - "limit": { "context": 160000, "input": 160000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "deepseek/deepseek-v3.2-speciale": { - "id": "deepseek/deepseek-v3.2-speciale", - "name": "DeepSeek V3.2 Speciale", - "family": "deepseek", + "claude-opus-4-7@default": { + "id": "claude-opus-4-7@default", + "name": "Claude Opus 4.7", + "family": "claude-opus", "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27999999999999997, "output": 0.42000000000000004 }, - "limit": { "context": 163000, "input": 163000, "output": 65536 } - }, - "deepseek/deepseek-v3.2": { - "id": "deepseek/deepseek-v3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", - "attachment": true, - "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "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, - "cost": { "input": 0.27999999999999997, "output": 0.42000000000000004 }, - "limit": { "context": 163000, "input": 163000, "output": 65536 } - }, - "zai-org/glm-4.7-flash": { - "id": "zai-org/glm-4.7-flash", - "name": "GLM 4.7 Flash", + "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, + "context_over_200k": { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5 + }, + "tiers": [ + { + "input": 10, + "output": 37.5, + "cache_read": 1, + "cache_write": 12.5, + "tier": { + "type": "context", + "size": 200000 + } + } + ] + } + } + } + }, + "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/zai-org/glm-4.7-flash": { + "id": "@cf/zai-org/glm-4.7-flash", + "name": "GLM-4.7-Flash", "family": "glm-flash", "attachment": false, "reasoning": true, "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"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.06, + "output": 0.4 + } + }, + "@cf/nvidia/nemotron-3-120b-a12b": { + "id": "@cf/nvidia/nemotron-3-120b-a12b", + "name": "Nemotron 3 Super 120B", + "family": "nemotron", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "release_date": "2026-03-11", + "last_updated": "2026-03-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.07, "output": 0.4 }, - "limit": { "context": 200000, "input": 200000, "output": 128000 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "zai-org/glm-5.1:thinking": { - "id": "zai-org/glm-5.1:thinking", - "name": "GLM 5.1 Thinking", - "family": "glm", + "@cf/openai/gpt-oss-20b": { + "id": "@cf/openai/gpt-oss-20b", + "name": "GPT OSS 20B", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-03-27", - "last_updated": "2026-03-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 2.55 }, - "limit": { "context": 200000, "input": 200000, "output": 131072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.2, + "output": 0.3 + } }, - "zai-org/glm-5:thinking": { - "id": "zai-org/glm-5:thinking", - "name": "GLM 5 Thinking", - "family": "glm", + "@cf/openai/gpt-oss-120b": { + "id": "@cf/openai/gpt-oss-120b", + "name": "GPT OSS 120B", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "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 + } + }, + "@cf/meta/llama-4-scout-17b-16e-instruct": { + "id": "@cf/meta/llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "family": "llama", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "release_date": "2025-04-16", + "last_updated": "2025-04-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 2.55 }, - "limit": { "context": 200000, "input": 200000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.27, + "output": 0.85 + } }, - "zai-org/glm-5": { - "id": "zai-org/glm-5", - "name": "GLM 5", - "family": "glm", - "attachment": false, + "@cf/google/gemma-4-26b-a4b-it": { + "id": "@cf/google/gemma-4-26b-a4b-it", + "name": "Gemma 4 26B A4B IT", + "family": "gemma", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-12-15", + "last_updated": "2025-12-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 2.55 }, - "limit": { "context": 200000, "input": 200000, "output": 128000 } + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "zai-org/glm-5.1": { - "id": "zai-org/glm-5.1", - "name": "GLM 5.1", - "family": "glm", - "attachment": false, + "@cf/moonshotai/kimi-k2.5": { + "id": "@cf/moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, - "release_date": "2026-03-27", - "last_updated": "2026-03-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-01-27", + "last_updated": "2026-01-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 2.55 }, - "limit": { "context": 200000, "input": 200000, "output": 131072 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.6, + "output": 3, + "cache_read": 0.1 + } }, - "zai-org/glm-4.7": { - "id": "zai-org/glm-4.7", - "name": "GLM 4.7", - "family": "glm", - "attachment": false, + "@cf/moonshotai/kimi-k2.6": { + "id": "@cf/moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.15, "output": 0.8 }, - "limit": { "context": 200000, "input": 200000, "output": 128000 } - }, - "NeverSleep/Llama-3-Lumimaid-70B-v0.1": { - "id": "NeverSleep/Llama-3-Lumimaid-70B-v0.1", - "name": "Lumimaid 70b", - "family": "llama", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.006, "output": 2.006 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } - }, - "NeverSleep/Lumimaid-v0.2-70B": { - "id": "NeverSleep/Lumimaid-v0.2-70B", - "name": "Lumimaid v0.2", - "family": "llama", + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } + } + } + }, + "groq": { + "id": "groq", + "env": ["GROQ_API_KEY"], + "npm": "@ai-sdk/groq", + "name": "Groq", + "doc": "https://console.groq.com/docs/models", + "models": { + "gemma2-9b-it": { + "id": "gemma2-9b-it", + "name": "Gemma 2 9B", + "family": "gemma", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 1.5 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "tool_call": true, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2024-06-27", + "last_updated": "2024-06-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": { - "id": "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1", - "name": "Nvidia Nemotron Ultra 253B", - "family": "nemotron", + "mistral-saba-24b": { + "id": "mistral-saba-24b", + "name": "Mistral Saba 24B", + "family": "mistral", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-03", - "last_updated": "2025-07-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-08", + "release_date": "2025-02-06", + "last_updated": "2025-02-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 0.8 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 32768, + "output": 32768 + }, + "status": "deprecated", + "cost": { + "input": 0.79, + "output": 0.79 + } }, - "nvidia/nvidia-nemotron-nano-9b-v2": { - "id": "nvidia/nvidia-nemotron-nano-9b-v2", - "name": "Nvidia Nemotron Nano 9B v2", - "family": "nemotron", + "deepseek-r1-distill-llama-70b": { + "id": "deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-18", - "last_updated": "2025-08-18", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.75, + "output": 0.99 + } }, - "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5": { - "id": "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5", - "name": "Nvidia Nemotron Super 49B v1.5", - "family": "nemotron", + "llama-guard-3-8b": { + "id": "llama-guard-3-8b", + "name": "Llama Guard 3 8B", + "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": false, - "cost": { "input": 0.05, "output": 0.25 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "temperature": true, + "release_date": "2024-07-23", + "last_updated": "2024-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": { - "id": "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF", - "name": "Nvidia Nemotron 70b", - "family": "nemotron", + "llama-3.3-70b-versatile": { + "id": "llama-3.3-70b-versatile", + "name": "Llama 3.3 70B Versatile", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.357, "output": 0.408 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "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 + }, + "cost": { + "input": 0.59, + "output": 0.79 + } }, - "nvidia/Llama-3.3-Nemotron-Super-49B-v1": { - "id": "nvidia/Llama-3.3-Nemotron-Super-49B-v1", - "name": "Nvidia Nemotron Super 49B", - "family": "nemotron", + "allam-2-7b": { + "id": "allam-2-7b", + "name": "ALLaM-2-7b", + "family": "allam", "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"] }, + "temperature": true, + "knowledge": "2024-09", + "release_date": "2024-09", + "last_updated": "2024-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nvidia/nemotron-3-nano-30b-a3b": { - "id": "nvidia/nemotron-3-nano-30b-a3b", - "name": "Nvidia Nemotron 3 Nano 30B", - "family": "nemotron", + "whisper-large-v3": { + "id": "whisper-large-v3", + "name": "Whisper Large V3", + "family": "whisper", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-12-15", - "last_updated": "2025-12-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 256000, "input": 256000, "output": 262144 } - }, - "z-ai/glm-4.6:thinking": { - "id": "z-ai/glm-4.6:thinking", - "name": "GLM 4.6 Thinking", - "family": "glm", - "attachment": false, - "reasoning": true, - "tool_call": true, - "structured_output": true, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.5 }, - "limit": { "context": 200000, "input": 200000, "output": 65535 } - }, - "z-ai/glm-4.5v:thinking": { - "id": "z-ai/glm-4.5v:thinking", - "name": "GLM 4.5V Thinking", - "family": "glmv", - "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-22", - "last_updated": "2025-11-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 1.7999999999999998 }, - "limit": { "context": 64000, "input": 64000, "output": 96000 } + "temperature": true, + "knowledge": "2023-09", + "release_date": "2023-09-01", + "last_updated": "2025-09-05", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 448, + "output": 448 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "z-ai/glm-4.6": { - "id": "z-ai/glm-4.6", - "name": "GLM 4.6", - "family": "glm", + "llama-3.1-8b-instant": { + "id": "llama-3.1-8b-instant", + "name": "Llama 3.1 8B Instant", + "family": "llama", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.5 }, - "limit": { "context": 200000, "input": 200000, "output": 65535 } - }, - "z-ai/glm-4.5v": { - "id": "z-ai/glm-4.5v", - "name": "GLM 4.5V", - "family": "glmv", - "attachment": true, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-22", - "last_updated": "2025-11-22", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.6, "output": 1.7999999999999998 }, - "limit": { "context": 64000, "input": 64000, "output": 96000 } + "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.05, + "output": 0.08 + } }, - "nex-agi/deepseek-v3.1-nex-n1": { - "id": "nex-agi/deepseek-v3.1-nex-n1", - "name": "DeepSeek V3.1 Nex N1", - "family": "deepseek", + "llama3-70b-8192": { + "id": "llama3-70b-8192", + "name": "Llama 3 70B", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-10", - "last_updated": "2025-12-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27999999999999997, "output": 0.42000000000000004 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } - }, - "stepfun-ai/step-3.5-flash:thinking": { - "id": "stepfun-ai/step-3.5-flash:thinking", - "name": "Step 3.5 Flash Thinking", - "family": "step", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-02", - "last_updated": "2026-02-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 256000, "input": 256000, "output": 256000 } - }, - "stepfun-ai/step-3.5-flash": { - "id": "stepfun-ai/step-3.5-flash", - "name": "Step 3.5 Flash", - "family": "step", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-02", - "last_updated": "2026-02-02", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 256000, "input": 256000, "output": 256000 } + "tool_call": true, + "temperature": true, + "knowledge": "2023-03", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.59, + "output": 0.79 + } }, - "cognitivecomputations/dolphin-2.9.2-qwen2-72b": { - "id": "cognitivecomputations/dolphin-2.9.2-qwen2-72b", - "name": "Dolphin 72b", + "qwen-qwq-32b": { + "id": "qwen-qwq-32b", + "name": "Qwen QwQ 32B", "family": "qwen", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-27", - "last_updated": "2025-02-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.306, "output": 0.306 }, - "limit": { "context": 8192, "input": 8192, "output": 4096 } - }, - "allenai/olmo-3.1-32b-instruct": { - "id": "allenai/olmo-3.1-32b-instruct", - "name": "Olmo 3.1 32B Instruct", - "family": "allenai", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-25", - "last_updated": "2026-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } - }, - "allenai/olmo-3-32b-think": { - "id": "allenai/olmo-3-32b-think", - "name": "Olmo 3 32B Think", - "family": "allenai", - "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 0.44999999999999996 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "tool_call": true, + "temperature": true, + "knowledge": "2024-09", + "release_date": "2024-11-27", + "last_updated": "2024-11-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "status": "deprecated", + "cost": { + "input": 0.29, + "output": 0.39 + } }, - "allenai/olmo-3.1-32b-think": { - "id": "allenai/olmo-3.1-32b-think", - "name": "Olmo 3.1 32B Think", - "family": "allenai", + "whisper-large-v3-turbo": { + "id": "whisper-large-v3-turbo", + "name": "Whisper Large v3 Turbo", + "family": "whisper", "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-25", - "last_updated": "2026-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.5 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } - }, - "allenai/molmo-2-8b": { - "id": "allenai/molmo-2-8b", - "name": "Molmo 2 8B", - "family": "allenai", - "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2026-02-14", - "last_updated": "2026-02-14", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 36864, "input": 36864, "output": 36864 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 448, + "output": 448 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "TheDrummer 2/Cydonia-24B-v4.1": { - "id": "TheDrummer 2/Cydonia-24B-v4.1", - "name": "The Drummer Cydonia 24B v4.1", + "llama3-8b-8192": { + "id": "llama3-8b-8192", + "name": "Llama 3 8B", "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-19", - "last_updated": "2025-08-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1003, "output": 0.1207 }, - "limit": { "context": 16384, "input": 16384, "output": 32768 } + "tool_call": true, + "temperature": true, + "knowledge": "2023-03", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.05, + "output": 0.08 + } }, - "TheDrummer 2/UnslopNemo-12B-v4.1": { - "id": "TheDrummer 2/UnslopNemo-12B-v4.1", - "name": "UnslopNemo 12b v4", - "family": "llama", - "attachment": true, + "canopylabs/orpheus-arabic-saudi": { + "id": "canopylabs/orpheus-arabic-saudi", + "name": "Orpheus Arabic Saudi", + "family": "canopylabs", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-12-16", + "release_date": "2025-12-16", + "last_updated": "2025-12-16", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "limit": { + "context": 4000, + "output": 50000 + }, + "cost": { + "input": 40, + "output": 0 + } }, - "TheDrummer 2/Cydonia-24B-v4.3": { - "id": "TheDrummer 2/Cydonia-24B-v4.3", - "name": "The Drummer Cydonia 24B v4.3", - "family": "llama", + "canopylabs/orpheus-v1-english": { + "id": "canopylabs/orpheus-v1-english", + "name": "Orpheus V1 English", + "family": "canopylabs", "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"] }, + "temperature": true, + "knowledge": "2025-12-19", + "release_date": "2025-12-19", + "last_updated": "2025-12-19", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, "open_weights": false, - "cost": { "input": 0.1003, "output": 0.1207 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "limit": { + "context": 4000, + "output": 50000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "TheDrummer 2/skyfall-36b-v2": { - "id": "TheDrummer 2/skyfall-36b-v2", - "name": "TheDrummer Skyfall 36B V2", + "meta-llama/llama-4-scout-17b-16e-instruct": { + "id": "meta-llama/llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B", "family": "llama", - "attachment": true, + "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 64000, "input": 64000, "output": 32768 } + "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": 131072, + "output": 8192 + }, + "cost": { + "input": 0.11, + "output": 0.34 + } }, - "TheDrummer 2/Anubis-70B-v1": { - "id": "TheDrummer 2/Anubis-70B-v1", - "name": "Anubis 70B v1", + "meta-llama/llama-prompt-guard-2-22m": { + "id": "meta-llama/llama-prompt-guard-2-22m", + "name": "Llama Prompt Guard 2 22M", "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.31, "output": 0.31 }, - "limit": { "context": 65536, "input": 65536, "output": 16384 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512, + "output": 512 + }, + "cost": { + "input": 0.03, + "output": 0.03 + } }, - "TheDrummer 2/Cydonia-24B-v2": { - "id": "TheDrummer 2/Cydonia-24B-v2", - "name": "The Drummer Cydonia 24B v2", + "meta-llama/llama-guard-4-12b": { + "id": "meta-llama/llama-guard-4-12b", + "name": "Llama Guard 4 12B", "family": "llama", "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": false, - "cost": { "input": 0.1003, "output": 0.1207 }, - "limit": { "context": 16384, "input": 16384, "output": 32768 } + "temperature": true, + "release_date": "2025-04-05", + "last_updated": "2025-04-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 1024 + }, + "status": "deprecated", + "cost": { + "input": 0.2, + "output": 0.2 + } }, - "TheDrummer 2/Cydonia-24B-v4": { - "id": "TheDrummer 2/Cydonia-24B-v4", - "name": "The Drummer Cydonia 24B v4", + "meta-llama/llama-4-maverick-17b-128e-instruct": { + "id": "meta-llama/llama-4-maverick-17b-128e-instruct", + "name": "Llama 4 Maverick 17B", "family": "llama", "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": false, - "cost": { "input": 0.2006, "output": 0.2414 }, - "limit": { "context": 16384, "input": 16384, "output": 32768 } + "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": 131072, + "output": 8192 + }, + "status": "deprecated", + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "TheDrummer 2/Anubis-70B-v1.1": { - "id": "TheDrummer 2/Anubis-70B-v1.1", - "name": "Anubis 70B v1.1", + "meta-llama/llama-prompt-guard-2-86m": { + "id": "meta-llama/llama-prompt-guard-2-86m", + "name": "Llama Prompt Guard 2 86M", "family": "llama", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.31, "output": 0.31 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2024-10-01", + "last_updated": "2024-10-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512, + "output": 512 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } }, - "TheDrummer 2/Magidonia-24B-v4.3": { - "id": "TheDrummer 2/Magidonia-24B-v4.3", - "name": "The Drummer Magidonia 24B v4.3", - "family": "llama", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "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": false, - "cost": { "input": 0.1003, "output": 0.1207 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "reasoning": true, + "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": 65536 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "TheDrummer 2/Rocinante-12B-v1.1": { - "id": "TheDrummer 2/Rocinante-12B-v1.1", - "name": "Rocinante 12b", - "family": "llama", + "openai/gpt-oss-safeguard-20b": { + "id": "openai/gpt-oss-safeguard-20b", + "name": "Safety GPT OSS 20B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-03-05", + "last_updated": "2025-03-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.075, + "output": 0.3, + "cache_read": 0.037 + } + }, + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, + "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": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } + }, + "qwen/qwen3-32b": { + "id": "qwen/qwen3-32b", + "name": "Qwen3 32B", + "family": "qwen", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-11-08", + "release_date": "2024-12-23", + "last_updated": "2024-12-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 40960 + }, + "cost": { + "input": 0.29, + "output": 0.59 + } + }, + "groq/compound": { + "id": "groq/compound", + "name": "Compound", + "family": "groq", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-09-04", + "release_date": "2025-09-04", + "last_updated": "2025-09-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.408, "output": 0.595 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "google/gemini-3-flash-preview-thinking": { - "id": "google/gemini-3-flash-preview-thinking", - "name": "Gemini 3 Flash Thinking", - "family": "gemini-flash", - "attachment": true, + "groq/compound-mini": { + "id": "groq/compound-mini", + "name": "Compound Mini", + "family": "groq", + "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-09-04", + "release_date": "2025-09-04", + "last_updated": "2025-09-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "google/gemini-3-flash-preview": { - "id": "google/gemini-3-flash-preview", - "name": "Gemini 3 Flash (Preview)", - "family": "gemini-flash", + "moonshotai/kimi-k2-instruct": { + "id": "moonshotai/kimi-k2-instruct", + "name": "Kimi K2 Instruct", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-07-14", + "last_updated": "2025-07-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "status": "deprecated", + "cost": { + "input": 1, + "output": 3 + } + }, + "moonshotai/kimi-k2-instruct-0905": { + "id": "moonshotai/kimi-k2-instruct-0905", + "name": "Kimi K2 Instruct 0905", + "family": "kimi", + "attachment": false, + "reasoning": false, + "tool_call": true, + "structured_output": 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 + } + } + } + }, + "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": { + "mistral-nemo": { + "id": "mistral-nemo", + "name": "Mistral Nemo", + "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": 128000 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } + }, + "gpt-5.2-chat": { + "id": "gpt-5.2-chat", + "name": "GPT-5.2 Chat", + "family": "gpt-codex", "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 1048756, "input": 1048756, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "google/gemini-flash-1.5": { - "id": "google/gemini-flash-1.5", - "name": "Gemini 1.5 Flash", - "family": "gemini-flash", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-05-14", - "last_updated": "2024-05-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "codex-mini": { + "id": "codex-mini", + "name": "Codex Mini", + "family": "gpt-codex-mini", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2024-04", + "release_date": "2025-05-16", + "last_updated": "2025-05-16", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.0748, "output": 0.306 }, - "limit": { "context": 2000000, "input": 2000000, "output": 8192 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.5, + "output": 6, + "cache_read": 0.375 + } }, - "undi95/remm-slerp-l2-13b": { - "id": "undi95/remm-slerp-l2-13b", - "name": "ReMM SLERP 13B", - "family": "llama", + "phi-4-multimodal": { + "id": "phi-4-multimodal", + "name": "Phi-4-multimodal", + "family": "phi", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.7989999999999999, "output": 1.2069999999999999 }, - "limit": { "context": 6144, "input": 6144, "output": 4096 } + "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 + }, + "cost": { + "input": 0.08, + "output": 0.32, + "input_audio": 4 + } }, - "amazon/nova-lite-v1": { - "id": "amazon/nova-lite-v1", - "name": "Amazon Nova Lite 1.0", - "family": "nova-lite", + "phi-3.5-mini-instruct": { + "id": "phi-3.5-mini-instruct", + "name": "Phi-3.5-mini-instruct", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0595, "output": 0.238 }, - "limit": { "context": 300000, "input": 300000, "output": 5120 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "amazon/nova-2-lite-v1": { - "id": "amazon/nova-2-lite-v1", - "name": "Amazon Nova 2 Lite", - "family": "nova", - "attachment": false, + "llama-4-scout-17b-16e-instruct": { + "id": "llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "family": "llama", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "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.2, + "output": 0.78 + } + }, + "grok-4-1-fast-reasoning": { + "id": "grok-4-1-fast-reasoning", + "name": "Grok 4.1 Fast (Reasoning)", + "family": "grok", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "release_date": "2025-06-27", + "last_updated": "2025-06-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5099999999999999, "output": 4.25 }, - "limit": { "context": 1000000, "input": 1000000, "output": 65535 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "status": "beta", + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "amazon/nova-micro-v1": { - "id": "amazon/nova-micro-v1", - "name": "Amazon Nova Micro 1.0", - "family": "nova-micro", + "phi-3-medium-4k-instruct": { + "id": "phi-3-medium-4k-instruct", + "name": "Phi-3-medium-instruct (4k)", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0357, "output": 0.1394 }, - "limit": { "context": 128000, "input": 128000, "output": 5120 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 1024 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } }, - "amazon/nova-pro-v1": { - "id": "amazon/nova-pro-v1", - "name": "Amazon Nova Pro 1.0", - "family": "nova-pro", + "ministral-3b": { + "id": "ministral-3b", + "name": "Ministral 3B", + "family": "ministral", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-03", - "last_updated": "2024-12-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + }, + "cost": { + "input": 0.04, + "output": 0.04 + } + }, + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-02-31", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7989999999999999, "output": 3.1959999999999997 }, - "limit": { "context": 300000, "input": 300000, "output": 32000 } + "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 + } }, - "baidu/ernie-4.5-300b-a47b": { - "id": "baidu/ernie-4.5-300b-a47b", - "name": "ERNIE 4.5 300B", - "family": "ernie", + "meta-llama-3.1-8b-instruct": { + "id": "meta-llama-3.1-8b-instruct", + "name": "Meta-Llama-3.1-8B-Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.35, "output": 1.15 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } + "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": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.61 + } }, - "baidu/ernie-4.5-vl-28b-a3b": { - "id": "baidu/ernie-4.5-vl-28b-a3b", - "name": "ERNIE 4.5 VL 28B", - "family": "ernie", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-30", - "last_updated": "2025-06-30", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.13999999999999999, "output": 0.5599999999999999 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-02-06", + "last_updated": "2026-02-06", + "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", + "shape": "completions" + }, + "cost": { + "input": 0.6, + "output": 3 + } }, - "meta-llama/llama-3.3-70b-instruct": { - "id": "meta-llama/llama-3.3-70b-instruct", - "name": "Llama 3.3 70b Instruct", + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama-3.3-70B-Instruct", "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-02-27", - "last_updated": "2025-02-27", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0.23 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } + "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 + }, + "cost": { + "input": 0.71, + "output": 0.71 + } }, - "meta-llama/llama-3.1-8b-instruct": { - "id": "meta-llama/llama-3.1-8b-instruct", - "name": "Llama 3.1 8b Instruct", - "family": "llama", + "deepseek-v3-0324": { + "id": "deepseek-v3-0324", + "name": "DeepSeek-V3-0324", + "family": "deepseek", "attachment": false, "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 1.14, + "output": 4.56 + } + }, + "gpt-5-chat": { + "id": "gpt-5-chat", + "name": "GPT-5 Chat", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-10-24", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.0544, "output": 0.0544 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "meta-llama/llama-4-scout": { - "id": "meta-llama/llama-4-scout", - "name": "Llama 4 Scout", - "family": "llama", - "attachment": true, + "phi-3.5-moe-instruct": { + "id": "phi-3.5-moe-instruct", + "name": "Phi-3.5-MoE-instruct", + "family": "phi", + "attachment": false, "reasoning": false, - "tool_call": true, - "structured_output": true, - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.085, "output": 0.46 }, - "limit": { "context": 328000, "input": 328000, "output": 65536 } + "tool_call": false, + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.16, + "output": 0.64 + } }, - "meta-llama/llama-4-maverick": { - "id": "meta-llama/llama-4-maverick", - "name": "Llama 4 Maverick", - "family": "llama", + "gpt-5.3-chat": { + "id": "gpt-5.3-chat", + "name": "GPT-5.3 Chat", + "family": "gpt-codex", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.18000000000000002, "output": 0.8 }, - "limit": { "context": 1048576, "input": 1048576, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "meta-llama/llama-3.2-90b-vision-instruct": { - "id": "meta-llama/llama-3.2-90b-vision-instruct", - "name": "Llama 3.2 Medium", - "family": "llama", + "o1-mini": { + "id": "o1-mini", + "name": "o1-mini", + "family": "o-mini", "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"] }, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.9009999999999999, "output": 0.9009999999999999 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "meta-llama/llama-3.2-3b-instruct": { - "id": "meta-llama/llama-3.2-3b-instruct", - "name": "Llama 3.2 3b Instruct", - "family": "llama", - "attachment": true, + "text-embedding-3-large": { + "id": "text-embedding-3-large", + "name": "text-embedding-3-large", + "family": "text-embedding", + "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-09-25", - "last_updated": "2024-09-25", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.0306, "output": 0.0493 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "limit": { + "context": 8191, + "output": 3072 + }, + "cost": { + "input": 0.13, + "output": 0 + } }, - "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", - "family": "llama", + "phi-3-mini-128k-instruct": { + "id": "phi-3-mini-128k-instruct", + "name": "Phi-3-mini-instruct (128k)", + "family": "phi", "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": false, - "cost": { "input": 0.5, "output": 0.5 }, - "limit": { "context": 16384, "input": 16384, "output": 32768 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "ReadyArt/The-Omega-Abomination-L-70B-v1.0": { - "id": "ReadyArt/The-Omega-Abomination-L-70B-v1.0", - "name": "The Omega Abomination V1", - "family": "llama", + "phi-4-reasoning": { + "id": "phi-4-reasoning", + "name": "Phi-4-reasoning", + "family": "phi", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } + }, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.7, "output": 0.95 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.03 + } }, - "miromind-ai/mirothinker-v1.5-235b": { - "id": "miromind-ai/mirothinker-v1.5-235b", - "name": "MiroThinker v1.5 235B", - "family": "gpt", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-07", - "last_updated": "2026-01-07", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5-nano": { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 32768, "input": 32768, "output": 4000 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.01 + } }, - "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond": { - "id": "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond", - "name": "MS3.2 24B Magnum Diamond", - "family": "mistral", + "meta-llama-3-70b-instruct": { + "id": "meta-llama-3-70b-instruct", + "name": "Meta-Llama-3-70B-Instruct", + "family": "llama", "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": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 32768 } + "temperature": true, + "knowledge": "2023-12", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 2.68, + "output": 3.54 + } }, - "LLM360/K2-Think": { - "id": "LLM360/K2-Think", - "name": "K2-Think", - "family": "kimi-thinking", + "phi-3-small-8k-instruct": { + "id": "phi-3-small-8k-instruct", + "name": "Phi-3-small-instruct (8k)", + "family": "phi", "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": false, - "cost": { "input": 0.17, "output": 0.68 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "MiniMaxAI/MiniMax-M1-80k": { - "id": "MiniMaxAI/MiniMax-M1-80k", - "name": "MiniMax M1 80K", - "family": "minimax", + "gpt-5.3-codex": { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "family": "gpt-codex", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-16", - "last_updated": "2025-06-16", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6052, "output": 2.4225000000000003 }, - "limit": { "context": 1000000, "input": 1000000, "output": 131072 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5": { - "id": "failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5", - "name": "Llama 3 70B abliterated", - "family": "llama", + "text-embedding-ada-002": { + "id": "text-embedding-ada-002", + "name": "text-embedding-ada-002", + "family": "text-embedding", "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"] }, + "release_date": "2022-12-15", + "last_updated": "2022-12-15", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "limit": { + "context": 8192, + "output": 1536 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "essentialai/rnj-1-instruct": { - "id": "essentialai/rnj-1-instruct", - "name": "RNJ-1 Instruct 8B", - "family": "rnj", - "attachment": false, + "llama-3.2-90b-vision-instruct": { + "id": "llama-3.2-90b-vision-instruct", + "name": "Llama-3.2-90B-Vision-Instruct", + "family": "llama", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-13", - "last_updated": "2025-12-13", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "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": 2.04, + "output": 2.04 + } }, - "pamanseau/OpenReasoning-Nemotron-32B": { - "id": "pamanseau/OpenReasoning-Nemotron-32B", - "name": "OpenReasoning Nemotron 32B", - "family": "nemotron", + "deepseek-r1": { + "id": "deepseek-r1", + "name": "DeepSeek-R1", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 32768, "input": 32768, "output": 65536 } + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163840, + "output": 163840 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "arcee-ai/trinity-mini": { - "id": "arcee-ai/trinity-mini", - "name": "Trinity Mini", - "family": "trinity-mini", - "attachment": false, + "grok-4-1-fast-non-reasoning": { + "id": "grok-4-1-fast-non-reasoning", + "name": "Grok 4.1 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2025-06-27", + "last_updated": "2025-06-27", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.045000000000000005, "output": 0.15 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "limit": { + "context": 128000, + "input": 128000, + "output": 8192 + }, + "status": "beta", + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "arcee-ai/trinity-large": { - "id": "arcee-ai/trinity-large", - "name": "Trinity Large", - "family": "trinity", + "deepseek-v3.2-speciale": { + "id": "deepseek-v3.2-speciale", + "name": "DeepSeek-V3.2-Speciale", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.58, + "output": 1.68 + } }, - "deepseek-ai/DeepSeek-V3.1-Terminus:thinking": { - "id": "deepseek-ai/DeepSeek-V3.1-Terminus:thinking", - "name": "DeepSeek V3.1 Terminus (Thinking)", - "family": "deepseek-thinking", - "attachment": false, - "reasoning": false, + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-09-22", - "last_updated": "2025-09-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.25, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.125 + } }, - "deepseek-ai/DeepSeek-V3.1:thinking": { - "id": "deepseek-ai/DeepSeek-V3.1:thinking", - "name": "DeepSeek V3.1 Thinking", - "family": "deepseek-thinking", + "mistral-large-2411": { + "id": "mistral-large-2411", + "name": "Mistral Large 24.11", + "family": "mistral-large", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-09", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 6 + } }, - "deepseek-ai/DeepSeek-V3.1": { - "id": "deepseek-ai/DeepSeek-V3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", + "claude-opus-4-1": { + "id": "claude-opus-4-1", + "name": "Claude Opus 4.1", + "family": "claude-opus", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-26", - "last_updated": "2025-07-26", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-03-31", + "release_date": "2025-11-18", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 200000, + "output": 32000 + }, + "provider": { + "npm": "@ai-sdk/anthropic", + "api": "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1" + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "deepseek-ai/deepseek-v3.2-exp-thinking": { - "id": "deepseek-ai/deepseek-v3.2-exp-thinking", - "name": "DeepSeek V3.2 Exp Thinking", - "family": "deepseek-thinking", + "cohere-command-a": { + "id": "cohere-command-a", + "name": "Command A", + "family": "command-a", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27999999999999997, "output": 0.42000000000000004 }, - "limit": { "context": 163840, "input": 163840, "output": 65536 } + "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": 256000, + "output": 8000 + }, + "cost": { + "input": 2.5, + "output": 10 + } }, - "deepseek-ai/DeepSeek-V3.1-Terminus": { - "id": "deepseek-ai/DeepSeek-V3.1-Terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", + "llama-3.2-11b-vision-instruct": { + "id": "llama-3.2-11b-vision-instruct", + "name": "Llama-3.2-11B-Vision-Instruct", + "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.37, + "output": 0.37 + } + }, + "meta-llama-3.1-405b-instruct": { + "id": "meta-llama-3.1-405b-instruct", + "name": "Meta-Llama-3.1-405B-Instruct", + "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": 32768 + }, + "cost": { + "input": 5.33, + "output": 16 + } + }, + "gpt-5.1-chat": { + "id": "gpt-5.1-chat", + "name": "GPT-5.1 Chat", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "tool_call": true, "structured_output": true, - "release_date": "2025-08-02", - "last_updated": "2025-08-02", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text", "image", "audio"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "deepseek-ai/deepseek-v3.2-exp": { - "id": "deepseek-ai/deepseek-v3.2-exp", - "name": "DeepSeek V3.2 Exp", - "family": "deepseek", - "attachment": false, + "gpt-4-turbo-vision": { + "id": "gpt-4-turbo-vision", + "name": "GPT-4 Turbo Vision", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-29", - "last_updated": "2025-09-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.27999999999999997, "output": 0.42000000000000004 }, - "limit": { "context": 163840, "input": 163840, "output": 65536 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "deepseek-ai/DeepSeek-R1-0528": { - "id": "deepseek-ai/DeepSeek-R1-0528", - "name": "DeepSeek R1 0528", - "family": "deepseek", + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.7 }, - "limit": { "context": 128000, "input": 128000, "output": 163840 } - }, - "inflatebot/MN-12B-Mag-Mell-R1": { - "id": "inflatebot/MN-12B-Mag-Mell-R1", - "name": "Mag Mell R1", - "family": "mistral-nemo", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.75, + "output": 14, + "cache_read": 0.175 + } }, - "MarinaraSpaghetti/NemoMix-Unleashed-12B": { - "id": "MarinaraSpaghetti/NemoMix-Unleashed-12B", - "name": "NemoMix 12B Unleashed", - "family": "mistral-nemo", - "attachment": false, + "cohere-embed-v-4-0": { + "id": "cohere-embed-v-4-0", + "name": "Embed v4", + "family": "cohere-embed", + "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "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 + }, + "cost": { + "input": 0.12, + "output": 0 + } }, - "Alibaba-NLP/Tongyi-DeepResearch-30B-A3B": { - "id": "Alibaba-NLP/Tongyi-DeepResearch-30B-A3B", - "name": "Tongyi DeepResearch 30B A3B", - "family": "yi", + "gpt-5.1-codex-mini": { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex Mini", + "family": "gpt-codex", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-26", - "last_updated": "2025-08-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.08, "output": 0.24000000000000002 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "soob3123/GrayLine-Qwen3-8B": { - "id": "soob3123/GrayLine-Qwen3-8B", - "name": "Grayline Qwen3 8B", - "family": "qwen", + "gpt-3.5-turbo-0125": { + "id": "gpt-3.5-turbo-0125", + "name": "GPT-3.5 Turbo 0125", + "family": "gpt", "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"] }, + "temperature": true, + "knowledge": "2021-08", + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 16384, "input": 16384, "output": 32768 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.5, + "output": 1.5 + } }, - "soob3123/amoral-gemma3-27B-v2": { - "id": "soob3123/amoral-gemma3-27B-v2", - "name": "Amoral Gemma3 27B v2", - "family": "gemma", + "o1-preview": { + "id": "o1-preview", + "name": "o1-preview", + "family": "o", "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"] }, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 16.5, + "output": 66, + "cache_read": 8.25 + } }, - "soob3123/Veiled-Calla-12B": { - "id": "soob3123/Veiled-Calla-12B", - "name": "Veiled Calla 12B", - "family": "llama", + "cohere-embed-v3-multilingual": { + "id": "cohere-embed-v3-multilingual", + "name": "Embed v3 Multilingual", + "family": "cohere-embed", "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": false, - "cost": { "input": 0.3, "output": 0.3 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "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 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "minimax/minimax-m2-her": { - "id": "minimax/minimax-m2-her", - "name": "MiniMax M2-her", - "family": "minimax", + "grok-4-20-non-reasoning": { + "id": "grok-4-20-non-reasoning", + "name": "Grok 4.20 (Non-Reasoning)", + "family": "grok", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-24", - "last_updated": "2026-01-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.30200000000000005, "output": 1.2069999999999999 }, - "limit": { "context": 65532, "input": 65532, "output": 2048 } + "limit": { + "context": 262000, + "output": 8192 + }, + "status": "beta", + "cost": { + "input": 2, + "output": 6 + } }, - "minimax/minimax-01": { - "id": "minimax/minimax-01", - "name": "MiniMax 01", - "family": "minimax", + "gpt-5.1": { + "id": "gpt-5.1", + "name": "GPT-5.1", + "family": "gpt", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-15", - "last_updated": "2025-01-15", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1394, "output": 1.1219999999999999 }, - "limit": { "context": 1000192, "input": 1000192, "output": 16384 } - }, - "minimax/minimax-m2.1": { - "id": "minimax/minimax-m2.1", - "name": "MiniMax M2.1", - "family": "minimax", - "attachment": false, "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-12-19", - "last_updated": "2025-12-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2024-09-30", + "release_date": "2025-11-14", + "last_updated": "2025-11-14", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text", "image", "audio"] + }, "open_weights": false, - "cost": { "input": 0.33, "output": 1.32 }, - "limit": { "context": 200000, "input": 200000, "output": 131072 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "minimax/minimax-m2.7": { - "id": "minimax/minimax-m2.7", - "name": "MiniMax M2.7", - "family": "minimax", - "attachment": false, + "grok-4-fast-reasoning": { + "id": "grok-4-fast-reasoning", + "name": "Grok 4 Fast (Reasoning)", + "family": "grok", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "input": 204800, "output": 131072 } + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } }, - "minimax/minimax-m2.5": { - "id": "minimax/minimax-m2.5", - "name": "MiniMax M2.5", - "family": "minimax", + "o1": { + "id": "o1", + "name": "o1", + "family": "o", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2023-09", + "release_date": "2024-12-05", + "last_updated": "2024-12-05", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "input": 204800, "output": 131072 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 15, + "output": 60, + "cache_read": 7.5 + } }, - "qwen/qwen3.5-397b-a17b": { - "id": "qwen/qwen3.5-397b-a17b", - "name": "Qwen3.5 397B A17B", - "family": "qwen", - "attachment": false, + "mistral-small-2503": { + "id": "mistral-small-2503", + "name": "Mistral Small 3.1", + "family": "mistral-small", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-16", - "last_updated": "2026-02-16", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 258048, "input": 258048, "output": 65536 } + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3 + } }, - "dmind/dmind-1": { - "id": "dmind/dmind-1", - "name": "DMind-1", - "family": "gpt", - "attachment": false, + "model-router": { + "id": "model-router", + "name": "Model Router", + "family": "model-router", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "release_date": "2025-05-19", + "last_updated": "2025-11-18", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.6 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.14, + "output": 0 + } }, - "dmind/dmind-1-mini": { - "id": "dmind/dmind-1-mini", - "name": "DMind-1-Mini", + "gpt-3.5-turbo-1106": { + "id": "gpt-3.5-turbo-1106", + "name": "GPT-3.5 Turbo 1106", "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2021-08", + "release_date": "2023-11-06", + "last_updated": "2023-11-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.4 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 2 + } }, - "VongolaChouko/Starcannon-Unleashed-12B-v1.0": { - "id": "VongolaChouko/Starcannon-Unleashed-12B-v1.0", - "name": "Mistral Nemo Starcannon 12b v1", - "family": "mistral-nemo", + "text-embedding-3-small": { + "id": "text-embedding-3-small", + "name": "text-embedding-3-small", + "family": "text-embedding", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2024-01-25", + "last_updated": "2024-01-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 8191, + "output": 1536 + }, + "cost": { + "input": 0.02, + "output": 0 + } }, - "xiaomi/mimo-v2-flash-thinking": { - "id": "xiaomi/mimo-v2-flash-thinking", - "name": "MiMo V2 Flash (Thinking)", - "family": "mimo", + "deepseek-v3.1": { + "id": "deepseek-v3.1", + "name": "DeepSeek-V3.1", + "family": "deepseek", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-07", + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.56, + "output": 1.68 + } + }, + "claude-opus-4-5": { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": 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, - "cost": { "input": 0.102, "output": 0.306 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "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 + } }, - "xiaomi/mimo-v2-flash-thinking-original": { - "id": "xiaomi/mimo-v2-flash-thinking-original", - "name": "MiMo V2 Flash (Thinking) Original", - "family": "mimo", + "phi-3-mini-4k-instruct": { + "id": "phi-3-mini-4k-instruct", + "name": "Phi-3-mini-instruct (4k)", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.102, "output": 0.306 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 1024 + }, + "cost": { + "input": 0.13, + "output": 0.52 + } }, - "xiaomi/mimo-v2-flash-original": { - "id": "xiaomi/mimo-v2-flash-original", - "name": "MiMo V2 Flash Original", - "family": "mimo", + "meta-llama-3.1-70b-instruct": { + "id": "meta-llama-3.1-70b-instruct", + "name": "Meta-Llama-3.1-70B-Instruct", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.102, "output": 0.306 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "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": 32768 + }, + "cost": { + "input": 2.68, + "output": 3.54 + } }, - "xiaomi/mimo-v2-flash": { - "id": "xiaomi/mimo-v2-flash", - "name": "MiMo V2 Flash", - "family": "mimo", + "phi-4-mini-reasoning": { + "id": "phi-4-mini-reasoning", + "name": "Phi-4-mini-reasoning", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-17", - "last_updated": "2025-12-17", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.102, "output": 0.306 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "reasoning": true, + "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 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "Salesforce/Llama-xLAM-2-70b-fc-r": { - "id": "Salesforce/Llama-xLAM-2-70b-fc-r", - "name": "Llama-xLAM-2 70B fc-r", - "family": "llama", + "gpt-4": { + "id": "gpt-4", + "name": "GPT-4", + "family": "gpt", "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"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2023-11", + "release_date": "2023-03-14", + "last_updated": "2023-03-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 2.5 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } - }, - "Gryphe/MythoMax-L2-13b": { - "id": "Gryphe/MythoMax-L2-13b", - "name": "MythoMax 13B", + "limit": { + "context": 8192, + "output": 8192 + }, + "cost": { + "input": 60, + "output": 120 + } + }, + "meta-llama-3-8b-instruct": { + "id": "meta-llama-3-8b-instruct", + "name": "Meta-Llama-3-8B-Instruct", "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": false, - "cost": { "input": 0.1003, "output": 0.1003 }, - "limit": { "context": 4000, "input": 4000, "output": 4096 } + "temperature": true, + "knowledge": "2023-12", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0.3, + "output": 0.61 + } }, - "baseten/Kimi-K2-Instruct-FP4": { - "id": "baseten/Kimi-K2-Instruct-FP4", - "name": "Kimi K2 0711 Instruct FP4", + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", "family": "kimi", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-11", - "last_updated": "2025-07-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 131072 } + "reasoning": true, + "tool_call": true, + "interleaved": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "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", + "shape": "completions" + }, + "cost": { + "input": 0.95, + "output": 4 + } }, - "Steelskull/L3.3-Nevoria-R1-70b": { - "id": "Steelskull/L3.3-Nevoria-R1-70b", - "name": "Steelskull Nevoria R1 70b", - "family": "llama", + "gpt-5-codex": { + "id": "gpt-5-codex", + "name": "GPT-5-Codex", + "family": "gpt-codex", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "Steelskull/L3.3-Electra-R1-70b": { - "id": "Steelskull/L3.3-Electra-R1-70b", - "name": "Steelskull Electra R1 70b", - "family": "llama", + "phi-4-mini": { + "id": "phi-4-mini", + "name": "Phi-4-mini", + "family": "phi", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.69989, "output": 0.69989 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "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 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } }, - "Steelskull/L3.3-Cu-Mai-R1-70b": { - "id": "Steelskull/L3.3-Cu-Mai-R1-70b", - "name": "Llama 3.3 70B Cu Mai", - "family": "llama", + "grok-4-20-reasoning": { + "id": "grok-4-20-reasoning", + "name": "Grok 4.20 (Reasoning)", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 262000, + "output": 8192 + }, + "status": "beta", + "cost": { + "input": 2, + "output": 6 + } }, - "Steelskull/L3.3-MS-Evalebis-70b": { - "id": "Steelskull/L3.3-MS-Evalebis-70b", - "name": "MS Evalebis 70b", - "family": "llama", + "gpt-3.5-turbo-0301": { + "id": "gpt-3.5-turbo-0301", + "name": "GPT-3.5 Turbo 0301", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2021-08", + "release_date": "2023-03-01", + "last_updated": "2023-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 1.5, + "output": 2 + } }, - "Steelskull/L3.3-MS-Nevoria-70b": { - "id": "Steelskull/L3.3-MS-Nevoria-70b", - "name": "Steelskull Nevoria 70b", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2025-05-31", + "release_date": "2026-02-05", + "last_updated": "2026-02-05", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 200000, + "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 + } + } }, - "Steelskull/L3.3-MS-Evayale-70B": { - "id": "Steelskull/L3.3-MS-Evayale-70B", - "name": "Evayale 70b ", - "family": "llama", + "phi-3-small-128k-instruct": { + "id": "phi-3-small-128k-instruct", + "name": "Phi-3-small-instruct (128k)", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "meganova-ai/manta-mini-1.0": { - "id": "meganova-ai/manta-mini-1.0", - "name": "Manta Mini 1.0", - "family": "nova", + "deepseek-v3.2": { + "id": "deepseek-v3.2", + "name": "DeepSeek-V3.2", + "family": "deepseek", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-20", - "last_updated": "2025-12-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.02, "output": 0.16 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "reasoning": true, + "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 + }, + "cost": { + "input": 0.58, + "output": 1.68 + } }, - "meganova-ai/manta-pro-1.0": { - "id": "meganova-ai/manta-pro-1.0", - "name": "Manta Pro 1.0", - "family": "nova", + "phi-3-medium-128k-instruct": { + "id": "phi-3-medium-128k-instruct", + "name": "Phi-3-medium-instruct (128k)", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-12-20", - "last_updated": "2025-12-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.060000000000000005, "output": 0.5 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "temperature": true, + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0.17, + "output": 0.68 + } }, - "meganova-ai/manta-flash-1.0": { - "id": "meganova-ai/manta-flash-1.0", - "name": "Manta Flash 1.0", - "family": "nova", + "gpt-3.5-turbo-0613": { + "id": "gpt-3.5-turbo-0613", + "name": "GPT-3.5 Turbo 0613", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-12-20", - "last_updated": "2025-12-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2021-08", + "release_date": "2023-06-13", + "last_updated": "2023-06-13", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.02, "output": 0.16 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 3, + "output": 4 + } }, - "meituan-longcat/LongCat-Flash-Chat-FP8": { - "id": "meituan-longcat/LongCat-Flash-Chat-FP8", - "name": "LongCat Flash", - "family": "longcat", - "attachment": false, - "reasoning": false, + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-08-31", - "last_updated": "2025-08-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.15, "output": 0.7 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "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 + } }, - "TEE/kimi-k2-thinking": { - "id": "TEE/kimi-k2-thinking", - "name": "Kimi K2 Thinking TEE", - "family": "kimi-thinking", + "phi-4": { + "id": "phi-4", + "name": "Phi-4", + "family": "phi", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 65535 } + "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 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } }, - "TEE/kimi-k2.5": { - "id": "TEE/kimi-k2.5", - "name": "Kimi K2.5 TEE", - "family": "kimi", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5": { + "id": "gpt-5", + "name": "GPT-5", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.3, "output": 1.9 }, - "limit": { "context": 128000, "input": 128000, "output": 65535 } + "limit": { + "context": 272000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.13 + } }, - "TEE/glm-4.7-flash": { - "id": "TEE/glm-4.7-flash", - "name": "GLM 4.7 Flash TEE", - "family": "glm-flash", + "gpt-4-32k": { + "id": "gpt-4-32k", + "name": "GPT-4 32K", + "family": "gpt", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-19", - "last_updated": "2026-01-19", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2023-11", + "release_date": "2023-03-14", + "last_updated": "2023-03-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.5 }, - "limit": { "context": 203000, "input": 203000, "output": 65535 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 60, + "output": 120 + } }, - "TEE/gemma-3-27b-it": { - "id": "TEE/gemma-3-27b-it", - "name": "Gemma 3 27B TEE", - "family": "gemma", + "cohere-embed-v3-english": { + "id": "cohere-embed-v3-english", + "name": "Embed v3 English", + "family": "cohere-embed", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-03-10", - "last_updated": "2025-03-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "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 + }, + "cost": { + "input": 0.1, + "output": 0 + } }, - "TEE/kimi-k2.5-thinking": { - "id": "TEE/kimi-k2.5-thinking", - "name": "Kimi K2.5 Thinking TEE", - "family": "kimi-thinking", + "phi-4-reasoning-plus": { + "id": "phi-4-reasoning-plus", + "name": "Phi-4-reasoning-plus", + "family": "phi", "attachment": false, "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.9 }, - "limit": { "context": 128000, "input": 128000, "output": 65535 } + "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 + }, + "cost": { + "input": 0.125, + "output": 0.5 + } }, - "TEE/gpt-oss-120b": { - "id": "TEE/gpt-oss-120b", - "name": "GPT-OSS 120B TEE", - "family": "gpt-oss", - "attachment": false, + "mistral-medium-2505": { + "id": "mistral-medium-2505", + "name": "Mistral Medium 3", + "family": "mistral-medium", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 131072, "input": 131072, "output": 16384 } + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0.4, + "output": 2 + } }, - "TEE/qwen3-coder": { - "id": "TEE/qwen3-coder", - "name": "Qwen3 Coder 480B TEE", - "family": "qwen", + "gpt-3.5-turbo-instruct": { + "id": "gpt-3.5-turbo-instruct", + "name": "GPT-3.5 Turbo Instruct", + "family": "gpt", "attachment": false, "reasoning": false, "tool_call": false, - "structured_output": false, - "release_date": "2025-07-23", - "last_updated": "2025-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2021-08", + "release_date": "2023-09-21", + "last_updated": "2023-09-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.5, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "limit": { + "context": 4096, + "output": 4096 + }, + "cost": { + "input": 1.5, + "output": 2 + } }, - "TEE/minimax-m2.1": { - "id": "TEE/minimax-m2.1", - "name": "MiniMax M2.1 TEE", - "family": "minimax", + "deepseek-r1-0528": { + "id": "deepseek-r1-0528", + "name": "DeepSeek-R1-0528", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 200000, "input": 200000, "output": 131072 } + "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": 163840 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "TEE/qwen2.5-vl-72b-instruct": { - "id": "TEE/qwen2.5-vl-72b-instruct", - "name": "Qwen2.5 VL 72B TEE", - "family": "qwen", - "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-02-01", - "last_updated": "2025-02-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": 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": 262144 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "TEE/glm-4.6": { - "id": "TEE/glm-4.6", - "name": "GLM 4.6 TEE", - "family": "glm", + "gpt-5.1-codex": { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "family": "gpt-codex", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-30", - "last_updated": "2025-09-30", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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", "audio"], + "output": ["text", "image", "audio"] + }, "open_weights": false, - "cost": { "input": 0.75, "output": 2 }, - "limit": { "context": 203000, "input": 203000, "output": 65535 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "TEE/deepseek-v3.1": { - "id": "TEE/deepseek-v3.1", - "name": "DeepSeek V3.1 TEE", - "family": "deepseek", + "codestral-2501": { + "id": "codestral-2501", + "name": "Codestral 25.01", + "family": "codestral", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 1, "output": 2.5 }, - "limit": { "context": 164000, "input": 164000, "output": 8192 } + "limit": { + "context": 256000, + "output": 256000 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "TEE/llama3-3-70b": { - "id": "TEE/llama3-3-70b", - "name": "Llama 3.3 70B", + "llama-4-maverick-17b-128e-instruct-fp8": { + "id": "llama-4-maverick-17b-128e-instruct-fp8", + "name": "Llama 4 Maverick 17B 128E Instruct FP8", "family": "llama", - "attachment": false, + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-03", - "last_updated": "2025-07-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "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.25, + "output": 1 + } }, - "TEE/glm-5": { - "id": "TEE/glm-5", - "name": "GLM 5 TEE", - "family": "glm", + "mai-ds-r1": { + "id": "mai-ds-r1", + "name": "MAI-DS-R1", + "family": "mai", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-06", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.2, "output": 3.5 }, - "limit": { "context": 203000, "input": 203000, "output": 65535 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 1.35, + "output": 5.4 + } }, - "TEE/qwen3.5-397b-a17b": { - "id": "TEE/qwen3.5-397b-a17b", - "name": "Qwen3.5 397B A17B TEE", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-02-28", - "last_updated": "2026-02-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.1-codex-max": { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "family": "gpt-codex", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.6, "output": 3.6 }, - "limit": { "context": 258048, "input": 258048, "output": 65536 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "TEE/glm-4.7": { - "id": "TEE/glm-4.7", - "name": "GLM 4.7 TEE", - "family": "glm", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2026-01-29", - "last_updated": "2026-01-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.85, "output": 3.3 }, - "limit": { "context": 131000, "input": 131000, "output": 65535 } + "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 + } }, - "TEE/deepseek-r1-0528": { - "id": "TEE/deepseek-r1-0528", - "name": "DeepSeek R1 0528 TEE", - "family": "deepseek", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.5": { + "id": "gpt-5.5", + "name": "GPT-5.5", + "family": "gpt", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 2, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 5, + "output": 30, + "cache_read": 0.5, + "context_over_200k": { + "input": 10, + "output": 45, + "cache_read": 1 + }, + "tiers": [ + { + "input": 10, + "output": 45, + "cache_read": 1, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "TEE/gpt-oss-20b": { - "id": "TEE/gpt-oss-20b", - "name": "GPT-OSS 20B TEE", - "family": "gpt-oss", - "attachment": false, + "gpt-4-turbo": { + "id": "gpt-4-turbo", + "name": "GPT-4 Turbo", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.2, "output": 0.8 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 10, + "output": 30 + } }, - "TEE/deepseek-v3.2": { - "id": "TEE/deepseek-v3.2", - "name": "DeepSeek V3.2 TEE", - "family": "deepseek", - "attachment": false, + "gpt-4o-mini": { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": 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, - "cost": { "input": 0.5, "output": 1 }, - "limit": { "context": 164000, "input": 164000, "output": 65536 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.08 + } }, - "TEE/qwen3-30b-a3b-instruct-2507": { - "id": "TEE/qwen3-30b-a3b-instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507 TEE", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.4-mini": { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.15, "output": 0.44999999999999996 }, - "limit": { "context": 262000, "input": 262000, "output": 32768 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.75, + "output": 4.5, + "cache_read": 0.075 + } }, - "chutesai/Mistral-Small-3.2-24B-Instruct-2506": { - "id": "chutesai/Mistral-Small-3.2-24B-Instruct-2506", - "name": "Mistral Small 3.2 24b Instruct", - "family": "chutesai", + "cohere-command-r-08-2024": { + "id": "cohere-command-r-08-2024", + "name": "Command R", + "family": "command-r", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.4 }, - "limit": { "context": 128000, "input": 128000, "output": 131072 } + "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.15, + "output": 0.6 + } }, - "Infermatic/MN-12B-Inferor-v0.0": { - "id": "Infermatic/MN-12B-Inferor-v0.0", - "name": "Mistral Nemo Inferor 12B", - "family": "mistral-nemo", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "o4-mini": { + "id": "o4-mini", + "name": "o4-mini", + "family": "o-mini", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.25499999999999995, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.28 + } }, - "aion-labs/aion-rp-llama-3.1-8b": { - "id": "aion-labs/aion-rp-llama-3.1-8b", - "name": "Llama 3.1 8b (uncensored)", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "gpt-5.4-nano": { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.2006, "output": 0.2006 }, - "limit": { "context": 32768, "input": 32768, "output": 16384 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0.2, + "output": 1.25, + "cache_read": 0.02 + } }, - "aion-labs/aion-1.0-mini": { - "id": "aion-labs/aion-1.0-mini", - "name": "Aion 1.0 mini (DeepSeek)", - "family": "deepseek", + "grok-code-fast-1": { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "family": "grok", "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"] }, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2023-10", + "release_date": "2025-08-28", + "last_updated": "2025-08-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7989999999999999, "output": 1.394 }, - "limit": { "context": 131072, "input": 131072, "output": 8192 } + "limit": { + "context": 256000, + "output": 10000 + }, + "cost": { + "input": 0.2, + "output": 1.5, + "cache_read": 0.02 + } }, - "aion-labs/aion-1.0": { - "id": "aion-labs/aion-1.0", - "name": "Aion 1.0", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, + "gpt-5.4-pro": { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, "structured_output": false, - "release_date": "2025-02-01", - "last_updated": "2025-02-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 3.995, "output": 7.99 }, - "limit": { "context": 65536, "input": 65536, "output": 8192 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 30, + "output": 180, + "context_over_200k": { + "input": 60, + "output": 270 + }, + "tiers": [ + { + "input": 60, + "output": 270, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "mlabonne/NeuralDaredevil-8B-abliterated": { - "id": "mlabonne/NeuralDaredevil-8B-abliterated", - "name": "Neural Daredevil 8B abliterated", - "family": "llama", + "o3-mini": { + "id": "o3-mini", + "name": "o3-mini", + "family": "o-mini", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.44, "output": 0.44 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 1.1, + "output": 4.4, + "cache_read": 0.55 + } }, - "moonshotai/kimi-k2-thinking": { - "id": "moonshotai/kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", + "grok-4": { + "id": "grok-4", + "name": "Grok 4", + "family": "grok", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 256000, "input": 256000, "output": 262144 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "reasoning": 15, + "cache_read": 0.75 + } }, - "moonshotai/kimi-k2.5": { - "id": "moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "gpt-5.4": { + "id": "gpt-5.4", + "name": "GPT-5.4", + "family": "gpt", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": false, - "release_date": "2026-01-26", - "last_updated": "2026-01-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, - "cost": { "input": 0.3, "output": 1.9 }, - "limit": { "context": 256000, "input": 256000, "output": 65536 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 2.5, + "output": 15, + "cache_read": 0.25, + "context_over_200k": { + "input": 5, + "output": 22.5, + "cache_read": 0.5 + }, + "tiers": [ + { + "input": 5, + "output": 22.5, + "cache_read": 0.5, + "tier": { + "type": "context", + "size": 272000 + } + } + ] + } }, - "moonshotai/kimi-k2.5:thinking": { - "id": "moonshotai/kimi-k2.5:thinking", - "name": "Kimi K2.5 Thinking", - "family": "kimi-thinking", + "gpt-4.1-nano": { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "family": "gpt-nano", "attachment": true, - "reasoning": true, + "reasoning": false, "tool_call": true, - "structured_output": false, - "release_date": "2026-01-26", - "last_updated": "2026-01-26", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.9 }, - "limit": { "context": 256000, "input": 256000, "output": 65536 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.03 + } }, - "moonshotai/kimi-k2-thinking-turbo-original": { - "id": "moonshotai/kimi-k2-thinking-turbo-original", - "name": "Kimi K2 Thinking Turbo Original", - "family": "kimi-thinking", + "grok-3-mini": { + "id": "grok-3-mini", + "name": "Grok 3 Mini", + "family": "grok", "attachment": false, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.15, "output": 8 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } - }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "Kimi K2 0905", - "family": "kimi", - "attachment": false, - "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": true, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 256000, "input": 256000, "output": 262144 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0.3, + "output": 0.5, + "reasoning": 0.5, + "cache_read": 0.075 + } }, - "moonshotai/kimi-k2-thinking-original": { - "id": "moonshotai/kimi-k2-thinking-original", - "name": "Kimi K2 Thinking Original", - "family": "kimi-thinking", - "attachment": false, + "o3": { + "id": "o3", + "name": "o3", + "family": "o", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.6, "output": 2.5 }, - "limit": { "context": 256000, "input": 256000, "output": 16384 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "moonshotai/kimi-k2-instruct-0711": { - "id": "moonshotai/kimi-k2-instruct-0711", - "name": "Kimi K2 0711", - "family": "kimi", - "attachment": false, - "reasoning": false, + "gpt-5-pro": { + "id": "gpt-5-pro", + "name": "GPT-5 Pro", + "family": "gpt-pro", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, - "release_date": "2025-07-11", - "last_updated": "2025-07-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.1, "output": 2 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } + "limit": { + "context": 400000, + "output": 272000 + }, + "cost": { + "input": 15, + "output": 120 + } }, - "moonshotai/Kimi-Dev-72B": { - "id": "moonshotai/Kimi-Dev-72B", - "name": "Kimi Dev 72B", - "family": "kimi", + "gpt-4o": { + "id": "gpt-4o", + "name": "GPT-4o", + "family": "gpt", "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-04-15", - "last_updated": "2025-04-15", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, + "tool_call": 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, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 128000, "input": 128000, "output": 131072 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 2.5, + "output": 10, + "cache_read": 1.25 + } }, - "moonshotai/kimi-k2-instruct": { - "id": "moonshotai/kimi-k2-instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", + "cohere-command-r-plus-08-2024": { + "id": "cohere-command-r-plus-08-2024", + "name": "Command R+", + "family": "command-r", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 2 }, - "limit": { "context": 256000, "input": 256000, "output": 8192 } + "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 + } }, - "tencent/Hunyuan-MT-7B": { - "id": "tencent/Hunyuan-MT-7B", - "name": "Hunyuan MT 7B", - "family": "hunyuan", - "attachment": false, + "gpt-4.1": { + "id": "gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-18", - "last_updated": "2025-09-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 10, "output": 20 }, - "limit": { "context": 8192, "input": 8192, "output": 8192 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B": { - "id": "Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B", - "name": "Llama 3.05 Storybreaker Ministral 70b", - "family": "llama", - "attachment": false, + "gpt-4.1-mini": { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 0.4, + "output": 1.6, + "cache_read": 0.1 + } }, - "Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B": { - "id": "Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B", - "name": "Nemotron Tenyxchat Storybreaker 70b", - "family": "nemotron", + "grok-3": { + "id": "grok-3", + "name": "Grok 3", + "family": "grok", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-12-01", - "last_updated": "2024-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-11", + "release_date": "2025-02-17", + "last_updated": "2025-02-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75 + } }, - "Tongyi-Zhiwen/QwenLong-L1-32B": { - "id": "Tongyi-Zhiwen/QwenLong-L1-32B", - "name": "QwenLong L1 32B", - "family": "qwen", - "attachment": false, + "grok-4-fast-non-reasoning": { + "id": "grok-4-fast-non-reasoning", + "name": "Grok 4 Fast (Non-Reasoning)", + "family": "grok", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-25", - "last_updated": "2025-01-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2025-07", + "release_date": "2025-09-19", + "last_updated": "2025-09-19", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.13999999999999999, "output": 0.6 }, - "limit": { "context": 128000, "input": 128000, "output": 40960 } - }, - "featherless-ai/Qwerky-72B": { - "id": "featherless-ai/Qwerky-72B", - "name": "Qwerky 72B", - "family": "qwerky", + "limit": { + "context": 2000000, + "output": 30000 + }, + "cost": { + "input": 0.2, + "output": 0.5, + "cache_read": 0.05 + } + } + } + }, + "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": { + "x-ai/grok-4": { + "id": "x-ai/grok-4", + "name": "Grok 4", + "family": "grok", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-03-20", - "last_updated": "2025-03-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.5, "output": 0.5 }, - "limit": { "context": 32000, "input": 32000, "output": 8192 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.75, + "cache_write": 15 + } }, - "Sao10K/L3.3-70B-Euryale-v2.3": { - "id": "Sao10K/L3.3-70B-Euryale-v2.3", - "name": "Llama 3.3 70B Euryale", - "family": "llama", + "deepseek-ai/deepseek-r1-distill-llama-70b": { + "id": "deepseek-ai/deepseek-r1-distill-llama-70b", + "name": "DeepSeek R1 Distill Llama 70B", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": false, - "structured_output": false, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 20480, "input": 20480, "output": 16384 } + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-01-23", + "last_updated": "2025-01-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.03, + "output": 0.14 + } }, - "Sao10K/L3.1-70B-Hanami-x1": { - "id": "Sao10K/L3.1-70B-Hanami-x1", - "name": "Llama 3.1 70B Hanami", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "openai/gpt-5-mini": { + "id": "openai/gpt-5-mini", + "name": "GPT-5 Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10-01", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.25, + "output": 2, + "cache_read": 0.025 + } }, - "Sao10K/L3.1-70B-Euryale-v2.2": { - "id": "Sao10K/L3.1-70B-Euryale-v2.2", - "name": "Llama 3.1 70B Euryale", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "openai/gpt-5-nano": { + "id": "openai/gpt-5-nano", + "name": "GPT-5 Nano", + "family": "gpt-nano", + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10-01", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.306, "output": 0.357 }, - "limit": { "context": 20480, "input": 20480, "output": 16384 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 0.05, + "output": 0.4, + "cache_read": 0.005 + } }, - "Sao10K/L3-8B-Stheno-v3.2": { - "id": "Sao10K/L3-8B-Stheno-v3.2", - "name": "Sao10K Stheno 8b", - "family": "llama", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-11-29", - "last_updated": "2024-11-29", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2006, "output": 0.2006 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "reasoning": true, + "tool_call": 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": 65536 + }, + "cost": { + "input": 0.05, + "output": 0.2 + } }, - "inflection/inflection-3-pi": { - "id": "inflection/inflection-3-pi", - "name": "Inflection 3 Pi", + "openai/gpt-5": { + "id": "openai/gpt-5", + "name": "GPT-5", "family": "gpt", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-10-11", - "last_updated": "2024-10-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "attachment": true, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10-01", + "release_date": "2025-08-07", + "last_updated": "2025-08-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.499, "output": 9.996 }, - "limit": { "context": 8000, "input": 8000, "output": 4096 } + "limit": { + "context": 400000, + "output": 128000 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.125 + } }, - "inflection/inflection-3-productivity": { - "id": "inflection/inflection-3-productivity", - "name": "Inflection 3 Productivity", - "family": "gpt", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-10-11", - "last_updated": "2024-10-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.499, "output": 9.996 }, - "limit": { "context": 8000, "input": 8000, "output": 4096 } + "reasoning": true, + "tool_call": 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 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "GalrionSoftworks/MN-LooseCannon-12B-v1": { - "id": "GalrionSoftworks/MN-LooseCannon-12B-v1", - "name": "MN-LooseCannon-12B-v1", - "family": "mistral-nemo", + "z-ai/glm-5": { + "id": "z-ai/glm-5", + "name": "GLM-5", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.49299999999999994, "output": 0.49299999999999994 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "reasoning": true, + "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": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.95, + "output": 3.15 + } }, - "LatitudeGames/Wayfarer-Large-70B-Llama-3.3": { - "id": "LatitudeGames/Wayfarer-Large-70B-Llama-3.3", - "name": "Llama 3.3 70B Wayfarer", - "family": "llama", + "qwen/qwen3-coder": { + "id": "qwen/qwen3-coder", + "name": "Qwen3 Coder", + "family": "qwen", "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": false, - "cost": { "input": 0.700000007, "output": 0.700000007 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "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": 262144, + "output": 66536 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "anthracite-org/magnum-v4-72b": { - "id": "anthracite-org/magnum-v4-72b", - "name": "Magnum v4 72B", - "family": "llama", + "google/gemini-2.5-pro": { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.006, "output": 2.992 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } - }, - "anthracite-org/magnum-v2-72b": { - "id": "anthracite-org/magnum-v2-72b", - "name": "Magnum V2 72B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 2.006, "output": 2.992 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31 + } }, - "tngtech/tng-r1t-chimera": { - "id": "tngtech/tng-r1t-chimera", - "name": "TNG R1T Chimera", - "family": "tngtech", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-26", - "last_updated": "2025-11-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "google/gemini-2.5-flash": { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 128000, "input": 128000, "output": 65536 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.0375 + } }, - "tngtech/DeepSeek-TNG-R1T2-Chimera": { - "id": "tngtech/DeepSeek-TNG-R1T2-Chimera", - "name": "DeepSeek TNG R1T2 Chimera", - "family": "tngtech", + "moonshotai/kimi-k2": { + "id": "moonshotai/kimi-k2", + "name": "Kimi K2", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.31, "output": 0.31 }, - "limit": { "context": 128000, "input": 128000, "output": 8192 } - }, - "deepcogito/cogito-v2.1-671b": { - "id": "deepcogito/cogito-v2.1-671b", - "name": "Cogito v2.1 671B MoE", - "family": "cogito", - "attachment": false, - "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-11-19", - "last_updated": "2025-11-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 1.25 }, - "limit": { "context": 128000, "input": 128000, "output": 16384 } + "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": 32768 + }, + "cost": { + "input": 0.55, + "output": 2.2 + } }, - "deepcogito/cogito-v1-preview-qwen-32B": { - "id": "deepcogito/cogito-v1-preview-qwen-32B", - "name": "Cogito v1 Preview Qwen 32B", - "family": "qwen", - "attachment": false, + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-05-10", - "last_updated": "2025-05-10", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 1.7999999999999998, "output": 1.7999999999999998 }, - "limit": { "context": 128000, "input": 128000, "output": 32768 } + "limit": { + "context": 1047576, + "output": 32768 + }, + "cost": { + "input": 2, + "output": 8, + "cache_read": 0.5 + } }, - "huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated": { - "id": "huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated", - "name": "DeepSeek R1 Llama 70B Abliterated", - "family": "deepseek", - "attachment": false, + "anthropic/claude-opus-4.1": { + "id": "anthropic/claude-opus-4.1", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, - "structured_output": false, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } - }, - "huihui-ai/Llama-3.3-70B-Instruct-abliterated": { - "id": "huihui-ai/Llama-3.3-70B-Instruct-abliterated", - "name": "Llama 3.3 70B Instruct abliterated", - "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"] }, + "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, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "huihui-ai/Qwen2.5-32B-Instruct-abliterated": { - "id": "huihui-ai/Qwen2.5-32B-Instruct-abliterated", - "name": "Qwen 2.5 32B Abliterated", + "anthropic/claude-sonnet-4": { + "id": "anthropic/claude-sonnet-4", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + } + } + }, + "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": { + "Qwen/Qwen3-VL-Embedding-8B": { + "id": "Qwen/Qwen3-VL-Embedding-8B", + "name": "Qwen3-VL Embedding 8B", "family": "qwen", - "attachment": false, + "attachment": true, "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": false, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "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.09 + } }, - "huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated": { - "id": "huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated", - "name": "DeepSeek R1 Qwen Abliterated", + "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8": { + "id": "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8", + "name": "Qwen3-VL 235B", "family": "qwen", - "attachment": false, - "reasoning": true, - "tool_call": false, + "attachment": true, + "reasoning": false, + "tool_call": true, "structured_output": false, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.4, "output": 1.4 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "temperature": true, + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 218000, + "output": 8192 + }, + "cost": { + "input": 1.64, + "output": 1.91 + } }, - "huihui-ai/Llama-3.1-Nemotron-70B-Instruct-HF-abliterated": { - "id": "huihui-ai/Llama-3.1-Nemotron-70B-Instruct-HF-abliterated", - "name": "Nemotron 3.1 70B abliterated", - "family": "nemotron", + "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8": { + "id": "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8", + "name": "Llama 3.1 8B", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, + "tool_call": true, + "structured_output": true, + "temperature": true, "release_date": "2024-07-23", "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.7, "output": 0.7 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } - }, - "mistralai/mistral-medium-3.1": { - "id": "mistralai/mistral-medium-3.1", - "name": "Mistral Medium 3.1", - "family": "mistral-medium", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-05", - "last_updated": "2025-09-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "input": 131072, "output": 32768 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.16, + "output": 0.27 + } }, - "mistralai/mistral-7b-instruct": { - "id": "mistralai/mistral-7b-instruct", - "name": "Mistral 7B Instruct", + "neuralmagic/Mistral-Nemo-Instruct-2407-FP8": { + "id": "neuralmagic/Mistral-Nemo-Instruct-2407-FP8", + "name": "Mistral Nemo", "family": "mistral", - "attachment": true, + "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2024-05-27", - "last_updated": "2024-05-27", - "modalities": { "input": ["text", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0544, "output": 0.0544 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } + "temperature": true, + "release_date": "2024-07-01", + "last_updated": "2024-07-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.49, + "output": 0.71 + } }, - "mistralai/devstral-2-123b-instruct-2512": { - "id": "mistralai/devstral-2-123b-instruct-2512", - "name": "Devstral 2 123B", - "family": "devstral", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT-OSS 120B", + "family": "gpt", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "structured_output": false, - "release_date": "2025-12-09", - "last_updated": "2025-12-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 1.4 }, - "limit": { "context": 262144, "input": 262144, "output": 65536 } + "temperature": true, + "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.49, + "output": 0.71 + } }, - "mistralai/mixtral-8x22b-instruct-v0.1": { - "id": "mistralai/mixtral-8x22b-instruct-v0.1", - "name": "Mixtral 8x22B", - "family": "mixtral", + "cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic": { + "id": "cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic", + "name": "Llama 3.3 70B", + "family": "llama", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "structured_output": false, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.8999999999999999, "output": 0.8999999999999999 }, - "limit": { "context": 65536, "input": 65536, "output": 32768 } + "temperature": true, + "release_date": "2024-12-05", + "last_updated": "2024-12-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.49, + "output": 0.71 + } }, - "mistralai/mistral-large-3-675b-instruct-2512": { - "id": "mistralai/mistral-large-3-675b-instruct-2512", - "name": "Mistral Large 3 675B", - "family": "mistral-large", + "google/gemma-3-27b-it": { + "id": "google/gemma-3-27b-it", + "name": "Gemma 3 27B", + "family": "gemma", "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 262144, "input": 262144, "output": 256000 } + "temperature": true, + "release_date": "2025-05-17", + "last_updated": "2025-05-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 37000, + "output": 8192 + }, + "cost": { + "input": 0.49, + "output": 0.71 + } }, - "mistralai/Devstral-Small-2505": { - "id": "mistralai/Devstral-Small-2505", - "name": "Mistral Devstral Small 2505", - "family": "devstral", + "intfloat/e5-mistral-7b-instruct": { + "id": "intfloat/e5-mistral-7b-instruct", + "name": "E5 Mistral 7B", + "family": "mistral", "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": false, - "cost": { "input": 0.060000000000000005, "output": 0.060000000000000005 }, - "limit": { "context": 32768, "input": 32768, "output": 8192 } - }, - "mistralai/mistral-medium-3": { - "id": "mistralai/mistral-medium-3", - "name": "Mistral Medium 3", - "family": "mistral-medium", + "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.02, + "output": 0.02 + } + } + } + }, + "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": { + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi-K2.5", + "family": "kimi", "attachment": true, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "reasoning": true, + "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-5": { + "id": "glm-5", + "name": "GLM-5", + "family": "glm", + "attachment": false, + "reasoning": true, + "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, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131072, "input": 131072, "output": 32768 } + "limit": { + "context": 202752, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "mistralai/ministral-8b-2512": { - "id": "mistralai/ministral-8b-2512", - "name": "Ministral 8B", - "family": "ministral", + "hunyuan-turbos": { + "id": "hunyuan-turbos", + "name": "Hunyuan-TurboS", + "family": "hunyuan", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-04", - "last_updated": "2025-12-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-08", + "last_updated": "2026-03-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 262144, "input": 262144, "output": 32768 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "mistralai/ministral-14b-2512": { - "id": "mistralai/ministral-14b-2512", - "name": "Ministral 14B", - "family": "ministral", + "hunyuan-t1": { + "id": "hunyuan-t1", + "name": "Hunyuan-T1", + "family": "hunyuan", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-04", - "last_updated": "2025-12-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.2 }, - "limit": { "context": 262144, "input": 262144, "output": 32768 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "mistralai/Mistral-Nemo-Instruct-2407": { - "id": "mistralai/Mistral-Nemo-Instruct-2407", - "name": "Mistral Nemo", - "family": "mistral-nemo", + "hunyuan-2.0-instruct": { + "id": "hunyuan-2.0-instruct", + "name": "Tencent HY 2.0 Instruct", + "family": "hunyuan", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-08", + "last_updated": "2026-03-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1003, "output": 0.1207 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "mistralai/codestral-2508": { - "id": "mistralai/codestral-2508", - "name": "Codestral 2508", - "family": "codestral", + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + }, + "tc-code-latest": { + "id": "tc-code-latest", + "name": "Auto", + "family": "auto", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "release_date": "2026-03-08", + "last_updated": "2026-03-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.8999999999999999 }, - "limit": { "context": 256000, "input": 256000, "output": 32768 } + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "mistralai/mistral-small-creative": { - "id": "mistralai/mistral-small-creative", - "name": "Mistral Small Creative", - "family": "mistral-small", + "hunyuan-2.0-thinking": { + "id": "hunyuan-2.0-thinking", + "name": "Tencent HY 2.0 Think", + "family": "hunyuan", "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "privatemode-ai": { + "id": "privatemode-ai", + "env": ["PRIVATEMODE_API_KEY", "PRIVATEMODE_ENDPOINT"], + "npm": "@ai-sdk/openai-compatible", + "api": "http://localhost:8080/v1", + "name": "Privatemode AI", + "doc": "https://docs.privatemode.ai/api/overview", + "models": { + "gemma-3-27b": { + "id": "gemma-3-27b", + "name": "Gemma 3 27B", + "family": "gemma", + "attachment": true, "reasoning": false, "tool_call": true, "structured_output": true, - "release_date": "2025-12-16", - "last_updated": "2025-12-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "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, + "output": 0 + } }, - "mistralai/ministral-14b-instruct-2512": { - "id": "mistralai/ministral-14b-instruct-2512", - "name": "Ministral 3 14B", - "family": "ministral", + "whisper-large-v3": { + "id": "whisper-large-v3", + "name": "Whisper large-v3", + "family": "whisper", "attachment": true, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2025-12-02", - "last_updated": "2025-12-02", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 262144, "input": 262144, "output": 32768 } + "temperature": true, + "knowledge": "2023-09", + "release_date": "2023-09-01", + "last_updated": "2023-09-01", + "modalities": { + "input": ["audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 0, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "mistralai/mistral-large": { - "id": "mistralai/mistral-large", - "name": "Mistral Large 2411", - "family": "mistral-large", + "qwen3-embedding-4b": { + "id": "qwen3-embedding-4b", + "name": "Qwen3-Embedding 4B", + "family": "qwen", "attachment": false, "reasoning": false, "tool_call": false, "structured_output": false, - "release_date": "2024-02-26", - "last_updated": "2024-02-26", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 2.006, "output": 6.001 }, - "limit": { "context": 128000, "input": 128000, "output": 256000 } + "temperature": true, + "knowledge": "2025-06", + "release_date": "2025-06-06", + "last_updated": "2025-06-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 2560 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "mistralai/ministral-3b-2512": { - "id": "mistralai/ministral-3b-2512", - "name": "Ministral 3B", - "family": "ministral", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "gpt-oss-120b", + "family": "gpt-oss", + "attachment": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-08", + "release_date": "2025-08-04", + "last_updated": "2025-08-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "qwen3-coder-30b-a3b": { + "id": "qwen3-coder-30b-a3b", + "name": "Qwen3-Coder 30B-A3B", + "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-04", - "last_updated": "2025-12-04", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-04", + "last_updated": "2025-04", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } + } + } + }, + "google": { + "id": "google", + "env": ["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-flash-lite-latest": { + "id": "gemini-flash-lite-latest", + "name": "Gemini Flash-Lite Latest", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, + "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", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131072, "input": 131072, "output": 32768 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "mistralai/mistral-tiny": { - "id": "mistralai/mistral-tiny", - "name": "Mistral Tiny", - "family": "mistral", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2023-12-11", - "last_updated": "2024-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "gemini-2.5-pro-preview-05-06": { + "id": "gemini-2.5-pro-preview-05-06", + "name": "Gemini 2.5 Pro Preview 05-06", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", + "release_date": "2025-05-06", + "last_updated": "2025-05-06", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25499999999999995, "output": 0.25499999999999995 }, - "limit": { "context": 32000, "input": 32000, "output": 8192 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 1.25, + "output": 10, + "cache_read": 0.31 + } }, - "mistralai/mixtral-8x7b-instruct-v0.1": { - "id": "mistralai/mixtral-8x7b-instruct-v0.1", - "name": "Mixtral 8x7B", - "family": "mixtral", + "gemini-live-2.5-flash-preview-native-audio": { + "id": "gemini-live-2.5-flash-preview-native-audio", + "name": "Gemini Live 2.5 Flash Preview Native Audio", + "family": "gemini-flash", "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-12-11", - "last_updated": "2025-12-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-06-17", + "last_updated": "2025-09-18", + "modalities": { + "input": ["text", "audio", "video"], + "output": ["text", "audio"] + }, "open_weights": false, - "cost": { "input": 0.27, "output": 0.27 }, - "limit": { "context": 32768, "input": 32768, "output": 32768 } + "limit": { + "context": 131072, + "output": 65536 + }, + "cost": { + "input": 0.5, + "output": 2, + "input_audio": 3, + "output_audio": 12 + } }, - "mistralai/mistral-saba": { - "id": "mistralai/mistral-saba", - "name": "Mistral Saba", - "family": "mistral", - "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"] }, + "gemini-3.1-pro-preview-customtools": { + "id": "gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.1989, "output": 0.595 }, - "limit": { "context": 32000, "input": 32000, "output": 32768 } + "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 + } + } }, - "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", - "family": "qwen", - "attachment": false, - "reasoning": false, - "tool_call": false, - "structured_output": false, + "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-25", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": true, + "knowledge": "2025-01", "release_date": "2025-09-25", "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7989999999999999, "output": 0.7989999999999999 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "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", - "family": "llama", - "attachment": false, + "gemini-1.5-flash": { + "id": "gemini-1.5-flash", + "name": "Gemini 1.5 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-05-14", + "last_updated": "2024-05-14", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.006, "output": 2.006 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } + "limit": { + "context": 1000000, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3, + "cache_read": 0.01875 + } }, - "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", - "family": "qwen", - "attachment": false, + "gemini-1.5-pro": { + "id": "gemini-1.5-pro", + "name": "Gemini 1.5 Pro", + "family": "gemini-pro", + "attachment": true, "reasoning": false, - "tool_call": false, - "structured_output": false, - "release_date": "2025-07-26", - "last_updated": "2025-07-26", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": true, + "temperature": true, + "knowledge": "2024-04", + "release_date": "2024-02-15", + "last_updated": "2024-02-15", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.7989999999999999, "output": 0.7989999999999999 }, - "limit": { "context": 16384, "input": 16384, "output": 8192 } + "limit": { + "context": 1000000, + "output": 8192 + }, + "cost": { + "input": 1.25, + "output": 5, + "cache_read": 0.3125 + } }, - "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", - "family": "llama", - "attachment": false, + "gemma-3n-e4b-it": { + "id": "gemma-3n-e4b-it", + "name": "Gemma 3n 4B", + "family": "gemma", + "attachment": true, "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": false, - "cost": { "input": 2.006, "output": 2.006 }, - "limit": { "context": 16384, "input": 16384, "output": 16384 } - } - } - }, - "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": { - "openai/chat-completion/models/gpt-oss-20b": { - "id": "openai/chat-completion/models/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", - "attachment": false, - "reasoning": true, - "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-12-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.045, "output": 0.18 }, - "limit": { "context": 131072, "output": 16384 } + "limit": { + "context": 8192, + "output": 2000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "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", - "family": "gpt-oss", - "attachment": false, + "gemini-3.1-flash-lite-preview": { + "id": "gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "family": "gemini-flash-lite", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2026-02-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.09, "output": 0.36 }, - "limit": { "context": 131072, "output": 16384 } + "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 + } }, - "arcee_ai/AFM/models/trinity-mini": { - "id": "arcee_ai/AFM/models/trinity-mini", - "name": "Trinity Mini", - "family": "trinity-mini", - "attachment": false, + "gemini-3.1-pro-preview": { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-12", - "last_updated": "2026-02-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.045, "output": 0.15 }, - "limit": { "context": 131072, "output": 131072 } + "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 + } + } }, - "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", - "family": "minimax", - "attachment": false, - "reasoning": true, + "gemini-2.0-flash": { + "id": "gemini-2.0-flash", + "name": "Gemini 2.0 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": false, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2026-02-12", - "last_updated": "2026-02-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 204800, "output": 131072 } + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.025 + } }, - "deepseek-ai/deepseek-ocr/models/DeepSeek-OCR": { - "id": "deepseek-ai/deepseek-ocr/models/DeepSeek-OCR", - "name": "DeepSeek OCR", - "family": "deepseek", + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", "attachment": true, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-10-20", - "last_updated": "2026-02-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.2, "output": 0.7 }, - "limit": { "context": 8192, "output": 8192 } + "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 + } }, - "qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct": { - "id": "qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct", - "name": "Qwen3 Coder 30B A3B Instruct", - "family": "qwen", + "gemini-2.5-flash-preview-tts": { + "id": "gemini-2.5-flash-preview-tts", + "name": "Gemini 2.5 Flash Preview TTS", + "family": "gemini-flash", "attachment": false, "reasoning": false, - "tool_call": true, - "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-31", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.11458, "output": 0.74812 }, - "limit": { "context": 262144, "output": 65536 } + "tool_call": false, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-05-01", + "last_updated": "2025-05-01", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, + "open_weights": false, + "limit": { + "context": 8000, + "output": 16000 + }, + "cost": { + "input": 0.5, + "output": 10 + } }, - "qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507": { - "id": "qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507", - "name": "Qwen3 30B A3B Thinking 2507", - "family": "qwen", - "attachment": false, + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.36, "output": 1.3 }, - "limit": { "context": 262144, "output": 131072 } + "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": 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": 200000 + } + } + ], + "context_over_200k": { + "input": 4, + "output": 18, + "cache_read": 0.4 + } + } }, - "qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507": { - "id": "qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen3 30B A3B Instruct 2507", - "family": "qwen", - "attachment": false, - "reasoning": false, + "gemini-2.5-flash-preview-05-20": { + "id": "gemini-2.5-flash-preview-05-20", + "name": "Gemini 2.5 Flash Preview 05-20", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2025-07-30", - "last_updated": "2026-02-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.3, "output": 0.5 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.0375 + } }, - "clarifai/main/models/mm-poly-8b": { - "id": "clarifai/main/models/mm-poly-8b", - "name": "MM Poly 8B", - "family": "mm-poly", - "attachment": true, + "gemini-embedding-001": { + "id": "gemini-embedding-001", + "name": "Gemini Embedding 001", + "family": "gemini", + "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-06", - "last_updated": "2026-02-25", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-05", + "release_date": "2025-05-20", + "last_updated": "2025-05-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.658, "output": 1.11 }, - "limit": { "context": 32768, "output": 4096 } + "limit": { + "context": 2048, + "output": 3072 + }, + "cost": { + "input": 0.15, + "output": 0 + } }, - "mistralai/completion/models/Ministral-3-14B-Reasoning-2512": { - "id": "mistralai/completion/models/Ministral-3-14B-Reasoning-2512", - "name": "Ministral 3 14B Reasoning 2512", - "family": "ministral", + "gemini-2.5-pro": { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "family": "gemini-pro", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": 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, - "cost": { "input": 2.5, "output": 1.7 }, - "limit": { "context": 262144, "output": 262144 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } + } }, - "mistralai/completion/models/Ministral-3-3B-Reasoning-2512": { - "id": "mistralai/completion/models/Ministral-3-3B-Reasoning-2512", - "name": "Ministral 3 3B Reasoning 2512", - "family": "ministral", + "gemini-flash-latest": { + "id": "gemini-flash-latest", + "name": "Gemini Flash Latest", + "family": "gemini-flash", "attachment": true, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-12", - "last_updated": "2026-02-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.039, "output": 0.54825 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "cerebras": { - "id": "cerebras", - "env": ["CEREBRAS_API_KEY"], - "npm": "@ai-sdk/cerebras", - "name": "Cerebras", - "doc": "https://inference-docs.cerebras.ai/models/overview", - "models": { - "gpt-oss-120b": { - "id": "gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "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, + "input_audio": 1 + } + }, + "gemma-4-31b-it": { + "id": "gemma-4-31b-it", + "name": "Gemma 4 31B", + "family": "gemma", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.25, "output": 0.69 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 256000, + "output": 8192 + } }, - "llama3.1-8b": { - "id": "llama3.1-8b", - "name": "Llama 3.1 8B", - "family": "llama", - "attachment": false, - "reasoning": false, + "gemini-2.5-pro-preview-06-05": { + "id": "gemini-2.5-pro-preview-06-05", + "name": "Gemini 2.5 Pro Preview 06-05", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, "tool_call": true, + "structured_output": true, "temperature": true, - "knowledge": "2023-12", - "release_date": "2025-01-01", - "last_updated": "2025-01-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 32000, "output": 8000 } + "knowledge": "2025-01", + "release_date": "2025-06-05", + "last_updated": "2025-06-05", + "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 + } }, - "zai-glm-4.7": { - "id": "zai-glm-4.7", - "name": "Z.AI GLM-4.7", - "attachment": false, - "reasoning": false, + "gemini-2.5-flash-image": { + "id": "gemini-2.5-flash-image", + "name": "Gemini 2.5 Flash Image", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": false, + "temperature": true, + "knowledge": "2025-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.075 + } + }, + "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", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2026-01-10", - "last_updated": "2026-01-10", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 2.25, "output": 2.75, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 40000 } + "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.025, + "input_audio": 0.3 + } }, - "qwen-3-235b-a22b-instruct-2507": { - "id": "qwen-3-235b-a22b-instruct-2507", - "name": "Qwen 3 235B Instruct", - "family": "qwen", - "attachment": false, + "gemma-3-12b-it": { + "id": "gemma-3-12b-it", + "name": "Gemma 3 12B", + "family": "gemma", + "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2025-07-22", - "last_updated": "2025-07-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 1.2 }, - "limit": { "context": 131000, "output": 32000 } - } - } - }, - "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": { - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT-OSS 120B", - "family": "gpt", - "attachment": false, + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", + "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": false, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.49, "output": 0.71 }, - "limit": { "context": 131000, "output": 8192 } + "knowledge": "2025-01", + "release_date": "2025-03-20", + "last_updated": "2025-06-05", + "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 + } }, - "google/gemma-3-27b-it": { - "id": "google/gemma-3-27b-it", - "name": "Gemma 3 27B", + "gemma-3n-e2b-it": { + "id": "gemma-3n-e2b-it", + "name": "Gemma 3n 2B", "family": "gemma", "attachment": true, "reasoning": false, "tool_call": false, - "structured_output": false, - "temperature": true, - "release_date": "2025-05-17", - "last_updated": "2025-05-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.49, "output": 0.71 }, - "limit": { "context": 37000, "output": 8192 } - }, - "cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic": { - "id": "cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic", - "name": "Llama 3.3 70B", - "family": "llama", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2024-12-05", - "last_updated": "2024-12-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2025-07-09", + "last_updated": "2025-07-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.49, "output": 0.71 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 8192, + "output": 2000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "neuralmagic/Mistral-Nemo-Instruct-2407-FP8": { - "id": "neuralmagic/Mistral-Nemo-Instruct-2407-FP8", - "name": "Mistral Nemo", - "family": "mistral", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": false, + "gemini-3.1-flash-image-preview": { + "id": "gemini-3.1-flash-image-preview", + "name": "Gemini 3.1 Flash Image (Preview)", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": false, "temperature": true, - "release_date": "2024-07-01", - "last_updated": "2024-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.49, "output": 0.71 }, - "limit": { "context": 128000, "output": 8192 } + "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 + } }, - "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8": { - "id": "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8", - "name": "Llama 3.1 8B", - "family": "llama", - "attachment": false, - "reasoning": false, + "gemini-3.1-flash-lite": { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.16, "output": 0.27 }, - "limit": { "context": 128000, "output": 8192 } + "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 + } }, - "intfloat/e5-mistral-7b-instruct": { - "id": "intfloat/e5-mistral-7b-instruct", - "name": "E5 Mistral 7B", - "family": "mistral", - "attachment": false, + "gemma-3-4b-it": { + "id": "gemma-3-4b-it", + "name": "Gemma 3 4B", + "family": "gemma", + "attachment": true, "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"] }, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-03-13", + "last_updated": "2025-03-13", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.02 }, - "limit": { "context": 4096, "output": 4096 } + "limit": { + "context": 32768, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8": { - "id": "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8", - "name": "Qwen3-VL 235B", - "family": "qwen", + "gemini-2.5-flash-preview-04-17": { + "id": "gemini-2.5-flash-preview-04-17", + "name": "Gemini 2.5 Flash Preview 04-17", + "family": "gemini-flash", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2024-11-01", - "last_updated": "2024-11-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 1.64, "output": 1.91 }, - "limit": { "context": 218000, "output": 8192 } + "knowledge": "2025-01", + "release_date": "2025-04-17", + "last_updated": "2025-04-17", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.15, + "output": 0.6, + "cache_read": 0.0375 + } }, - "Qwen/Qwen3-VL-Embedding-8B": { - "id": "Qwen/Qwen3-VL-Embedding-8B", - "name": "Qwen3-VL Embedding 8B", - "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, - "cost": { "input": 0.09, "output": 0.09 }, - "limit": { "context": 32000, "output": 4096 } - } - } - }, - "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/openai/gpt-oss-120b": { - "id": "@cf/openai/gpt-oss-120b", - "name": "GPT OSS 120B", + "gemini-2.5-pro-preview-tts": { + "id": "gemini-2.5-pro-preview-tts", + "name": "Gemini 2.5 Pro Preview TTS", + "family": "gemini-flash", "attachment": false, "reasoning": false, "tool_call": false, - "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2025-05-01", + "last_updated": "2025-05-01", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 0.75 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 8000, + "output": 16000 + }, + "cost": { + "input": 1, + "output": 20 + } }, - "@cf/openai/gpt-oss-20b": { - "id": "@cf/openai/gpt-oss-20b", - "name": "GPT OSS 20B", - "attachment": false, - "reasoning": false, - "tool_call": false, + "gemini-2.5-flash-preview-09-2025": { + "id": "gemini-2.5-flash-preview-09-2025", + "name": "Gemini 2.5 Flash Preview 09-25", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-09-25", + "last_updated": "2025-09-25", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.3 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.3, + "output": 2.5, + "cache_read": 0.075, + "input_audio": 1 + } }, - "@cf/zai-org/glm-4.7-flash": { - "id": "@cf/zai-org/glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", - "attachment": false, - "reasoning": true, + "gemma-3-27b-it": { + "id": "gemma-3-27b-it", + "name": "Gemma 3 27B", + "family": "gemma", + "attachment": true, + "reasoning": false, "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"] }, + "knowledge": "2024-10", + "release_date": "2025-03-12", + "last_updated": "2025-03-12", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.06, "output": 0.4 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 131072, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/nvidia/nemotron-3-120b-a12b": { - "id": "@cf/nvidia/nemotron-3-120b-a12b", - "name": "Nemotron 3 Super 120B", - "family": "nemotron", + "gemma-4-26b-a4b-it": { + "id": "gemma-4-26b-a4b-it", + "name": "Gemma 4 26B", + "family": "gemma", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "structured_output": true, "temperature": true, - "release_date": "2026-03-11", - "last_updated": "2026-03-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-02", + "last_updated": "2026-04-02", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.5, "output": 1.5 }, - "limit": { "context": 256000, "output": 256000 } + "limit": { + "context": 256000, + "output": 8192 + } }, - "@cf/myshell-ai/melotts": { - "id": "@cf/myshell-ai/melotts", - "name": "MyShell MeloTTS", - "family": "melotts", - "attachment": false, - "reasoning": false, - "tool_call": false, + "gemini-2.5-flash-lite": { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1048576, + "output": 65536 + }, + "cost": { + "input": 0.1, + "output": 0.4, + "cache_read": 0.01, + "input_audio": 0.3 + } }, - "@cf/google/gemma-3-12b-it": { - "id": "@cf/google/gemma-3-12b-it", - "name": "Gemma 3 12B IT", - "family": "gemma", - "attachment": false, - "reasoning": false, + "gemini-2.5-flash-image-preview": { + "id": "gemini-2.5-flash-image-preview", + "name": "Gemini 2.5 Flash Image (Preview)", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, "tool_call": false, "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-06", + "release_date": "2025-08-26", + "last_updated": "2025-08-26", + "modalities": { + "input": ["text", "image"], + "output": ["text", "image"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 0.56 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 30, + "cache_read": 0.075 + } }, - "@cf/ibm-granite/granite-4.0-h-micro": { - "id": "@cf/ibm-granite/granite-4.0-h-micro", - "name": "IBM Granite 4.0 H Micro", - "family": "granite", - "attachment": false, + "gemini-1.5-flash-8b": { + "id": "gemini-1.5-flash-8b", + "name": "Gemini 1.5 Flash-8B", + "family": "gemini-flash", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-10-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2024-10-03", + "last_updated": "2024-10-03", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.017, "output": 0.11 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 8192 + }, + "cost": { + "input": 0.0375, + "output": 0.15, + "cache_read": 0.01 + } }, - "@cf/ai4bharat/indictrans2-en-indic-1B": { - "id": "@cf/ai4bharat/indictrans2-en-indic-1B", - "name": "IndicTrans2 EN-Indic 1B", - "family": "indictrans", - "attachment": false, - "reasoning": false, - "tool_call": false, + "gemini-live-2.5-flash": { + "id": "gemini-live-2.5-flash", + "name": "Gemini Live 2.5 Flash", + "family": "gemini-flash", + "attachment": true, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2025-09-01", + "last_updated": "2025-09-01", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text", "audio"] + }, "open_weights": false, - "cost": { "input": 0.34, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 8000 + }, + "cost": { + "input": 0.5, + "output": 2, + "input_audio": 3, + "output_audio": 12 + } }, - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": { - "id": "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "name": "DeepSeek R1 Distill Qwen 32B", - "family": "deepseek-thinking", - "attachment": false, + "gemini-2.0-flash-lite": { + "id": "gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite", + "family": "gemini-flash-lite", + "attachment": true, "reasoning": false, - "tool_call": false, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 4.88 }, - "limit": { "context": 128000, "output": 16384 } - }, - "@cf/qwen/qwq-32b": { - "id": "@cf/qwen/qwq-32b", - "name": "QwQ 32B", - "family": "qwen", + "limit": { + "context": 1048576, + "output": 8192 + }, + "cost": { + "input": 0.075, + "output": 0.3 + } + } + } + }, + "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", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.66, "output": 1 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-12", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 32000 + }, + "cost": { + "input": 0.55, + "output": 2.2 + } }, - "@cf/qwen/qwen3-30b-a3b-fp8": { - "id": "@cf/qwen/qwen3-30b-a3b-fp8", - "name": "Qwen3 30B A3B FP8", - "family": "qwen", + "public/minimax-m25": { + "id": "public/minimax-m25", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_details" + }, "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-03-01", + "last_updated": "2025-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.051, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.29, + "output": 1.16 + } }, - "@cf/qwen/qwen3-embedding-0.6b": { - "id": "@cf/qwen/qwen3-embedding-0.6b", - "name": "Qwen3 Embedding 0.6B", - "family": "qwen", + "public/deepseek-v3": { + "id": "public/deepseek-v3", + "name": "DeepSeek V3", + "family": "deepseek", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.012, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } - }, - "@cf/qwen/qwen2.5-coder-32b-instruct": { - "id": "@cf/qwen/qwen2.5-coder-32b-instruct", - "name": "Qwen 2.5 Coder 32B Instruct", - "family": "qwen", + "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 + } + } + } + }, + "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-k2-0905-preview": { + "id": "kimi-k2-0905-preview", + "name": "Kimi K2 0905", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.66, "output": 1 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "@cf/huggingface/distilbert-sst-2-int8": { - "id": "@cf/huggingface/distilbert-sst-2-int8", - "name": "DistilBERT SST-2 INT8", - "family": "distilbert", + "kimi-k2.5": { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi-k2.5", "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.026, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-01", + "release_date": "2026-01", + "last_updated": "2026-01", + "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 + } }, - "@cf/facebook/bart-large-cnn": { - "id": "@cf/facebook/bart-large-cnn", - "name": "BART Large CNN", - "family": "bart", + "kimi-k2-thinking-turbo": { + "id": "kimi-k2-thinking-turbo", + "name": "Kimi K2 Thinking Turbo", + "family": "kimi-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-04-09", - "last_updated": "2025-04-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "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": 1.15, + "output": 8, + "cache_read": 0.15 + } }, - "@cf/baai/bge-base-en-v1.5": { - "id": "@cf/baai/bge-base-en-v1.5", - "name": "BGE Base EN v1.5", - "family": "bge", - "attachment": false, - "reasoning": false, - "tool_call": false, + "kimi-k2.6": { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.067, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "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": 262144 + }, + "cost": { + "input": 0.95, + "output": 4, + "cache_read": 0.16 + } }, - "@cf/baai/bge-small-en-v1.5": { - "id": "@cf/baai/bge-small-en-v1.5", - "name": "BGE Small EN v1.5", - "family": "bge", + "kimi-k2-turbo-preview": { + "id": "kimi-k2-turbo-preview", + "name": "Kimi K2 Turbo", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.02, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 2.4, + "output": 10, + "cache_read": 0.6 + } }, - "@cf/baai/bge-large-en-v1.5": { - "id": "@cf/baai/bge-large-en-v1.5", - "name": "BGE Large EN v1.5", - "family": "bge", + "kimi-k2-0711-preview": { + "id": "kimi-k2-0711-preview", + "name": "Kimi K2 0711", + "family": "kimi", "attachment": false, "reasoning": false, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-10", + "release_date": "2025-07-14", + "last_updated": "2025-07-14", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.5, + "cache_read": 0.15 + } }, - "@cf/baai/bge-reranker-base": { - "id": "@cf/baai/bge-reranker-base", - "name": "BGE Reranker Base", - "family": "bge", + "kimi-k2-thinking": { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "family": "kimi-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-04-09", - "last_updated": "2025-04-09", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.0031, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } - }, - "@cf/baai/bge-m3": { - "id": "@cf/baai/bge-m3", - "name": "BGE M3", - "family": "bge", + "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 + } + } + } + }, + "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": { + "zai-org/GLM-4.7": { + "id": "zai-org/GLM-4.7", + "name": "GLM 4.7", + "family": "glm", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.012, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2025-12", + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.77, + "output": 2.75 + } }, - "@cf/pipecat-ai/smart-turn-v2": { - "id": "@cf/pipecat-ai/smart-turn-v2", - "name": "Pipecat Smart Turn v2", - "family": "smart-turn", + "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", + "family": "mistral-small", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2025-09", + "release_date": "2025-10-01", + "last_updated": "2025-10-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32000, + "output": 8192 + }, + "cost": { + "input": 0.33, + "output": 0.33 + } }, - "@cf/moonshotai/kimi-k2.5": { - "id": "@cf/moonshotai/kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", + "mistralai/Mistral-Medium-3.5-128B": { + "id": "mistralai/Mistral-Medium-3.5-128B", + "name": "Mistral Medium 3.5 128B", + "family": "mistral-medium", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2026-04", + "release_date": "2026-04-29", + "last_updated": "2026-04-29", + "modalities": { + "input": ["image", "text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 256000, "output": 256000 } - }, - "@cf/deepgram/aura-2-en": { - "id": "@cf/deepgram/aura-2-en", - "name": "Deepgram Aura 2 (EN)", - "family": "aura", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } - }, - "@cf/deepgram/nova-3": { - "id": "@cf/deepgram/nova-3", - "name": "Deepgram Nova 3", - "family": "nova", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 1.65, + "output": 5.5 + } }, - "@cf/deepgram/aura-2-es": { - "id": "@cf/deepgram/aura-2-es", - "name": "Deepgram Aura 2 (ES)", - "family": "aura", + "meta-llama/Llama-3.3-70B-Instruct": { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-11-14", - "last_updated": "2025-11-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-12", + "release_date": "2025-04-27", + "last_updated": "2025-04-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0.99, + "output": 0.99 + } }, - "@cf/mistral/mistral-7b-instruct-v0.1": { - "id": "@cf/mistral/mistral-7b-instruct-v0.1", - "name": "Mistral 7B Instruct v0.1", - "family": "mistral", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT-OSS-120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, + "structured_output": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.11, "output": 0.19 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2025-08", + "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.44, + "output": 0.99 + } }, - "@cf/aisingapore/gemma-sea-lion-v4-27b-it": { - "id": "@cf/aisingapore/gemma-sea-lion-v4-27b-it", - "name": "Gemma SEA-LION v4 27B IT", + "google/gemma-4-31B-it": { + "id": "google/gemma-4-31B-it", + "name": "Gemma 4 31B Instruct", "family": "gemma", + "attachment": true, + "reasoning": true, + "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.275, + "output": 0.55 + } + } + } + }, + "github-models": { + "id": "github-models", + "env": ["GITHUB_TOKEN"], + "npm": "@ai-sdk/openai-compatible", + "api": "https://models.github.ai/inference", + "name": "GitHub Models", + "doc": "https://docs.github.com/en/github-models", + "models": { + "deepseek/deepseek-v3-0324": { + "id": "deepseek/deepseek-v3-0324", + "name": "DeepSeek-V3-0324", + "family": "deepseek", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.35, "output": 0.56 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-06", + "release_date": "2025-03-24", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@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", - "family": "llama", + "deepseek/deepseek-r1": { + "id": "deepseek/deepseek-r1", + "name": "DeepSeek-R1", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.29, "output": 2.25 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-06", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3-8b-instruct-awq": { - "id": "@cf/meta/llama-3-8b-instruct-awq", - "name": "Llama 3 8B Instruct AWQ", - "family": "llama", + "deepseek/deepseek-r1-0528": { + "id": "deepseek/deepseek-r1-0528", + "name": "DeepSeek-R1-0528", + "family": "deepseek-thinking", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.12, "output": 0.27 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2024-06", + "release_date": "2025-05-28", + "last_updated": "2025-05-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3.2-1b-instruct": { - "id": "@cf/meta/llama-3.2-1b-instruct", - "name": "Llama 3.2 1B Instruct", - "family": "llama", + "ai21-labs/ai21-jamba-1.5-mini": { + "id": "ai21-labs/ai21-jamba-1.5-mini", + "name": "AI21 Jamba 1.5 Mini", + "family": "jamba", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-08-29", + "last_updated": "2024-08-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.027, "output": 0.2 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/m2m100-1.2b": { - "id": "@cf/meta/m2m100-1.2b", - "name": "M2M100 1.2B", - "family": "m2m", + "ai21-labs/ai21-jamba-1.5-large": { + "id": "ai21-labs/ai21-jamba-1.5-large", + "name": "AI21 Jamba 1.5 Large", + "family": "jamba", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-08-29", + "last_updated": "2024-08-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.34, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 256000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3.1-8b-instruct": { - "id": "@cf/meta/llama-3.1-8b-instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", + "microsoft/phi-3.5-mini-instruct": { + "id": "microsoft/phi-3.5-mini-instruct", + "name": "Phi-3.5-mini instruct (128k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.28, "output": 0.8299999999999998 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-4-scout-17b-16e-instruct": { - "id": "@cf/meta/llama-4-scout-17b-16e-instruct", - "name": "Llama 4 Scout 17B 16E Instruct", - "family": "llama", + "microsoft/phi-3-medium-4k-instruct": { + "id": "microsoft/phi-3-medium-4k-instruct", + "name": "Phi-3-medium instruct (4k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27, "output": 0.85 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 1024 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3.2-11b-vision-instruct": { - "id": "@cf/meta/llama-3.2-11b-vision-instruct", - "name": "Llama 3.2 11B Vision Instruct", - "family": "llama", + "microsoft/phi-3.5-moe-instruct": { + "id": "microsoft/phi-3.5-moe-instruct", + "name": "Phi-3.5-MoE instruct (128k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.049, "output": 0.68 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3-8b-instruct": { - "id": "@cf/meta/llama-3-8b-instruct", - "name": "Llama 3 8B Instruct", - "family": "llama", + "microsoft/phi-3-mini-128k-instruct": { + "id": "microsoft/phi-3-mini-128k-instruct", + "name": "Phi-3-mini instruct (128k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.28, "output": 0.83 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-guard-3-8b": { - "id": "@cf/meta/llama-guard-3-8b", - "name": "Llama Guard 3 8B", - "family": "llama", + "microsoft/phi-4-mini-instruct": { + "id": "microsoft/phi-4-mini-instruct", + "name": "Phi-4-mini-instruct", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.48, "output": 0.03 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3.2-3b-instruct": { - "id": "@cf/meta/llama-3.2-3b-instruct", - "name": "Llama 3.2 3B Instruct", - "family": "llama", + "microsoft/phi-4-reasoning": { + "id": "microsoft/phi-4-reasoning", + "name": "Phi-4-Reasoning", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.051, "output": 0.34 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3.1-8b-instruct-awq": { - "id": "@cf/meta/llama-3.1-8b-instruct-awq", - "name": "Llama 3.1 8B Instruct AWQ", - "family": "llama", + "microsoft/phi-3-small-8k-instruct": { + "id": "microsoft/phi-3-small-8k-instruct", + "name": "Phi-3-small instruct (8k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.12, "output": 0.27 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-3.1-8b-instruct-fp8": { - "id": "@cf/meta/llama-3.1-8b-instruct-fp8", - "name": "Llama 3.1 8B Instruct FP8", - "family": "llama", + "microsoft/phi-3.5-vision-instruct": { + "id": "microsoft/phi-3.5-vision-instruct", + "name": "Phi-3.5-vision instruct (128k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.29 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-08-20", + "last_updated": "2024-08-20", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/meta/llama-2-7b-chat-fp16": { - "id": "@cf/meta/llama-2-7b-chat-fp16", - "name": "Llama 2 7B Chat FP16", - "family": "llama", + "microsoft/phi-3-mini-4k-instruct": { + "id": "microsoft/phi-3-mini-4k-instruct", + "name": "Phi-3-mini instruct (4k)", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-04-03", - "last_updated": "2025-04-03", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.56, "output": 6.67 }, - "limit": { "context": 128000, "output": 16384 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 4096, + "output": 1024 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/pfnet/plamo-embedding-1b": { - "id": "@cf/pfnet/plamo-embedding-1b", - "name": "PLaMo Embedding 1B", - "family": "plamo", + "microsoft/phi-4-mini-reasoning": { + "id": "microsoft/phi-4-mini-reasoning", + "name": "Phi-4-mini-reasoning", + "family": "phi", "attachment": false, - "reasoning": false, - "tool_call": false, + "reasoning": true, + "tool_call": true, "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-09-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.019, "output": 0 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "@cf/mistralai/mistral-small-3.1-24b-instruct": { - "id": "@cf/mistralai/mistral-small-3.1-24b-instruct", - "name": "Mistral Small 3.1 24B Instruct", - "family": "mistral-small", - "attachment": false, - "reasoning": false, - "tool_call": false, - "temperature": true, - "release_date": "2025-04-11", - "last_updated": "2025-04-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.35, "output": 0.56 }, - "limit": { "context": 128000, "output": 16384 } - } - } - }, - "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": { - "THUDM/GLM-Z1-32B-0414": { - "id": "THUDM/GLM-Z1-32B-0414", - "name": "THUDM/GLM-Z1-32B-0414", - "family": "glm-z", + "microsoft/phi-3-small-128k-instruct": { + "id": "microsoft/phi-3-small-128k-instruct", + "name": "Phi-3-small instruct (128k)", + "family": "phi", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "THUDM/GLM-Z1-9B-0414": { - "id": "THUDM/GLM-Z1-9B-0414", - "name": "THUDM/GLM-Z1-9B-0414", - "family": "glm-z", + "microsoft/phi-3-medium-128k-instruct": { + "id": "microsoft/phi-3-medium-128k-instruct", + "name": "Phi-3-medium instruct (128k)", + "family": "phi", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.086, "output": 0.086 }, - "limit": { "context": 131000, "output": 131000 } + "knowledge": "2023-10", + "release_date": "2024-04-23", + "last_updated": "2024-04-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "THUDM/GLM-4-32B-0414": { - "id": "THUDM/GLM-4-32B-0414", - "name": "THUDM/GLM-4-32B-0414", - "family": "glm", + "microsoft/phi-4": { + "id": "microsoft/phi-4", + "name": "Phi-4", + "family": "phi", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27, "output": 0.27 }, - "limit": { "context": 33000, "output": 33000 } + "knowledge": "2023-10", + "release_date": "2024-12-11", + "last_updated": "2024-12-11", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "THUDM/GLM-4-9B-0414": { - "id": "THUDM/GLM-4-9B-0414", - "name": "THUDM/GLM-4-9B-0414", - "family": "glm", + "microsoft/phi-4-multimodal-instruct": { + "id": "microsoft/phi-4-multimodal-instruct", + "name": "Phi-4-multimodal-instruct", + "family": "phi", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.086, "output": 0.086 }, - "limit": { "context": 33000, "output": 33000 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "openai/gpt-oss-120b", - "family": "gpt-oss", + "microsoft/mai-ds-r1": { + "id": "microsoft/mai-ds-r1", + "name": "MAI-DS-R1", + "family": "mai", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-06", + "release_date": "2025-01-20", + "last_updated": "2025-01-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.45 }, - "limit": { "context": 131000, "output": 8000 } + "limit": { + "context": 65536, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "openai/gpt-oss-20b": { - "id": "openai/gpt-oss-20b", - "name": "openai/gpt-oss-20b", - "family": "gpt-oss", + "cohere/cohere-command-r-08-2024": { + "id": "cohere/cohere-command-r-08-2024", + "name": "Cohere Command R 08-2024", + "family": "command-r", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-08-01", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.04, "output": 0.18 }, - "limit": { "context": 131000, "output": 8000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-4.5-Air": { - "id": "zai-org/GLM-4.5-Air", - "name": "zai-org/GLM-4.5-Air", - "family": "glm-air", + "cohere/cohere-command-a": { + "id": "cohere/cohere-command-a", + "name": "Cohere Command A", + "family": "command-a", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.86 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-4.7": { - "id": "zai-org/GLM-4.7", - "name": "zai-org/GLM-4.7", - "family": "glm", + "cohere/cohere-command-r-plus": { + "id": "cohere/cohere-command-r-plus", + "name": "Cohere Command R+", + "family": "command-r", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2025-12-22", - "last_updated": "2025-12-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-04-04", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 205000, "output": 205000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-4.6V": { - "id": "zai-org/GLM-4.6V", - "name": "zai-org/GLM-4.6V", - "family": "glm", - "attachment": true, + "cohere/cohere-command-r": { + "id": "cohere/cohere-command-r", + "name": "Cohere Command R", + "family": "command-r", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": false, "temperature": true, - "release_date": "2025-12-07", - "last_updated": "2025-12-07", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-03-11", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 0.9 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-4.5V": { - "id": "zai-org/GLM-4.5V", - "name": "zai-org/GLM-4.5V", - "family": "glm", - "attachment": true, + "cohere/cohere-command-r-plus-08-2024": { + "id": "cohere/cohere-command-r-plus-08-2024", + "name": "Cohere Command R+ 08-2024", + "family": "command-r", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2024-08-01", + "last_updated": "2024-08-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.14, "output": 0.86 }, - "limit": { "context": 66000, "output": 66000 } + "limit": { + "context": 128000, + "output": 4096 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-4.5": { - "id": "zai-org/GLM-4.5", - "name": "zai-org/GLM-4.5", - "family": "glm", + "xai/grok-3-mini": { + "id": "xai/grok-3-mini", + "name": "Grok 3 Mini", + "family": "grok", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-10", + "release_date": "2024-12-09", + "last_updated": "2024-12-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-5": { - "id": "zai-org/GLM-5", - "name": "zai-org/GLM-5", - "family": "glm", + "xai/grok-3": { + "id": "xai/grok-3", + "name": "Grok 3", + "family": "grok", "attachment": false, "reasoning": true, "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, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 205000, "output": 205000 } + "knowledge": "2024-10", + "release_date": "2024-12-09", + "last_updated": "2024-12-09", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "zai-org/GLM-4.6": { - "id": "zai-org/GLM-4.6", - "name": "zai-org/GLM-4.6", - "family": "glm", + "openai/o1-mini": { + "id": "openai/o1-mini", + "name": "OpenAI o1-mini", + "family": "o-mini", "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": false, + "knowledge": "2023-10", + "release_date": "2024-09-12", + "last_updated": "2024-12-17", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 128000, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "openai/gpt-4o-mini": { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o mini", + "family": "gpt-mini", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2023-10", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 1.9 }, - "limit": { "context": 205000, "output": 205000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "nex-agi/DeepSeek-V3.1-Nex-N1": { - "id": "nex-agi/DeepSeek-V3.1-Nex-N1", - "name": "nex-agi/DeepSeek-V3.1-Nex-N1", - "family": "deepseek", + "openai/o4-mini": { + "id": "openai/o4-mini", + "name": "OpenAI o4-mini", + "family": "o-mini", "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-01-01", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "knowledge": "2024-04", + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.5, "output": 2 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "stepfun-ai/Step-3.5-Flash": { - "id": "stepfun-ai/Step-3.5-Flash", - "name": "stepfun-ai/Step-3.5-Flash", - "family": "step", + "openai/o1-preview": { + "id": "openai/o1-preview", + "name": "OpenAI o1-preview", + "family": "o", "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "tool_call": false, + "temperature": false, + "knowledge": "2023-10", + "release_date": "2024-09-12", + "last_updated": "2024-09-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.1, "output": 0.3 }, - "limit": { "context": 262000, "output": 262000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "baidu/ERNIE-4.5-300B-A47B": { - "id": "baidu/ERNIE-4.5-300B-A47B", - "name": "baidu/ERNIE-4.5-300B-A47B", - "family": "ernie", + "openai/o1": { + "id": "openai/o1", + "name": "OpenAI o1", + "family": "o", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-07-02", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": false, + "temperature": false, + "knowledge": "2023-10", + "release_date": "2024-09-12", + "last_updated": "2024-12-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.28, "output": 1.1 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "meta-llama/Meta-Llama-3.1-8B-Instruct": { - "id": "meta-llama/Meta-Llama-3.1-8B-Instruct", - "name": "meta-llama/Meta-Llama-3.1-8B-Instruct", - "family": "llama", + "openai/o3-mini": { + "id": "openai/o3-mini", + "name": "OpenAI o3-mini", + "family": "o-mini", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-04-23", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "reasoning": true, + "tool_call": false, + "temperature": false, + "knowledge": "2024-04", + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.06, "output": 0.06 }, - "limit": { "context": 33000, "output": 4000 } + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "MiniMaxAI/MiniMax-M2.1": { - "id": "MiniMaxAI/MiniMax-M2.1", - "name": "MiniMaxAI/MiniMax-M2.1", - "family": "minimax", - "attachment": false, + "openai/gpt-4.1-nano": { + "id": "openai/gpt-4.1-nano", + "name": "GPT-4.1-nano", + "family": "gpt-nano", + "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-12-23", - "last_updated": "2025-12-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 197000, "output": 131000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "MiniMaxAI/MiniMax-M2.5": { - "id": "MiniMaxAI/MiniMax-M2.5", - "name": "MiniMaxAI/MiniMax-M2.5", - "family": "minimax", + "openai/o3": { + "id": "openai/o3", + "name": "OpenAI o3", + "family": "o", "attachment": false, + "reasoning": true, + "tool_call": false, + "temperature": false, + "knowledge": "2024-04", + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 100000 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "openai/gpt-4o": { + "id": "openai/gpt-4o", + "name": "GPT-4o", + "family": "gpt", + "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"], "output": ["text"] }, + "knowledge": "2023-10", + "release_date": "2024-05-13", + "last_updated": "2024-05-13", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 1.2 }, - "limit": { "context": 197000, "output": 131000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/deepseek-vl2": { - "id": "deepseek-ai/deepseek-vl2", - "name": "deepseek-ai/deepseek-vl2", - "family": "deepseek", + "openai/gpt-4.1": { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "family": "gpt", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-12-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.15, "output": 0.15 }, - "limit": { "context": 4000, "output": 4000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { - "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", - "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", - "family": "qwen", - "attachment": false, - "reasoning": true, + "openai/gpt-4.1-mini": { + "id": "openai/gpt-4.1-mini", + "name": "GPT-4.1-mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-04", + "release_date": "2025-04-14", + "last_updated": "2025-04-14", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-V3.1": { - "id": "deepseek-ai/DeepSeek-V3.1", - "name": "deepseek-ai/DeepSeek-V3.1", - "family": "deepseek", + "meta/llama-4-scout-17b-16e-instruct": { + "id": "meta/llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-08-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "knowledge": "2024-12", + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-V3.2-Exp": { - "id": "deepseek-ai/DeepSeek-V3.2-Exp", - "name": "deepseek-ai/DeepSeek-V3.2-Exp", - "family": "deepseek", + "meta/meta-llama-3.1-8b-instruct": { + "id": "meta/meta-llama-3.1-8b-instruct", + "name": "Meta-Llama-3.1-8B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "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": false, - "cost": { "input": 0.27, "output": 0.41 }, - "limit": { "context": 164000, "output": 164000 } + "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": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-R1": { - "id": "deepseek-ai/DeepSeek-R1", - "name": "deepseek-ai/DeepSeek-R1", - "family": "deepseek-thinking", + "meta/llama-3.3-70b-instruct": { + "id": "meta/llama-3.3-70b-instruct", + "name": "Llama-3.3-70B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.5, "output": 2.18 }, - "limit": { "context": 164000, "output": 164000 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-V3.1-Terminus": { - "id": "deepseek-ai/DeepSeek-V3.1-Terminus", - "name": "deepseek-ai/DeepSeek-V3.1-Terminus", - "family": "deepseek", + "meta/meta-llama-3-70b-instruct": { + "id": "meta/meta-llama-3-70b-instruct", + "name": "Meta-Llama-3-70B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "knowledge": "2023-12", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { - "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", - "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", - "family": "qwen", + "meta/llama-3.2-90b-vision-instruct": { + "id": "meta/llama-3.2-90b-vision-instruct", + "name": "Llama-3.2-90B-Vision-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 131000, "output": 131000 } + "knowledge": "2023-12", + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "deepseek-ai/DeepSeek-V3.2", - "family": "deepseek", + "meta/llama-3.2-11b-vision-instruct": { + "id": "meta/llama-3.2-11b-vision-instruct", + "name": "Llama-3.2-11B-Vision-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.27, "output": 0.42 }, - "limit": { "context": 164000, "output": 164000 } - }, - "deepseek-ai/DeepSeek-V3": { - "id": "deepseek-ai/DeepSeek-V3", - "name": "deepseek-ai/DeepSeek-V3", - "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, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 164000, "output": 164000 } + "knowledge": "2023-12", + "release_date": "2024-09-25", + "last_updated": "2024-09-25", + "modalities": { + "input": ["text", "image", "audio"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "ByteDance-Seed/Seed-OSS-36B-Instruct": { - "id": "ByteDance-Seed/Seed-OSS-36B-Instruct", - "name": "ByteDance-Seed/Seed-OSS-36B-Instruct", - "family": "seed", + "meta/meta-llama-3.1-405b-instruct": { + "id": "meta/meta-llama-3.1-405b-instruct", + "name": "Meta-Llama-3.1-405B-Instruct", + "family": "llama", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.21, "output": 0.57 }, - "limit": { "context": 262000, "output": 262000 } + "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": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen2.5-Coder-32B-Instruct": { - "id": "Qwen/Qwen2.5-Coder-32B-Instruct", - "name": "Qwen/Qwen2.5-Coder-32B-Instruct", - "family": "qwen", + "meta/meta-llama-3.1-70b-instruct": { + "id": "meta/meta-llama-3.1-70b-instruct", + "name": "Meta-Llama-3.1-70B-Instruct", + "family": "llama", "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2024-11-11", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 33000, "output": 4000 } - }, - "Qwen/Qwen3-Omni-30B-A3B-Thinking": { - "id": "Qwen/Qwen3-Omni-30B-A3B-Thinking", - "name": "Qwen/Qwen3-Omni-30B-A3B-Thinking", - "family": "qwen", - "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 66000, "output": 66000 } + "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": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-Next-80B-A3B-Thinking": { - "id": "Qwen/Qwen3-Next-80B-A3B-Thinking", - "name": "Qwen/Qwen3-Next-80B-A3B-Thinking", - "family": "qwen", + "meta/meta-llama-3-8b-instruct": { + "id": "meta/meta-llama-3-8b-instruct", + "name": "Meta-Llama-3-8B-Instruct", + "family": "llama", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-09-25", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 262000, "output": 262000 } - }, - "Qwen/Qwen3-VL-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", - "name": "Qwen/Qwen3-VL-30B-A3B-Instruct", - "family": "qwen", - "attachment": true, - "reasoning": false, - "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-05", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.29, "output": 1 }, - "limit": { "context": 262000, "output": 262000 } + "knowledge": "2023-12", + "release_date": "2024-04-18", + "last_updated": "2024-04-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-VL-235B-A22B-Thinking": { - "id": "Qwen/Qwen3-VL-235B-A22B-Thinking", - "name": "Qwen/Qwen3-VL-235B-A22B-Thinking", - "family": "qwen", - "attachment": true, + "meta/llama-4-maverick-17b-128e-instruct-fp8": { + "id": "meta/llama-4-maverick-17b-128e-instruct-fp8", + "name": "Llama 4 Maverick 17B 128E Instruct FP8", + "family": "llama", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.45, "output": 3.5 }, - "limit": { "context": 262000, "output": 262000 } + "knowledge": "2024-12", + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-30B-A3B-Thinking-2507": { - "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", - "name": "Qwen/Qwen3-30B-A3B-Thinking-2507", - "family": "qwen", + "core42/jais-30b-chat": { + "id": "core42/jais-30b-chat", + "name": "JAIS 30b Chat", + "family": "jais", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-31", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09, "output": 0.3 }, - "limit": { "context": 262000, "output": 131000 } + "knowledge": "2023-03", + "release_date": "2023-08-30", + "last_updated": "2023-08-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 2048 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen2.5-14B-Instruct": { - "id": "Qwen/Qwen2.5-14B-Instruct", - "name": "Qwen/Qwen2.5-14B-Instruct", - "family": "qwen", + "mistral-ai/mistral-nemo": { + "id": "mistral-ai/mistral-nemo", + "name": "Mistral Nemo", + "family": "mistral-nemo", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.1, "output": 0.1 }, - "limit": { "context": 33000, "output": 4000 } + "knowledge": "2024-03", + "release_date": "2024-07-18", + "last_updated": "2024-07-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 8192 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-32B": { - "id": "Qwen/Qwen3-32B", - "name": "Qwen/Qwen3-32B", - "family": "qwen", + "mistral-ai/ministral-3b": { + "id": "mistral-ai/ministral-3b", + "name": "Ministral 3B", + "family": "ministral", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "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 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-14B": { - "id": "Qwen/Qwen3-14B", - "name": "Qwen/Qwen3-14B", - "family": "qwen", + "mistral-ai/mistral-large-2411": { + "id": "mistral-ai/mistral-large-2411", + "name": "Mistral Large 24.11", + "family": "mistral-large", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2024-11-01", + "last_updated": "2024-11-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-235B-A22B": { - "id": "Qwen/Qwen3-235B-A22B", - "name": "Qwen/Qwen3-235B-A22B", - "family": "qwen", + "mistral-ai/mistral-small-2503": { + "id": "mistral-ai/mistral-small-2503", + "name": "Mistral Small 3.1", + "family": "mistral-small", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-04-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2025-03-01", + "last_updated": "2025-03-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.35, "output": 1.42 }, - "limit": { "context": 131000, "output": 131000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen2.5-72B-Instruct-128K": { - "id": "Qwen/Qwen2.5-72B-Instruct-128K", - "name": "Qwen/Qwen2.5-72B-Instruct-128K", - "family": "qwen", + "mistral-ai/mistral-medium-2505": { + "id": "mistral-ai/mistral-medium-2505", + "name": "Mistral Medium 3 (25.05)", + "family": "mistral-medium", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-09-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09", + "release_date": "2025-05-01", + "last_updated": "2025-05-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.59, "output": 0.59 }, - "limit": { "context": 131000, "output": 4000 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "Qwen/Qwen3-235B-A22B-Thinking-2507": { - "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "name": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "family": "qwen", + "mistral-ai/codestral-2501": { + "id": "mistral-ai/codestral-2501", + "name": "Codestral 25.01", + "family": "codestral", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-03", + "release_date": "2025-01-01", + "last_updated": "2025-01-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.13, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } - }, - "Qwen/Qwen3-Next-80B-A3B-Instruct": { - "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "name": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "family": "qwen", + "limit": { + "context": 32000, + "output": 8192 + }, + "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-fast": { + "id": "glm-5-fast", + "name": "GLM 5 Fast", + "family": "glm", "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": false, - "cost": { "input": 0.14, "output": 1.4 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "output": 200000 + }, + "cost": { + "input": 1.1, + "output": 3.6 + } }, - "Qwen/Qwen2.5-VL-72B-Instruct": { - "id": "Qwen/Qwen2.5-VL-72B-Instruct", - "name": "Qwen/Qwen2.5-VL-72B-Instruct", - "family": "qwen", + "kimi-k2.6-fast": { + "id": "kimi-k2.6-fast", + "name": "Kimi K2.6 Fast", + "family": "kimi", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-01-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.59, "output": 0.59 }, - "limit": { "context": 131000, "output": 4000 } - }, - "Qwen/Qwen3-VL-8B-Thinking": { - "id": "Qwen/Qwen3-VL-8B-Thinking", - "name": "Qwen/Qwen3-VL-8B-Thinking", - "family": "qwen", - "attachment": true, - "reasoning": true, - "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": false, - "cost": { "input": 0.18, "output": 2 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.69, + "output": 3.22 + } }, - "Qwen/Qwen3-Omni-30B-A3B-Captioner": { - "id": "Qwen/Qwen3-Omni-30B-A3B-Captioner", - "name": "Qwen/Qwen3-Omni-30B-A3B-Captioner", + "qwen3.5-397b-fast": { + "id": "qwen3.5-397b-fast", + "name": "Qwen3.5 397B Fast", "family": "qwen", - "attachment": true, + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 66000, "output": 66000 } + "release_date": "2026-02-01", + "last_updated": "2026-02-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.69, + "output": 4.14 + } }, - "Qwen/Qwen3-VL-30B-A3B-Thinking": { - "id": "Qwen/Qwen3-VL-30B-A3B-Thinking", - "name": "Qwen/Qwen3-VL-30B-A3B-Thinking", - "family": "qwen", - "attachment": true, - "reasoning": true, + "glm-5.1-fast": { + "id": "glm-5.1-fast", + "name": "GLM 5.1 Fast", + "family": "glm", + "attachment": false, + "reasoning": false, "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": false, - "cost": { "input": 0.29, "output": 1 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 200000, + "output": 200000 + }, + "cost": { + "input": 1.1, + "output": 3.6 + } }, - "Qwen/Qwen2.5-VL-7B-Instruct": { - "id": "Qwen/Qwen2.5-VL-7B-Instruct", - "name": "Qwen/Qwen2.5-VL-7B-Instruct", - "family": "qwen", + "qwen3.6-35b-fast": { + "id": "qwen3.6-35b-fast", + "name": "Qwen3.6 35B Fast", + "family": "qwen3.6", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-01-28", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0.05 }, - "limit": { "context": 33000, "output": 4000 } + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.1 + } }, - "Qwen/Qwen2.5-VL-32B-Instruct": { - "id": "Qwen/Qwen2.5-VL-32B-Instruct", - "name": "Qwen/Qwen2.5-VL-32B-Instruct", - "family": "qwen", + "kimi-k2.5-fast": { + "id": "kimi-k2.5-fast", + "name": "Kimi K2.5 Fast", + "family": "kimi", "attachment": true, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-03-24", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.27, "output": 0.27 }, - "limit": { "context": 131000, "output": 131000 } + "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.52, + "output": 2.59 + } }, - "Qwen/Qwen3-Coder-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", - "name": "Qwen/Qwen3-Coder-30B-A3B-Instruct", + "Qwen/Qwen3.5-397B-A17B-FP8": { + "id": "Qwen/Qwen3.5-397B-A17B-FP8", + "name": "Qwen3.5 397B A17B FP8", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-01", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-02-01", + "last_updated": "2026-02-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.69, + "output": 4.14 + } }, - "Qwen/Qwen3-VL-8B-Instruct": { - "id": "Qwen/Qwen3-VL-8B-Instruct", - "name": "Qwen/Qwen3-VL-8B-Instruct", - "family": "qwen", + "Qwen/Qwen3.6-35B-A3B": { + "id": "Qwen/Qwen3.6-35B-A3B", + "name": "Qwen3.6 35B A3B", + "family": "qwen3.6", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-15", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 0.68 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-01", + "last_updated": "2026-04-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.05, + "output": 0.1 + } }, - "Qwen/Qwen3-8B": { - "id": "Qwen/Qwen3-8B", - "name": "Qwen/Qwen3-8B", - "family": "qwen", + "zai-org/GLM-5.1-FP8": { + "id": "zai-org/GLM-5.1-FP8", + "name": "GLM 5.1 FP8", + "family": "glm", "attachment": false, + "reasoning": true, + "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": 200000, + "output": 200000 + }, + "cost": { + "input": 1.1, + "output": 3.6 + } + }, + "mistralai/Devstral-Small-2-24B-Instruct-2512": { + "id": "mistralai/Devstral-Small-2-24B-Instruct-2512", + "name": "Devstral Small 2 24B Instruct 2512", + "family": "devstral", + "attachment": true, "reasoning": false, "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": false, - "cost": { "input": 0.06, "output": 0.06 }, - "limit": { "context": 131000, "output": 131000 } + "release_date": "2025-12-09", + "last_updated": "2025-12-09", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.12, + "output": 0.35 + } }, - "Qwen/QwQ-32B": { - "id": "Qwen/QwQ-32B", - "name": "Qwen/QwQ-32B", - "family": "qwen", + "openai/gpt-oss-20b": { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-03-06", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.58 }, - "limit": { "context": 131000, "output": 131000 } + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 16384, + "output": 16384 + }, + "cost": { + "input": 0.03, + "output": 0.16 + } }, - "Qwen/Qwen3-Coder-480B-A35B-Instruct": { - "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "name": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "moonshotai/Kimi-K2.6": { + "id": "moonshotai/Kimi-K2.6", + "name": "Kimi K2.6", + "family": "kimi", + "attachment": true, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-31", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 1 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.69, + "output": 3.22 + } }, - "Qwen/Qwen3-VL-32B-Instruct": { - "id": "Qwen/Qwen3-VL-32B-Instruct", - "name": "Qwen/Qwen3-VL-32B-Instruct", - "family": "qwen", + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi K2.5", + "family": "kimi", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-21", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.2, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } + "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.52, + "output": 2.59 + } }, - "Qwen/Qwen3-30B-A3B-Instruct-2507": { - "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "name": "Qwen/Qwen3-30B-A3B-Instruct-2507", - "family": "qwen", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax M2.5", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09, "output": 0.3 }, - "limit": { "context": 262000, "output": 262000 } - }, - "Qwen/Qwen3-Omni-30B-A3B-Instruct": { - "id": "Qwen/Qwen3-Omni-30B-A3B-Instruct", - "name": "Qwen/Qwen3-Omni-30B-A3B-Instruct", - "family": "qwen", - "attachment": true, - "reasoning": false, + "release_date": "2026-02-12", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 196608 + }, + "cost": { + "input": 0.35, + "output": 1.38 + } + } + } + }, + "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", + "family": "sarvam", + "attachment": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 66000, "output": 66000 } + "release_date": "2026-02-18", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + } }, - "Qwen/Qwen2.5-7B-Instruct": { - "id": "Qwen/Qwen2.5-7B-Instruct", - "name": "Qwen/Qwen2.5-7B-Instruct", - "family": "qwen", + "sarvam-30b": { + "id": "sarvam-30b", + "name": "Sarvam-30B", + "family": "sarvam", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-09-18", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.05, "output": 0.05 }, - "limit": { "context": 33000, "output": 4000 } - }, - "Qwen/Qwen3-VL-235B-A22B-Instruct": { - "id": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "name": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "family": "qwen", - "attachment": true, + "release_date": "2026-02-18", + "last_updated": "2026-03-06", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 65536, + "output": 65536 + } + } + } + }, + "togetherai": { + "id": "togetherai", + "env": ["TOGETHER_API_KEY"], + "npm": "@ai-sdk/togetherai", + "name": "Together AI", + "doc": "https://docs.together.ai/docs/serverless-models", + "models": { + "essentialai/Rnj-1-Instruct": { + "id": "essentialai/Rnj-1-Instruct", + "name": "Rnj-1 Instruct", + "family": "rnj", + "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-10-04", - "last_updated": "2025-11-25", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.3, "output": 1.5 }, - "limit": { "context": 262000, "output": 262000 } + "knowledge": "2024-10", + "release_date": "2025-12-05", + "last_updated": "2025-12-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 32768, + "output": 32768 + }, + "cost": { + "input": 0.15, + "output": 0.15 + } }, - "Qwen/Qwen2.5-72B-Instruct": { - "id": "Qwen/Qwen2.5-72B-Instruct", - "name": "Qwen/Qwen2.5-72B-Instruct", + "Qwen/Qwen3.5-397B-A17B": { + "id": "Qwen/Qwen3.5-397B-A17B", + "name": "Qwen3.5 397B A17B", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0.59, "output": 0.59 }, - "limit": { "context": 33000, "output": 4000 } + "release_date": "2026-02-16", + "last_updated": "2026-02-16", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 130000 + }, + "cost": { + "input": 0.6, + "output": 3.6 + } }, - "Qwen/Qwen3-VL-32B-Thinking": { - "id": "Qwen/Qwen3-VL-32B-Thinking", - "name": "Qwen/Qwen3-VL-32B-Thinking", + "Qwen/Qwen3.6-Plus": { + "id": "Qwen/Qwen3.6-Plus", + "name": "Qwen3.6 Plus", "family": "qwen", - "attachment": true, + "attachment": false, "reasoning": true, "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": false, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-30", + "last_updated": "2026-04-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 500000 + }, + "cost": { + "input": 0.5, + "output": 3 + } }, - "Qwen/Qwen2.5-32B-Instruct": { - "id": "Qwen/Qwen2.5-32B-Instruct", - "name": "Qwen/Qwen2.5-32B-Instruct", + "Qwen/Qwen3-Coder-Next-FP8": { + "id": "Qwen/Qwen3-Coder-Next-FP8", + "name": "Qwen3 Coder Next FP8", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2024-09-19", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.18, "output": 0.18 }, - "limit": { "context": 33000, "output": 4000 } + "knowledge": "2026-02-03", + "release_date": "2026-02-03", + "last_updated": "2026-02-03", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.5, + "output": 1.2 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "Qwen/Qwen3-235B-A22B-Instruct-2507-tput": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507-tput", + "name": "Qwen3 235B A22B Instruct 2507 FP8", "family": "qwen", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-23", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.09, "output": 0.6 }, - "limit": { "context": 262000, "output": 262000 } + "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": 262144 + }, + "cost": { + "input": 0.2, + "output": 0.6 + } }, - "inclusionAI/Ling-flash-2.0": { - "id": "inclusionAI/Ling-flash-2.0", - "name": "inclusionAI/Ling-flash-2.0", - "family": "ling", + "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", + "name": "Qwen3 Coder 480B A35B Instruct", + "family": "qwen", "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": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "knowledge": "2025-04", + "release_date": "2025-07-23", + "last_updated": "2025-07-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 2, + "output": 2 + } }, - "inclusionAI/Ring-flash-2.0": { - "id": "inclusionAI/Ring-flash-2.0", - "name": "inclusionAI/Ring-flash-2.0", - "family": "ring", + "zai-org/GLM-5.1": { + "id": "zai-org/GLM-5.1", + "name": "GLM-5.1", + "family": "glm", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } + "knowledge": "2025-11", + "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 + } }, - "inclusionAI/Ling-mini-2.0": { - "id": "inclusionAI/Ling-mini-2.0", - "name": "inclusionAI/Ling-mini-2.0", - "family": "ling", + "meta-llama/Llama-3.3-70B-Instruct-Turbo": { + "id": "meta-llama/Llama-3.3-70B-Instruct-Turbo", + "name": "Llama 3.3 70B", + "family": "llama", "attachment": false, "reasoning": false, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-10", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.07, "output": 0.28 }, - "limit": { "context": 131000, "output": 131000 } + "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.88, + "output": 0.88 + } }, - "moonshotai/Kimi-K2-Instruct": { - "id": "moonshotai/Kimi-K2-Instruct", - "name": "moonshotai/Kimi-K2-Instruct", - "family": "kimi", + "deepseek-ai/DeepSeek-V3": { + "id": "deepseek-ai/DeepSeek-V3", + "name": "DeepSeek V3", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-07-13", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.58, "output": 2.29 }, - "limit": { "context": 131000, "output": 131000 } + "knowledge": "2024-07", + "release_date": "2025-01-20", + "last_updated": "2025-05-29", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 1.25, + "output": 1.25 + } }, - "moonshotai/Kimi-K2.5": { - "id": "moonshotai/Kimi-K2.5", - "name": "moonshotai/Kimi-K2.5", - "family": "kimi", + "deepseek-ai/DeepSeek-R1": { + "id": "deepseek-ai/DeepSeek-R1", + "name": "DeepSeek R1", + "family": "deepseek-thinking", "attachment": false, "reasoning": true, - "tool_call": true, - "structured_output": true, + "tool_call": false, "temperature": true, - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.55, "output": 3 }, - "limit": { "context": 262000, "output": 262000 } + "knowledge": "2024-07", + "release_date": "2024-12-26", + "last_updated": "2025-03-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 163839, + "output": 163839 + }, + "cost": { + "input": 3, + "output": 7 + } }, - "moonshotai/Kimi-K2-Instruct-0905": { - "id": "moonshotai/Kimi-K2-Instruct-0905", - "name": "moonshotai/Kimi-K2-Instruct-0905", - "family": "kimi", + "deepseek-ai/DeepSeek-V3-1": { + "id": "deepseek-ai/DeepSeek-V3-1", + "name": "DeepSeek V3.1", + "family": "deepseek", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, - "release_date": "2025-09-08", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.4, "output": 2 }, - "limit": { "context": 262000, "output": 262000 } + "knowledge": "2025-08", + "release_date": "2025-08-21", + "last_updated": "2025-08-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 1.7 + } }, - "moonshotai/Kimi-K2-Thinking": { - "id": "moonshotai/Kimi-K2-Thinking", - "name": "moonshotai/Kimi-K2-Thinking", - "family": "kimi-thinking", + "deepseek-ai/DeepSeek-V4-Pro": { + "id": "deepseek-ai/DeepSeek-V4-Pro", + "name": "DeepSeek V4 Pro", + "family": "deepseek", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "structured_output": true, "temperature": true, - "release_date": "2025-11-07", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.55, "output": 2.5 }, - "limit": { "context": 262000, "output": 262000 } + "release_date": "2026-04-24", + "last_updated": "2026-04-24", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 512000, + "output": 384000 + }, + "cost": { + "input": 2.1, + "output": 4.4, + "cache_read": 0.2 + } }, - "tencent/Hunyuan-MT-7B": { - "id": "tencent/Hunyuan-MT-7B", - "name": "tencent/Hunyuan-MT-7B", - "family": "hunyuan", + "openai/gpt-oss-120b": { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "family": "gpt-oss", "attachment": false, - "reasoning": false, + "reasoning": true, "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": false, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 33000, "output": 33000 } + "knowledge": "2025-08", + "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 + } }, - "tencent/Hunyuan-A13B-Instruct": { - "id": "tencent/Hunyuan-A13B-Instruct", - "name": "tencent/Hunyuan-A13B-Instruct", - "family": "hunyuan", - "attachment": false, - "reasoning": false, - "tool_call": true, - "structured_output": true, - "temperature": true, - "release_date": "2025-06-30", - "last_updated": "2025-11-25", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.14, "output": 0.57 }, - "limit": { "context": 131000, "output": 131000 } - } - } - }, - "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.5-plus": { - "id": "qwen3.5-plus", - "name": "Qwen3.5 Plus", - "family": "qwen", - "attachment": false, + "google/gemma-4-31B-it": { + "id": "google/gemma-4-31B-it", + "name": "Gemma 4 31B Instruct", + "family": "gemma", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 1000000, "output": 65536 } - }, - "qwen3-coder-next": { - "id": "qwen3-coder-next", - "name": "Qwen3 Coder Next", - "family": "qwen", - "attachment": false, - "reasoning": false, + "knowledge": "2025-01", + "release_date": "2026-04-07", + "last_updated": "2026-04-07", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.2, + "output": 0.5 + } + }, + "moonshotai/Kimi-K2.6": { + "id": "moonshotai/Kimi-K2.6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", + "attachment": true, + "reasoning": true, "tool_call": true, "structured_output": true, "temperature": true, - "release_date": "2026-02-03", - "last_updated": "2026-02-03", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-01", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 262144, + "output": 131000 + }, + "cost": { + "input": 1.2, + "output": 4.5, + "cache_read": 0.2 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", + "moonshotai/Kimi-K2.5": { + "id": "moonshotai/Kimi-K2.5", "name": "Kimi K2.5", "family": "kimi", - "attachment": true, + "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": true, "temperature": true, - "knowledge": "2025-01", + "knowledge": "2026-01", "release_date": "2026-01-27", "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.5, + "output": 2.8 + } }, - "MiniMax-M2.5": { - "id": "MiniMax-M2.5", + "MiniMaxAI/MiniMax-M2.5": { + "id": "MiniMaxAI/MiniMax-M2.5", "name": "MiniMax-M2.5", "family": "minimax", "attachment": false, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 196608, "input": 196601, "output": 24576 } - }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 202752, "output": 16384 } - }, - "qwen3-coder-plus": { - "id": "qwen3-coder-plus", - "name": "Qwen3 Coder Plus", - "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"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 1000000, "output": 65536 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", + "MiniMaxAI/MiniMax-M2.7": { + "id": "MiniMaxAI/MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 202752, "output": 16384 } - }, - "qwen3-max-2026-01-23": { - "id": "qwen3-max-2026-01-23", - "name": "Qwen3 Max", - "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 262144, "output": 32768 } + "limit": { + "context": 202752, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2, + "cache_read": 0.06 + } } } }, - "inception": { - "id": "inception", - "env": ["INCEPTION_API_KEY"], + "qihang-ai": { + "id": "qihang-ai", + "env": ["QIHANG_API_KEY"], "npm": "@ai-sdk/openai-compatible", - "api": "https://api.inceptionlabs.ai/v1/", - "name": "Inception", - "doc": "https://platform.inceptionlabs.ai/docs", + "api": "https://api.qhaigc.net/v1", + "name": "QiHang", + "doc": "https://www.qhaigc.net/docs", "models": { - "mercury-edit": { - "id": "mercury-edit", - "name": "Mercury Edit", - "attachment": false, + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "family": "claude-opus", + "attachment": true, "reasoning": true, - "tool_call": false, + "tool_call": true, "temperature": true, - "release_date": "2026-02-24", - "last_updated": "2026-02-24", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-03", + "release_date": "2025-11-01", + "last_updated": "2025-11-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 200000, + "output": 32000 + }, + "cost": { + "input": 0.71, + "output": 3.57 + } }, - "mercury-2": { - "id": "mercury-2", - "name": "Mercury 2", - "family": "mercury", - "attachment": false, + "gemini-3-flash-preview": { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "family": "gemini-flash", + "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 0.25, "output": 0.75, "cache_read": 0.025 }, - "limit": { "context": 128000, "output": 50000 } + "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 + } + } }, - "mercury-coder": { - "id": "mercury-coder", - "name": "Mercury Coder", - "family": "mercury", - "attachment": false, - "reasoning": false, + "gpt-5-mini": { + "id": "gpt-5-mini", + "name": "GPT-5-Mini", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-02-26", - "last_updated": "2025-07-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-09-30", + "release_date": "2025-09-15", + "last_updated": "2025-09-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1, "cache_read": 0.25, "cache_write": 1 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.04, + "output": 0.29 + } }, - "mercury": { - "id": "mercury", - "name": "Mercury", - "family": "mercury", - "attachment": false, - "reasoning": false, + "gemini-3-pro-preview": { + "id": "gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview", + "family": "gemini-pro", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2023-10", - "release_date": "2025-06-26", - "last_updated": "2025-07-31", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-11", + "release_date": "2025-11-19", + "last_updated": "2025-11-19", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 1, "cache_read": 0.25, "cache_write": 1 }, - "limit": { "context": 128000, "output": 16384 } - } - } - }, - "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-5.1": { - "id": "glm-5.1", - "name": "GLM-5.1", - "family": "glm", - "attachment": false, + "limit": { + "context": 1000000, + "output": 65000 + }, + "cost": { + "input": 0.57, + "output": 3.43 + } + }, + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, "temperature": true, - "release_date": "2026-03-27", - "last_updated": "2026-03-27", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2025-09-29", + "last_updated": "2025-09-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.43, + "output": 2.14 + } }, - "glm-4.6v-flash": { - "id": "glm-4.6v-flash", - "name": "GLM-4.6V-Flash", - "family": "glm", + "gpt-5.2": { + "id": "gpt-5.2", + "name": "GPT-5.2", + "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, + "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "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.25, + "output": 2 + } }, - "glm-4.7": { - "id": "glm-4.7", - "name": "GLM-4.7", - "family": "glm", - "attachment": false, + "gpt-5.2-codex": { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "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": 0.14, + "output": 1.14 + } }, - "glm-4.5v": { - "id": "glm-4.5v", - "name": "GLM-4.5V", - "family": "glm", + "gemini-2.5-flash": { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "family": "gemini-flash", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 64000, "output": 16384 } + "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.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 + } + } }, - "glm-4.5-air": { - "id": "glm-4.5-air", - "name": "GLM-4.5-Air", - "family": "glm-air", - "attachment": false, + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } - }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", - "family": "glm", + "knowledge": "2025-07-31", + "release_date": "2025-10-01", + "last_updated": "2025-10-01", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0.14, + "output": 0.71 + } + } + } + }, + "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": { + "hy3-preview": { + "id": "hy3-preview", + "name": "Hy3 preview", + "family": "Hy", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-20", + "last_updated": "2026-04-20", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 256000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "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-3-sonnet-20240229": { + "id": "claude-3-sonnet-20240229", + "name": "Claude Sonnet 3", + "family": "claude-sonnet", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "knowledge": "2023-08-31", + "release_date": "2024-03-04", + "last_updated": "2024-03-04", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 0.3 + } }, - "glm-4.5-flash": { - "id": "glm-4.5-flash", - "name": "GLM-4.5-Flash", - "family": "glm-flash", - "attachment": false, + "claude-haiku-4-5": { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "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 + } }, - "glm-4.6v": { - "id": "glm-4.6v", - "name": "GLM-4.6V", - "family": "glm", + "claude-opus-4-5-20251101": { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "family": "claude-opus", "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0 }, - "limit": { "context": 128000, "output": 32768 } + "knowledge": "2025-03-31", + "release_date": "2025-11-01", + "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 + } }, - "glm-4.6": { - "id": "glm-4.6", - "name": "GLM-4.6", - "family": "glm", - "attachment": false, - "reasoning": true, + "claude-3-opus-20240229": { + "id": "claude-3-opus-20240229", + "name": "Claude Opus 3", + "family": "claude-opus", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 204800, "output": 131072 } + "knowledge": "2023-08-31", + "release_date": "2024-02-29", + "last_updated": "2024-02-29", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 4096 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } }, - "glm-4.7-flashx": { - "id": "glm-4.7-flashx", - "name": "GLM-4.7-FlashX", - "family": "glm-flash", - "attachment": false, - "reasoning": true, + "claude-3-5-haiku-20241022": { + "id": "claude-3-5-haiku-20241022", + "name": "Claude Haiku 3.5", + "family": "claude-haiku", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 0.07, "output": 0.4, "cache_read": 0.01, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "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 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "glm-4.5": { - "id": "glm-4.5", - "name": "GLM-4.5", - "family": "glm", - "attachment": false, + "claude-3-5-sonnet-20241022": { + "id": "claude-3-5-sonnet-20241022", + "name": "Claude Sonnet 3.5 v2", + "family": "claude-sonnet", + "attachment": true, + "reasoning": false, + "tool_call": true, + "temperature": true, + "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": 200000, + "output": 8192 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } + }, + "claude-sonnet-4-6": { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 131072, "output": 98304 } + "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 + } }, - "glm-5-turbo": { - "id": "glm-5-turbo", - "name": "GLM-5-Turbo", - "family": "glm", - "attachment": false, + "claude-opus-4-0": { + "id": "claude-opus-4-0", + "name": "Claude Opus 4 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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"] }, + "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 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } + }, + "claude-opus-4-7": { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } + "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 + } }, - "glm-4.7-flash": { - "id": "glm-4.7-flash", - "name": "GLM-4.7-Flash", - "family": "glm-flash", - "attachment": false, - "reasoning": true, - "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, - "cost": { "input": 0, "output": 0, "cache_read": 0, "cache_write": 0 }, - "limit": { "context": 200000, "output": 131072 } - } - } - }, - "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-k2-0711-preview": { - "id": "kimi-k2-0711-preview", - "name": "Kimi K2 0711", - "family": "kimi", - "attachment": false, + "claude-3-haiku-20240307": { + "id": "claude-3-haiku-20240307", + "name": "Claude Haiku 3", + "family": "claude-haiku", + "attachment": true, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2025-07-14", - "last_updated": "2025-07-14", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 131072, "output": 16384 } + "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 + } }, - "kimi-k2-turbo-preview": { - "id": "kimi-k2-turbo-preview", - "name": "Kimi K2 Turbo", - "family": "kimi", - "attachment": false, - "reasoning": false, + "claude-sonnet-4-5-20250929": { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": true, "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, - "cost": { "input": 2.4, "output": 10, "cache_read": 0.6 }, - "limit": { "context": 262144, "output": 262144 } + "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 + } }, - "kimi-k2-0905-preview": { - "id": "kimi-k2-0905-preview", - "name": "Kimi K2 0905", - "family": "kimi", - "attachment": false, + "claude-3-5-haiku-latest": { + "id": "claude-3-5-haiku-latest", + "name": "Claude Haiku 3.5 (latest)", + "family": "claude-haiku", + "attachment": true, "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, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "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 + }, + "cost": { + "input": 0.8, + "output": 4, + "cache_read": 0.08, + "cache_write": 1 + } }, - "kimi-k2-thinking-turbo": { - "id": "kimi-k2-thinking-turbo", - "name": "Kimi K2 Thinking Turbo", - "family": "kimi-thinking", - "attachment": false, + "claude-opus-4-1": { + "id": "claude-opus-4-1", + "name": "Claude Opus 4.1 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 1.15, "output": 8, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } + "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 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": false, + "claude-sonnet-4-0": { + "id": "claude-sonnet-4-0", + "name": "Claude Sonnet 4 (latest)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, - "structured_output": true, - "temperature": false, - "knowledge": "2025-01", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 262144 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "kimi-k2-thinking": { - "id": "kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, - "reasoning": true, + "claude-3-5-sonnet-20240620": { + "id": "claude-3-5-sonnet-20240620", + "name": "Claude Sonnet 3.5", + "family": "claude-sonnet", + "attachment": true, + "reasoning": false, "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, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.15 }, - "limit": { "context": 262144, "output": 262144 } - } - } - }, - "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/routers/kimi-k2p5-turbo": { - "id": "accounts/fireworks/routers/kimi-k2p5-turbo", - "name": "Kimi K2.5 Turbo", - "family": "kimi-thinking", - "attachment": false, + "knowledge": "2024-04-30", + "release_date": "2024-06-20", + "last_updated": "2024-06-20", + "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 + } + }, + "claude-opus-4-5": { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0, "output": 0, "cache_read": 0 }, - "limit": { "context": 256000, "output": 256000 } + "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 + } }, - "accounts/fireworks/models/kimi-k2p5": { - "id": "accounts/fireworks/models/kimi-k2p5", - "name": "Kimi K2.5", - "family": "kimi-thinking", - "attachment": false, + "claude-opus-4-1-20250805": { + "id": "claude-opus-4-1-20250805", + "name": "Claude Opus 4.1", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 256000, "output": 256000 } + "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 + } }, - "accounts/fireworks/models/kimi-k2-thinking": { - "id": "accounts/fireworks/models/kimi-k2-thinking", - "name": "Kimi K2 Thinking", - "family": "kimi-thinking", - "attachment": false, + "claude-haiku-4-5-20251001": { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "family": "claude-haiku", + "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2025-11-06", - "last_updated": "2025-11-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.5, "cache_read": 0.3 }, - "limit": { "context": 256000, "output": 256000 } + "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 + } }, - "accounts/fireworks/models/deepseek-v3p1": { - "id": "accounts/fireworks/models/deepseek-v3p1", - "name": "DeepSeek V3.1", - "family": "deepseek", - "attachment": false, + "claude-sonnet-4-20250514": { + "id": "claude-sonnet-4-20250514", + "name": "Claude Sonnet 4", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-07", - "release_date": "2025-08-21", - "last_updated": "2025-08-21", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.56, "output": 1.68 }, - "limit": { "context": 163840, "output": 163840 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "accounts/fireworks/models/minimax-m2p1": { - "id": "accounts/fireworks/models/minimax-m2p1", - "name": "MiniMax-M2.1", - "family": "minimax", - "attachment": false, + "claude-opus-4-6": { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 200000, "output": 200000 } + "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 + } }, - "accounts/fireworks/models/minimax-m2p5": { - "id": "accounts/fireworks/models/minimax-m2p5", - "name": "MiniMax-M2.5", - "family": "minimax", - "attachment": false, + "claude-3-7-sonnet-20250219": { + "id": "claude-3-7-sonnet-20250219", + "name": "Claude Sonnet 3.7", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 196608, "output": 196608 } + "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 + }, + "cost": { + "input": 3, + "output": 15, + "cache_read": 0.3, + "cache_write": 3.75 + } }, - "accounts/fireworks/models/gpt-oss-120b": { - "id": "accounts/fireworks/models/gpt-oss-120b", - "name": "GPT OSS 120B", - "family": "gpt-oss", - "attachment": false, + "claude-sonnet-4-5": { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "family": "claude-sonnet", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 131072, "output": 32768 } + "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 + } }, - "accounts/fireworks/models/glm-4p7": { - "id": "accounts/fireworks/models/glm-4p7", - "name": "GLM 4.7", - "family": "glm", - "attachment": false, + "claude-opus-4-20250514": { + "id": "claude-opus-4-20250514", + "name": "Claude Opus 4", + "family": "claude-opus", + "attachment": true, "reasoning": true, "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, - "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.3 }, - "limit": { "context": 198000, "output": 198000 } - }, - "accounts/fireworks/models/deepseek-v3p2": { - "id": "accounts/fireworks/models/deepseek-v3p2", - "name": "DeepSeek V3.2", - "family": "deepseek", + "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 + }, + "cost": { + "input": 15, + "output": 75, + "cache_read": 1.5, + "cache_write": 18.75 + } + } + } + }, + "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": { + "Qwen/Qwen3-30B-A3B-Thinking-2507": { + "id": "Qwen/Qwen3-30B-A3B-Thinking-2507", + "name": "Qwen3 30B A3B Thinking 2507", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2025-09", - "release_date": "2025-12-01", - "last_updated": "2025-12-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.56, "output": 1.68, "cache_read": 0.28 }, - "limit": { "context": 160000, "output": 160000 } + "limit": { + "context": 262144, + "output": 32768 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "accounts/fireworks/models/glm-4p5": { - "id": "accounts/fireworks/models/glm-4p5", - "name": "GLM 4.5", - "family": "glm", + "Qwen/Qwen3-30B-A3B-Instruct-2507": { + "id": "Qwen/Qwen3-30B-A3B-Instruct-2507", + "name": "Qwen3 30B A3B Instruct 2507", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-07-29", - "last_updated": "2025-07-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-30", + "last_updated": "2025-07-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.55, "output": 2.19 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "accounts/fireworks/models/glm-5": { - "id": "accounts/fireworks/models/glm-5", - "name": "GLM 5", - "family": "glm", + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B A22B Instruct 2507", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-04-28", + "last_updated": "2025-07-21", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.5 }, - "limit": { "context": 202752, "output": 131072 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "accounts/fireworks/models/glm-4p5-air": { - "id": "accounts/fireworks/models/glm-4p5-air", - "name": "GLM 4.5 Air", - "family": "glm-air", + "Qwen/Qwen3-Coder-30B-A3B-Instruct": { + "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", + "name": "Qwen3 Coder 30B A3B Instruct", + "family": "qwen", "attachment": false, - "reasoning": true, + "reasoning": false, "tool_call": true, "temperature": true, "knowledge": "2025-04", - "release_date": "2025-08-01", - "last_updated": "2025-08-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2025-07-31", + "last_updated": "2025-07-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.22, "output": 0.88 }, - "limit": { "context": 131072, "output": 131072 } + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "accounts/fireworks/models/gpt-oss-20b": { - "id": "accounts/fireworks/models/gpt-oss-20b", - "name": "GPT OSS 20B", - "family": "gpt-oss", + "Qwen/Qwen3-235B-A22B-Thinking-2507": { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen3-235B-A22B-Thinking-2507", + "family": "qwen", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-25", + "last_updated": "2025-07-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.05, "output": 0.2 }, - "limit": { "context": 131072, "output": 32768 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "accounts/fireworks/models/kimi-k2-instruct": { - "id": "accounts/fireworks/models/kimi-k2-instruct", - "name": "Kimi K2 Instruct", - "family": "kimi", + "ZhipuAI/GLM-4.5": { + "id": "ZhipuAI/GLM-4.5", + "name": "GLM-4.5", + "family": "glm", "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, - "cost": { "input": 1, "output": 3 }, - "limit": { "context": 128000, "output": 16384 } - } - } - }, - "opencode-go": { - "id": "opencode-go", - "env": ["OPENCODE_API_KEY"], - "npm": "@ai-sdk/openai-compatible", - "api": "https://opencode.ai/zen/go/v1", - "name": "OpenCode Go", - "doc": "https://opencode.ai/docs/zen", - "models": { - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": true, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, "temperature": true, - "knowledge": "2024-10", - "release_date": "2026-01-27", - "last_updated": "2026-01-27", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 3, "cache_read": 0.1 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "minimax-m2.7": { - "id": "minimax-m2.7", - "name": "MiniMax M2.7", - "family": "minimax-m2.7", + "ZhipuAI/GLM-4.6": { + "id": "ZhipuAI/GLM-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-03-18", - "last_updated": "2026-03-18", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-07", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.06 }, - "limit": { "context": 204800, "output": 131072 }, - "provider": { "npm": "@ai-sdk/anthropic" } - }, - "glm-5": { - "id": "glm-5", - "name": "GLM-5", + "limit": { + "context": 202752, + "output": 98304 + }, + "cost": { + "input": 0, + "output": 0 + } + } + } + }, + "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": { + "zai-org/glm-5.1": { + "id": "zai-org/glm-5.1", + "name": "GLM 5.1", "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, - "interleaved": { "field": "reasoning_content" }, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "knowledge": "2025-04", - "release_date": "2026-02-11", - "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "release_date": "2026-04-08", + "last_updated": "2026-04-08", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2, "cache_read": 0.2 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 202000, + "output": 202000 + }, + "cost": { + "input": 0.66, + "output": 2, + "cache_read": 0.12 + } }, - "minimax-m2.5": { - "id": "minimax-m2.5", + "minimax/minimax-m2.5": { + "id": "minimax/minimax-m2.5", "name": "MiniMax M2.5", "family": "minimax-m2.5", "attachment": false, "reasoning": true, "tool_call": true, + "structured_output": false, "temperature": true, - "knowledge": "2025-01", "release_date": "2026-02-12", - "last_updated": "2026-02-12", - "modalities": { "input": ["text"], "output": ["text"] }, + "last_updated": "2026-03-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 1000000, + "output": 131072 + }, + "cost": { + "input": 0.14, + "output": 0.56, + "cache_read": 0.014 + } + }, + "moonshotai/kimi-k2.5": { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "family": "kimi", + "attachment": false, + "reasoning": true, + "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, + "temperature": false, + "knowledge": "2025-01-01", + "release_date": "2026-01-01", + "last_updated": "2026-03-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.3, "output": 1.2, "cache_read": 0.03 }, - "limit": { "context": 204800, "output": 131072 }, - "provider": { "npm": "@ai-sdk/anthropic" } + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.21, + "output": 1, + "cache_read": 0.03 + } } } }, - "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", + "gitlab": { + "id": "gitlab", + "env": ["GITLAB_TOKEN"], + "npm": "gitlab-ai-provider", + "name": "GitLab Duo", + "doc": "https://docs.gitlab.com/user/duo_agent_platform/", "models": { - "gpt-5.2-codex": { - "id": "gpt-5.2-codex", - "name": "GPT-5.2 Codex", - "family": "gpt", + "duo-chat-gpt-5-4-nano": { + "id": "duo-chat-gpt-5-4-nano", + "name": "Agentic Chat (GPT-5.4 Nano)", + "family": "gpt-nano", "attachment": true, "reasoning": true, "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"] }, + "release_date": "2026-03-17", + "last_updated": "2026-03-17", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "llama-3.3-70b-versatile": { - "id": "llama-3.3-70b-versatile", - "name": "Llama 3.3 70B Versatile", - "family": "llama", - "attachment": false, - "reasoning": false, + "duo-chat-gpt-5-mini": { + "id": "duo-chat-gpt-5-mini", + "name": "Agentic Chat (GPT-5 Mini)", + "family": "gpt-mini", + "attachment": true, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2024-12-06", - "last_updated": "2024-12-06", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.59, "output": 0.79 }, - "limit": { "context": 128000, "output": 32768 } + "structured_output": true, + "temperature": false, + "knowledge": "2024-05-30", + "release_date": "2026-01-22", + "last_updated": "2026-01-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-opus-4-5-20251101": { - "id": "claude-opus-4-5-20251101", - "name": "Claude Opus 4.5", - "family": "claude-opus", + "duo-chat-sonnet-4-6": { + "id": "duo-chat-sonnet-4-6", + "name": "Agentic Chat (Claude Sonnet 4.6)", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-03-31", - "release_date": "2025-11-01", - "last_updated": "2025-11-01", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-08-31", + "release_date": "2026-02-17", + "last_updated": "2026-02-17", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "o3-mini": { - "id": "o3-mini", - "name": "o3-mini", - "family": "o-mini", + "duo-chat-gpt-5-2": { + "id": "duo-chat-gpt-5-2", + "name": "Agentic Chat (GPT-5.2)", + "family": "gpt", + "attachment": true, + "reasoning": true, + "tool_call": true, + "structured_output": true, + "temperature": false, + "knowledge": "2025-08-31", + "release_date": "2026-01-23", + "last_updated": "2026-01-23", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "duo-chat-gpt-5-codex": { + "id": "duo-chat-gpt-5-codex", + "name": "Agentic Chat (GPT-5 Codex)", + "family": "gpt-codex", "attachment": false, "reasoning": true, "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"] }, + "knowledge": "2024-09-30", + "release_date": "2026-01-22", + "last_updated": "2026-01-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "output": 100000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5.2-chat-latest": { - "id": "gpt-5.2-chat-latest", - "name": "GPT-5.2 Chat Latest", + "duo-chat-gpt-5-1": { + "id": "duo-chat-gpt-5-1", + "name": "Agentic Chat (GPT-5.1)", "family": "gpt", "attachment": true, "reasoning": true, "tool_call": true, - "temperature": true, + "structured_output": true, + "temperature": false, "knowledge": "2024-09-30", - "release_date": "2026-01-01", - "last_updated": "2026-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2026-01-22", + "last_updated": "2026-01-22", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "gpt-5": { - "id": "gpt-5", - "name": "GPT-5", - "family": "gpt", + "duo-chat-gpt-5-2-codex": { + "id": "duo-chat-gpt-5-2-codex", + "name": "Agentic Chat (GPT-5.2 Codex)", + "family": "gpt-codex", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-08-31", + "release_date": "2026-01-22", + "last_updated": "2026-01-22", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 400000, + "input": 272000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-opus-4-20250514": { - "id": "claude-opus-4-20250514", - "name": "Claude Opus 4", - "family": "claude-opus", + "duo-chat-sonnet-4-5": { + "id": "duo-chat-sonnet-4-5", + "name": "Agentic Chat (Claude Sonnet 4.5)", + "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-14", - "last_updated": "2025-05-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "knowledge": "2025-07-31", + "release_date": "2026-01-08", + "last_updated": "2026-01-08", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 15, "output": 75 }, - "limit": { "context": 200000, "output": 32000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "gemini-3.1-pro-preview": { - "id": "gemini-3.1-pro-preview", - "name": "Gemini 3.1 Pro Preview", - "family": "gemini-pro", + "duo-chat-gpt-5-4": { + "id": "duo-chat-gpt-5-4", + "name": "Agentic Chat (GPT-5.4)", + "family": "gpt", "attachment": true, "reasoning": true, "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"] }, + "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, - "cost": { "input": 2, "output": 12 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 1050000, + "input": 922000, + "output": 128000 + }, + "cost": { + "input": 0, + "output": 0 + } }, - "claude-3-7-sonnet-20250219": { - "id": "claude-3-7-sonnet-20250219", - "name": "Claude Sonnet 3.7", - "family": "claude-sonnet", + "duo-chat-haiku-4-5": { + "id": "duo-chat-haiku-4-5", + "name": "Agentic Chat (Claude Haiku 4.5)", + "family": "claude-haiku", "attachment": true, "reasoning": true, "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"] }, + "knowledge": "2025-02-28", + "release_date": "2026-01-08", + "last_updated": "2026-01-08", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "kimi-k2.5": { - "id": "kimi-k2.5", - "name": "Kimi K2.5", - "family": "kimi", - "attachment": false, + "duo-chat-gpt-5-3-codex": { + "id": "duo-chat-gpt-5-3-codex", + "name": "Agentic Chat (GPT-5.3 Codex)", + "family": "gpt-codex", + "attachment": true, "reasoning": true, "tool_call": true, "structured_output": true, - "temperature": true, - "knowledge": "2025-01", - "release_date": "2026-01", - "last_updated": "2026-01", - "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 3 }, - "limit": { "context": 262144, "output": 32768 } + "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": 0, + "output": 0 + } }, - "grok-4-fast-non-reasoning": { - "id": "grok-4-fast-non-reasoning", - "name": "Grok 4 Fast (Non-Reasoning)", - "family": "grok", + "duo-chat-gpt-5-4-mini": { + "id": "duo-chat-gpt-5-4-mini", + "name": "Agentic Chat (GPT-5.4 Mini)", + "family": "gpt-mini", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, - "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "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, + "output": 0 + } + }, + "duo-chat-opus-4-7": { + "id": "duo-chat-opus-4-7", + "name": "Agentic Chat (Claude Opus 4.7)", + "family": "claude-opus", + "attachment": true, + "reasoning": true, + "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, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "output": 16384 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "grok-code-fast-1": { - "id": "grok-code-fast-1", - "name": "Grok Code Fast 1", - "family": "grok", + "duo-chat-opus-4-5": { + "id": "duo-chat-opus-4-5", + "name": "Agentic Chat (Claude Opus 4.5)", + "family": "claude-opus", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-09-01", - "last_updated": "2025-09-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-03-31", + "release_date": "2026-01-08", + "last_updated": "2026-01-08", + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 1.5 }, - "limit": { "context": 256000, "output": 16384 } + "limit": { + "context": 200000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "gpt-5.3-codex": { - "id": "gpt-5.3-codex", - "name": "GPT-5.3 Codex", - "family": "gpt", + "duo-chat-opus-4-6": { + "id": "duo-chat-opus-4-6", + "name": "Agentic Chat (Claude Opus 4.6)", + "family": "claude-opus", "attachment": true, "reasoning": true, "tool_call": true, - "structured_output": true, - "temperature": false, - "knowledge": "2025-08-31", + "temperature": true, + "knowledge": "2025-05-31", "release_date": "2026-02-05", "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "modalities": { + "input": ["text", "image", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } + } + } + }, + "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.5-pro": { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", + "attachment": false, + "reasoning": true, + "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 + }, + "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 + } + } }, - "gpt-5-mini": { - "id": "gpt-5-mini", - "name": "GPT-5 Mini", - "family": "gpt-mini", + "mimo-v2-omni": { + "id": "mimo-v2-omni", + "name": "MiMo-V2-Omni", + "family": "mimo", "attachment": true, "reasoning": true, "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"] }, + "interleaved": { + "field": "reasoning_content" + }, + "temperature": true, + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.25, "output": 2 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0.4, + "output": 2, + "cache_read": 0.08 + } }, - "claude-opus-4-6": { - "id": "claude-opus-4-6", - "name": "Claude Opus 4.6", - "family": "claude-opus", + "mimo-v2.5": { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2025-05", - "release_date": "2026-02-05", - "last_updated": "2026-02-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, + "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.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 + } + } + }, + "mimo-v2-pro": { + "id": "mimo-v2-pro", + "name": "MiMo-V2-Pro", + "family": "mimo", + "attachment": false, + "reasoning": true, + "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, - "cost": { "input": 5, "output": 25 }, - "limit": { "context": 200000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "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 + } + } + }, + "mimo-v2-flash": { + "id": "mimo-v2-flash", + "name": "MiMo-V2-Flash", + "family": "mimo", + "attachment": false, + "reasoning": true, + "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 + }, + "cost": { + "input": 0.1, + "output": 0.3, + "cache_read": 0.01 + } + } + } + }, + "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", + "family": "trinity-mini", + "attachment": false, + "reasoning": true, + "tool_call": true, + "temperature": true, + "knowledge": "2024-10", + "release_date": "2025-12", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 131072 + }, + "cost": { + "input": 0.045, + "output": 0.15 + } + }, + "mistralai/completion/models/Ministral-3-14B-Reasoning-2512": { + "id": "mistralai/completion/models/Ministral-3-14B-Reasoning-2512", + "name": "Ministral 3 14B Reasoning 2512", + "family": "ministral", + "attachment": true, + "reasoning": true, + "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 + } }, - "claude-sonnet-4-5-20250929": { - "id": "claude-sonnet-4-5-20250929", - "name": "Claude Sonnet 4.5", - "family": "claude-sonnet", + "mistralai/completion/models/Ministral-3-3B-Reasoning-2512": { + "id": "mistralai/completion/models/Ministral-3-3B-Reasoning-2512", + "name": "Ministral 3 3B Reasoning 2512", + "family": "ministral", "attachment": true, "reasoning": true, "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, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 64000 } + "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 + } }, - "gpt-4o-mini": { - "id": "gpt-4o-mini", - "name": "GPT-4o Mini", - "family": "gpt", + "deepseek-ai/deepseek-ocr/models/DeepSeek-OCR": { + "id": "deepseek-ai/deepseek-ocr/models/DeepSeek-OCR", + "name": "DeepSeek OCR", + "family": "deepseek", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "knowledge": "2024-04", - "release_date": "2024-07-18", - "last_updated": "2024-07-18", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 0.6 }, - "limit": { "context": 128000, "output": 16384 } + "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 + } }, - "gpt-5.1-codex-max": { - "id": "gpt-5.1-codex-max", - "name": "GPT-5.1 Codex Max", - "family": "gpt", - "attachment": true, + "openai/chat-completion/models/gpt-oss-20b": { + "id": "openai/chat-completion/models/gpt-oss-20b", + "name": "GPT OSS 20B", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-12-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.045, + "output": 0.18 + } }, - "claude-sonnet-4-6": { - "id": "claude-sonnet-4-6", - "name": "Claude Sonnet 4.6", - "family": "claude-sonnet", - "attachment": true, + "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", + "family": "gpt-oss", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-08", - "release_date": "2026-02-17", - "last_updated": "2026-02-17", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-08-05", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 131072, + "output": 16384 + }, + "cost": { + "input": 0.09, + "output": 0.36 + } }, - "gpt-4.1": { - "id": "gpt-4.1", - "name": "GPT-4.1", - "family": "gpt", - "attachment": true, - "reasoning": false, + "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", + "family": "minimax", + "attachment": false, + "reasoning": true, "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, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 1047576, "output": 32768 } + "release_date": "2026-02-12", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "gpt-5.1-chat-latest": { - "id": "gpt-5.1-chat-latest", - "name": "GPT-5.1 Chat Latest", - "family": "gpt", - "attachment": true, - "reasoning": true, + "qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct": { + "id": "qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct", + "name": "Qwen3 Coder 30B A3B Instruct", + "family": "qwen", + "attachment": false, + "reasoning": false, "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "temperature": true, + "knowledge": "2025-04", + "release_date": "2025-07-31", + "last_updated": "2026-02-12", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 65536 + }, + "cost": { + "input": 0.11458, + "output": 0.74812 + } }, - "gpt-5.3-codex-xhigh": { - "id": "gpt-5.3-codex-xhigh", - "name": "GPT-5.3 Codex XHigh", - "family": "gpt", - "attachment": true, + "qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507": { + "id": "qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507", + "name": "Qwen3 30B A3B Thinking 2507", + "family": "qwen", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "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 + } }, - "gpt-5.4": { - "id": "gpt-5.4", - "name": "GPT-5.4", - "family": "gpt", - "attachment": true, - "reasoning": true, + "qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507": { + "id": "qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507", + "name": "Qwen3 30B A3B Instruct 2507", + "family": "qwen", + "attachment": false, + "reasoning": false, "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, - "cost": { "input": 2.5, "output": 15 }, - "limit": { "context": 1050000, "input": 922000, "output": 128000 } - }, - "o3": { - "id": "o3", - "name": "o3", - "family": "o", - "attachment": true, - "reasoning": true, - "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, - "cost": { "input": 2, "output": 8 }, - "limit": { "context": 200000, "output": 100000 } + "temperature": true, + "release_date": "2025-07-30", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.3, + "output": 0.5 + } }, - "grok-4-1-fast-non-reasoning": { - "id": "grok-4-1-fast-non-reasoning", - "name": "Grok 4.1 Fast (Non-Reasoning)", - "family": "grok", + "clarifai/main/models/mm-poly-8b": { + "id": "clarifai/main/models/mm-poly-8b", + "name": "MM Poly 8B", + "family": "mm-poly", "attachment": true, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2025-11-17", - "last_updated": "2025-11-17", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "release_date": "2025-06", + "last_updated": "2026-02-25", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.2, "output": 0.5 }, - "limit": { "context": 2000000, "output": 16384 } + "limit": { + "context": 32768, + "output": 4096 + }, + "cost": { + "input": 0.658, + "output": 1.11 + } }, - "gpt-5.3-chat-latest": { - "id": "gpt-5.3-chat-latest", - "name": "GPT-5.3 Chat Latest", - "family": "gpt", + "moonshotai/chat-completion/models/Kimi-K2_6": { + "id": "moonshotai/chat-completion/models/Kimi-K2_6", + "name": "Kimi K2.6", + "family": "kimi-k2.6", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2026-03-01", - "last_updated": "2026-03-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 } - }, - "claude-sonnet-4-20250514": { - "id": "claude-sonnet-4-20250514", - "name": "Claude Sonnet 4", - "family": "claude-sonnet", - "attachment": true, + "knowledge": "2025-01", + "release_date": "2026-04-21", + "last_updated": "2026-04-21", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 262144 + }, + "cost": { + "input": 0.95, + "output": 4 + } + } + } + }, + "minimax-cn": { + "id": "minimax-cn", + "env": ["MINIMAX_API_KEY"], + "npm": "@ai-sdk/anthropic", + "api": "https://api.minimaxi.com/anthropic/v1", + "name": "MiniMax (minimaxi.com)", + "doc": "https://platform.minimaxi.com/docs/guides/quickstart", + "models": { + "MiniMax-M2": { + "id": "MiniMax-M2", + "name": "MiniMax-M2", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-14", - "last_updated": "2025-05-14", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 200000, "output": 64000 } + "release_date": "2025-10-27", + "last_updated": "2025-10-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 196608, + "output": 128000 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "grok-4-0709": { - "id": "grok-4-0709", - "name": "Grok 4", - "family": "grok", - "attachment": true, + "MiniMax-M2.5": { + "id": "MiniMax-M2.5", + "name": "MiniMax-M2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-09", - "last_updated": "2025-07-09", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 256000, "output": 16384 } + "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 + } }, - "gemini-3-flash-preview": { - "id": "gemini-3-flash-preview", - "name": "Gemini 3 Flash Preview", - "family": "gemini-flash", - "attachment": true, + "MiniMax-M2.7": { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", + "family": "minimax", + "attachment": false, "reasoning": true, "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, - "cost": { "input": 0.5, "output": 3 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "gemini-2.5-pro": { - "id": "gemini-2.5-pro", - "name": "Gemini 2.5 Pro", - "family": "gemini-pro", - "attachment": true, + "MiniMax-M2.7-highspeed": { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-25", - "last_updated": "2025-03-25", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 1048576, "output": 65536 } + "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 + } }, - "claude-opus-4-1-20250805": { - "id": "claude-opus-4-1-20250805", - "name": "Claude Opus 4.1", - "family": "claude-opus", - "attachment": true, + "MiniMax-M2.1": { + "id": "MiniMax-M2.1", + "name": "MiniMax-M2.1", + "family": "minimax", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 15, "output": 75 }, - "limit": { "context": 200000, "output": 32000 } + "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 + } }, - "kimi-k2-turbo-preview": { - "id": "kimi-k2-turbo-preview", - "name": "Kimi K2 Turbo Preview", - "family": "kimi", + "MiniMax-M2.5-highspeed": { + "id": "MiniMax-M2.5-highspeed", + "name": "MiniMax-M2.5-highspeed", + "family": "minimax", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-08", - "last_updated": "2025-07-08", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.15, "output": 8 }, - "limit": { "context": 256000, "output": 8192 } - }, - "gemini-2.5-flash": { - "id": "gemini-2.5-flash", - "name": "Gemini 2.5 Flash", - "family": "gemini-flash", - "attachment": 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.06, + "cache_write": 0.375 + } + } + } + }, + "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": { + "mistral-small3.2": { + "id": "mistral-small3.2", + "name": "Mistral Small 3.2", + "family": "mistral-small", + "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2025-01", - "release_date": "2025-03-20", - "last_updated": "2025-06-05", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, + "release_date": "2025-01-31", + "last_updated": "2025-01-31", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 0.3, "output": 2.5 }, - "limit": { "context": 1048576, "output": 65536 } + "limit": { + "context": 120000, + "output": 120000 + }, + "cost": { + "input": 0.5, + "output": 2.2 + } }, - "gpt-4o-2024-11-20": { - "id": "gpt-4o-2024-11-20", - "name": "GPT-4o (2024-11-20)", - "family": "gpt", - "attachment": true, + "qwen3-embedding-8b": { + "id": "qwen3-embedding-8b", + "name": "Qwen3-Embedding-8B", + "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.1, + "output": 0.1 + } + }, + "llama-3.3-70b-instruct": { + "id": "llama-3.3-70b-instruct", + "name": "Llama 3.3 70B Instruct", + "family": "llama", + "attachment": false, "reasoning": false, "tool_call": true, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-11-20", - "last_updated": "2024-11-20", - "modalities": { "input": ["text", "image", "audio"], "output": ["text"] }, + "release_date": "2025-04-28", + "last_updated": "2025-04-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 2.5, "output": 10 }, - "limit": { "context": 128000, "output": 16384 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 2.7 + } }, - "gpt-5.2": { - "id": "gpt-5.2", - "name": "GPT-5.2", - "family": "gpt", - "attachment": true, - "reasoning": true, - "tool_call": true, + "qwen3-reranker-4b": { + "id": "qwen3-reranker-4b", + "name": "Qwen3-Reranker-4B", + "family": "qwen", + "attachment": false, + "reasoning": false, + "tool_call": 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, - "cost": { "input": 1.75, "output": 14 }, - "limit": { "context": 400000, "output": 128000 } + "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 + } }, - "gpt-5.1": { - "id": "gpt-5.1", - "name": "GPT-5.1", - "family": "gpt", + "mistral-small-4-119b": { + "id": "mistral-small-4-119b", + "name": "Mistral Small 4 119B", + "family": "mistral-small", "attachment": true, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2026-03-15", + "last_updated": "2026-03-15", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "output": 128000 } + "limit": { + "context": 256000, + "output": 16384 + }, + "cost": { + "input": 0.75, + "output": 3 + } }, - "gpt-4.1-mini": { - "id": "gpt-4.1-mini", - "name": "GPT-4.1 Mini", - "family": "gpt", + "qwen3.5-122b": { + "id": "qwen3.5-122b", + "name": "Qwen3.5-122B", + "family": "qwen", "attachment": true, - "reasoning": false, + "reasoning": true, "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, - "cost": { "input": 0.4, "output": 1.6 }, - "limit": { "context": 1047576, "output": 32768 } + "release_date": "2026-02-01", + "last_updated": "2026-02-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.9, + "output": 3.6 + } }, - "qwen-2.5-coder-32b": { - "id": "qwen-2.5-coder-32b", - "name": "Qwen 2.5 Coder 32B", + "qwen-image": { + "id": "qwen-image", + "name": "Qwen-Image", "family": "qwen", "attachment": false, "reasoning": false, - "tool_call": true, + "tool_call": false, "temperature": true, - "release_date": "2024-11-11", - "last_updated": "2024-11-11", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.79, "output": 0.79 }, - "limit": { "context": 128000, "output": 8192 } - }, - "gpt-5-nano": { - "id": "gpt-5-nano", - "name": "GPT-5 Nano", - "family": "gpt-nano", - "attachment": true, - "reasoning": true, - "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"] }, + "release_date": "2026-03-01", + "last_updated": "2026-03-01", + "modalities": { + "input": ["text"], + "output": ["image"] + }, "open_weights": false, - "cost": { "input": 0.05, "output": 0.4 }, - "limit": { "context": 400000, "output": 128000 } - }, - "gemini-3.1-flash-lite-preview": { - "id": "gemini-3.1-flash-lite-preview", - "name": "Gemini 3.1 Flash Lite Preview", - "family": "gemini-flash", - "attachment": true, + "limit": { + "context": 8192, + "output": 4096 + }, + "cost": { + "input": 0.5, + "output": 2 + } + }, + "qwen3-coder-next": { + "id": "qwen3-coder-next", + "name": "Qwen3-Coder-Next", + "family": "qwen", + "attachment": false, "reasoning": true, "tool_call": true, - "structured_output": true, "temperature": true, "release_date": "2026-03-01", "last_updated": "2026-03-01", - "modalities": { "input": ["text", "image", "audio", "video", "pdf"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 0.25, "output": 1.5, "cache_read": 0.025, "cache_write": 1 }, - "limit": { "context": 1048576, "output": 65536 } + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 16384 + }, + "cost": { + "input": 0.3, + "output": 1.2 + } }, - "claude-haiku-4-5-20251001": { - "id": "claude-haiku-4-5-20251001", - "name": "Claude Haiku 4.5", - "family": "claude-haiku", - "attachment": true, + "minimax-m2.5": { + "id": "minimax-m2.5", + "name": "MiniMax 2.5", + "family": "minimax", + "attachment": false, "reasoning": true, "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"] }, + "release_date": "2026-03-10", + "last_updated": "2026-03-10", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1, "output": 5 }, - "limit": { "context": 200000, "output": 64000 } + "limit": { + "context": 190000, + "output": 64000 + }, + "cost": { + "input": 0.8, + "output": 3.5 + } }, - "qwen3-max": { - "id": "qwen3-max", - "name": "Qwen3 Max", - "family": "qwen", + "gpt-oss-20b": { + "id": "gpt-oss-20b", + "name": "GPT-OSS-20B", + "family": "gpt-oss", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-05-28", - "last_updated": "2025-05-28", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 1.2, "output": 6 }, - "limit": { "context": 131072, "output": 16384 } + "release_date": "2026-03-01", + "last_updated": "2026-03-01", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 0.4, + "output": 1.8 + } }, - "o3-pro": { - "id": "o3-pro", - "name": "o3-pro", - "family": "o-pro", + "qwen3.5-9b": { + "id": "qwen3.5-9b", + "name": "Qwen3.5-9B", + "family": "qwen", "attachment": true, "reasoning": true, "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, - "cost": { "input": 20, "output": 40 }, - "limit": { "context": 200000, "output": 100000 } - }, - "gpt-4.1-nano": { - "id": "gpt-4.1-nano", - "name": "GPT-4.1 Nano", - "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, - "cost": { "input": 0.1, "output": 0.4 }, - "limit": { "context": 1047576, "output": 32768 } + "release_date": "2026-02-01", + "last_updated": "2026-02-01", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "open_weights": true, + "limit": { + "context": 262144, + "output": 8192 + }, + "cost": { + "input": 0.15, + "output": 0.6 + } }, - "gpt-5-codex": { - "id": "gpt-5-codex", - "name": "GPT-5 Codex", - "family": "gpt", + "gpt-oss-120b": { + "id": "gpt-oss-120b", + "name": "GPT-OSS-120B", + "family": "gpt-oss", "attachment": false, "reasoning": true, "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"] }, + "temperature": true, + "release_date": "2025-08-05", + "last_updated": "2025-08-05", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 128000, + "output": 16384 + }, + "cost": { + "input": 1, + "output": 4.2 + } }, - "o4-mini": { - "id": "o4-mini", - "name": "o4-mini", - "family": "o-mini", - "attachment": true, - "reasoning": true, + "llama-3.1-8b-instruct": { + "id": "llama-3.1-8b-instruct", + "name": "Llama 3.1 8B Instruct", + "family": "llama", + "attachment": false, + "reasoning": false, "tool_call": true, - "temperature": false, - "knowledge": "2024-05", - "release_date": "2025-04-16", - "last_updated": "2025-04-16", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "temperature": true, + "release_date": "2025-04-07", + "last_updated": "2025-04-07", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": false, - "cost": { "input": 1.1, "output": 4.4 }, - "limit": { "context": 200000, "output": 100000 } - }, - "route-llm": { - "id": "route-llm", - "name": "Route LLM", - "family": "gpt", - "attachment": true, + "limit": { + "context": 120000, + "output": 120000 + }, + "cost": { + "input": 0.05, + "output": 0.25 + } + } + } + }, + "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-tts": { + "id": "mimo-v2-tts", + "name": "MiMo-V2-TTS", + "family": "mimo", + "attachment": false, "reasoning": false, + "tool_call": false, + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text"], + "output": ["audio"] + }, + "open_weights": true, + "limit": { + "context": 8192, + "output": 16384 + }, + "cost": { + "input": 0, + "output": 0 + } + }, + "mimo-v2-flash": { + "id": "mimo-v2-flash", + "name": "MiMo-V2-Flash", + "family": "mimo", + "attachment": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "knowledge": "2024-10", - "release_date": "2024-01-01", - "last_updated": "2024-01-01", - "modalities": { "input": ["text", "image"], "output": ["text"] }, - "open_weights": false, - "cost": { "input": 3, "output": 15 }, - "limit": { "context": 128000, "output": 16384 } + "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 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "gpt-5.1-codex": { - "id": "gpt-5.1-codex", - "name": "GPT-5.1 Codex", - "family": "gpt", - "attachment": true, + "mimo-v2-pro": { + "id": "mimo-v2-pro", + "name": "MiMo-V2-Pro", + "family": "mimo", + "attachment": false, "reasoning": true, "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"] }, + "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, - "cost": { "input": 1.25, "output": 10 }, - "limit": { "context": 400000, "input": 272000, "output": 128000 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "openai/gpt-oss-120b": { - "id": "openai/gpt-oss-120b", - "name": "GPT-OSS 120B", - "family": "gpt-oss", + "mimo-v2.5": { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "family": "mimo", "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-08-05", - "last_updated": "2025-08-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text", "image", "audio", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.08, "output": 0.44 }, - "limit": { "context": 128000, "output": 32768 } + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "deepseek/deepseek-v3.1": { - "id": "deepseek/deepseek-v3.1", - "name": "DeepSeek V3.1", - "family": "deepseek", - "attachment": false, + "mimo-v2-omni": { + "id": "mimo-v2-omni", + "name": "MiMo-V2-Omni", + "family": "mimo", + "attachment": true, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.55, "output": 1.66 }, - "limit": { "context": 128000, "output": 8192 } + "knowledge": "2024-12", + "release_date": "2026-03-18", + "last_updated": "2026-03-18", + "modalities": { + "input": ["text", "image", "audio", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 262144, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } }, - "zai-org/glm-4.5": { - "id": "zai-org/glm-4.5", - "name": "GLM-4.5", - "family": "glm", + "mimo-v2.5-pro": { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "family": "mimo", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-07-28", - "last_updated": "2025-07-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2024-12", + "release_date": "2026-04-22", + "last_updated": "2026-04-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 128000, "output": 8192 } - }, - "zai-org/glm-4.6": { - "id": "zai-org/glm-4.6", - "name": "GLM-4.6", + "limit": { + "context": 1048576, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + } + } + } + }, + "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.z.ai/guides/overview/pricing", + "models": { + "glm-5v-turbo": { + "id": "glm-5v-turbo", + "name": "GLM-5V-Turbo", "family": "glm", - "attachment": false, - "reasoning": false, + "attachment": true, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2025-03-01", - "last_updated": "2025-03-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 128000, "output": 8192 } + "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": 5, + "output": 22, + "cache_read": 1.2, + "cache_write": 0 + } }, - "zai-org/glm-5": { - "id": "zai-org/glm-5", + "glm-5": { + "id": "glm-5", "name": "GLM-5", "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, "release_date": "2026-02-11", "last_updated": "2026-02-11", - "modalities": { "input": ["text"], "output": ["text"] }, + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 1, "output": 3.2 }, - "limit": { "context": 204800, "output": 131072 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 1, + "output": 3.2, + "cache_read": 0.2, + "cache_write": 0 + } }, - "zai-org/glm-4.7": { - "id": "zai-org/glm-4.7", - "name": "GLM-4.7", + "glm-5.1": { + "id": "glm-5.1", + "name": "GLM-5.1", "family": "glm", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, + "structured_output": true, "temperature": true, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.6, "output": 2.2 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2026-03-27", + "last_updated": "2026-03-27", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 6, + "output": 24, + "cache_read": 1.3, + "cache_write": 0 + } }, - "meta-llama/Meta-Llama-3.1-8B-Instruct": { - "id": "meta-llama/Meta-Llama-3.1-8B-Instruct", - "name": "Llama 3.1 8B Instruct", - "family": "llama", + "glm-4.7-flash": { + "id": "glm-4.7-flash", + "name": "GLM-4.7-Flash", + "family": "glm-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.02, "output": 0.05 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "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", - "family": "llama", + "glm-4.5-flash": { + "id": "glm-4.5-flash", + "name": "GLM-4.5-Flash", + "family": "glm-flash", "attachment": false, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-07-23", - "last_updated": "2024-07-23", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 3.5, "output": 3.5 }, - "limit": { "context": 128000, "output": 4096 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0, + "cache_write": 0 + } }, - "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", - "family": "llama", + "glm-4.6v": { + "id": "glm-4.6v", + "name": "GLM-4.6V", + "family": "glm", "attachment": true, - "reasoning": false, + "reasoning": true, "tool_call": true, "temperature": true, - "knowledge": "2024-08", - "release_date": "2025-04-05", - "last_updated": "2025-04-05", - "modalities": { "input": ["text", "image"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-08", + "last_updated": "2025-12-08", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.14, "output": 0.59 }, - "limit": { "context": 1000000, "output": 32768 } + "limit": { + "context": 128000, + "output": 32768 + }, + "cost": { + "input": 0.3, + "output": 0.9 + } }, - "deepseek-ai/DeepSeek-R1": { - "id": "deepseek-ai/DeepSeek-R1", - "name": "DeepSeek R1", - "family": "deepseek-thinking", + "glm-4.6": { + "id": "glm-4.6", + "name": "GLM-4.6", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-01-20", - "last_updated": "2025-01-20", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-09-30", + "last_updated": "2025-09-30", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 3, "output": 7 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11, + "cache_write": 0 + } }, - "deepseek-ai/DeepSeek-V3.1-Terminus": { - "id": "deepseek-ai/DeepSeek-V3.1-Terminus", - "name": "DeepSeek V3.1 Terminus", - "family": "deepseek", - "attachment": false, + "glm-4.5v": { + "id": "glm-4.5v", + "name": "GLM-4.5V", + "family": "glm", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-06-01", - "last_updated": "2025-06-01", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-08-11", + "last_updated": "2025-08-11", + "modalities": { + "input": ["text", "image", "video"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 1 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 64000, + "output": 16384 + }, + "cost": { + "input": 0.6, + "output": 1.8 + } }, - "deepseek-ai/DeepSeek-V3.2": { - "id": "deepseek-ai/DeepSeek-V3.2", - "name": "DeepSeek V3.2", - "family": "deepseek", + "glm-4.5-air": { + "id": "glm-4.5-air", + "name": "GLM-4.5-Air", + "family": "glm-air", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-06-15", - "last_updated": "2025-06-15", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.27, "output": 0.4 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.2, + "output": 1.1, + "cache_read": 0.03, + "cache_write": 0 + } }, - "Qwen/Qwen3-32B": { - "id": "Qwen/Qwen3-32B", - "name": "Qwen3 32B", - "family": "qwen", + "glm-4.5": { + "id": "glm-4.5", + "name": "GLM-4.5", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-04-29", - "last_updated": "2025-04-29", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-07-28", + "last_updated": "2025-07-28", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.09, "output": 0.29 }, - "limit": { "context": 128000, "output": 8192 } + "limit": { + "context": 131072, + "output": 98304 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11, + "cache_write": 0 + } }, - "Qwen/qwen3-coder-480b-a35b-instruct": { - "id": "Qwen/qwen3-coder-480b-a35b-instruct", - "name": "Qwen3 Coder 480B A35B Instruct", - "family": "qwen", + "glm-4.7-flashx": { + "id": "glm-4.7-flashx", + "name": "GLM-4.7-FlashX", + "family": "glm-flash", "attachment": false, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-22", - "last_updated": "2025-07-22", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2026-01-19", + "last_updated": "2026-01-19", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.29, "output": 1.2 }, - "limit": { "context": 262144, "output": 65536 } + "limit": { + "context": 200000, + "output": 131072 + }, + "cost": { + "input": 0.07, + "output": 0.4, + "cache_read": 0.01, + "cache_write": 0 + } }, - "Qwen/QwQ-32B": { - "id": "Qwen/QwQ-32B", - "name": "QwQ 32B", - "family": "qwen", + "glm-4.7": { + "id": "glm-4.7", + "name": "GLM-4.7", + "family": "glm", "attachment": false, "reasoning": true, "tool_call": true, + "interleaved": { + "field": "reasoning_content" + }, "temperature": true, - "release_date": "2024-11-28", - "last_updated": "2024-11-28", - "modalities": { "input": ["text"], "output": ["text"] }, + "knowledge": "2025-04", + "release_date": "2025-12-22", + "last_updated": "2025-12-22", + "modalities": { + "input": ["text"], + "output": ["text"] + }, "open_weights": true, - "cost": { "input": 0.4, "output": 0.4 }, - "limit": { "context": 32768, "output": 32768 } - }, - "Qwen/Qwen2.5-72B-Instruct": { - "id": "Qwen/Qwen2.5-72B-Instruct", - "name": "Qwen 2.5 72B Instruct", - "family": "qwen", - "attachment": false, - "reasoning": false, + "limit": { + "context": 204800, + "output": 131072 + }, + "cost": { + "input": 0.6, + "output": 2.2, + "cache_read": 0.11, + "cache_write": 0 + } + } + } + }, + "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-lite-v1": { + "id": "nova-2-lite-v1", + "name": "Nova 2 Lite", + "family": "nova-lite", + "attachment": true, + "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2024-09-19", - "last_updated": "2024-09-19", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.11, "output": 0.38 }, - "limit": { "context": 128000, "output": 8192 } + "release_date": "2025-12-01", + "last_updated": "2025-12-01", + "modalities": { + "input": ["text", "image", "video", "pdf"], + "output": ["text"] + }, + "open_weights": false, + "limit": { + "context": 1000000, + "output": 64000 + }, + "cost": { + "input": 0, + "output": 0, + "reasoning": 0 + } }, - "Qwen/Qwen3-235B-A22B-Instruct-2507": { - "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "name": "Qwen3 235B A22B Instruct", - "family": "qwen", - "attachment": false, + "nova-2-pro-v1": { + "id": "nova-2-pro-v1", + "name": "Nova 2 Pro", + "family": "nova-pro", + "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, - "release_date": "2025-07-01", - "last_updated": "2025-07-01", - "modalities": { "input": ["text"], "output": ["text"] }, - "open_weights": true, - "cost": { "input": 0.13, "output": 0.6 }, - "limit": { "context": 262144, "output": 8192 } + "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 + } } } } diff --git a/packages/opencode/test/tool/grep.test.ts b/packages/opencode/test/tool/grep.test.ts index 53f5d9a19c63..29b5a60db2d7 100644 --- a/packages/opencode/test/tool/grep.test.ts +++ b/packages/opencode/test/tool/grep.test.ts @@ -1,4 +1,6 @@ import { describe, expect } from "bun:test" +import fs from "fs/promises" +import os from "os" import path from "path" import { Effect, Layer } from "effect" import { GrepTool } from "../../src/tool/grep" @@ -11,6 +13,8 @@ import { Ripgrep } from "../../src/file/ripgrep" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { testEffect } from "../lib/effect" import { Reference } from "@/reference/reference" +import { Permission } from "../../src/permission" +import type * as Tool from "../../src/tool/tool" const it = testEffect( Layer.mergeAll( @@ -110,4 +114,53 @@ describe("tool.grep", () => { expect(result.output).toContain("Line 2: line2") }), ) + + it.instance("does not ask for external_directory when alias path is allowed", () => + Effect.gen(function* () { + if (process.platform === "win32") return + + yield* TestInstance + const tmp = yield* Effect.acquireRelease( + Effect.promise(() => fs.mkdtemp(path.join(os.tmpdir(), "opencode-grep-alias-"))), + (dir) => Effect.promise(() => fs.rm(dir, { recursive: true, force: true })), + ) + const real = path.join(tmp, "real") + const alias = path.join(tmp, "alias") + yield* Effect.promise(() => fs.mkdir(real)) + yield* Effect.promise(() => fs.symlink(real, alias, "dir")) + yield* Effect.promise(() => Bun.write(path.join(real, "test.txt"), "needle")) + + const ruleset = Permission.fromConfig({ + grep: "allow", + external_directory: { + [path.join(alias, "*")]: "allow", + }, + }) + const requests: Array> = [] + const next: Tool.Context = { + ...ctx, + ask: (req) => + Effect.sync(() => { + const needsAsk = req.patterns.some( + (pattern) => Permission.evaluate(req.permission, pattern, ruleset).action !== "allow", + ) + if (needsAsk) requests.push(req) + }), + } + + const info = yield* GrepTool + const grep = yield* info.init() + const result = yield* grep.execute( + { + pattern: "needle", + path: alias, + include: "*.txt", + }, + next, + ) + + expect(result.metadata.matches).toBe(1) + expect(requests.find((req) => req.permission === "external_directory")).toBeUndefined() + }), + ) }) diff --git a/packages/opencode/test/tool/parameters.test.ts b/packages/opencode/test/tool/parameters.test.ts index 17af7b983e4d..3a124be81b0c 100644 --- a/packages/opencode/test/tool/parameters.test.ts +++ b/packages/opencode/test/tool/parameters.test.ts @@ -1,13 +1,13 @@ import { describe, expect, test } from "bun:test" import { Result, Schema } from "effect" -import { toJsonSchema } from "@opencode-ai/core/effect-zod" +import { ToolJsonSchema } from "../../src/tool/json-schema" // Each tool exports its parameters schema at module scope so this test can // import them without running the tool's Effect-based init. The JSON Schema // snapshot captures what the LLM sees; the parse assertions pin down the -// accepts/rejects contract. `toJsonSchema` is the same helper `session/ +// accepts/rejects contract. `ToolJsonSchema.fromSchema` is the same helper `session/ // prompt.ts` uses to emit tool schemas to the LLM, so the snapshots stay -// byte-identical regardless of whether a tool has migrated from zod to Schema. +// provider-compatible while tools use Effect Schema internally. import { Parameters as ApplyPatch } from "../../src/tool/apply_patch" import { Parameters as Edit } from "../../src/tool/edit" @@ -32,6 +32,8 @@ const parse = >(schema: S, input: unknown): S[ const accepts = (schema: Schema.Decoder, input: unknown): boolean => Result.isSuccess(Schema.decodeUnknownResult(schema)(input)) +const toJsonSchema = ToolJsonSchema.fromSchema + describe("tool parameters", () => { describe("JSON Schema (wire shape)", () => { test("apply_patch", () => expect(toJsonSchema(ApplyPatch)).toMatchSnapshot()) @@ -50,6 +52,36 @@ describe("tool parameters", () => { test("webfetch", () => expect(toJsonSchema(WebFetch)).toMatchSnapshot()) test("websearch", () => expect(toJsonSchema(WebSearch)).toMatchSnapshot()) test("write", () => expect(toJsonSchema(Write)).toMatchSnapshot()) + + test("inlines named child schemas for provider compatibility", () => { + const schema = toJsonSchema(Question) + expect(schema).not.toHaveProperty("$defs") + expect(schema).toMatchObject({ + properties: { + questions: { items: { properties: { options: { items: { properties: { label: { type: "string" } } } } } } }, + }, + }) + }) + + test("preserves required nullable fields", () => { + expect(toJsonSchema(Schema.Struct({ value: Schema.NullOr(Schema.String) }))).toMatchObject({ + properties: { value: { anyOf: expect.arrayContaining([{ type: "null" }]) } }, + }) + }) + + test("keeps repeated allOf constraints instead of dropping duplicates", () => { + expect( + toJsonSchema( + Schema.Struct({ value: Schema.String.check(Schema.isPattern(/^a/)).check(Schema.isPattern(/z$/)) }), + ), + ).toMatchObject({ properties: { value: { allOf: [{ pattern: "^a" }, { pattern: "z$" }] } } }) + }) + + test("bounds bare integer fields to safe integer range", () => { + expect(toJsonSchema(Schema.Struct({ value: Schema.Int }))).toMatchObject({ + properties: { value: { minimum: Number.MIN_SAFE_INTEGER, maximum: Number.MAX_SAFE_INTEGER } }, + }) + }) }) describe("apply_patch", () => { @@ -203,6 +235,10 @@ describe("tool parameters", () => { const parsed = parse(Task, { description: "d", prompt: "p", subagent_type: "general" }) expect(parsed.subagent_type).toBe("general") }) + test("accepts optional background flag", () => { + const parsed = parse(Task, { description: "d", prompt: "p", subagent_type: "general", background: true }) + expect(parsed.background).toBe(true) + }) test("rejects missing prompt", () => { expect(accepts(Task, { description: "d", subagent_type: "general" })).toBe(false) }) diff --git a/packages/opencode/test/tool/question.test.ts b/packages/opencode/test/tool/question.test.ts index da215db7705b..854c1f891148 100644 --- a/packages/opencode/test/tool/question.test.ts +++ b/packages/opencode/test/tool/question.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from "bun:test" -import { Effect, Fiber, Layer } from "effect" +import { Effect, Fiber, Layer, Queue } from "effect" import { QuestionTool } from "../../src/tool/question" import { Question } from "../../src/question" import { SessionID, MessageID } from "../../src/session/schema" @@ -7,6 +7,7 @@ import { Agent } from "../../src/agent/agent" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { Truncate } from "@/tool/truncate" import { testEffect } from "../lib/effect" +import { Bus } from "../../src/bus" const ctx = { sessionID: SessionID.make("ses_test-session"), @@ -20,15 +21,25 @@ const ctx = { } const it = testEffect( - Layer.mergeAll(Question.defaultLayer, CrossSpawnSpawner.defaultLayer, Truncate.defaultLayer, Agent.defaultLayer), + Layer.mergeAll( + Question.layer.pipe(Layer.provideMerge(Bus.layer)), + CrossSpawnSpawner.defaultLayer, + Truncate.defaultLayer, + Agent.defaultLayer, + ), ) const pending = Effect.fn("QuestionToolTest.pending")(function* (question: Question.Interface) { + const bus = yield* Bus.Service + const asked = yield* Queue.unbounded() + const off = yield* bus.subscribeCallback(Question.Event.Asked, () => Queue.offerUnsafe(asked, undefined)) + yield* Effect.addFinalizer(() => Effect.sync(off)) + for (;;) { const items = yield* question.list() const item = items[0] if (item) return item - yield* Effect.sleep("10 millis") + yield* Queue.take(asked).pipe(Effect.timeout("2 seconds")) } }) diff --git a/packages/opencode/test/tool/read.test.ts b/packages/opencode/test/tool/read.test.ts index 11bb1513f3eb..fcbd10bb4d18 100644 --- a/packages/opencode/test/tool/read.test.ts +++ b/packages/opencode/test/tool/read.test.ts @@ -4,8 +4,10 @@ import path from "path" import { Agent } from "../../src/agent/agent" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { AppFileSystem } from "@opencode-ai/core/filesystem" -import { Flag } from "@opencode-ai/core/flag/flag" import { Global } from "@opencode-ai/core/global" +import { Config } from "@/config/config" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { Git } from "@/git" import { LSP } from "@/lsp/lsp" import { Permission } from "../../src/permission" import { Instance } from "../../src/project/instance" @@ -36,17 +38,27 @@ const ctx = { ask: () => Effect.void, } -const it = testEffect( +const referenceLayer = (flags: Partial = {}) => + Reference.layer.pipe( + Layer.provide(Config.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Git.defaultLayer), + Layer.provide(RuntimeFlags.layer(flags)), + ) + +const readLayer = (flags: Partial = {}) => Layer.mergeAll( Agent.defaultLayer, AppFileSystem.defaultLayer, CrossSpawnSpawner.defaultLayer, Instruction.defaultLayer, LSP.defaultLayer, - Reference.defaultLayer, + referenceLayer(flags), Truncate.defaultLayer, - ), -) + ) + +const it = testEffect(readLayer()) +const scout = testEffect(readLayer({ experimentalScout: true })) const init = Effect.fn("ReadToolTest.init")(function* () { const info = yield* ReadTool @@ -85,19 +97,6 @@ const fail = Effect.fn("ReadToolTest.fail")(function* ( const full = (p: string) => (process.platform === "win32" ? Filesystem.normalizePath(p) : p) const glob = (p: string) => process.platform === "win32" ? Filesystem.normalizePathPattern(p) : p.replaceAll("\\", "/") -const experimentalScout = (self: Effect.Effect) => - Effect.acquireUseRelease( - Effect.sync(() => { - const previous = Flag.OPENCODE_EXPERIMENTAL_SCOUT - Flag.OPENCODE_EXPERIMENTAL_SCOUT = true - return previous - }), - () => self, - (previous) => - Effect.sync(() => { - Flag.OPENCODE_EXPERIMENTAL_SCOUT = previous - }), - ) const githubBase = (url: string, self: Effect.Effect) => Effect.acquireUseRelease( Effect.sync(() => { @@ -260,44 +259,42 @@ describe("tool.read external_directory permission", () => { }), ) - it.live("does not ask for external_directory permission when reading configured references", () => - experimentalScout( - Effect.gen(function* () { - const fs = yield* AppFileSystem.Service - const cache = path.join(Global.Path.repos, "github.com", "opencode-read-reference", "repo") - yield* fs.remove(cache, { recursive: true }).pipe(Effect.ignore) - yield* Effect.addFinalizer(() => fs.remove(cache, { recursive: true }).pipe(Effect.ignore)) - - const source = yield* tmpdirScoped({ git: true }) - const remoteRoot = yield* tmpdirScoped() - const remoteDir = path.join(remoteRoot, "opencode-read-reference") - const remoteRepo = path.join(remoteDir, "repo.git") - yield* put(path.join(source, "notes.md"), "reference notes") - yield* git(source, ["add", "."]) - yield* git(source, ["commit", "-m", "add notes"]) - yield* fs.makeDirectory(remoteDir, { recursive: true }).pipe(Effect.orDie) - yield* git(remoteRoot, ["clone", "--bare", source, remoteRepo]) - - const dir = yield* tmpdirScoped({ - git: true, - config: { - reference: { - docs: "opencode-read-reference/repo", - }, + scout.live("does not ask for external_directory permission when reading configured references", () => + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + const cache = path.join(Global.Path.repos, "github.com", "opencode-read-reference", "repo") + yield* fs.remove(cache, { recursive: true }).pipe(Effect.ignore) + yield* Effect.addFinalizer(() => fs.remove(cache, { recursive: true }).pipe(Effect.ignore)) + + const source = yield* tmpdirScoped({ git: true }) + const remoteRoot = yield* tmpdirScoped() + const remoteDir = path.join(remoteRoot, "opencode-read-reference") + const remoteRepo = path.join(remoteDir, "repo.git") + yield* put(path.join(source, "notes.md"), "reference notes") + yield* git(source, ["add", "."]) + yield* git(source, ["commit", "-m", "add notes"]) + yield* fs.makeDirectory(remoteDir, { recursive: true }).pipe(Effect.orDie) + yield* git(remoteRoot, ["clone", "--bare", source, remoteRepo]) + + const dir = yield* tmpdirScoped({ + git: true, + config: { + reference: { + docs: "opencode-read-reference/repo", }, - }) + }, + }) - const { items, next } = asks() - const result = yield* githubBase( - `file://${remoteRoot}/`, - exec(dir, { filePath: path.join(cache, "notes.md") }, next), - ) - const ext = items.find((item) => item.permission === "external_directory") + const { items, next } = asks() + const result = yield* githubBase( + `file://${remoteRoot}/`, + exec(dir, { filePath: path.join(cache, "notes.md") }, next), + ) + const ext = items.find((item) => item.permission === "external_directory") - expect(result.output).toContain("reference notes") - expect(ext).toBeUndefined() - }), - ), + expect(result.output).toContain("reference notes") + expect(ext).toBeUndefined() + }), ) }) diff --git a/packages/opencode/test/tool/registry.test.ts b/packages/opencode/test/tool/registry.test.ts index dc66c308ac93..0a96a689cde0 100644 --- a/packages/opencode/test/tool/registry.test.ts +++ b/packages/opencode/test/tool/registry.test.ts @@ -1,10 +1,11 @@ import { afterEach, describe, expect } from "bun:test" import path from "path" import fs from "fs/promises" -import { Effect, Layer } from "effect" +import { pathToFileURL } from "url" +import { Effect, Layer, Result, Schema } from "effect" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { ToolRegistry } from "@/tool/registry" -import { Flag } from "@opencode-ai/core/flag/flag" +import { Tool } from "@/tool/tool" import { disposeAllInstances, TestInstance } from "../fixture/fixture" import { testEffect } from "../lib/effect" import { TestConfig } from "../fixture/config" @@ -14,7 +15,9 @@ import { Question } from "@/question" import { Todo } from "@/session/todo" import { Skill } from "@/skill" import { Agent } from "@/agent/agent" +import { BackgroundJob } from "@/background/job" import { Session } from "@/session/session" +import { SessionStatus } from "@/session/status" import { Provider } from "@/provider/provider" import { Git } from "@/git" import { LSP } from "@/lsp/lsp" @@ -26,67 +29,108 @@ import { Ripgrep } from "@/file/ripgrep" import * as Truncate from "@/tool/truncate" import { InstanceState } from "@/effect/instance-state" import { Reference } from "@/reference/reference" +import { ProviderID, ModelID } from "@/provider/schema" +import { ToolJsonSchema } from "@/tool/json-schema" +import { MessageID, SessionID } from "@/session/schema" +import { RuntimeFlags } from "@/effect/runtime-flags" const node = CrossSpawnSpawner.defaultLayer -const originalExperimentalScout = Flag.OPENCODE_EXPERIMENTAL_SCOUT const configLayer = TestConfig.layer({ directories: () => InstanceState.directory.pipe(Effect.map((dir) => [path.join(dir, ".opencode")])), }) -const registryLayer = ToolRegistry.layer.pipe( - Layer.provide(configLayer), - Layer.provide(Plugin.defaultLayer), - Layer.provide(Question.defaultLayer), - Layer.provide(Todo.defaultLayer), - Layer.provide(Skill.defaultLayer), - Layer.provide(Agent.defaultLayer), - Layer.provide(Session.defaultLayer), - Layer.provide(Provider.defaultLayer), - Layer.provide(Git.defaultLayer), - Layer.provide(Reference.defaultLayer), - Layer.provide(LSP.defaultLayer), - Layer.provide(Instruction.defaultLayer), - Layer.provide(AppFileSystem.defaultLayer), - Layer.provide(Bus.layer), - Layer.provide(FetchHttpClient.layer), - Layer.provide(Format.defaultLayer), - Layer.provide(node), - Layer.provide(Ripgrep.defaultLayer), - Layer.provide(Truncate.defaultLayer), -) +const registryLayer = (flags: Partial = {}) => + ToolRegistry.layer + .pipe( + Layer.provide(configLayer), + Layer.provide(Plugin.defaultLayer), + Layer.provide(Question.defaultLayer), + Layer.provide(Todo.defaultLayer), + Layer.provide(Skill.defaultLayer), + Layer.provide(Agent.defaultLayer), + Layer.provide(Session.defaultLayer), + Layer.provide(Layer.mergeAll(SessionStatus.defaultLayer, BackgroundJob.defaultLayer)), + Layer.provide(Provider.defaultLayer), + Layer.provide(Git.defaultLayer), + Layer.provide(Reference.defaultLayer), + Layer.provide(LSP.defaultLayer), + Layer.provide(Instruction.defaultLayer), + Layer.provide(AppFileSystem.defaultLayer), + Layer.provide(Bus.layer), + Layer.provide(FetchHttpClient.layer), + Layer.provide(Format.defaultLayer), + Layer.provide(node), + Layer.provide(Ripgrep.defaultLayer), + Layer.provide(Truncate.defaultLayer), + ) + .pipe(Layer.provide(RuntimeFlags.layer(flags))) -const it = testEffect(Layer.mergeAll(registryLayer, node)) +const it = testEffect(Layer.mergeAll(registryLayer(), node, Agent.defaultLayer)) +const scout = testEffect(Layer.mergeAll(registryLayer({ experimentalScout: true }), node, Agent.defaultLayer)) +const background = testEffect( + Layer.mergeAll(registryLayer({ experimentalBackgroundSubagents: true }), node, Agent.defaultLayer), +) afterEach(async () => { - Flag.OPENCODE_EXPERIMENTAL_SCOUT = originalExperimentalScout await disposeAllInstances() }) describe("tool.registry", () => { it.instance("hides repo research tools unless experimental", () => Effect.gen(function* () { - Flag.OPENCODE_EXPERIMENTAL_SCOUT = false const registry = yield* ToolRegistry.Service const ids = yield* registry.ids() - expect(ids).not.toContain("codesearch") expect(ids).not.toContain("repo_clone") expect(ids).not.toContain("repo_overview") }), ) - it.instance("shows repo research tools when experimental scout is enabled", () => + scout.instance("shows repo research tools when experimental scout is enabled", () => Effect.gen(function* () { - Flag.OPENCODE_EXPERIMENTAL_SCOUT = true const registry = yield* ToolRegistry.Service const ids = yield* registry.ids() - expect(ids).toContain("codesearch") expect(ids).toContain("repo_clone") expect(ids).toContain("repo_overview") }), ) + it.instance("hides task_status unless experimental background subagents are enabled", () => + Effect.gen(function* () { + const registry = yield* ToolRegistry.Service + const ids = yield* registry.ids() + + expect(ids).not.toContain("task_status") + }), + ) + + it.instance("hides task background parameter unless experimental background subagents are enabled", () => + Effect.gen(function* () { + const registry = yield* ToolRegistry.Service + const agent = yield* Agent.Service + const build = yield* agent.get("build") + if (!build) throw new Error("build agent not found") + const task = (yield* registry.tools({ + providerID: ProviderID.opencode, + modelID: ModelID.make("test"), + agent: build, + })).find((tool) => tool.id === "task") + + expect(task?.jsonSchema).toBeDefined() + expect((task?.jsonSchema?.properties as Record | undefined)?.background).toBeUndefined() + }), + ) + + background.instance("shows task_status when experimental background subagents are enabled", () => + Effect.gen(function* () { + const registry = yield* ToolRegistry.Service + const ids = yield* registry.ids() + + expect(ids).toContain("task_status") + }), + ) + it.instance("loads tools from .opencode/tool (singular)", () => Effect.gen(function* () { const test = yield* TestInstance @@ -114,6 +158,33 @@ describe("tool.registry", () => { }), ) + it.instance("ignores non-tool exports in .opencode/tool files", () => + Effect.gen(function* () { + const test = yield* TestInstance + const tool = path.join(test.directory, ".opencode", "tool") + yield* Effect.promise(() => fs.mkdir(tool, { recursive: true })) + yield* Effect.promise(() => + Bun.write( + path.join(tool, "mixed.ts"), + [ + "export const helper = 'not a tool'", + "export default {", + " description: 'mixed tool',", + " args: {},", + " execute: async () => 'ok',", + "}", + "", + ].join("\n"), + ), + ) + + const registry = yield* ToolRegistry.Service + const ids = yield* registry.ids() + expect(ids).toContain("mixed") + expect(ids).not.toContain("mixed_helper") + }), + ) + it.instance("loads tools from .opencode/tools (plural)", () => Effect.gen(function* () { const test = yield* TestInstance @@ -141,6 +212,134 @@ describe("tool.registry", () => { }), ) + it.instance("loads Zod-schema custom tools with JSON Schema and validation", () => + Effect.gen(function* () { + const test = yield* TestInstance + const customTools = path.join(test.directory, ".opencode", "tools") + const pluginTool = pathToFileURL(path.resolve(import.meta.dir, "../../../plugin/src/tool.ts")).href + yield* Effect.promise(() => fs.mkdir(customTools, { recursive: true })) + yield* Effect.promise(() => + Bun.write( + path.join(customTools, "sql.ts"), + [ + `import { tool } from ${JSON.stringify(pluginTool)}`, + "export default tool({", + " description: 'query database',", + " args: { query: tool.schema.string().describe('SQL query to execute') },", + " execute: async ({ query }) => query,", + "})", + "", + ].join("\n"), + ), + ) + + const registry = yield* ToolRegistry.Service + const loaded = (yield* registry.all()).find((tool) => tool.id === "sql") + if (!loaded) throw new Error("custom sql tool was not loaded") + expect(loaded?.jsonSchema).toMatchObject({ + type: "object", + properties: { + query: { type: "string", description: "SQL query to execute" }, + }, + required: ["query"], + }) + expect(Result.isSuccess(Schema.decodeUnknownResult(loaded.parameters)({ query: "select 1" }))).toBe(true) + expect(Result.isSuccess(Schema.decodeUnknownResult(loaded.parameters)({}))).toBe(false) + + const agents = yield* Agent.Service + const promptTools = yield* registry.tools({ + providerID: ProviderID.opencode, + modelID: ModelID.make("test"), + agent: yield* agents.defaultInfo(), + }) + const promptTool = promptTools.find((tool) => tool.id === "sql") + if (!promptTool) throw new Error("custom sql tool was not returned for prompts") + expect(ToolJsonSchema.fromTool(promptTool)).toMatchObject({ + properties: { + query: { type: "string", description: "SQL query to execute" }, + }, + required: ["query"], + }) + }), + ) + + it.instance("preserves attachments from structured custom tool results", () => + Effect.gen(function* () { + const test = yield* TestInstance + const customTools = path.join(test.directory, ".opencode", "tools") + const pluginTool = pathToFileURL(path.resolve(import.meta.dir, "../../../plugin/src/tool.ts")).href + yield* Effect.promise(() => fs.mkdir(customTools, { recursive: true })) + yield* Effect.promise(() => + Bun.write( + path.join(customTools, "image.ts"), + [ + `import { tool } from ${JSON.stringify(pluginTool)}`, + "export default tool({", + " description: 'image tool',", + " args: {},", + " execute: async () => ({", + " output: 'here is an image',", + " attachments: [{ type: 'file', mime: 'image/png', filename: 'picture.png', url: 'data:image/png;base64,AAAA' }],", + " }),", + "})", + "", + ].join("\n"), + ), + ) + + const registry = yield* ToolRegistry.Service + const loaded = (yield* registry.all()).find((tool) => tool.id === "image") + if (!loaded) throw new Error("custom image tool was not loaded") + const agents = yield* Agent.Service + const result = yield* loaded.execute({}, { + sessionID: SessionID.make("ses_test"), + messageID: MessageID.make("msg_test"), + agent: (yield* agents.defaultInfo()).name, + abort: new AbortController().signal, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + } satisfies Tool.Context) + + expect(result.output).toBe("here is an image") + expect(result.attachments).toEqual([ + { type: "file", mime: "image/png", filename: "picture.png", url: "data:image/png;base64,AAAA" }, + ]) + }), + ) + + it.instance("loads legacy JSON-schema-shaped custom tools with wire schema", () => + Effect.gen(function* () { + const test = yield* TestInstance + const tools = path.join(test.directory, ".opencode", "tools") + yield* Effect.promise(() => fs.mkdir(tools, { recursive: true })) + yield* Effect.promise(() => + Bun.write( + path.join(tools, "legacy.ts"), + [ + "export default {", + " description: 'legacy schema tool',", + " args: { text: { type: 'string', description: 'Text to render' } },", + " execute: async ({ text }) => text,", + "}", + "", + ].join("\n"), + ), + ) + + const registry = yield* ToolRegistry.Service + const loaded = (yield* registry.all()).find((tool) => tool.id === "legacy") + if (!loaded) throw new Error("legacy custom tool was not loaded") + expect(ToolJsonSchema.fromTool(loaded)).toMatchObject({ + type: "object", + properties: { + text: { type: "string", description: "Text to render" }, + }, + required: ["text"], + }) + }), + ) + it.instance("loads tools with external dependencies without crashing", () => Effect.gen(function* () { const test = yield* TestInstance diff --git a/packages/opencode/test/tool/repo_overview.test.ts b/packages/opencode/test/tool/repo_overview.test.ts index 556fa05d1fbe..c854e51a3fdc 100644 --- a/packages/opencode/test/tool/repo_overview.test.ts +++ b/packages/opencode/test/tool/repo_overview.test.ts @@ -97,6 +97,21 @@ describe("tool.repo_overview", () => { ), ) + it.live("resolves relative paths from the instance directory", () => + provideTmpdirInstance((dir) => + Effect.gen(function* () { + const fs = yield* AppFileSystem.Service + yield* fs.writeWithDirs(path.join(dir, "nested", "README.md"), "# Nested\n") + + const tool = yield* init() + const result = yield* tool.execute({ path: "nested" }, ctx) + + expect(result.metadata.path).toBe(path.join(dir, "nested")) + expect(result.output).toContain("README.md") + }), + ), + ) + it.live("resolves a cached repository from repository shorthand", () => provideTmpdirInstance((_dir) => Effect.gen(function* () { diff --git a/packages/opencode/test/tool/shell.test.ts b/packages/opencode/test/tool/shell.test.ts index 287844141fc0..fe4f5a483468 100644 --- a/packages/opencode/test/tool/shell.test.ts +++ b/packages/opencode/test/tool/shell.test.ts @@ -1,14 +1,13 @@ -import { describe, expect, test } from "bun:test" -import { Effect, Layer, ManagedRuntime } from "effect" +import { describe, expect } from "bun:test" +import { Cause, Effect, Exit, Layer } from "effect" +import type * as Scope from "effect/Scope" import os from "os" import path from "path" import { Config } from "@/config/config" import { Shell } from "../../src/shell/shell" import { ShellTool } from "../../src/tool/shell" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { Filesystem } from "@/util/filesystem" -import { tmpdir } from "../fixture/fixture" +import { provideInstance, tmpdirScoped } from "../fixture/fixture" import type { Permission } from "../../src/permission" import { Agent } from "../../src/agent/agent" import { Truncate } from "@/tool/truncate" @@ -16,23 +15,52 @@ import { SessionID, MessageID } from "../../src/session/schema" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Plugin } from "../../src/plugin" +import { testEffect } from "../lib/effect" +import { Tool } from "@/tool/tool" +import { RuntimeFlags } from "@/effect/runtime-flags" -const runtime = ManagedRuntime.make( - Layer.mergeAll( - CrossSpawnSpawner.defaultLayer, - AppFileSystem.defaultLayer, - Plugin.defaultLayer, - Truncate.defaultLayer, - Config.defaultLayer, - Agent.defaultLayer, - ), +const shellLayer = Layer.mergeAll( + CrossSpawnSpawner.defaultLayer, + AppFileSystem.defaultLayer, + Plugin.defaultLayer, + Truncate.defaultLayer, + Config.defaultLayer, + Agent.defaultLayer, + RuntimeFlags.defaultLayer, ) +const it = testEffect(shellLayer) +type ShellTestServices = + | (typeof shellLayer extends Layer.Layer ? ROut : never) + | Scope.Scope -function initBash() { - return runtime.runPromise(ShellTool.pipe(Effect.flatMap((info) => info.init()))) -} +const initShell = Effect.fn("ShellToolTest.init")(function* () { + const info = yield* ShellTool + return yield* info.init() +}) -const initShell = initBash +const initBash = initShell + +const run = Effect.fn("ShellToolTest.run")(function* ( + args: Tool.InferParameters, + next: Tool.Context = ctx, +) { + const bash = yield* initShell() + return yield* bash.execute(args, next) +}) + +const runIn = (directory: string, self: Effect.Effect) => self.pipe(provideInstance(directory)) + +const fail = Effect.fn("ShellToolTest.fail")(function* ( + args: Tool.InferParameters, + next: Tool.Context = ctx, +) { + const exit = yield* run(args, next).pipe(Effect.exit) + if (Exit.isFailure(exit)) { + const err = Cause.squash(exit.cause) + return err instanceof Error ? err : new Error(String(err)) + } + throw new Error("expected command to fail") +}) const ctx = { sessionID: SessionID.make("ses_test"), @@ -96,27 +124,31 @@ const forms = (dir: string) => { return Array.from(new Set([full, slash, root, root.toLowerCase()])) } -const withShell = (item: { label: string; shell: string }, fn: () => Promise) => async () => { - const prev = process.env.SHELL - process.env.SHELL = item.shell - Shell.acceptable.reset() - Shell.preferred.reset() - try { - await fn() - } finally { - if (prev === undefined) delete process.env.SHELL - else process.env.SHELL = prev - Shell.acceptable.reset() - Shell.preferred.reset() - } -} +const withShell = (item: { label: string; shell: string }, self: Effect.Effect) => + Effect.acquireUseRelease( + Effect.sync(() => { + const prev = process.env.SHELL + process.env.SHELL = item.shell + Shell.acceptable.reset() + Shell.preferred.reset() + return prev + }), + () => self, + (prev) => + Effect.sync(() => { + if (prev === undefined) delete process.env.SHELL + else process.env.SHELL = prev + Shell.acceptable.reset() + Shell.preferred.reset() + }), + ) -const each = (name: string, fn: (item: { label: string; shell: string }) => Promise) => { +const each = ( + name: string, + fn: (item: { label: string; shell: string }) => Effect.Effect, +) => { for (const item of shells) { - test( - `${name} [${item.label}]`, - withShell(item, () => fn(item)), - ) + it.live(`${name} [${item.label}]`, () => withShell(item, fn(item))) } } @@ -140,277 +172,248 @@ const mustTruncate = (result: { } describe("tool.shell", () => { - each("basic", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const result = await Effect.runPromise( - bash.execute( - { - command: "echo test", - description: "Echo test message", - }, - ctx, - ), - ) + each("basic", () => + runIn( + projectRoot, + Effect.gen(function* () { + const result = yield* run({ + command: "echo test", + description: "Echo test message", + }) expect(result.metadata.exit).toBe(0) expect(result.metadata.output).toContain("test") - }, - }) - }) - - test("falls back from terminal-only configured shell", async () => { - await using tmp = await tmpdir({ - config: { shell: "fish" }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const fallback = Shell.name(Shell.acceptable("fish")) - expect(fallback).not.toBe("fish") - expect(bash.description).toContain(fallback) - - const result = await Effect.runPromise( - bash.execute( + }), + ), + ) + + it.live("falls back from terminal-only configured shell", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped({ config: { shell: "fish" } }) + yield* runIn( + tmp, + Effect.gen(function* () { + const bash = yield* initBash() + const fallback = Shell.name(Shell.acceptable("fish")) + expect(fallback).not.toBe("fish") + expect(bash.description).toContain(fallback) + + const result = yield* bash.execute( { command: "echo fallback", description: "Echo fallback text", }, ctx, - ), - ) - expect(result.metadata.exit).toBe(0) - expect(result.output).toContain("fallback") - }, - }) - }) + ) + expect(result.metadata.exit).toBe(0) + expect(result.output).toContain("fallback") + }), + ) + }), + ) }) describe("tool.shell permissions", () => { - each("asks for bash permission with correct pattern", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initShell() - const requests: Array> = [] - await Effect.runPromise( - bash.execute( + each("asks for bash permission with correct pattern", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const requests: Array> = [] + yield* run( { command: "echo hello", description: "Echo hello", }, capture(requests), - ), - ) - expect(requests.length).toBe(1) - expect(requests[0].permission).toBe("bash") - expect(requests[0].patterns).toContain("echo hello") - }, - }) - }) - - each("asks for bash permission with multiple commands", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initShell() - const requests: Array> = [] - await Effect.runPromise( - bash.execute( + ) + expect(requests.length).toBe(1) + expect(requests[0].permission).toBe("bash") + expect(requests[0].patterns).toContain("echo hello") + }), + ) + }), + ) + + each("asks for bash permission with multiple commands", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const requests: Array> = [] + yield* run( { command: "echo foo && echo bar", description: "Echo twice", }, capture(requests), - ), - ) - expect(requests.length).toBe(1) - expect(requests[0].permission).toBe("bash") - expect(requests[0].patterns).toContain("echo foo") - expect(requests[0].patterns).toContain("echo bar") - }, - }) - }) + ) + expect(requests.length).toBe(1) + expect(requests[0].permission).toBe("bash") + expect(requests[0].patterns).toContain("echo foo") + expect(requests[0].patterns).toContain("echo bar") + }), + ) + }), + ) for (const item of ps) { - test( - `parses PowerShell conditionals for permission prompts [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live(`parses PowerShell conditionals for permission prompts [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const requests: Array> = [] - await Effect.runPromise( - bash.execute( - { - command: "Write-Host foo; if ($?) { Write-Host bar }", - description: "Check PowerShell conditional", - }, - capture(requests), - ), + yield* run( + { + command: "Write-Host foo; if ($?) { Write-Host bar }", + description: "Check PowerShell conditional", + }, + capture(requests), ) const bashReq = requests.find((r) => r.permission === "bash") expect(bashReq).toBeDefined() expect(bashReq!.patterns).toContain("Write-Host foo") expect(bashReq!.patterns).toContain("Write-Host bar") expect(bashReq!.always).toContain("Write-Host *") - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `uses PowerShell cmdlet prefixes for always-allow prompts [${item.label}]`, - withShell(item, async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initShell() - const err = new Error("stop after permission") - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + it.live(`uses PowerShell cmdlet prefixes for always-allow prompts [${item.label}]`, () => + withShell( + item, + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + expect( + yield* fail( { command: "Remove-Item -Recurse tmp", description: "Remove a temp directory", }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - const bashReq = requests.find((r) => r.permission === "bash") - expect(bashReq).toBeDefined() - expect(bashReq!.always).toContain("Remove-Item *") - expect(bashReq!.always).not.toContain("Remove-Item -Recurse *") - }, - }) - }), + ).toMatchObject({ message: err.message }) + const bashReq = requests.find((r) => r.permission === "bash") + expect(bashReq).toBeDefined() + expect(bashReq!.always).toContain("Remove-Item *") + expect(bashReq!.always).not.toContain("Remove-Item -Recurse *") + }), + ) + }), + ), ) } - each("asks for external_directory permission for wildcard external paths", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + each("asks for external_directory permission for wildcard external paths", () => + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] const file = process.platform === "win32" ? `${process.env.WINDIR!.replaceAll("\\", "/")}/*` : "/etc/*" const want = process.platform === "win32" ? glob(path.join(process.env.WINDIR!, "*")) : "/etc/*" - await expect( - Effect.runPromise( - bash.execute( - { - command: `cat ${file}`, - description: "Read wildcard path", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: `cat ${file}`, + description: "Read wildcard path", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() expect(extDirReq!.patterns).toContain(want) - }, - }) - }) + }), + ), + ) if (process.platform === "win32") { if (bash) { - test( - "asks for nested bash command permissions [bash]", - withShell({ label: "bash", shell: bash }, async () => { - await using outerTmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "outside.txt"), "x") - }, - }) - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const file = path.join(outerTmp.path, "outside.txt").replaceAll("\\", "/") - const requests: Array> = [] - await Effect.runPromise( - bash.execute( + it.live("asks for nested bash command permissions [bash]", () => + withShell( + { label: "bash", shell: bash }, + Effect.gen(function* () { + const outerTmp = yield* tmpdirScoped() + yield* Effect.promise(() => Bun.write(path.join(outerTmp, "outside.txt"), "x")) + yield* runIn( + projectRoot, + Effect.gen(function* () { + const file = path.join(outerTmp, "outside.txt").replaceAll("\\", "/") + const requests: Array> = [] + yield* run( { command: `echo $(cat "${file}")`, description: "Read nested bash file", }, capture(requests), - ), - ) - const extDirReq = requests.find((r) => r.permission === "external_directory") - const bashReq = requests.find((r) => r.permission === "bash") - expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns).toContain(glob(path.join(outerTmp.path, "*"))) - expect(bashReq).toBeDefined() - expect(bashReq!.patterns).toContain(`cat "${file}"`) - }, - }) - }), + ) + const extDirReq = requests.find((r) => r.permission === "external_directory") + const bashReq = requests.find((r) => r.permission === "bash") + expect(extDirReq).toBeDefined() + expect(extDirReq!.patterns).toContain(glob(path.join(outerTmp, "*"))) + expect(bashReq).toBeDefined() + expect(bashReq!.patterns).toContain(`cat "${file}"`) + }), + ) + }), + ), ) } - } - if (process.platform === "win32") { for (const item of ps) { - test( - `asks for external_directory permission for PowerShell paths after switches [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live(`asks for external_directory permission for PowerShell paths after switches [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( - { - command: `Copy-Item -PassThru "${process.env.WINDIR!.replaceAll("\\", "/")}/win.ini" ./out`, - description: "Copy Windows ini", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: `Copy-Item -PassThru "${process.env.WINDIR!.replaceAll("\\", "/")}/win.ini" ./out`, + description: "Copy Windows ini", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() expect(extDirReq!.patterns).toContain(glob(path.join(process.env.WINDIR!, "*"))) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `asks for nested PowerShell command permissions [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live(`asks for nested PowerShell command permissions [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const requests: Array> = [] const file = `${process.env.WINDIR!.replaceAll("\\", "/")}/win.ini` - await Effect.runPromise( - bash.execute( - { - command: `Write-Output $(Get-Content ${file})`, - description: "Read nested PowerShell file", - }, - capture(requests), - ), + yield* run( + { + command: `Write-Output $(Get-Content ${file})`, + description: "Read nested PowerShell file", + }, + capture(requests), ) const extDirReq = requests.find((r) => r.permission === "external_directory") const bashReq = requests.find((r) => r.permission === "bash") @@ -418,283 +421,266 @@ describe("tool.shell permissions", () => { expect(extDirReq!.patterns).toContain(glob(path.join(process.env.WINDIR!, "*"))) expect(bashReq).toBeDefined() expect(bashReq!.patterns).toContain(`Get-Content ${file}`) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for drive-relative PowerShell paths [${item.label}]`, - withShell(item, async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initShell() - const err = new Error("stop after permission") - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + it.live(`asks for external_directory permission for drive-relative PowerShell paths [${item.label}]`, () => + withShell( + item, + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + expect( + yield* fail( { command: 'Get-Content "C:../outside.txt"', description: "Read drive-relative file", }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - expect(requests[0]?.permission).toBe("external_directory") - if (requests[0]?.permission !== "external_directory") return - expect(requests[0].patterns).toContain(glob(path.join(path.dirname(tmp.path), "*"))) - }, - }) - }), + ).toMatchObject({ message: err.message }) + expect(requests[0]?.permission).toBe("external_directory") + if (requests[0]?.permission !== "external_directory") return + expect(requests[0].patterns).toContain(glob(path.join(path.dirname(tmp), "*"))) + }), + ) + }), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for $HOME PowerShell paths [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live(`asks for external_directory permission for $HOME PowerShell paths [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( - { - command: 'Get-Content "$HOME/.ssh/config"', - description: "Read home config", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: 'Get-Content "$HOME/.ssh/config"', + description: "Read home config", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) expect(requests[0]?.permission).toBe("external_directory") if (requests[0]?.permission !== "external_directory") return expect(requests[0].patterns).toContain(glob(path.join(os.homedir(), ".ssh", "*"))) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for $PWD PowerShell paths [${item.label}]`, - withShell(item, async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const err = new Error("stop after permission") - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + it.live(`asks for external_directory permission for $PWD PowerShell paths [${item.label}]`, () => + withShell( + item, + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + expect( + yield* fail( { command: 'Get-Content "$PWD/../outside.txt"', description: "Read pwd-relative file", }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - expect(requests[0]?.permission).toBe("external_directory") - if (requests[0]?.permission !== "external_directory") return - expect(requests[0].patterns).toContain(glob(path.join(path.dirname(tmp.path), "*"))) - }, - }) - }), + ).toMatchObject({ message: err.message }) + expect(requests[0]?.permission).toBe("external_directory") + if (requests[0]?.permission !== "external_directory") return + expect(requests[0].patterns).toContain(glob(path.join(path.dirname(tmp), "*"))) + }), + ) + }), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for $PSHOME PowerShell paths [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live(`asks for external_directory permission for $PSHOME PowerShell paths [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( - { - command: 'Get-Content "$PSHOME/outside.txt"', - description: "Read pshome file", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: 'Get-Content "$PSHOME/outside.txt"', + description: "Read pshome file", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) expect(requests[0]?.permission).toBe("external_directory") if (requests[0]?.permission !== "external_directory") return expect(requests[0].patterns).toContain(glob(path.join(path.dirname(item.shell), "*"))) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for missing PowerShell env paths [${item.label}]`, - withShell(item, async () => { - const key = "OPENCODE_TEST_MISSING" - const prev = process.env[key] - delete process.env[key] - try { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const err = new Error("stop after permission") - const requests: Array> = [] - const root = path.parse(process.env.WINDIR!).root.replace(/[\\/]+$/, "") - await expect( - Effect.runPromise( - bash.execute( + it.live(`asks for external_directory permission for missing PowerShell env paths [${item.label}]`, () => + withShell( + item, + Effect.acquireUseRelease( + Effect.sync(() => { + const key = "OPENCODE_TEST_MISSING" + const prev = process.env[key] + delete process.env[key] + return { key, prev } + }), + ({ key }) => + runIn( + projectRoot, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + const root = path.parse(process.env.WINDIR!).root.replace(/[\\/]+$/, "") + expect( + yield* fail( { command: `Get-Content -Path "${root}$env:${key}\\Windows\\win.ini"`, description: "Read Windows ini with missing env", }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - const extDirReq = requests.find((r) => r.permission === "external_directory") - expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns).toContain(glob(path.join(process.env.WINDIR!, "*"))) - }, - }) - } finally { - if (prev === undefined) delete process.env[key] - else process.env[key] = prev - } - }), + ).toMatchObject({ message: err.message }) + const extDirReq = requests.find((r) => r.permission === "external_directory") + expect(extDirReq).toBeDefined() + expect(extDirReq!.patterns).toContain(glob(path.join(process.env.WINDIR!, "*"))) + }), + ), + ({ key, prev }) => + Effect.sync(() => { + if (prev === undefined) delete process.env[key] + else process.env[key] = prev + }), + ), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for PowerShell env paths [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live(`asks for external_directory permission for PowerShell env paths [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const requests: Array> = [] - await Effect.runPromise( - bash.execute( - { - command: "Get-Content $env:WINDIR/win.ini", - description: "Read Windows ini from env", - }, - capture(requests), - ), + yield* run( + { + command: "Get-Content $env:WINDIR/win.ini", + description: "Read Windows ini from env", + }, + capture(requests), ) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() expect(extDirReq!.patterns).toContain( Filesystem.normalizePathPattern(path.join(process.env.WINDIR!, "*")), ) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for PowerShell FileSystem paths [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live(`asks for external_directory permission for PowerShell FileSystem paths [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( - { - command: `Get-Content -Path FileSystem::${process.env.WINDIR!.replaceAll("\\", "/")}/win.ini`, - description: "Read Windows ini from FileSystem provider", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: `Get-Content -Path FileSystem::${process.env.WINDIR!.replaceAll("\\", "/")}/win.ini`, + description: "Read Windows ini from FileSystem provider", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) expect(requests[0]?.permission).toBe("external_directory") if (requests[0]?.permission !== "external_directory") return expect(requests[0].patterns).toContain( Filesystem.normalizePathPattern(path.join(process.env.WINDIR!, "*")), ) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `asks for external_directory permission for braced PowerShell env paths [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live(`asks for external_directory permission for braced PowerShell env paths [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( - { - command: "Get-Content ${env:WINDIR}/win.ini", - description: "Read Windows ini from braced env", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: "Get-Content ${env:WINDIR}/win.ini", + description: "Read Windows ini from braced env", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) expect(requests[0]?.permission).toBe("external_directory") if (requests[0]?.permission !== "external_directory") return expect(requests[0].patterns).toContain( Filesystem.normalizePathPattern(path.join(process.env.WINDIR!, "*")), ) - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `treats Set-Location like cd for permissions [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live(`treats Set-Location like cd for permissions [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const requests: Array> = [] - await Effect.runPromise( - bash.execute( - { - command: "Set-Location C:/Windows", - description: "Change location", - }, - capture(requests), - ), + yield* run( + { + command: "Set-Location C:/Windows", + description: "Change location", + }, + capture(requests), ) const extDirReq = requests.find((r) => r.permission === "external_directory") const bashReq = requests.find((r) => r.permission === "bash") @@ -703,104 +689,96 @@ describe("tool.shell permissions", () => { Filesystem.normalizePathPattern(path.join(process.env.WINDIR!, "*")), ) expect(bashReq).toBeUndefined() - }, - }) - }), + }), + ), + ), ) } for (const item of ps) { - test( - `does not add nested PowerShell expressions to permission prompts [${item.label}]`, - withShell(item, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live(`does not add nested PowerShell expressions to permission prompts [${item.label}]`, () => + withShell( + item, + runIn( + projectRoot, + Effect.gen(function* () { const requests: Array> = [] - await Effect.runPromise( - bash.execute( - { - command: "Write-Output ('a' * 3)", - description: "Write repeated text", - }, - capture(requests), - ), + yield* run( + { + command: "Write-Output ('a' * 3)", + description: "Write repeated text", + }, + capture(requests), ) const bashReq = requests.find((r) => r.permission === "bash") expect(bashReq).toBeDefined() expect(bashReq!.patterns).not.toContain("a * 3") expect(bashReq!.always).not.toContain("a *") - }, - }) - }), + }), + ), + ), ) } } if (process.platform === "win32" && cmdShell) { - test( - "asks for external_directory permission for cmd file commands [cmd]", - withShell(cmdShell, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live("asks for external_directory permission for cmd file commands [cmd]", () => + withShell( + cmdShell, + runIn( + projectRoot, + Effect.gen(function* () { const requests: Array> = [] - await Effect.runPromise( - bash.execute( - { - command: `TYPE "${path.join(process.env.WINDIR!, "win.ini")}"`, - description: "Read Windows ini with cmd", - }, - capture(requests), - ), + yield* run( + { + command: `TYPE "${path.join(process.env.WINDIR!, "win.ini")}"`, + description: "Read Windows ini with cmd", + }, + capture(requests), ) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() expect(extDirReq!.patterns).toContain(Filesystem.normalizePathPattern(path.join(process.env.WINDIR!, "*"))) - }, - }) - }), + }), + ), + ), ) } - each("asks for external_directory permission when cd to parent", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const err = new Error("stop after permission") - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + each("asks for external_directory permission when cd to parent", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + expect( + yield* fail( { command: "cd ../", description: "Change to parent directory", }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - const extDirReq = requests.find((r) => r.permission === "external_directory") - expect(extDirReq).toBeDefined() - }, - }) - }) - - each("asks for external_directory permission when workdir is outside project", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const err = new Error("stop after permission") - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + ).toMatchObject({ message: err.message }) + const extDirReq = requests.find((r) => r.permission === "external_directory") + expect(extDirReq).toBeDefined() + }), + ) + }), + ) + + each("asks for external_directory permission when workdir is outside project", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + expect( + yield* fail( { command: "echo ok", workdir: os.tmpdir(), @@ -808,31 +786,30 @@ describe("tool.shell permissions", () => { }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - const extDirReq = requests.find((r) => r.permission === "external_directory") - expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns).toContain(glob(path.join(os.tmpdir(), "*"))) - }, - }) - }) + ).toMatchObject({ message: err.message }) + const extDirReq = requests.find((r) => r.permission === "external_directory") + expect(extDirReq).toBeDefined() + expect(extDirReq!.patterns).toContain(glob(path.join(os.tmpdir(), "*"))) + }), + ) + }), + ) if (process.platform === "win32") { - test("normalizes external_directory workdir variants on Windows", async () => { - const err = new Error("stop after permission") - await using outerTmp = await tmpdir() - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const want = Filesystem.normalizePathPattern(path.join(outerTmp.path, "*")) - - for (const dir of forms(outerTmp.path)) { - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + it.live("normalizes external_directory workdir variants on Windows", () => + Effect.gen(function* () { + const err = new Error("stop after permission") + const outerTmp = yield* tmpdirScoped() + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const want = Filesystem.normalizePathPattern(path.join(outerTmp, "*")) + + for (const dir of forms(outerTmp)) { + const requests: Array> = [] + expect( + yield* fail( { command: "echo ok", workdir: dir, @@ -840,240 +817,224 @@ describe("tool.shell permissions", () => { }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) - const extDirReq = requests.find((r) => r.permission === "external_directory") - expect({ dir, patterns: extDirReq?.patterns, always: extDirReq?.always }).toEqual({ - dir, - patterns: [want], - always: [want], - }) - } - }, - }) - }) + const extDirReq = requests.find((r) => r.permission === "external_directory") + expect({ dir, patterns: extDirReq?.patterns, always: extDirReq?.always }).toEqual({ + dir, + patterns: [want], + always: [want], + }) + } + }), + ) + }), + ) if (bash) { - test( - "uses Git Bash /tmp semantics for external workdir", - withShell({ label: "bash", shell: bash }, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live("uses Git Bash /tmp semantics for external workdir", () => + withShell( + { label: "bash", shell: bash }, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] const want = glob(path.join(os.tmpdir(), "*")) - await expect( - Effect.runPromise( - bash.execute( - { - command: "echo ok", - workdir: "/tmp", - description: "Echo from Git Bash tmp", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: "echo ok", + workdir: "/tmp", + description: "Echo from Git Bash tmp", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) expect(requests[0]).toMatchObject({ permission: "external_directory", patterns: [want], always: [want], }) - }, - }) - }), + }), + ), + ), ) - test( - "uses Git Bash /tmp semantics for external file paths", - withShell({ label: "bash", shell: bash }, async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + it.live("uses Git Bash /tmp semantics for external file paths", () => + withShell( + { label: "bash", shell: bash }, + runIn( + projectRoot, + Effect.gen(function* () { const err = new Error("stop after permission") const requests: Array> = [] const want = glob(path.join(os.tmpdir(), "*")) - await expect( - Effect.runPromise( - bash.execute( - { - command: "cat /tmp/opencode-does-not-exist", - description: "Read Git Bash tmp file", - }, - capture(requests, err), - ), + expect( + yield* fail( + { + command: "cat /tmp/opencode-does-not-exist", + description: "Read Git Bash tmp file", + }, + capture(requests, err), ), - ).rejects.toThrow(err.message) + ).toMatchObject({ message: err.message }) expect(requests[0]).toMatchObject({ permission: "external_directory", patterns: [want], always: [want], }) - }, - }) - }), + }), + ), + ), ) } } - each("asks for external_directory permission when file arg is outside project", async () => { - await using outerTmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "outside.txt"), "x") - }, - }) - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const err = new Error("stop after permission") - const requests: Array> = [] - const filepath = path.join(outerTmp.path, "outside.txt") - await expect( - Effect.runPromise( - bash.execute( + each("asks for external_directory permission when file arg is outside project", () => + Effect.gen(function* () { + const outerTmp = yield* tmpdirScoped() + yield* Effect.promise(() => Bun.write(path.join(outerTmp, "outside.txt"), "x")) + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + const filepath = path.join(outerTmp, "outside.txt") + expect( + yield* fail( { command: `cat ${filepath}`, description: "Read external file", }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - const extDirReq = requests.find((r) => r.permission === "external_directory") - const expected = glob(path.join(outerTmp.path, "*")) - expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns).toContain(expected) - expect(extDirReq!.always).toContain(expected) - }, - }) - }) - - each("does not ask for external_directory permission when rm inside project", async () => { - await using tmp = await tmpdir({ - init: async (dir) => { - await Bun.write(path.join(dir, "tmpfile"), "x") - }, - }) - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const requests: Array> = [] - await Effect.runPromise( - bash.execute( + ).toMatchObject({ message: err.message }) + const extDirReq = requests.find((r) => r.permission === "external_directory") + const expected = glob(path.join(outerTmp, "*")) + expect(extDirReq).toBeDefined() + expect(extDirReq!.patterns).toContain(expected) + expect(extDirReq!.always).toContain(expected) + }), + ) + }), + ) + + each("does not ask for external_directory permission when rm inside project", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* Effect.promise(() => Bun.write(path.join(tmp, "tmpfile"), "x")) + yield* runIn( + tmp, + Effect.gen(function* () { + const requests: Array> = [] + yield* run( { - command: `rm -rf ${path.join(tmp.path, "nested")}`, + command: `rm -rf ${path.join(tmp, "nested")}`, description: "Remove nested dir", }, capture(requests), - ), - ) - const extDirReq = requests.find((r) => r.permission === "external_directory") - expect(extDirReq).toBeUndefined() - }, - }) - }) - - each("includes always patterns for auto-approval", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const requests: Array> = [] - await Effect.runPromise( - bash.execute( + ) + const extDirReq = requests.find((r) => r.permission === "external_directory") + expect(extDirReq).toBeUndefined() + }), + ) + }), + ) + + each("includes always patterns for auto-approval", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const requests: Array> = [] + yield* run( { command: "git log --oneline -5", description: "Git log", }, capture(requests), - ), - ) - expect(requests.length).toBe(1) - expect(requests[0].always.length).toBeGreaterThan(0) - expect(requests[0].always.some((item) => item.endsWith("*"))).toBe(true) - }, - }) - }) - - each("does not ask for bash permission when command is cd only", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initShell() - const requests: Array> = [] - await Effect.runPromise( - bash.execute( + ) + expect(requests.length).toBe(1) + expect(requests[0].always.length).toBeGreaterThan(0) + expect(requests[0].always.some((item) => item.endsWith("*"))).toBe(true) + }), + ) + }), + ) + + each("does not ask for bash permission when command is cd only", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const requests: Array> = [] + yield* run( { command: "cd .", description: "Stay in current directory", }, capture(requests), - ), - ) - const bashReq = requests.find((r) => r.permission === "bash") - expect(bashReq).toBeUndefined() - }, - }) - }) - - each("matches redirects in permission pattern", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initShell() - const err = new Error("stop after permission") - const requests: Array> = [] - await expect( - Effect.runPromise( - bash.execute( + ) + const bashReq = requests.find((r) => r.permission === "bash") + expect(bashReq).toBeUndefined() + }), + ) + }), + ) + + each("matches redirects in permission pattern", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const err = new Error("stop after permission") + const requests: Array> = [] + expect( + yield* fail( { command: "echo test > output.txt", description: "Redirect test output" }, capture(requests, err), ), - ), - ).rejects.toThrow(err.message) - const bashReq = requests.find((r) => r.permission === "bash") - expect(bashReq).toBeDefined() - expect(bashReq!.patterns).toContain("echo test > output.txt") - }, - }) - }) - - each("always pattern has space before wildcard to not include different commands", async () => { - await using tmp = await tmpdir() - await WithInstance.provide({ - directory: tmp.path, - fn: async () => { - const bash = await initBash() - const requests: Array> = [] - await Effect.runPromise(bash.execute({ command: "ls -la", description: "List" }, capture(requests))) - const bashReq = requests.find((r) => r.permission === "bash") - expect(bashReq).toBeDefined() - expect(bashReq!.always[0]).toBe("ls *") - }, - }) - }) + ).toMatchObject({ message: err.message }) + const bashReq = requests.find((r) => r.permission === "bash") + expect(bashReq).toBeDefined() + expect(bashReq!.patterns).toContain("echo test > output.txt") + }), + ) + }), + ) + + each("always pattern has space before wildcard to not include different commands", () => + Effect.gen(function* () { + const tmp = yield* tmpdirScoped() + yield* runIn( + tmp, + Effect.gen(function* () { + const requests: Array> = [] + yield* run({ command: "ls -la", description: "List" }, capture(requests)) + const bashReq = requests.find((r) => r.permission === "bash") + expect(bashReq).toBeDefined() + expect(bashReq!.always[0]).toBe("ls *") + }), + ) + }), + ) }) describe("tool.shell abort", () => { - test("preserves output when aborted", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const controller = new AbortController() - const collected: string[] = [] - const res = await Effect.runPromise( - bash.execute( + it.live( + "preserves output when aborted", + () => + runIn( + projectRoot, + Effect.gen(function* () { + const controller = new AbortController() + const collected: string[] = [] + const res = yield* run( { command: `echo before && sleep 30`, description: "Long running command", @@ -1090,198 +1051,175 @@ describe("tool.shell abort", () => { } }), }, - ), - ) - expect(res.output).toContain("before") - expect(res.output).toContain("User aborted the command") - expect(collected.length).toBeGreaterThan(0) - }, - }) - }, 15_000) - - test("terminates command on timeout", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const result = await Effect.runPromise( - bash.execute( - { - command: `echo started && sleep 60`, - description: "Timeout test", - timeout: 500, - }, - ctx, - ), - ) - expect(result.output).toContain("started") - expect(result.output).toContain("shell tool terminated command after exceeding timeout") - expect(result.output).toContain("retry with a larger timeout value in milliseconds") - }, - }) - }, 15_000) - - test.skipIf(process.platform === "win32")("captures stderr in output", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const result = await Effect.runPromise( - bash.execute( - { - command: `echo stdout_msg && echo stderr_msg >&2`, - description: "Stderr test", - }, - ctx, - ), - ) - expect(result.output).toContain("stdout_msg") - expect(result.output).toContain("stderr_msg") - expect(result.metadata.exit).toBe(0) - }, - }) - }) - - test("returns non-zero exit code", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const result = await Effect.runPromise( - bash.execute( - { - command: `exit 42`, - description: "Non-zero exit", - }, - ctx, - ), - ) + ) + expect(res.output).toContain("before") + expect(res.output).toContain("User aborted the command") + expect(collected.length).toBeGreaterThan(0) + }), + ), + 15_000, + ) + + it.live( + "terminates command on timeout", + () => + runIn( + projectRoot, + Effect.gen(function* () { + const result = yield* run({ + command: `echo started && sleep 60`, + description: "Timeout test", + timeout: 500, + }) + expect(result.output).toContain("started") + expect(result.output).toContain("shell tool terminated command after exceeding timeout") + expect(result.output).toContain("retry with a larger timeout value in milliseconds") + }), + ), + 15_000, + ) + + it.live( + "uses RuntimeFlags bashDefaultTimeoutMs when timeout is omitted", + () => + runIn( + projectRoot, + Effect.gen(function* () { + const result = yield* run({ + command: `echo started && sleep 60`, + description: "Default timeout test", + }) + expect(result.output).toContain("started") + expect(result.output).toContain("exceeding timeout 500 ms") + }), + ).pipe(Effect.provide(RuntimeFlags.layer({ bashDefaultTimeoutMs: 500 }))), + 15_000, + ) + + if (process.platform !== "win32") { + it.live("captures stderr in output", () => + runIn( + projectRoot, + Effect.gen(function* () { + const result = yield* run({ + command: `echo stdout_msg && echo stderr_msg >&2`, + description: "Stderr test", + }) + expect(result.output).toContain("stdout_msg") + expect(result.output).toContain("stderr_msg") + expect(result.metadata.exit).toBe(0) + }), + ), + ) + } + + it.live("returns non-zero exit code", () => + runIn( + projectRoot, + Effect.gen(function* () { + const result = yield* run({ + command: `exit 42`, + description: "Non-zero exit", + }) expect(result.metadata.exit).toBe(42) - }, - }) - }) - - test("streams metadata updates progressively", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initBash() + }), + ), + ) + + it.live("streams metadata updates progressively", () => + runIn( + projectRoot, + Effect.gen(function* () { const updates: string[] = [] - const result = await Effect.runPromise( - bash.execute( - { - command: `echo first && sleep 0.1 && echo second`, - description: "Streaming test", - }, - { - ...ctx, - metadata: (input) => - Effect.sync(() => { - const output = (input.metadata as { output?: string })?.output - if (output) updates.push(output) - }), - }, - ), + const result = yield* run( + { + command: `echo first && sleep 0.1 && echo second`, + description: "Streaming test", + }, + { + ...ctx, + metadata: (input) => + Effect.sync(() => { + const output = (input.metadata as { output?: string })?.output + if (output) updates.push(output) + }), + }, ) expect(result.output).toContain("first") expect(result.output).toContain("second") expect(updates.length).toBeGreaterThan(1) - }, - }) - }) + }), + ), + ) }) describe("tool.shell truncation", () => { - test("truncates output exceeding line limit", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + it.live("truncates output exceeding line limit", () => + runIn( + projectRoot, + Effect.gen(function* () { const lineCount = Truncate.MAX_LINES + 500 - const result = await Effect.runPromise( - bash.execute( - { - command: fill("lines", lineCount), - description: "Generate lines exceeding limit", - }, - ctx, - ), - ) + const result = yield* run({ + command: fill("lines", lineCount), + description: "Generate lines exceeding limit", + }) mustTruncate(result) expect(result.output).toMatch(/\.\.\.output truncated\.\.\./) expect(result.output).toMatch(/Full output saved to:\s+\S+/) - }, - }) - }) - - test("truncates output exceeding byte limit", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + }), + ), + ) + + it.live("truncates output exceeding byte limit", () => + runIn( + projectRoot, + Effect.gen(function* () { const byteCount = Truncate.MAX_BYTES + 10000 - const result = await Effect.runPromise( - bash.execute( - { - command: fill("bytes", byteCount), - description: "Generate bytes exceeding limit", - }, - ctx, - ), - ) + const result = yield* run({ + command: fill("bytes", byteCount), + description: "Generate bytes exceeding limit", + }) mustTruncate(result) expect(result.output).toMatch(/\.\.\.output truncated\.\.\./) expect(result.output).toMatch(/Full output saved to:\s+\S+/) - }, - }) - }) - - test("does not truncate small output", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() - const result = await Effect.runPromise( - bash.execute( - { - command: "echo hello", - description: "Echo hello", - }, - ctx, - ), - ) + }), + ), + ) + + it.live("does not truncate small output", () => + runIn( + projectRoot, + Effect.gen(function* () { + const result = yield* run({ + command: fill("lines", 1), + description: "Generate one line", + }) expect((result.metadata as { truncated?: boolean }).truncated).toBe(false) - expect(result.output).toContain("hello") - }, - }) - }) - - test("full output is saved to file when truncated", async () => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const bash = await initShell() + expect(result.output).toContain("1") + }), + ), + ) + + it.live("full output is saved to file when truncated", () => + runIn( + projectRoot, + Effect.gen(function* () { const lineCount = Truncate.MAX_LINES + 100 - const result = await Effect.runPromise( - bash.execute( - { - command: fill("lines", lineCount), - description: "Generate lines for file check", - }, - ctx, - ), - ) + const result = yield* run({ + command: fill("lines", lineCount), + description: "Generate lines for file check", + }) mustTruncate(result) const filepath = (result.metadata as { outputPath?: string }).outputPath expect(filepath).toBeTruthy() - const saved = await Filesystem.readText(filepath!) + const saved = yield* (yield* AppFileSystem.Service).readFileString(filepath!) const lines = saved.trim().split(/\r?\n/) expect(lines.length).toBe(lineCount) expect(lines[0]).toBe("1") expect(lines[lineCount - 1]).toBe(String(lineCount)) - }, - }) - }) + }), + ), + ) }) diff --git a/packages/opencode/test/tool/task.test.ts b/packages/opencode/test/tool/task.test.ts index f75fcf84b8a9..2b7d001572a0 100644 --- a/packages/opencode/test/tool/task.test.ts +++ b/packages/opencode/test/tool/task.test.ts @@ -1,16 +1,21 @@ import { afterEach, describe, expect } from "bun:test" import { Effect, Exit, Fiber, Layer } from "effect" import { Agent } from "../../src/agent/agent" +import { BackgroundJob } from "@/background/job" +import { Bus } from "@/bus" import { Config } from "@/config/config" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { Session } from "@/session/session" import { MessageV2 } from "../../src/session/message-v2" import type { SessionPrompt } from "../../src/session/prompt" import { MessageID, PartID, SessionID } from "../../src/session/schema" +import { SessionRunState } from "@/session/run-state" +import { SessionStatus } from "@/session/status" import { ModelID, ProviderID } from "../../src/provider/schema" import { TaskTool, type TaskPromptOps } from "../../src/tool/task" import { Truncate } from "@/tool/truncate" import { ToolRegistry } from "@/tool/registry" +import { RuntimeFlags } from "@/effect/runtime-flags" import { disposeAllInstances } from "../fixture/fixture" import { testEffect } from "../lib/effect" @@ -23,16 +28,23 @@ const ref = { modelID: ModelID.make("test-model"), } -const it = testEffect( +const layer = (flags: Partial = {}) => Layer.mergeAll( Agent.defaultLayer, + BackgroundJob.defaultLayer, + Bus.defaultLayer, Config.defaultLayer, CrossSpawnSpawner.defaultLayer, Session.defaultLayer, + SessionRunState.defaultLayer, + SessionStatus.defaultLayer, Truncate.defaultLayer, ToolRegistry.defaultLayer, - ), -) + RuntimeFlags.layer(flags), + ) + +const it = testEffect(layer()) +const background = testEffect(layer({ experimentalBackgroundSubagents: true })) function defer() { let resolve!: (value: T | PromiseLike) => void @@ -80,6 +92,7 @@ function stubOps(opts?: { onPrompt?: (input: SessionPrompt.PromptInput) => void; opts?.onPrompt?.(input) return reply(input, opts?.text ?? "done") }), + loop: (input) => Effect.succeed(reply({ sessionID: input.sessionID, parts: [] }, opts?.text ?? "done")), } } @@ -294,6 +307,7 @@ describe("tool.task", () => { ready.resolve(input) return cancelled.promise }).pipe(Effect.as(reply(input, "cancelled"))), + loop: (input) => Effect.succeed(reply({ sessionID: input.sessionID, parts: [] }, "done")), } const fiber = yield* def @@ -432,4 +446,311 @@ describe("tool.task", () => { }, }, ) + + it.instance("rejects background execution when the experiment is disabled", () => + Effect.gen(function* () { + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const exit = yield* def + .execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { promptOps: stubOps() }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + .pipe(Effect.exit) + + expect(Exit.isFailure(exit)).toBe(true) + }), + ) + + background.instance("execute launches background tasks without waiting for completion", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const result = yield* def.execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { + promptOps: { + ...stubOps(), + prompt: () => Effect.never, + } satisfies TaskPromptOps, + }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + const job = yield* jobs.get(result.metadata.sessionId) + expect(result.metadata.background).toBe(true) + expect(result.output).toContain("state: running") + expect(job?.status).toBe("running") + }), + ) + + background.instance("background tasks complete through the background job service", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const result = yield* def.execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { promptOps: stubOps({ text: "background done" }) }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + const waited = yield* jobs.wait({ id: result.metadata.sessionId, timeout: 1_000 }) + expect(waited.timedOut).toBe(false) + expect(waited.info?.status).toBe("completed") + expect(waited.info?.output).toBe("background done") + }), + ) + + background.instance("background task completion does not wait for the parent resume loop", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const sessions = yield* Session.Service + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const result = yield* def.execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { + promptOps: { + ...stubOps({ text: "background done" }), + prompt: (input) => + input.noReply + ? Effect.gen(function* () { + const user = yield* sessions.updateMessage({ + id: input.messageID ?? MessageID.ascending(), + role: "user", + sessionID: input.sessionID, + agent: input.agent ?? "build", + model: input.model ?? ref, + time: { created: Date.now() }, + }) + const parts = input.parts.map((part) => ({ + ...part, + id: part.id ?? PartID.ascending(), + messageID: user.id, + sessionID: input.sessionID, + })) + yield* Effect.forEach(parts, (part) => sessions.updatePart(part), { discard: true }) + return { info: user, parts } + }) + : Effect.succeed(reply(input, "background done")), + loop: () => Effect.never, + } satisfies TaskPromptOps, + }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + const waited = yield* jobs.wait({ id: result.metadata.sessionId, timeout: 1_000 }) + expect(waited.timedOut).toBe(false) + expect(waited.info?.status).toBe("completed") + }), + ) + + background.instance("removing the parent session cancels running background tasks", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const sessions = yield* Session.Service + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const result = yield* def.execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { + promptOps: { + ...stubOps(), + prompt: () => Effect.never, + } satisfies TaskPromptOps, + }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + yield* sessions.remove(chat.id) + const waited = yield* jobs.wait({ id: result.metadata.sessionId, timeout: 1_000 }) + expect(waited.timedOut).toBe(false) + expect(waited.info?.status).toBe("cancelled") + }), + ) + + background.instance("removing the child task session cancels its running background task", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const sessions = yield* Session.Service + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const result = yield* def.execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { + promptOps: { + ...stubOps(), + prompt: () => Effect.never, + } satisfies TaskPromptOps, + }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + yield* sessions.remove(result.metadata.sessionId) + const waited = yield* jobs.wait({ id: result.metadata.sessionId, timeout: 1_000 }) + expect(waited.timedOut).toBe(false) + expect(waited.info?.status).toBe("cancelled") + }), + ) + + background.instance("cancelling the parent run cancels running background tasks", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const runState = yield* SessionRunState.Service + const { chat, assistant } = yield* seed() + const tool = yield* TaskTool + const def = yield* tool.init() + + const result = yield* def.execute( + { + description: "inspect bug", + prompt: "look into the cache key path", + subagent_type: "general", + background: true, + }, + { + sessionID: chat.id, + messageID: assistant.id, + agent: "build", + abort: new AbortController().signal, + extra: { + promptOps: { + ...stubOps(), + prompt: () => Effect.never, + } satisfies TaskPromptOps, + }, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + yield* runState.cancel(chat.id) + const waited = yield* jobs.wait({ id: result.metadata.sessionId, timeout: 1_000 }) + expect(waited.timedOut).toBe(false) + expect(waited.info?.status).toBe("cancelled") + }), + ) + + it.instance("cancelling a parent run recursively cancels descendant background tasks", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const runState = yield* SessionRunState.Service + const sessions = yield* Session.Service + const { chat } = yield* seed() + const child = yield* sessions.create({ parentID: chat.id, title: "child" }) + const grandchild = yield* sessions.create({ parentID: child.id, title: "grandchild" }) + + yield* jobs.start({ + id: child.id, + type: "task", + metadata: { parentSessionId: chat.id, sessionId: child.id }, + run: Effect.never, + }) + yield* jobs.start({ + id: grandchild.id, + type: "task", + metadata: { parentSessionId: child.id, sessionId: grandchild.id }, + run: Effect.never, + }) + + yield* runState.cancel(chat.id) + + expect((yield* jobs.get(child.id))?.status).toBe("cancelled") + expect((yield* jobs.get(grandchild.id))?.status).toBe("cancelled") + }), + ) }) diff --git a/packages/opencode/test/tool/task_status.test.ts b/packages/opencode/test/tool/task_status.test.ts new file mode 100644 index 000000000000..23bd49c616c7 --- /dev/null +++ b/packages/opencode/test/tool/task_status.test.ts @@ -0,0 +1,92 @@ +import { afterEach, describe, expect } from "bun:test" +import { Effect, Layer } from "effect" +import { Agent } from "@/agent/agent" +import { BackgroundJob } from "@/background/job" +import { Bus } from "@/bus" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { Session } from "@/session/session" +import { MessageID } from "@/session/schema" +import { SessionStatus } from "@/session/status" +import { TaskStatusTool } from "@/tool/task_status" +import { Truncate } from "@/tool/truncate" +import { RuntimeFlags } from "@/effect/runtime-flags" +import { disposeAllInstances } from "../fixture/fixture" +import { testEffect } from "../lib/effect" + +afterEach(async () => { + await disposeAllInstances() +}) + +const layer = (flags: Partial = {}) => + Layer.mergeAll( + Agent.defaultLayer, + BackgroundJob.defaultLayer, + Bus.defaultLayer, + CrossSpawnSpawner.defaultLayer, + Session.defaultLayer, + SessionStatus.defaultLayer, + Truncate.defaultLayer, + RuntimeFlags.layer(flags), + ) + +const it = testEffect(layer({ experimentalBackgroundSubagents: true })) + +describe("tool.task_status", () => { + it.instance("returns completed background job output", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const sessions = yield* Session.Service + const tool = yield* TaskStatusTool + const def = yield* tool.init() + const chat = yield* sessions.create({}) + + yield* jobs.start({ id: chat.id, type: "task", run: Effect.succeed("all done") }) + + const result = yield* def.execute( + { task_id: chat.id, wait: true, timeout_ms: 1_000 }, + { + sessionID: chat.id, + messageID: MessageID.ascending(), + agent: "build", + abort: new AbortController().signal, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + expect(result.output).toContain("state: completed") + expect(result.output).toContain("all done") + expect(result.metadata.timed_out).toBe(false) + }), + ) + + it.instance("wait=true times out while the background job is running", () => + Effect.gen(function* () { + const jobs = yield* BackgroundJob.Service + const sessions = yield* Session.Service + const tool = yield* TaskStatusTool + const def = yield* tool.init() + const chat = yield* sessions.create({}) + + yield* jobs.start({ id: chat.id, type: "task", run: Effect.never }) + + const result = yield* def.execute( + { task_id: chat.id, wait: true, timeout_ms: 50 }, + { + sessionID: chat.id, + messageID: MessageID.ascending(), + agent: "build", + abort: new AbortController().signal, + messages: [], + metadata: () => Effect.void, + ask: () => Effect.void, + }, + ) + + expect(result.output).toContain("state: running") + expect(result.output).toContain("Timed out after 50ms") + expect(result.metadata.timed_out).toBe(true) + }), + ) +}) diff --git a/packages/opencode/test/tool/tool-define.test.ts b/packages/opencode/test/tool/tool-define.test.ts index a291b9f7f972..ca351cca4867 100644 --- a/packages/opencode/test/tool/tool-define.test.ts +++ b/packages/opencode/test/tool/tool-define.test.ts @@ -1,11 +1,12 @@ -import { describe, test, expect } from "bun:test" -import { Effect, Layer, ManagedRuntime, Schema } from "effect" +import { describe, expect } from "bun:test" +import { Effect, Layer, Schema } from "effect" import { Agent } from "../../src/agent/agent" import { MessageID, SessionID } from "../../src/session/schema" import { Tool } from "@/tool/tool" import { Truncate } from "@/tool/truncate" +import { testEffect } from "../lib/effect" -const runtime = ManagedRuntime.make(Layer.mergeAll(Truncate.defaultLayer, Agent.defaultLayer)) +const it = testEffect(Layer.mergeAll(Truncate.defaultLayer, Agent.defaultLayer)) const params = Schema.Struct({ input: Schema.String }) @@ -21,49 +22,53 @@ function makeTool(id: string, executeFn?: () => void) { } describe("Tool.define", () => { - test("object-defined tool does not mutate the original init object", async () => { - const original = makeTool("test") - const originalExecute = original.execute + it.effect("object-defined tool does not mutate the original init object", () => + Effect.gen(function* () { + const original = makeTool("test") + const originalExecute = original.execute - const info = await runtime.runPromise(Tool.define("test-tool", Effect.succeed(original))) + const info = yield* Tool.define("test-tool", Effect.succeed(original)) - await Effect.runPromise(info.init()) - await Effect.runPromise(info.init()) - await Effect.runPromise(info.init()) + yield* info.init() + yield* info.init() + yield* info.init() - expect(original.execute).toBe(originalExecute) - }) + expect(original.execute).toBe(originalExecute) + }), + ) - test("effect-defined tool returns fresh objects and is unaffected", async () => { - const info = await runtime.runPromise( - Tool.define( + it.effect("effect-defined tool returns fresh objects and is unaffected", () => + Effect.gen(function* () { + const info = yield* Tool.define( "test-fn-tool", Effect.succeed(() => Effect.succeed(makeTool("test"))), - ), - ) + ) - const first = await Effect.runPromise(info.init()) - const second = await Effect.runPromise(info.init()) + const first = yield* info.init() + const second = yield* info.init() - expect(first).not.toBe(second) - }) + expect(first).not.toBe(second) + }), + ) - test("object-defined tool returns distinct objects per init() call", async () => { - const info = await runtime.runPromise(Tool.define("test-copy", Effect.succeed(makeTool("test")))) + it.effect("object-defined tool returns distinct objects per init() call", () => + Effect.gen(function* () { + const info = yield* Tool.define("test-copy", Effect.succeed(makeTool("test"))) - const first = await Effect.runPromise(info.init()) - const second = await Effect.runPromise(info.init()) + const first = yield* info.init() + const second = yield* info.init() - expect(first).not.toBe(second) - }) + expect(first).not.toBe(second) + }), + ) - test("execute receives decoded parameters", async () => { - const parameters = Schema.Struct({ - count: Schema.NumberFromString.pipe(Schema.optional, Schema.withDecodingDefaultType(Effect.succeed(5))), - }) - const calls: Array> = [] - const info = await runtime.runPromise( - Tool.define( + it.effect("execute receives decoded parameters", () => + Effect.gen(function* () { + const parameters = Schema.Struct({ + count: Schema.NumberFromString.pipe(Schema.optional, Schema.withDecodingDefaultType(Effect.succeed(5))), + }) + const calls: Array> = [] + const info = yield* Tool.define( "test-decoded", Effect.succeed({ description: "test tool", @@ -73,27 +78,27 @@ describe("Tool.define", () => { return Effect.succeed({ title: "test", output: "ok", metadata: { truncated: false } }) }, }), - ), - ) - const ctx: Tool.Context = { - sessionID: SessionID.descending(), - messageID: MessageID.ascending(), - agent: "build", - abort: new AbortController().signal, - messages: [], - metadata() { - return Effect.void - }, - ask() { - return Effect.void - }, - } - const tool = await Effect.runPromise(info.init()) - const execute = tool.execute as unknown as (args: unknown, ctx: Tool.Context) => ReturnType - - await Effect.runPromise(execute({}, ctx)) - await Effect.runPromise(execute({ count: "7" }, ctx)) - - expect(calls).toEqual([{ count: 5 }, { count: 7 }]) - }) + ) + const ctx: Tool.Context = { + sessionID: SessionID.descending(), + messageID: MessageID.ascending(), + agent: "build", + abort: new AbortController().signal, + messages: [], + metadata() { + return Effect.void + }, + ask() { + return Effect.void + }, + } + const tool = yield* info.init() + const execute = tool.execute as unknown as (args: unknown, ctx: Tool.Context) => ReturnType + + yield* execute({}, ctx) + yield* execute({ count: "7" }, ctx) + + expect(calls).toEqual([{ count: 5 }, { count: 7 }]) + }), + ) }) diff --git a/packages/opencode/test/tool/truncation.test.ts b/packages/opencode/test/tool/truncation.test.ts index e948a6dcb31c..804bbd67266a 100644 --- a/packages/opencode/test/tool/truncation.test.ts +++ b/packages/opencode/test/tool/truncation.test.ts @@ -1,11 +1,11 @@ import { describe, test, expect } from "bun:test" import { NodeFileSystem } from "@effect/platform-node" +import { AppFileSystem } from "@opencode-ai/core/filesystem" import { Effect, FileSystem, Layer } from "effect" import { Truncate } from "@/tool/truncate" import { Config } from "@/config/config" import { Identifier } from "../../src/id/id" import { Process } from "@/util/process" -import { Filesystem } from "@/util/filesystem" import path from "path" import { testEffect } from "../lib/effect" import { writeFileStringScoped } from "../lib/filesystem" @@ -14,10 +14,15 @@ import { TestConfig } from "../fixture/config" const FIXTURES_DIR = path.join(import.meta.dir, "fixtures") const ROOT = path.resolve(import.meta.dir, "..", "..") -const it = testEffect(Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer)) +const it = testEffect(Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer, AppFileSystem.defaultLayer)) const configuredLayer = (cfg: Config.Info) => - Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer, TestConfig.layer({ get: () => Effect.succeed(cfg) })) + Layer.mergeAll( + Truncate.defaultLayer, + NodeFileSystem.layer, + AppFileSystem.defaultLayer, + TestConfig.layer({ get: () => Effect.succeed(cfg) }), + ) const configuredIt = (cfg: Config.Info) => testEffect(configuredLayer(cfg)) describe("Truncate", () => { @@ -25,7 +30,8 @@ describe("Truncate", () => { it.live("truncates large json file by bytes", () => Effect.gen(function* () { const svc = yield* Truncate.Service - const content = yield* Effect.promise(() => Filesystem.readText(path.join(FIXTURES_DIR, "models-api.json"))) + const fsys = yield* AppFileSystem.Service + const content = yield* fsys.readFileString(path.join(FIXTURES_DIR, "models-api.json")) const result = yield* svc.output(content) expect(result.truncated).toBe(true) @@ -158,7 +164,8 @@ describe("Truncate", () => { it.live("large single-line file truncates with byte message", () => Effect.gen(function* () { const svc = yield* Truncate.Service - const content = yield* Effect.promise(() => Filesystem.readText(path.join(FIXTURES_DIR, "models-api.json"))) + const fsys = yield* AppFileSystem.Service + const content = yield* fsys.readFileString(path.join(FIXTURES_DIR, "models-api.json")) const result = yield* svc.output(content) expect(result.truncated).toBe(true) @@ -180,7 +187,8 @@ describe("Truncate", () => { expect(result.outputPath).toBeDefined() expect(result.outputPath).toContain("tool_") - const written = yield* Effect.promise(() => Filesystem.readText(result.outputPath!)) + const fsys = yield* AppFileSystem.Service + const written = yield* fsys.readFileString(result.outputPath!) expect(written).toBe(lines) }), ) diff --git a/packages/opencode/test/tool/webfetch.test.ts b/packages/opencode/test/tool/webfetch.test.ts index f3890c016170..fdf5210b9c13 100644 --- a/packages/opencode/test/tool/webfetch.test.ts +++ b/packages/opencode/test/tool/webfetch.test.ts @@ -1,15 +1,14 @@ -import { describe, expect, test } from "bun:test" -import path from "path" +import { describe, expect } from "bun:test" import { Effect, Layer } from "effect" import { FetchHttpClient } from "effect/unstable/http" import { Agent } from "../../src/agent/agent" import { Truncate } from "@/tool/truncate" -import { Instance } from "../../src/project/instance" -import { WithInstance } from "../../src/project/with-instance" import { WebFetchTool } from "../../src/tool/webfetch" import { SessionID, MessageID } from "../../src/session/schema" +import { Tool } from "@/tool/tool" +import { testEffect } from "../lib/effect" -const projectRoot = path.join(import.meta.dir, "../..") +const it = testEffect(Layer.mergeAll(FetchHttpClient.layer, Truncate.defaultLayer, Agent.defaultLayer)) const ctx = { sessionID: SessionID.make("ses_test"), @@ -22,30 +21,31 @@ const ctx = { ask: () => Effect.void, } -async function withFetch(fetch: (req: Request) => Response | Promise, fn: (url: URL) => Promise) { - using server = Bun.serve({ port: 0, fetch }) - await fn(server.url) -} - -function exec(args: { url: string; format: "text" | "markdown" | "html" }) { - return WebFetchTool.pipe( - Effect.flatMap((info) => info.init()), - Effect.flatMap((tool) => tool.execute(args, ctx)), - Effect.provide(Layer.mergeAll(FetchHttpClient.layer, Truncate.defaultLayer, Agent.defaultLayer)), - Effect.runPromise, +const withFetch = ( + fetch: (req: Request) => Response | Promise, + fn: (url: URL) => Effect.Effect, +) => + Effect.acquireUseRelease( + Effect.sync(() => Bun.serve({ port: 0, fetch })), + (server) => fn(server.url), + (server) => Effect.sync(() => server.stop(true)), ) -} + +const exec = Effect.fn("WebFetchToolTest.exec")(function* (args: Tool.InferParameters) { + const info = yield* WebFetchTool + const tool = yield* info.init() + return yield* tool.execute(args, ctx) +}) describe("tool.webfetch", () => { - test("returns image responses as file attachments", async () => { - const bytes = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]) - await withFetch( - () => new Response(bytes, { status: 200, headers: { "content-type": "IMAGE/PNG; charset=binary" } }), - async (url) => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const result = await exec({ url: new URL("/image.png", url).toString(), format: "markdown" }) + it.instance("returns image responses as file attachments", () => + Effect.gen(function* () { + const bytes = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]) + yield* withFetch( + () => new Response(bytes, { status: 200, headers: { "content-type": "IMAGE/PNG; charset=binary" } }), + (url) => + Effect.gen(function* () { + const result = yield* exec({ url: new URL("/image.png", url).toString(), format: "markdown" }) expect(result.output).toBe("Image fetched successfully") expect(result.attachments).toBeDefined() expect(result.attachments?.length).toBe(1) @@ -55,50 +55,59 @@ describe("tool.webfetch", () => { expect(result.attachments?.[0]).not.toHaveProperty("id") expect(result.attachments?.[0]).not.toHaveProperty("sessionID") expect(result.attachments?.[0]).not.toHaveProperty("messageID") - }, - }) - }, - ) - }) + }), + ) + }), + ) - test("keeps svg as text output", async () => { - const svg = 'hello' - await withFetch( + it.instance("keeps svg as text output", () => + withFetch( () => - new Response(svg, { + new Response('hello', { status: 200, headers: { "content-type": "image/svg+xml; charset=UTF-8" }, }), - async (url) => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const result = await exec({ url: new URL("/image.svg", url).toString(), format: "html" }) - expect(result.output).toContain(" + Effect.gen(function* () { + const result = yield* exec({ url: new URL("/image.svg", url).toString(), format: "html" }) + expect(result.output).toContain(" { - await withFetch( + it.instance("keeps text responses as text output", () => + withFetch( () => new Response("hello from webfetch", { status: 200, headers: { "content-type": "text/plain; charset=utf-8" }, }), - async (url) => { - await WithInstance.provide({ - directory: projectRoot, - fn: async () => { - const result = await exec({ url: new URL("/file.txt", url).toString(), format: "text" }) - expect(result.output).toBe("hello from webfetch") - expect(result.attachments).toBeUndefined() + (url) => + Effect.gen(function* () { + const result = yield* exec({ url: new URL("/file.txt", url).toString(), format: "text" }) + expect(result.output).toBe("hello from webfetch") + expect(result.attachments).toBeUndefined() + }), + ), + ) + + it.instance("extracts text from html without scripts or styles", () => + withFetch( + () => + new Response( + "Hello world", + { + status: 200, + headers: { "content-type": "text/html; charset=utf-8" }, }, - }) - }, - ) - }) + ), + (url) => + Effect.gen(function* () { + const result = yield* exec({ url: new URL("/page.html", url).toString(), format: "text" }) + expect(result.output).toBe("Hello world") + expect(result.attachments).toBeUndefined() + }), + ), + ) }) diff --git a/packages/opencode/test/tool/websearch.test.ts b/packages/opencode/test/tool/websearch.test.ts index 591b385fdc53..b8edc2dc2fd4 100644 --- a/packages/opencode/test/tool/websearch.test.ts +++ b/packages/opencode/test/tool/websearch.test.ts @@ -4,6 +4,7 @@ import { parseResponse } from "../../src/tool/mcp-websearch" import { selectWebSearchProvider, webSearchModelName, webSearchProviderLabel } from "../../src/tool/websearch" import { ProviderID } from "../../src/provider/schema" import { webSearchEnabled } from "../../src/tool/registry" +import { it } from "../lib/effect" const SESSION_ID = "ses_0196aabbccddeeff001122334455" @@ -74,17 +75,24 @@ describe("websearch MCP response parser", () => { }, }) - test("parses plain JSON-RPC responses", async () => { - await expect(Effect.runPromise(parseResponse(payload))).resolves.toBe("search results") - }) + it.effect("parses plain JSON-RPC responses", () => + Effect.gen(function* () { + const result = yield* parseResponse(payload) + expect(result).toBe("search results") + }), + ) - test("parses SSE JSON-RPC responses", async () => { - await expect(Effect.runPromise(parseResponse(`event: message\ndata: ${payload}\n\n`))).resolves.toBe( - "search results", - ) - }) + it.effect("parses SSE JSON-RPC responses", () => + Effect.gen(function* () { + const result = yield* parseResponse(`event: message\ndata: ${payload}\n\n`) + expect(result).toBe("search results") + }), + ) - test("ignores non-JSON SSE data frames", async () => { - await expect(Effect.runPromise(parseResponse(`data: [DONE]\ndata: ${payload}\n\n`))).resolves.toBe("search results") - }) + it.effect("ignores non-JSON SSE data frames", () => + Effect.gen(function* () { + const result = yield* parseResponse(`data: [DONE]\ndata: ${payload}\n\n`) + expect(result).toBe("search results") + }), + ) }) diff --git a/packages/opencode/test/util/effect-zod.test.ts b/packages/opencode/test/util/effect-zod.test.ts deleted file mode 100644 index ab3923d8e0a5..000000000000 --- a/packages/opencode/test/util/effect-zod.test.ts +++ /dev/null @@ -1,754 +0,0 @@ -import { describe, expect, test } from "bun:test" -import { Effect, Schema, SchemaGetter } from "effect" -import z from "zod" - -import { zod, ZodOverride } from "@opencode-ai/core/effect-zod" - -function json(schema: z.ZodTypeAny) { - const { $schema: _, ...rest } = z.toJSONSchema(schema) - return rest -} - -describe("util.effect-zod", () => { - test("converts class schemas for route dto shapes", () => { - class Method extends Schema.Class("ProviderAuthMethod")({ - type: Schema.Union([Schema.Literal("oauth"), Schema.Literal("api")]), - label: Schema.String, - }) {} - - const out = zod(Method) - - expect(out.meta()?.ref).toBe("ProviderAuthMethod") - expect( - out.parse({ - type: "oauth", - label: "OAuth", - }), - ).toEqual({ - type: "oauth", - label: "OAuth", - }) - }) - - test("converts structs with optional fields, arrays, and records", () => { - const out = zod( - Schema.Struct({ - foo: Schema.optional(Schema.String), - bar: Schema.Array(Schema.Number), - baz: Schema.Record(Schema.String, Schema.Boolean), - }), - ) - - expect( - out.parse({ - bar: [1, 2], - baz: { ok: true }, - }), - ).toEqual({ - bar: [1, 2], - baz: { ok: true }, - }) - expect( - out.parse({ - foo: "hi", - bar: [1], - baz: { ok: false }, - }), - ).toEqual({ - foo: "hi", - bar: [1], - baz: { ok: false }, - }) - }) - - describe("Tuples", () => { - test("fixed-length tuple parses matching array", () => { - const out = zod(Schema.Tuple([Schema.String, Schema.Number])) - expect(out.parse(["a", 1])).toEqual(["a", 1]) - expect(out.safeParse(["a"]).success).toBe(false) - expect(out.safeParse(["a", "b"]).success).toBe(false) - }) - - test("single-element tuple parses a one-element array", () => { - const out = zod(Schema.Tuple([Schema.Boolean])) - expect(out.parse([true])).toEqual([true]) - expect(out.safeParse([true, false]).success).toBe(false) - }) - - test("tuple inside a union picks the right branch", () => { - const out = zod(Schema.Union([Schema.String, Schema.Tuple([Schema.String, Schema.Number])])) - expect(out.parse("hello")).toBe("hello") - expect(out.parse(["foo", 42])).toEqual(["foo", 42]) - expect(out.safeParse(["foo"]).success).toBe(false) - }) - - test("plain arrays still work (no element positions)", () => { - const out = zod(Schema.Array(Schema.String)) - expect(out.parse(["a", "b", "c"])).toEqual(["a", "b", "c"]) - expect(out.parse([])).toEqual([]) - }) - }) - - test("string literal unions produce z.enum with enum in JSON Schema", () => { - const Action = Schema.Literals(["allow", "deny", "ask"]) - const out = zod(Action) - - expect(out.parse("allow")).toBe("allow") - expect(out.parse("deny")).toBe("deny") - expect(() => out.parse("nope")).toThrow() - - // Matches native z.enum JSON Schema output - const bridged = json(out) - const native = json(z.enum(["allow", "deny", "ask"])) - expect(bridged).toEqual(native) - expect(bridged.enum).toEqual(["allow", "deny", "ask"]) - }) - - test("ZodOverride annotation provides the Zod schema for branded IDs", () => { - const override = z.string().startsWith("per") - const ID = Schema.String.annotate({ [ZodOverride]: override }).pipe(Schema.brand("TestID")) - - const Parent = Schema.Struct({ id: ID, name: Schema.String }) - const out = zod(Parent) - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - expect((out as any).parse({ id: "per_abc", name: "test" })).toEqual({ id: "per_abc", name: "test" }) - - const schema = json(out) as any - expect(schema.properties.id).toEqual({ type: "string", pattern: "^per.*" }) - }) - - test("Schema.Class nested in a parent preserves ref via identifier", () => { - class Inner extends Schema.Class("MyInner")({ - value: Schema.String, - }) {} - - class Outer extends Schema.Class("MyOuter")({ - inner: Inner, - }) {} - - const out = zod(Outer) - expect(out.meta()?.ref).toBe("MyOuter") - - const shape = (out as any).shape ?? (out as any)._def?.shape?.() - expect(shape.inner.meta()?.ref).toBe("MyInner") - }) - - test("Schema.Class preserves identifier and uses enum format", () => { - class Rule extends Schema.Class("PermissionRule")({ - permission: Schema.String, - pattern: Schema.String, - action: Schema.Literals(["allow", "deny", "ask"]), - }) {} - - const out = zod(Rule) - expect(out.meta()?.ref).toBe("PermissionRule") - - const schema = json(out) as any - expect(schema.properties.action).toEqual({ - type: "string", - enum: ["allow", "deny", "ask"], - }) - }) - - test("ZodOverride on ID carries pattern through Schema.Class", () => { - const ID = Schema.String.annotate({ - [ZodOverride]: z.string().startsWith("per"), - }) - - class Request extends Schema.Class("TestRequest")({ - id: ID, - name: Schema.String, - }) {} - - const schema = json(zod(Request)) as any - expect(schema.properties.id).toEqual({ type: "string", pattern: "^per.*" }) - expect(schema.properties.name).toEqual({ type: "string" }) - }) - - test("Permission schemas match original Zod equivalents", () => { - const MsgID = Schema.String.annotate({ [ZodOverride]: z.string().startsWith("msg") }) - const PerID = Schema.String.annotate({ [ZodOverride]: z.string().startsWith("per") }) - const SesID = Schema.String.annotate({ [ZodOverride]: z.string().startsWith("ses") }) - - class Tool extends Schema.Class("PermissionTool")({ - messageID: MsgID, - callID: Schema.String, - }) {} - - class Request extends Schema.Class("PermissionRequest")({ - id: PerID, - sessionID: SesID, - permission: Schema.String, - patterns: Schema.Array(Schema.String), - metadata: Schema.Record(Schema.String, Schema.Unknown), - always: Schema.Array(Schema.String), - tool: Schema.optional(Tool), - }) {} - - const bridged = json(zod(Request)) as any - expect(bridged.properties.id).toEqual({ type: "string", pattern: "^per.*" }) - expect(bridged.properties.sessionID).toEqual({ type: "string", pattern: "^ses.*" }) - expect(bridged.properties.permission).toEqual({ type: "string" }) - expect(bridged.required?.sort()).toEqual(["id", "sessionID", "permission", "patterns", "metadata", "always"].sort()) - - // Tool field is present with the ref from Schema.Class identifier - const toolSchema = json(zod(Tool)) as any - expect(toolSchema.properties.messageID).toEqual({ type: "string", pattern: "^msg.*" }) - expect(toolSchema.properties.callID).toEqual({ type: "string" }) - }) - - test("ZodOverride survives Schema.brand", () => { - const override = z.string().startsWith("ses") - const ID = Schema.String.annotate({ [ZodOverride]: override }).pipe(Schema.brand("SessionID")) - - // The branded schema's AST still has the override - class Parent extends Schema.Class("Parent")({ - sessionID: ID, - }) {} - - const schema = json(zod(Parent)) as any - expect(schema.properties.sessionID).toEqual({ type: "string", pattern: "^ses.*" }) - }) - - describe("Schema.check translation", () => { - test("filter returning string triggers refinement with that message", () => { - const isEven = Schema.makeFilter((n: number) => (n % 2 === 0 ? undefined : "expected an even number")) - const schema = zod(Schema.Number.check(isEven)) - - expect(schema.parse(4)).toBe(4) - const result = schema.safeParse(3) - expect(result.success).toBe(false) - expect(result.error!.issues[0].message).toBe("expected an even number") - }) - - test("filter returning false triggers refinement with fallback message", () => { - const nonEmpty = Schema.makeFilter((s: string) => s.length > 0) - const schema = zod(Schema.String.check(nonEmpty)) - - expect(schema.parse("hi")).toBe("hi") - const result = schema.safeParse("") - expect(result.success).toBe(false) - expect(result.error!.issues[0].message).toMatch(/./) - }) - - test("filter returning undefined passes validation", () => { - const alwaysOk = Schema.makeFilter(() => undefined) - const schema = zod(Schema.Number.check(alwaysOk)) - - expect(schema.parse(42)).toBe(42) - }) - - test("annotations.message on the filter is used when filter returns false", () => { - const positive = Schema.makeFilter((n: number) => n > 0, { message: "must be positive" }) - const schema = zod(Schema.Number.check(positive)) - - const result = schema.safeParse(-1) - expect(result.success).toBe(false) - expect(result.error!.issues[0].message).toBe("must be positive") - }) - - test("cross-field check on a record flags missing key", () => { - const hasKey = Schema.makeFilter((data: Record) => - "required" in data ? undefined : "missing 'required' key", - ) - const schema = zod(Schema.Record(Schema.String, Schema.Struct({ enabled: Schema.Boolean })).check(hasKey)) - - expect(schema.parse({ required: { enabled: true } })).toEqual({ - required: { enabled: true }, - }) - - const result = schema.safeParse({ other: { enabled: true } }) - expect(result.success).toBe(false) - expect(result.error!.issues[0].message).toBe("missing 'required' key") - }) - }) - - describe("StructWithRest / catchall", () => { - test("struct with a string-keyed record rest parses known AND extra keys", () => { - const schema = zod( - Schema.StructWithRest( - Schema.Struct({ - apiKey: Schema.optional(Schema.String), - baseURL: Schema.optional(Schema.String), - }), - [Schema.Record(Schema.String, Schema.Unknown)], - ), - ) - - // Known fields come through as declared - expect(schema.parse({ apiKey: "sk-x" })).toEqual({ apiKey: "sk-x" }) - - // Extra keys are preserved (catchall) - expect( - schema.parse({ - apiKey: "sk-x", - baseURL: "https://api.example.com", - customField: "anything", - nested: { foo: 1 }, - }), - ).toEqual({ - apiKey: "sk-x", - baseURL: "https://api.example.com", - customField: "anything", - nested: { foo: 1 }, - }) - }) - - test("catchall value type constrains the extras", () => { - const schema = zod( - Schema.StructWithRest( - Schema.Struct({ - count: Schema.Number, - }), - [Schema.Record(Schema.String, Schema.Number)], - ), - ) - - // Known field + numeric extras - expect(schema.parse({ count: 10, a: 1, b: 2 })).toEqual({ count: 10, a: 1, b: 2 }) - - // Non-numeric extra is rejected - expect(schema.safeParse({ count: 10, bad: "not a number" }).success).toBe(false) - }) - - test("JSON schema output marks additionalProperties appropriately", () => { - const schema = zod( - Schema.StructWithRest( - Schema.Struct({ - id: Schema.String, - }), - [Schema.Record(Schema.String, Schema.Unknown)], - ), - ) - const shape = json(schema) as { additionalProperties?: unknown } - // Presence of `additionalProperties` (truthy or a schema) signals catchall. - expect(shape.additionalProperties).not.toBe(false) - expect(shape.additionalProperties).toBeDefined() - }) - - test("plain struct without rest still emits additionalProperties unchanged (regression)", () => { - const schema = zod(Schema.Struct({ id: Schema.String })) - expect(schema.parse({ id: "x" })).toEqual({ id: "x" }) - }) - }) - - describe("transforms (Schema.decodeTo)", () => { - test("Number -> pseudo-Duration (seconds) applies the decode function", () => { - // Models the account/account.ts DurationFromSeconds pattern. - const SecondsToMs = Schema.Number.pipe( - Schema.decodeTo(Schema.Number, { - decode: SchemaGetter.transform((n: number) => n * 1000), - encode: SchemaGetter.transform((ms: number) => ms / 1000), - }), - ) - - const schema = zod(SecondsToMs) - expect(schema.parse(3)).toBe(3000) - expect(schema.parse(0)).toBe(0) - }) - - test("String -> Number via parseInt decode", () => { - const ParsedInt = Schema.String.pipe( - Schema.decodeTo(Schema.Number, { - decode: SchemaGetter.transform((s: string) => Number.parseInt(s, 10)), - encode: SchemaGetter.transform((n: number) => String(n)), - }), - ) - - const schema = zod(ParsedInt) - expect(schema.parse("42")).toBe(42) - expect(schema.parse("0")).toBe(0) - }) - - test("transform inside a struct field applies per-field", () => { - const Field = Schema.Number.pipe( - Schema.decodeTo(Schema.Number, { - decode: SchemaGetter.transform((n: number) => n + 1), - encode: SchemaGetter.transform((n: number) => n - 1), - }), - ) - - const schema = zod( - Schema.Struct({ - plain: Schema.Number, - bumped: Field, - }), - ) - - expect(schema.parse({ plain: 5, bumped: 10 })).toEqual({ plain: 5, bumped: 11 }) - }) - - test("chained decodeTo composes transforms in order", () => { - // String -> Number (parseInt) -> Number (doubled). - // Exercises the encoded() reduce, not just a single link. - const Chained = Schema.String.pipe( - Schema.decodeTo(Schema.Number, { - decode: SchemaGetter.transform((s: string) => Number.parseInt(s, 10)), - encode: SchemaGetter.transform((n: number) => String(n)), - }), - Schema.decodeTo(Schema.Number, { - decode: SchemaGetter.transform((n: number) => n * 2), - encode: SchemaGetter.transform((n: number) => n / 2), - }), - ) - - const schema = zod(Chained) - expect(schema.parse("21")).toBe(42) - expect(schema.parse("0")).toBe(0) - }) - - test("Schema.Class is unaffected by transform walker (returns plain object, not instance)", () => { - // Schema.Class uses Declaration + encoding under the hood to construct - // class instances. The walker must NOT apply that transform, or zod - // parsing would return class instances instead of plain objects. - class Method extends Schema.Class("TxTestMethod")({ - type: Schema.String, - value: Schema.Number, - }) {} - - const schema = zod(Method) - const parsed = schema.parse({ type: "oauth", value: 1 }) - expect(parsed).toEqual({ type: "oauth", value: 1 }) - // Guardrail: ensure we didn't get back a Method instance. - expect(parsed).not.toBeInstanceOf(Method) - }) - }) - - describe("optimizations", () => { - test("walk() memoizes by AST identity — same AST node returns same Zod", () => { - const shared = Schema.Struct({ id: Schema.String, name: Schema.String }) - const left = zod(shared) - const right = zod(shared) - expect(left).toBe(right) - }) - - test("nested reuse of the same AST reuses the cached Zod child", () => { - // Two different parents embed the same inner schema. The inner zod - // child should be identical by reference inside both parents. - class Inner extends Schema.Class("MemoTestInner")({ - value: Schema.String, - }) {} - - class OuterA extends Schema.Class("MemoTestOuterA")({ - inner: Inner, - }) {} - - class OuterB extends Schema.Class("MemoTestOuterB")({ - inner: Inner, - }) {} - - const shapeA = (zod(OuterA) as any).shape ?? (zod(OuterA) as any)._def?.shape?.() - const shapeB = (zod(OuterB) as any).shape ?? (zod(OuterB) as any)._def?.shape?.() - expect(shapeA.inner).toBe(shapeB.inner) - }) - - test("multiple checks run in a single refinement layer (all fire on one value)", () => { - // Three checks attached to the same schema. All three must run and - // report — asserting that no check silently got dropped when we - // flattened into one superRefine. - const positive = Schema.makeFilter((n: number) => (n > 0 ? undefined : "not positive")) - const even = Schema.makeFilter((n: number) => (n % 2 === 0 ? undefined : "not even")) - const under100 = Schema.makeFilter((n: number) => (n < 100 ? undefined : "too big")) - - const schema = zod(Schema.Number.check(positive).check(even).check(under100)) - - const neg = schema.safeParse(-3) - expect(neg.success).toBe(false) - expect(neg.error!.issues.map((i) => i.message)).toEqual(expect.arrayContaining(["not positive", "not even"])) - - const big = schema.safeParse(101) - expect(big.success).toBe(false) - expect(big.error!.issues.map((i) => i.message)).toContain("too big") - - // Passing value satisfies all three - expect(schema.parse(42)).toBe(42) - }) - - test("FilterGroup flattens into the single refinement layer alongside its siblings", () => { - const positive = Schema.makeFilter((n: number) => (n > 0 ? undefined : "not positive")) - const even = Schema.makeFilter((n: number) => (n % 2 === 0 ? undefined : "not even")) - const group = Schema.makeFilterGroup([positive, even]) - const under100 = Schema.makeFilter((n: number) => (n < 100 ? undefined : "too big")) - - const schema = zod(Schema.Number.check(group).check(under100)) - - const bad = schema.safeParse(-3) - expect(bad.success).toBe(false) - expect(bad.error!.issues.map((i) => i.message)).toEqual(expect.arrayContaining(["not positive", "not even"])) - }) - }) - - describe("well-known refinement translation", () => { - test("Schema.isInt emits type: integer in JSON Schema", () => { - const schema = zod(Schema.Number.check(Schema.isInt())) - const native = json(z.number().int()) - expect(json(schema)).toEqual(native) - expect(schema.parse(3)).toBe(3) - expect(schema.safeParse(1.5).success).toBe(false) - }) - - test("Schema.isGreaterThan(0) emits exclusiveMinimum: 0", () => { - const schema = zod(Schema.Number.check(Schema.isGreaterThan(0))) - expect((json(schema) as any).exclusiveMinimum).toBe(0) - expect(schema.parse(1)).toBe(1) - expect(schema.safeParse(0).success).toBe(false) - expect(schema.safeParse(-1).success).toBe(false) - }) - - test("Schema.isGreaterThanOrEqualTo(0) emits minimum: 0", () => { - const schema = zod(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))) - expect((json(schema) as any).minimum).toBe(0) - expect(schema.parse(0)).toBe(0) - expect(schema.safeParse(-1).success).toBe(false) - }) - - test("Schema.isLessThan(10) emits exclusiveMaximum: 10", () => { - const schema = zod(Schema.Number.check(Schema.isLessThan(10))) - expect((json(schema) as any).exclusiveMaximum).toBe(10) - expect(schema.parse(9)).toBe(9) - expect(schema.safeParse(10).success).toBe(false) - }) - - test("Schema.isLessThanOrEqualTo(10) emits maximum: 10", () => { - const schema = zod(Schema.Number.check(Schema.isLessThanOrEqualTo(10))) - expect((json(schema) as any).maximum).toBe(10) - expect(schema.parse(10)).toBe(10) - expect(schema.safeParse(11).success).toBe(false) - }) - - test("Schema.isMultipleOf(5) emits multipleOf: 5", () => { - const schema = zod(Schema.Number.check(Schema.isMultipleOf(5))) - expect((json(schema) as any).multipleOf).toBe(5) - expect(schema.parse(10)).toBe(10) - expect(schema.safeParse(7).success).toBe(false) - }) - - test("Schema.isFinite validates at runtime", () => { - const schema = zod(Schema.Number.check(Schema.isFinite())) - expect(schema.parse(1)).toBe(1) - expect(schema.safeParse(Infinity).success).toBe(false) - expect(schema.safeParse(NaN).success).toBe(false) - }) - - test("chained isInt + isGreaterThan(0) matches z.number().int().positive()", () => { - const schema = zod(Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0))) - const native = json(z.number().int().positive()) - expect(json(schema)).toEqual(native) - expect(schema.parse(3)).toBe(3) - expect(schema.safeParse(0).success).toBe(false) - expect(schema.safeParse(1.5).success).toBe(false) - }) - - test("chained isInt + isGreaterThanOrEqualTo(0) matches z.number().int().min(0)", () => { - const schema = zod(Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0))) - const native = json(z.number().int().min(0)) - expect(json(schema)).toEqual(native) - expect(schema.parse(0)).toBe(0) - expect(schema.safeParse(-1).success).toBe(false) - }) - - test("Schema.isBetween emits both bounds", () => { - const schema = zod(Schema.Number.check(Schema.isBetween({ minimum: 1, maximum: 10 }))) - const shape = json(schema) as any - expect(shape.minimum).toBe(1) - expect(shape.maximum).toBe(10) - expect(schema.parse(5)).toBe(5) - expect(schema.safeParse(11).success).toBe(false) - expect(schema.safeParse(0).success).toBe(false) - }) - - test("Schema.isBetween with exclusive bounds emits exclusiveMinimum/Maximum", () => { - const schema = zod( - Schema.Number.check( - Schema.isBetween({ minimum: 1, maximum: 10, exclusiveMinimum: true, exclusiveMaximum: true }), - ), - ) - const shape = json(schema) as any - expect(shape.exclusiveMinimum).toBe(1) - expect(shape.exclusiveMaximum).toBe(10) - expect(schema.parse(5)).toBe(5) - expect(schema.safeParse(1).success).toBe(false) - expect(schema.safeParse(10).success).toBe(false) - }) - - test("Schema.isInt32 (FilterGroup) produces integer bounds", () => { - const schema = zod(Schema.Number.check(Schema.isInt32())) - const shape = json(schema) as any - expect(shape.type).toBe("integer") - expect(shape.minimum).toBe(-2147483648) - expect(shape.maximum).toBe(2147483647) - expect(schema.parse(42)).toBe(42) - expect(schema.safeParse(1.5).success).toBe(false) - expect(schema.safeParse(2147483648).success).toBe(false) - }) - - test("Schema.isMinLength on string emits minLength", () => { - const schema = zod(Schema.String.check(Schema.isMinLength(3))) - expect((json(schema) as any).minLength).toBe(3) - expect(schema.parse("abc")).toBe("abc") - expect(schema.safeParse("ab").success).toBe(false) - }) - - test("Schema.isMaxLength on string emits maxLength", () => { - const schema = zod(Schema.String.check(Schema.isMaxLength(5))) - expect((json(schema) as any).maxLength).toBe(5) - expect(schema.parse("abcde")).toBe("abcde") - expect(schema.safeParse("abcdef").success).toBe(false) - }) - - test("Schema.isLengthBetween on string emits both bounds", () => { - const schema = zod(Schema.String.check(Schema.isLengthBetween(2, 4))) - const shape = json(schema) as any - expect(shape.minLength).toBe(2) - expect(shape.maxLength).toBe(4) - expect(schema.parse("abc")).toBe("abc") - expect(schema.safeParse("a").success).toBe(false) - expect(schema.safeParse("abcde").success).toBe(false) - }) - - test("Schema.isMinLength on array emits minItems", () => { - const schema = zod(Schema.Array(Schema.String).check(Schema.isMinLength(1))) - expect((json(schema) as any).minItems).toBe(1) - expect(schema.parse(["x"])).toEqual(["x"]) - expect(schema.safeParse([]).success).toBe(false) - }) - - test("Schema.isPattern emits pattern", () => { - const schema = zod(Schema.String.check(Schema.isPattern(/^per/))) - expect((json(schema) as any).pattern).toBe("^per") - expect(schema.parse("per_abc")).toBe("per_abc") - expect(schema.safeParse("abc").success).toBe(false) - }) - - test("Schema.isStartsWith matches native zod .startsWith() JSON Schema", () => { - const schema = zod(Schema.String.check(Schema.isStartsWith("per"))) - const native = json(z.string().startsWith("per")) - expect(json(schema)).toEqual(native) - expect(schema.parse("per_abc")).toBe("per_abc") - expect(schema.safeParse("abc").success).toBe(false) - }) - - test("Schema.isEndsWith matches native zod .endsWith() JSON Schema", () => { - const schema = zod(Schema.String.check(Schema.isEndsWith(".json"))) - const native = json(z.string().endsWith(".json")) - expect(json(schema)).toEqual(native) - expect(schema.parse("a.json")).toBe("a.json") - expect(schema.safeParse("a.txt").success).toBe(false) - }) - - test("Schema.isUUID emits format: uuid", () => { - const schema = zod(Schema.String.check(Schema.isUUID())) - expect((json(schema) as any).format).toBe("uuid") - }) - - test("mix of well-known and anonymous filters translates known and reroutes unknown to superRefine", () => { - // isInt is well-known (translates to .int()); the anonymous filter falls - // back to superRefine. - const notSeven = Schema.makeFilter((n: number) => (n !== 7 ? undefined : "no sevens allowed")) - const schema = zod(Schema.Number.check(Schema.isInt()).check(notSeven)) - - const shape = json(schema) as any - // Well-known translation is preserved — type is integer, not plain number - expect(shape.type).toBe("integer") - - // Runtime: both constraints fire - expect(schema.parse(3)).toBe(3) - expect(schema.safeParse(1.5).success).toBe(false) - const seven = schema.safeParse(7) - expect(seven.success).toBe(false) - expect(seven.error!.issues[0].message).toBe("no sevens allowed") - }) - - test("inside a struct field, well-known refinements propagate through", () => { - // Mirrors config.ts port: z.number().int().positive().optional() - const Port = Schema.optional(Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0))) - const schema = zod(Schema.Struct({ port: Port })) - const shape = json(schema) as any - expect(shape.properties.port.type).toBe("integer") - expect(shape.properties.port.exclusiveMinimum).toBe(0) - }) - }) - - describe("Schema.optionalWith defaults", () => { - test("parsing undefined returns the default value", () => { - const schema = zod( - Schema.Struct({ - mode: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("ctrl-x"))), - }), - ) - expect(schema.parse({})).toEqual({ mode: "ctrl-x" }) - expect(schema.parse({ mode: undefined })).toEqual({ mode: "ctrl-x" }) - }) - - test("parsing a real value returns that value (default does not fire)", () => { - const schema = zod( - Schema.Struct({ - mode: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("ctrl-x"))), - }), - ) - expect(schema.parse({ mode: "ctrl-y" })).toEqual({ mode: "ctrl-y" }) - }) - - test("default on a number field", () => { - const schema = zod( - Schema.Struct({ - count: Schema.Number.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed(42))), - }), - ) - expect(schema.parse({})).toEqual({ count: 42 }) - expect(schema.parse({ count: 7 })).toEqual({ count: 7 }) - }) - - test("multiple defaulted fields inside a struct", () => { - const schema = zod( - Schema.Struct({ - leader: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("ctrl-x"))), - quit: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("ctrl-c"))), - inner: Schema.String, - }), - ) - expect(schema.parse({ inner: "hi" })).toEqual({ - leader: "ctrl-x", - quit: "ctrl-c", - inner: "hi", - }) - expect(schema.parse({ leader: "a", quit: "b", inner: "c" })).toEqual({ - leader: "a", - quit: "b", - inner: "c", - }) - }) - - test("JSON Schema output includes the default key", () => { - const schema = zod( - Schema.Struct({ - mode: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("ctrl-x"))), - }), - ) - const shape = json(schema) as any - expect(shape.properties.mode.default).toBe("ctrl-x") - }) - - test("default referencing a computed value resolves when evaluated", () => { - // Simulates `keybinds.ts` style of per-platform defaults: the default is - // produced by an Effect that computes a value at decode time. - const platform = "darwin" - const fallback = platform === "darwin" ? "cmd-k" : "ctrl-k" - const schema = zod( - Schema.Struct({ - command_palette: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.sync(() => fallback))), - }), - ) - expect(schema.parse({})).toEqual({ command_palette: "cmd-k" }) - const shape = json(schema) as any - expect(shape.properties.command_palette.default).toBe("cmd-k") - }) - - test("plain Schema.optional (no default) still emits .optional() (regression)", () => { - const schema = zod(Schema.Struct({ foo: Schema.optional(Schema.String) })) - expect(schema.parse({})).toEqual({}) - expect(schema.parse({ foo: "hi" })).toEqual({ foo: "hi" }) - }) - }) -}) diff --git a/packages/opencode/test/util/error.test.ts b/packages/opencode/test/util/error.test.ts index e7a02d6151e3..fdb559a231f2 100644 --- a/packages/opencode/test/util/error.test.ts +++ b/packages/opencode/test/util/error.test.ts @@ -1,5 +1,7 @@ import { describe, expect, test } from "bun:test" +import { NamedError } from "@opencode-ai/core/util/error" import { errorData, errorFormat, errorMessage } from "../../src/util/error" +import { MessageError } from "../../src/session/message-error" describe("util.error", () => { test("formats native Error instances", () => { @@ -48,4 +50,15 @@ describe("util.error", () => { expect(data.message).toBe("ResolveMessage: Cannot resolve module") expect(String(data.formatted)).toContain("ResolveMessage") }) + + test("schema-backed named errors are real NamedError instances", () => { + const error = new MessageError.AuthError({ providerID: "anthropic", message: "boom" }) + + expect(error).toBeInstanceOf(NamedError) + expect(error.toObject()).toEqual({ name: "ProviderAuthError", data: { providerID: "anthropic", message: "boom" } }) + }) + + test("named errors without fields serialize data", () => { + expect(new MessageError.OutputLengthError({}).toObject()).toEqual({ name: "MessageOutputLengthError", data: {} }) + }) }) diff --git a/packages/opencode/test/util/lock.test.ts b/packages/opencode/test/util/lock.test.ts deleted file mode 100644 index 79fbb583162e..000000000000 --- a/packages/opencode/test/util/lock.test.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { describe, expect, test } from "bun:test" -import { Lock } from "@/util/lock" - -function tick() { - return new Promise((r) => queueMicrotask(r)) -} - -async function flush(n = 5) { - for (let i = 0; i < n; i++) await tick() -} - -describe("util.lock", () => { - test("writer exclusivity: blocks reads and other writes while held", async () => { - const key = "lock:" + Math.random().toString(36).slice(2) - - const state = { - writer2: false, - reader: false, - writers: 0, - } - - // Acquire writer1 - using writer1 = await Lock.write(key) - state.writers++ - expect(state.writers).toBe(1) - - // Start writer2 candidate (should block) - const writer2Task = (async () => { - const w = await Lock.write(key) - state.writers++ - expect(state.writers).toBe(1) - state.writer2 = true - // Hold for a tick so reader cannot slip in - await tick() - return w - })() - - // Start reader candidate (should block) - const readerTask = (async () => { - const r = await Lock.read(key) - state.reader = true - return r - })() - - // Flush microtasks and assert neither acquired - await flush() - expect(state.writer2).toBe(false) - expect(state.reader).toBe(false) - - // Release writer1 - writer1[Symbol.dispose]() - state.writers-- - - // writer2 should acquire next - const writer2 = await writer2Task - expect(state.writer2).toBe(true) - - // Reader still blocked while writer2 held - await flush() - expect(state.reader).toBe(false) - - // Release writer2 - writer2[Symbol.dispose]() - state.writers-- - - // Reader should now acquire - const reader = await readerTask - expect(state.reader).toBe(true) - - reader[Symbol.dispose]() - }) -}) diff --git a/packages/opencode/test/util/log.test.ts b/packages/opencode/test/util/log.test.ts index 486ca0f3b644..62dc1d61c2ab 100644 --- a/packages/opencode/test/util/log.test.ts +++ b/packages/opencode/test/util/log.test.ts @@ -1,44 +1,77 @@ -import { afterEach, expect, test } from "bun:test" +import { expect } from "bun:test" +import { Effect } from "effect" import fs from "fs/promises" import path from "path" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { Global } from "@opencode-ai/core/global" import * as Log from "@opencode-ai/core/util/log" -import { tmpdir } from "../fixture/fixture" +import { tmpdirScoped } from "../fixture/fixture" +import { testEffect } from "../lib/effect" -const log = Global.Path.log +const it = testEffect(CrossSpawnSpawner.defaultLayer) -afterEach(() => { - Global.Path.log = log -}) +function files(dir: string) { + return Effect.gen(function* () { + let last = "" + let same = 0 -async function files(dir: string) { - let last = "" - let same = 0 + for (let i = 0; i < 50; i++) { + const list = yield* Effect.promise(() => fs.readdir(dir).then((files) => files.sort())) + const next = JSON.stringify(list) + same = next === last ? same + 1 : 0 + if (same >= 2 && list.length === 11) return list + last = next + yield* Effect.sleep("10 millis") + } - for (let i = 0; i < 50; i++) { - const list = (await fs.readdir(dir)).sort() - const next = JSON.stringify(list) - same = next === last ? same + 1 : 0 - if (same >= 2 && list.length === 11) return list - last = next - await Bun.sleep(10) - } - - return (await fs.readdir(dir)).sort() + return yield* Effect.promise(() => fs.readdir(dir).then((files) => files.sort())) + }) } -test("init cleanup keeps the newest timestamped logs", async () => { - await using tmp = await tmpdir() - Global.Path.log = tmp.path +it.live("init cleanup keeps the newest timestamped logs", () => + Effect.gen(function* () { + const log = Global.Path.log + yield* Effect.addFinalizer(() => Effect.sync(() => (Global.Path.log = log))) + const dir = yield* tmpdirScoped() + Global.Path.log = dir + + const list = Array.from({ length: 12 }, (_, i) => `2000-01-${String(i + 1).padStart(2, "0")}T000000.log`) + + yield* Effect.all(list.map((file) => Effect.promise(() => fs.writeFile(path.join(dir, file), file)))) + + yield* Effect.promise(() => Log.init({ print: false, dev: false })) + + const next = yield* files(dir) - const list = Array.from({ length: 12 }, (_, i) => `2000-01-${String(i + 1).padStart(2, "0")}T000000.log`) + expect(next).not.toContain(list[0]!) + expect(next).toContain(list.at(-1)!) + }), +) - await Promise.all(list.map((file) => fs.writeFile(path.join(tmp.path, file), file))) +it.live("local dev log is not truncated twice for the same run", () => + Effect.gen(function* () { + const log = Global.Path.log + const runID = process.env.OPENCODE_RUN_ID + const initialized = process.env.OPENCODE_LOG_INITIALIZED_RUN_ID + yield* Effect.addFinalizer(() => + Effect.sync(() => { + Global.Path.log = log + if (runID === undefined) delete process.env.OPENCODE_RUN_ID + else process.env.OPENCODE_RUN_ID = runID + if (initialized === undefined) delete process.env.OPENCODE_LOG_INITIALIZED_RUN_ID + else process.env.OPENCODE_LOG_INITIALIZED_RUN_ID = initialized + }), + ) - await Log.init({ print: false, dev: false }) + const dir = yield* tmpdirScoped() + Global.Path.log = dir + process.env.OPENCODE_RUN_ID = "run-1" + delete process.env.OPENCODE_LOG_INITIALIZED_RUN_ID - const next = await files(tmp.path) + yield* Effect.promise(() => Log.init({ print: false, dev: true })) + yield* Effect.promise(() => fs.writeFile(path.join(dir, "dev.log"), "main startup\n")) + yield* Effect.promise(() => Log.init({ print: false, dev: true })) - expect(next).not.toContain(list[0]!) - expect(next).toContain(list.at(-1)!) -}) + expect(yield* Effect.promise(() => fs.readFile(path.join(dir, "dev.log"), "utf8"))).toContain("main startup") + }), +) diff --git a/packages/opencode/test/v2/session-message-updater.test.ts b/packages/opencode/test/v2/session-message-updater.test.ts index 44ac031edab5..588521281ce7 100644 --- a/packages/opencode/test/v2/session-message-updater.test.ts +++ b/packages/opencode/test/v2/session-message-updater.test.ts @@ -1,10 +1,11 @@ import { expect, test } from "bun:test" import * as DateTime from "effect/DateTime" import { SessionID } from "../../src/session/schema" -import { EventV2 } from "../../src/v2/event" -import { Modelv2 } from "../../src/v2/model" -import { SessionEvent } from "../../src/v2/session-event" -import { SessionMessageUpdater } from "../../src/v2/session-message-updater" +import { EventV2 } from "@opencode-ai/core/event" +import { ModelV2 } from "@opencode-ai/core/model" +import { ProviderV2 } from "@opencode-ai/core/provider" +import { SessionEvent } from "@opencode-ai/core/session-event" +import { SessionMessageUpdater } from "@opencode-ai/core/session-message-updater" test("step snapshots carry over to assistant messages", () => { const state: SessionMessageUpdater.MemoryState = { messages: [] } @@ -18,9 +19,9 @@ test("step snapshots carry over to assistant messages", () => { timestamp: DateTime.makeUnsafe(1), agent: "build", model: { - id: Modelv2.ID.make("model"), - providerID: Modelv2.ProviderID.make("provider"), - variant: Modelv2.VariantID.make("default"), + id: ModelV2.ID.make("model"), + providerID: ProviderV2.ID.make("provider"), + variant: ModelV2.VariantID.make("default"), }, snapshot: "before", }, @@ -62,9 +63,9 @@ test("text ended populates assistant text content", () => { timestamp: DateTime.makeUnsafe(1), agent: "build", model: { - id: Modelv2.ID.make("model"), - providerID: Modelv2.ProviderID.make("provider"), - variant: Modelv2.VariantID.make("default"), + id: ModelV2.ID.make("model"), + providerID: ProviderV2.ID.make("provider"), + variant: ModelV2.VariantID.make("default"), }, }, } satisfies SessionEvent.Event) @@ -106,9 +107,9 @@ test("tool completion stores completed timestamp", () => { timestamp: DateTime.makeUnsafe(1), agent: "build", model: { - id: Modelv2.ID.make("model"), - providerID: Modelv2.ProviderID.make("provider"), - variant: Modelv2.VariantID.make("default"), + id: ModelV2.ID.make("model"), + providerID: ProviderV2.ID.make("provider"), + variant: ModelV2.VariantID.make("default"), }, }, } satisfies SessionEvent.Event) diff --git a/packages/plugin/package.json b/packages/plugin/package.json index a3ce97368deb..67055fdcd92b 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", - "version": "1.14.48", + "version": "1.15.0", "type": "module", "license": "MIT", "scripts": { @@ -22,9 +22,9 @@ "zod": "catalog:" }, "peerDependencies": { - "@opentui/core": ">=0.2.6", - "@opentui/keymap": ">=0.2.6", - "@opentui/solid": ">=0.2.6" + "@opentui/core": ">=0.2.10", + "@opentui/keymap": ">=0.2.10", + "@opentui/solid": ">=0.2.10" }, "peerDependenciesMeta": { "@opentui/core": { diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index 2e96dd980179..6156477be216 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -8,10 +8,9 @@ import type { UserMessage, Message, Part, - Auth, Config as SDKConfig, } from "@opencode-ai/sdk" -import type { Provider as ProviderV2, Model as ModelV2 } from "@opencode-ai/sdk/v2" +import type { Provider as ProviderV2, Model as ModelV2, Auth } from "@opencode-ai/sdk/v2" import type { BunShell } from "./shell.js" import { type ToolDefinition } from "./tool.js" @@ -153,6 +152,7 @@ export type AuthHook = { type: "success" key: string provider?: string + metadata?: Record } | { type: "failed" @@ -177,7 +177,7 @@ export type AuthOAuthResult = { url: string; instructions: string } & ( accountId?: string enterpriseUrl?: string } - | { key: string } + | { key: string; metadata?: Record } )) | { type: "failed" @@ -198,7 +198,7 @@ export type AuthOAuthResult = { url: string; instructions: string } & ( accountId?: string enterpriseUrl?: string } - | { key: string } + | { key: string; metadata?: Record } )) | { type: "failed" diff --git a/packages/plugin/src/tool.ts b/packages/plugin/src/tool.ts index 3105bf534bef..b8a634c7967d 100644 --- a/packages/plugin/src/tool.ts +++ b/packages/plugin/src/tool.ts @@ -27,7 +27,21 @@ type AskInput = { metadata: { [key: string]: any } } -export type ToolResult = string | { output: string; metadata?: { [key: string]: any } } +export type ToolAttachment = { + type: "file" + mime: string + url: string + filename?: string +} + +export type ToolResult = + | string + | { + title?: string + output: string + metadata?: { [key: string]: any } + attachments?: ToolAttachment[] + } export function tool(input: { description: string diff --git a/packages/plugin/src/tui.ts b/packages/plugin/src/tui.ts index 851b0476e518..354e44abcd08 100644 --- a/packages/plugin/src/tui.ts +++ b/packages/plugin/src/tui.ts @@ -11,6 +11,7 @@ import type { Provider, PermissionRequest, QuestionRequest, + Session, SessionStatus, TextPart, Config as SdkConfig, @@ -225,6 +226,76 @@ export type TuiToast = { duration?: number } +export type TuiAttentionWhen = "always" | "focused" | "blurred" + +export const TuiAttentionSoundNames = ["default", "question", "permission", "error", "done", "subagent_done"] as const +export type TuiAttentionSoundName = (typeof TuiAttentionSoundNames)[number] + +export type TuiAttentionSound = + | boolean + | { + name?: TuiAttentionSoundName + volume?: number + when?: TuiAttentionWhen + } + +export type TuiAttentionNotification = + | boolean + | { + when?: TuiAttentionWhen + } + +export type TuiAttentionSoundPack = { + id: string + name?: string + sounds: Partial> +} + +export type TuiAttentionSoundPackInfo = { + id: string + name?: string + active: boolean + builtin: boolean +} + +export type TuiAttentionSoundboardActivateOptions = { + persist?: boolean +} + +export type TuiAttentionSoundboard = { + registerPack(pack: TuiAttentionSoundPack): () => void + activate(id: string, options?: TuiAttentionSoundboardActivateOptions): boolean + current(): string + list(): ReadonlyArray +} + +export type TuiAttentionNotifyInput = { + title?: string + message: string + notification?: TuiAttentionNotification + sound?: TuiAttentionSound +} + +export type TuiAttentionNotifySkipReason = + | "attention_disabled" + | "empty_message" + | "blurred" + | "focused" + | "focus_unknown" + | "renderer_destroyed" + +export type TuiAttentionNotifyResult = { + ok: boolean + notification: boolean + sound: boolean + skipped?: TuiAttentionNotifySkipReason +} + +export type TuiAttention = { + notify(input: TuiAttentionNotifyInput): Promise + soundboard: TuiAttentionSoundboard +} + export type TuiThemeCurrent = { readonly primary: RGBA readonly secondary: RGBA @@ -310,6 +381,7 @@ export type TuiState = { readonly vcs: { branch?: string } | undefined session: { count: () => number + get: (sessionID: string) => Session | undefined diff: (sessionID: string) => ReadonlyArray todo: (sessionID: string) => ReadonlyArray messages: (sessionID: string) => ReadonlyArray @@ -331,9 +403,19 @@ type TuiBindingLookupView = { omit: (name: string, commands: readonly string[]) => Binding[] } +type TuiAttentionConfigView = { + enabled: boolean + notifications: boolean + sound: boolean + volume: number + sound_pack: string + sounds: Partial> +} + type TuiConfigView = Pick & NonNullable & { leader_timeout: number + attention: TuiAttentionConfigView plugin_enabled?: Record keybinds: TuiBindingLookupView } @@ -497,6 +579,7 @@ export type TuiWorkspace = { export type TuiPluginApi = { app: TuiApp + attention: TuiAttention /** * Legacy `api.command` API kept so v1 plugins can initialize. Remove in v2. * diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index 65fbf98f0ef2..0dc58c876fa4 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "1.14.48", + "version": "1.15.0", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index 8fd2a02b921c..5e4fd8906155 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -1666,6 +1666,9 @@ export type OAuth = { export type ApiAuth = { type: "api" key: string + metadata?: { + [key: string]: string + } } export type WellKnownAuth = { diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index bf3201a5c081..495ccaffb89d 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -138,6 +138,15 @@ import type { SessionForkResponses, SessionGetErrors, SessionGetResponses, + SessionGoalClearErrors, + SessionGoalClearResponses, + SessionGoalCreateErrors, + SessionGoalCreateResponses, + SessionGoalGetErrors, + SessionGoalGetResponses, + SessionGoalStatus, + SessionGoalUpdateErrors, + SessionGoalUpdateResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, @@ -197,6 +206,10 @@ import type { TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, + V2ModelListResponses, + V2ProviderGetErrors, + V2ProviderGetResponses, + V2ProviderListResponses, V2SessionCompactResponses, V2SessionContextResponses, V2SessionListErrors, @@ -214,6 +227,7 @@ import type { WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, + WorktreeListErrors, WorktreeListResponses, WorktreeRemoveErrors, WorktreeRemoveInput, @@ -1256,7 +1270,7 @@ export class Worktree extends HeyApiClient { }, ], ) - return (options?.client ?? this.client).get({ + return (options?.client ?? this.client).get({ url: "/experimental/worktree", ...options, ...params, @@ -2946,6 +2960,156 @@ export class Provider extends HeyApiClient { } } +export class Goal extends HeyApiClient { + /** + * Clear session goal + * + * Clear the current session goal. + */ + public clear( + parameters: { + sessionID: string + directory?: string + workspace?: string + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) + return (options?.client ?? this.client).delete({ + url: "/session/{sessionID}/goal", + ...options, + ...params, + }) + } + + /** + * Get session goal + * + * Retrieve the current goal for a session, if one exists. + */ + public get( + parameters: { + sessionID: string + directory?: string + workspace?: string + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) + return (options?.client ?? this.client).get({ + url: "/session/{sessionID}/goal", + ...options, + ...params, + }) + } + + /** + * Update session goal + * + * Update goal objective, status, or token budget. + */ + public update( + parameters: { + sessionID: string + directory?: string + workspace?: string + objective?: string + status?: SessionGoalStatus + tokenBudget?: number | null + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + { in: "body", key: "objective" }, + { in: "body", key: "status" }, + { in: "body", key: "tokenBudget" }, + ], + }, + ], + ) + return (options?.client ?? this.client).patch({ + url: "/session/{sessionID}/goal", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } + + /** + * Create session goal + * + * Create a persistent goal for a session. + */ + public create( + parameters: { + sessionID: string + directory?: string + workspace?: string + objective?: string + tokenBudget?: number + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + { in: "body", key: "objective" }, + { in: "body", key: "tokenBudget" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post({ + url: "/session/{sessionID}/goal", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } +} + export class Session2 extends HeyApiClient { /** * List sessions @@ -3904,6 +4068,11 @@ export class Session2 extends HeyApiClient { ...params, }) } + + private _goal?: Goal + get goal(): Goal { + return (this._goal ??= new Goal({ client: this.client })) + } } export class Part extends HeyApiClient { @@ -4374,11 +4543,102 @@ export class Session3 extends HeyApiClient { } } +export class Model extends HeyApiClient { + /** + * List v2 models + * + * Retrieve available v2 models ordered by release date. + */ + public list( + parameters?: { + location?: { + directory?: string + workspace?: string + } + }, + options?: Options, + ) { + const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) + return (options?.client ?? this.client).get({ + url: "/api/model", + ...options, + ...params, + }) + } +} + +export class Provider2 extends HeyApiClient { + /** + * List v2 providers + * + * Retrieve active v2 AI providers so clients can show provider availability and configuration. + */ + public list( + parameters?: { + location?: { + directory?: string + workspace?: string + } + }, + options?: Options, + ) { + const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) + return (options?.client ?? this.client).get({ + url: "/api/provider", + ...options, + ...params, + }) + } + + /** + * Get v2 provider + * + * Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings. + */ + public get( + parameters: { + providerID: string + location?: { + directory?: string + workspace?: string + } + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "providerID" }, + { in: "query", key: "location" }, + ], + }, + ], + ) + return (options?.client ?? this.client).get({ + url: "/api/provider/{providerID}", + ...options, + ...params, + }) + } +} + export class V2 extends HeyApiClient { private _session?: Session3 get session(): Session3 { return (this._session ??= new Session3({ client: this.client })) } + + private _model?: Model + get model(): Model { + return (this._model ??= new Model({ client: this.client })) + } + + private _provider?: Provider2 + get provider(): Provider2 { + return (this._provider ??= new Provider2({ client: this.client })) + } } export class Control extends HeyApiClient { diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index c7a479f5ac90..257146fecf7a 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -11,19 +11,17 @@ export type Event = | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta + | EventSessionGoalIdleContinue | EventPermissionAsked | EventPermissionReplied | EventSessionDiff | EventSessionError - | EventInstallationUpdated - | EventInstallationUpdateAvailable | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventTodoUpdated | EventSessionStatus | EventSessionIdle - | EventSessionCompacted | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow1 @@ -32,6 +30,7 @@ export type Event = | EventMcpBrowserOpenFailed | EventCommandExecuted | EventProjectUpdated + | EventSessionCompacted | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed @@ -42,10 +41,14 @@ export type Event = | EventPtyUpdated | EventPtyExited | EventPtyDeleted + | EventInstallationUpdated + | EventInstallationUpdateAvailable | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved + | EventSessionGoalUpdated + | EventSessionGoalCleared | EventSessionCreated | EventSessionUpdated | EventSessionDeleted @@ -77,6 +80,7 @@ export type Event = | EventSessionNextCompactionEnded | EventServerConnected | EventGlobalDisposed + | EventCatalogModelUpdated export type OAuth = { type: "oauth" @@ -103,6 +107,24 @@ export type WellKnownAuth = { export type Auth = OAuth | ApiAuth | WellKnownAuth +export type SessionGoalStatus = "active" | "paused" | "budget_limited" | "complete" + +export type SessionGoal = { + id: string + sessionID: string + objective: string + status: SessionGoalStatus + tokens: { + used: number + budget?: number + } + time: { + used: number + created: number + updated: number + } +} + export type PermissionRequest = { id: string sessionID: string @@ -741,6 +763,16 @@ export type Session = { files: number diffs?: Array } + cost?: number + tokens?: { + input: number + output: number + reasoning: number + cache: { + read: number + write: number + } + } share?: { url: string } @@ -785,19 +817,17 @@ export type GlobalEvent = { | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta + | EventSessionGoalIdleContinue | EventPermissionAsked | EventPermissionReplied | EventSessionDiff | EventSessionError - | EventInstallationUpdated - | EventInstallationUpdateAvailable | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventTodoUpdated | EventSessionStatus | EventSessionIdle - | EventSessionCompacted | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow @@ -806,6 +836,7 @@ export type GlobalEvent = { | EventMcpBrowserOpenFailed | EventCommandExecuted | EventProjectUpdated + | EventSessionCompacted | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed @@ -816,10 +847,14 @@ export type GlobalEvent = { | EventPtyUpdated | EventPtyExited | EventPtyDeleted + | EventInstallationUpdated + | EventInstallationUpdateAvailable | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved + | EventSessionGoalUpdated + | EventSessionGoalCleared | EventSessionCreated | EventSessionUpdated | EventSessionDeleted @@ -851,10 +886,13 @@ export type GlobalEvent = { | EventSessionNextCompactionEnded | EventServerConnected | EventGlobalDisposed + | EventCatalogModelUpdated | SyncEventMessageUpdated | SyncEventMessageRemoved | SyncEventMessagePartUpdated | SyncEventMessagePartRemoved + | SyncEventSessionGoalUpdated + | SyncEventSessionGoalCleared | SyncEventSessionCreated | SyncEventSessionUpdated | SyncEventSessionDeleted @@ -945,7 +983,6 @@ export type PermissionConfig = question?: PermissionActionConfig webfetch?: PermissionActionConfig websearch?: PermissionActionConfig - codesearch?: PermissionActionConfig repo_clone?: PermissionRuleConfig repo_overview?: PermissionRuleConfig lsp?: PermissionRuleConfig @@ -1325,6 +1362,18 @@ export type Model = { read: number write: number } + tiers?: Array<{ + input: number + output: number + cache: { + read: number + write: number + } + tier: { + type: "context" + size: number + } + }> experimentalOver200K?: { input: number output: number @@ -1388,6 +1437,20 @@ export type ToolList = Array export type ToolIds = Array +export type WorktreeError = { + name: + | "WorktreeNotGitError" + | "WorktreeNameGenerationFailedError" + | "WorktreeCreateFailedError" + | "WorktreeStartCommandFailedError" + | "WorktreeRemoveFailedError" + | "WorktreeResetFailedError" + | "WorktreeListFailedError" + data: { + message: string + } +} + export type WorktreeCreateInput = { name?: string /** @@ -1430,6 +1493,16 @@ export type GlobalSession = { files: number diffs?: Array } + cost?: number + tokens?: { + input: number + output: number + reasoning: number + cache: { + read: number + write: number + } + } share?: { url: string } @@ -1676,6 +1749,21 @@ export type ProviderAuthAuthorization = { instructions: string } +export type ProviderAuthError1 = { + name: + | "BadRequest" + | "ProviderAuthOauthMissing" + | "ProviderAuthOauthCodeMissing" + | "ProviderAuthOauthCallbackFailed" + | "ProviderAuthValidationFailed" + data: { + providerID?: string + field?: string + message?: string + kind?: string + } +} + export type TextPartInput = { id?: string type: "text" @@ -1859,6 +1947,29 @@ export type SyncEventMessagePartRemoved = { } } +export type SyncEventSessionGoalUpdated = { + type: "sync" + name: "session.goal.updated.1" + id: string + seq: number + aggregateID: "sessionID" + data: { + sessionID: string + goal: SessionGoal + } +} + +export type SyncEventSessionGoalCleared = { + type: "sync" + name: "session.goal.cleared.1" + id: string + seq: number + aggregateID: "sessionID" + data: { + sessionID: string + } +} + export type SyncEventSessionCreated = { type: "sync" name: "session.created.1" @@ -1893,6 +2004,16 @@ export type SyncEventSessionUpdated = { files: number diffs?: Array } | null + cost?: number | null + tokens?: { + input: number + output: number + reasoning: number + cache: { + read: number + write: number + } + } | null share?: { url?: string | null } @@ -2385,6 +2506,15 @@ export type EventMessagePartDelta = { } } +export type EventSessionGoalIdleContinue = { + id: string + type: "session.goal.idle_continue" + properties: { + sessionID: string + goal: SessionGoal + } +} + export type EventPermissionAsked = { id: string type: "permission.asked" @@ -2426,22 +2556,6 @@ export type EventSessionError = { } } -export type EventInstallationUpdated = { - id: string - type: "installation.updated" - properties: { - version: string - } -} - -export type EventInstallationUpdateAvailable = { - id: string - type: "installation.update-available" - properties: { - version: string - } -} - export type EventQuestionAsked = { id: string type: "question.asked" @@ -2486,14 +2600,6 @@ export type EventSessionIdle = { } } -export type EventSessionCompacted = { - id: string - type: "session.compacted" - properties: { - sessionID: string - } -} - export type EventMcpToolsChanged = { id: string type: "mcp.tools.changed" @@ -2528,6 +2634,14 @@ export type EventProjectUpdated = { properties: Project } +export type EventSessionCompacted = { + id: string + type: "session.compacted" + properties: { + sessionID: string + } +} + export type EventVcsBranchUpdated = { id: string type: "vcs.branch.updated" @@ -2611,6 +2725,22 @@ export type EventPtyDeleted = { } } +export type EventInstallationUpdated = { + id: string + type: "installation.updated" + properties: { + version: string + } +} + +export type EventInstallationUpdateAvailable = { + id: string + type: "installation.update-available" + properties: { + version: string + } +} + export type EventMessageUpdated = { id: string type: "message.updated" @@ -2649,6 +2779,23 @@ export type EventMessagePartRemoved = { } } +export type EventSessionGoalUpdated = { + id: string + type: "session.goal.updated" + properties: { + sessionID: string + goal: SessionGoal + } +} + +export type EventSessionGoalCleared = { + id: string + type: "session.goal.cleared" + properties: { + sessionID: string + } +} + export type EventSessionCreated = { id: string type: "session.created" @@ -3073,6 +3220,112 @@ export type EventGlobalDisposed = { } } +export type ModelV2Info = { + id: string + apiID: string + providerID: string + family?: string + name: string + endpoint: + | { + type: "unknown" + } + | { + type: "openai/responses" + url: string + websocket?: boolean + } + | { + type: "openai/completions" + url: string + reasoning?: + | { + type: "reasoning_content" + } + | { + type: "reasoning_details" + } + } + | { + type: "anthropic/messages" + url: string + } + | { + type: "aisdk" + package: string + url?: string + } + capabilities: { + tools: boolean + input: Array + output: Array + } + options: { + headers: { + [key: string]: string + } + body: { + [key: string]: unknown + } + aisdk: { + provider: { + [key: string]: unknown + } + request: { + [key: string]: unknown + } + } + variant?: string + } + variants: Array<{ + id: string + headers: { + [key: string]: string + } + body: { + [key: string]: unknown + } + aisdk: { + provider: { + [key: string]: unknown + } + request: { + [key: string]: unknown + } + } + }> + time: { + released: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" + } + cost: Array<{ + tier?: { + type: "context" + size: number + } + input: number + output: number + cache: { + read: number + write: number + } + }> + status: "alpha" | "beta" | "deprecated" | "active" + enabled: boolean + limit: { + context: number + input?: number + output: number + } +} + +export type EventCatalogModelUpdated = { + id: string + type: "catalog.model.updated" + properties: { + model: ModelV2Info + } +} + export type SessionInfo = { id: string parentID?: string @@ -3085,6 +3338,16 @@ export type SessionInfo = { providerID: string variant: string } + cost: number + tokens: { + input: number + output: number + reasoning: number + cache: { + read: number + write: number + } + } time: { created: number updated: number @@ -3298,37 +3561,202 @@ export type SessionMessage = | SessionMessageAssistant | SessionMessageCompaction -export type EventTuiToastShow1 = { +export type ProviderV2Info = { id: string - type: "tui.toast.show" - properties: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number - } -} - -export type BadRequestError = { - name: "BadRequest" - data: { - message: string - kind?: "Params" | "Headers" | "Query" | "Body" | "Payload" - } -} - -export type AuthRemoveData = { - body?: never - path: { - providerID: string - } - query?: never - url: "/auth/{providerID}" -} - -export type AuthRemoveErrors = { - /** - * Bad request + name: string + enabled: + | false + | { + via: "env" + name: string + } + | { + via: "auth" + service: string + } + | { + via: "custom" + data: { + [key: string]: unknown + } + } + env: Array + endpoint: + | { + type: "unknown" + } + | { + type: "openai/responses" + url: string + websocket?: boolean + } + | { + type: "openai/completions" + url: string + reasoning?: + | { + type: "reasoning_content" + } + | { + type: "reasoning_details" + } + } + | { + type: "anthropic/messages" + url: string + } + | { + type: "aisdk" + package: string + url?: string + } + options: { + headers: { + [key: string]: string + } + body: { + [key: string]: unknown + } + aisdk: { + provider: { + [key: string]: unknown + } + request: { + [key: string]: unknown + } + } + } +} + +export type EventTuiToastShow1 = { + id: string + type: "tui.toast.show" + properties: { + title?: string + message: string + variant: "info" | "success" | "warning" | "error" + duration?: number + } +} + +export type ModelV2Info1 = { + id: string + apiID: string + providerID: string + family?: string + name: string + endpoint: + | { + type: "unknown" + } + | { + type: "openai/responses" + url: string + websocket?: boolean + } + | { + type: "openai/completions" + url: string + reasoning?: + | { + type: "reasoning_content" + } + | { + type: "reasoning_details" + } + } + | { + type: "anthropic/messages" + url: string + } + | { + type: "aisdk" + package: string + url?: string + } + capabilities: { + tools: boolean + input: Array + output: Array + } + options: { + headers: { + [key: string]: string + } + body: { + [key: string]: unknown + } + aisdk: { + provider: { + [key: string]: unknown + } + request: { + [key: string]: unknown + } + } + variant?: string + } + variants: Array<{ + id: string + headers: { + [key: string]: string + } + body: { + [key: string]: unknown + } + aisdk: { + provider: { + [key: string]: unknown + } + request: { + [key: string]: unknown + } + } + }> + time: { + released: number | "NaN" | "Infinity" | "-Infinity" + } + cost: Array<{ + tier?: { + type: "context" + size: number + } + input: number + output: number + cache: { + read: number + write: number + } + }> + status: "alpha" | "beta" | "deprecated" | "active" + enabled: boolean + limit: { + context: number + input?: number + output: number + } +} + +export type BadRequestError = { + name: "BadRequest" + data: { + message: string + kind?: "Params" | "Headers" | "Query" | "Body" | "Payload" + } +} + +export type AuthRemoveData = { + body?: never + path: { + providerID: string + } + query?: never + url: "/auth/{providerID}" +} + +export type AuthRemoveErrors = { + /** + * Bad request */ 400: BadRequestError } @@ -3792,9 +4220,9 @@ export type WorktreeRemoveData = { export type WorktreeRemoveErrors = { /** - * Bad request + * WorktreeError */ - 400: BadRequestError + 400: WorktreeError } export type WorktreeRemoveError = WorktreeRemoveErrors[keyof WorktreeRemoveErrors] @@ -3818,6 +4246,15 @@ export type WorktreeListData = { url: "/experimental/worktree" } +export type WorktreeListErrors = { + /** + * WorktreeError + */ + 400: WorktreeError +} + +export type WorktreeListError = WorktreeListErrors[keyof WorktreeListErrors] + export type WorktreeListResponses = { /** * List of worktree directories @@ -3839,9 +4276,9 @@ export type WorktreeCreateData = { export type WorktreeCreateErrors = { /** - * Bad request + * WorktreeError */ - 400: BadRequestError + 400: WorktreeError } export type WorktreeCreateError = WorktreeCreateErrors[keyof WorktreeCreateErrors] @@ -3867,9 +4304,9 @@ export type WorktreeResetData = { export type WorktreeResetErrors = { /** - * Bad request + * WorktreeError */ - 400: BadRequestError + 400: WorktreeError } export type WorktreeResetError = WorktreeResetErrors[keyof WorktreeResetErrors] @@ -5081,9 +5518,9 @@ export type ProviderOauthAuthorizeData = { export type ProviderOauthAuthorizeErrors = { /** - * Bad request + * ProviderAuthError */ - 400: BadRequestError + 400: ProviderAuthError1 } export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors] @@ -5117,9 +5554,9 @@ export type ProviderOauthCallbackData = { export type ProviderOauthCallbackErrors = { /** - * Bad request + * ProviderAuthError */ - 400: BadRequestError + 400: ProviderAuthError1 } export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors] @@ -5353,7 +5790,7 @@ export type SessionChildrenErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5387,7 +5824,7 @@ export type SessionTodoErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5403,6 +5840,149 @@ export type SessionTodoResponses = { export type SessionTodoResponse = SessionTodoResponses[keyof SessionTodoResponses] +export type SessionGoalClearData = { + body?: never + path: { + sessionID: string + } + query?: { + directory?: string + workspace?: string + } + url: "/session/{sessionID}/goal" +} + +export type SessionGoalClearErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * NotFoundError + */ + 404: NotFoundError +} + +export type SessionGoalClearError = SessionGoalClearErrors[keyof SessionGoalClearErrors] + +export type SessionGoalClearResponses = { + /** + * Cleared session goal + */ + 200: boolean +} + +export type SessionGoalClearResponse = SessionGoalClearResponses[keyof SessionGoalClearResponses] + +export type SessionGoalGetData = { + body?: never + path: { + sessionID: string + } + query?: { + directory?: string + workspace?: string + } + url: "/session/{sessionID}/goal" +} + +export type SessionGoalGetErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * NotFoundError + */ + 404: NotFoundError +} + +export type SessionGoalGetError = SessionGoalGetErrors[keyof SessionGoalGetErrors] + +export type SessionGoalGetResponses = { + /** + * Session goal + */ + 200: SessionGoal | null +} + +export type SessionGoalGetResponse = SessionGoalGetResponses[keyof SessionGoalGetResponses] + +export type SessionGoalUpdateData = { + body?: { + objective?: string + status?: SessionGoalStatus + tokenBudget?: number | null + } + path: { + sessionID: string + } + query?: { + directory?: string + workspace?: string + } + url: "/session/{sessionID}/goal" +} + +export type SessionGoalUpdateErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * NotFoundError + */ + 404: NotFoundError +} + +export type SessionGoalUpdateError = SessionGoalUpdateErrors[keyof SessionGoalUpdateErrors] + +export type SessionGoalUpdateResponses = { + /** + * Updated session goal + */ + 200: SessionGoal +} + +export type SessionGoalUpdateResponse = SessionGoalUpdateResponses[keyof SessionGoalUpdateResponses] + +export type SessionGoalCreateData = { + body?: { + objective: string + tokenBudget?: number + } + path: { + sessionID: string + } + query?: { + directory?: string + workspace?: string + } + url: "/session/{sessionID}/goal" +} + +export type SessionGoalCreateErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * NotFoundError + */ + 404: NotFoundError +} + +export type SessionGoalCreateError = SessionGoalCreateErrors[keyof SessionGoalCreateErrors] + +export type SessionGoalCreateResponses = { + /** + * Created session goal + */ + 200: SessionGoal +} + +export type SessionGoalCreateResponse = SessionGoalCreateResponses[keyof SessionGoalCreateResponses] + export type SessionDiffData = { body?: never path: { @@ -5497,7 +6077,7 @@ export type SessionPromptErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5535,7 +6115,7 @@ export type SessionDeleteMessageErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5642,10 +6222,6 @@ export type SessionAbortErrors = { * Bad request */ 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError } export type SessionAbortError = SessionAbortErrors[keyof SessionAbortErrors] @@ -5681,7 +6257,7 @@ export type SessionInitErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5836,7 +6412,7 @@ export type SessionPromptAsyncErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5885,7 +6461,7 @@ export type SessionCommandErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5930,7 +6506,7 @@ export type SessionShellErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -5970,7 +6546,7 @@ export type SessionRevertErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -6004,7 +6580,7 @@ export type SessionUnrevertErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -6041,7 +6617,7 @@ export type PermissionRespondErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -6077,7 +6653,7 @@ export type PartDeleteErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -6113,7 +6689,7 @@ export type PartUpdateErrors = { */ 400: BadRequestError /** - * Not found + * NotFoundError */ 404: NotFoundError } @@ -6420,6 +6996,80 @@ export type V2SessionMessagesResponses = { export type V2SessionMessagesResponse2 = V2SessionMessagesResponses[keyof V2SessionMessagesResponses] +export type V2ModelListData = { + body?: never + path?: never + query?: { + location?: { + directory?: string + workspace?: string + } + } + url: "/api/model" +} + +export type V2ModelListResponses = { + /** + * Success + */ + 200: Array +} + +export type V2ModelListResponse = V2ModelListResponses[keyof V2ModelListResponses] + +export type V2ProviderListData = { + body?: never + path?: never + query?: { + location?: { + directory?: string + workspace?: string + } + } + url: "/api/provider" +} + +export type V2ProviderListResponses = { + /** + * Success + */ + 200: Array +} + +export type V2ProviderListResponse = V2ProviderListResponses[keyof V2ProviderListResponses] + +export type V2ProviderGetData = { + body?: never + path: { + providerID: string + } + query?: { + location?: { + directory?: string + workspace?: string + } + } + url: "/api/provider/{providerID}" +} + +export type V2ProviderGetErrors = { + /** + * NotFoundError + */ + 404: NotFoundError +} + +export type V2ProviderGetError = V2ProviderGetErrors[keyof V2ProviderGetErrors] + +export type V2ProviderGetResponses = { + /** + * ProviderV2.Info + */ + 200: ProviderV2Info +} + +export type V2ProviderGetResponse = V2ProviderGetResponses[keyof V2ProviderGetResponses] + export type TuiAppendPromptData = { body?: { text: string diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 3d452cc9c07d..e92347c9bcab 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -1013,6 +1013,16 @@ } } } + }, + "400": { + "description": "WorktreeError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorktreeError" + } + } + } } }, "description": "List all sandbox worktrees for the current project.", @@ -1057,11 +1067,11 @@ } }, "400": { - "description": "Bad request", + "description": "WorktreeError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BadRequestError" + "$ref": "#/components/schemas/WorktreeError" } } } @@ -1119,11 +1129,11 @@ } }, "400": { - "description": "Bad request", + "description": "WorktreeError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BadRequestError" + "$ref": "#/components/schemas/WorktreeError" } } } @@ -1183,11 +1193,11 @@ } }, "400": { - "description": "Bad request", + "description": "WorktreeError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BadRequestError" + "$ref": "#/components/schemas/WorktreeError" } } } @@ -4207,11 +4217,11 @@ } }, "400": { - "description": "Bad request", + "description": "ProviderAuthError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BadRequestError" + "$ref": "#/components/schemas/ProviderAuthError1" } } } @@ -4293,11 +4303,11 @@ } }, "400": { - "description": "Bad request", + "description": "ProviderAuthError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BadRequestError" + "$ref": "#/components/schemas/ProviderAuthError1" } } } @@ -4893,7 +4903,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -4970,7 +4980,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -5227,7 +5237,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -5474,7 +5484,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -5635,16 +5645,6 @@ } } } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } } }, "description": "Abort an active session and stop any ongoing AI processing or command execution.", @@ -5711,7 +5711,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6040,7 +6040,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6195,7 +6195,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6344,7 +6344,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6453,7 +6453,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6547,7 +6547,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6630,7 +6630,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6740,7 +6740,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -6828,7 +6828,7 @@ } }, "404": { - "description": "Not found", + "description": "NotFoundError", "content": { "application/json": { "schema": { @@ -7606,6 +7606,171 @@ ] } }, + "/api/model": { + "get": { + "tags": ["v2 models"], + "operationId": "v2.model.list", + "parameters": [ + { + "name": "location", + "in": "query", + "schema": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "workspace": { + "type": "string" + } + }, + "additionalProperties": false + }, + "required": false, + "style": "deepObject", + "explode": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModelV2Info" + } + } + } + } + } + }, + "description": "Retrieve available v2 models ordered by release date.", + "summary": "List v2 models", + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.model.list({\n ...\n})" + } + ] + } + }, + "/api/provider": { + "get": { + "tags": ["v2 providers"], + "operationId": "v2.provider.list", + "parameters": [ + { + "name": "location", + "in": "query", + "schema": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "workspace": { + "type": "string" + } + }, + "additionalProperties": false + }, + "required": false, + "style": "deepObject", + "explode": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderV2Info" + } + } + } + } + } + }, + "description": "Retrieve active v2 AI providers so clients can show provider availability and configuration.", + "summary": "List v2 providers", + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.list({\n ...\n})" + } + ] + } + }, + "/api/provider/{providerID}": { + "get": { + "tags": ["v2 providers"], + "operationId": "v2.provider.get", + "parameters": [ + { + "name": "providerID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "location", + "in": "query", + "schema": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "workspace": { + "type": "string" + } + }, + "additionalProperties": false + }, + "required": false, + "style": "deepObject", + "explode": true + } + ], + "responses": { + "200": { + "description": "ProviderV2.Info", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProviderV2Info" + } + } + } + }, + "404": { + "description": "NotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + } + }, + "description": "Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.", + "summary": "Get v2 provider", + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.get({\n ...\n})" + } + ] + } + }, "/tui/append-prompt": { "post": { "tags": ["tui"], @@ -8908,12 +9073,6 @@ { "$ref": "#/components/schemas/EventSessionError" }, - { - "$ref": "#/components/schemas/EventInstallationUpdated" - }, - { - "$ref": "#/components/schemas/EventInstallationUpdate-available" - }, { "$ref": "#/components/schemas/EventQuestionAsked" }, @@ -8932,9 +9091,6 @@ { "$ref": "#/components/schemas/EventSessionIdle" }, - { - "$ref": "#/components/schemas/EventSessionCompacted" - }, { "$ref": "#/components/schemas/Event.tui.prompt.append" }, @@ -8959,6 +9115,9 @@ { "$ref": "#/components/schemas/EventProjectUpdated" }, + { + "$ref": "#/components/schemas/EventSessionCompacted" + }, { "$ref": "#/components/schemas/EventVcsBranchUpdated" }, @@ -8989,6 +9148,12 @@ { "$ref": "#/components/schemas/EventPtyDeleted" }, + { + "$ref": "#/components/schemas/EventInstallationUpdated" + }, + { + "$ref": "#/components/schemas/EventInstallationUpdate-available" + }, { "$ref": "#/components/schemas/EventMessageUpdated" }, @@ -9093,61 +9258,142 @@ }, { "$ref": "#/components/schemas/EventGlobalDisposed" - } - ] - }, - "OAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["oauth"] }, - "refresh": { - "type": "string" + { + "$ref": "#/components/schemas/EventCatalogModelUpdated" }, - "access": { - "type": "string" + { + "$ref": "#/components/schemas/EventSessionNextAgentSwitched" }, - "expires": { - "type": "integer", - "minimum": 0 + { + "$ref": "#/components/schemas/EventSessionNextModelSwitched" }, - "accountId": { - "type": "string" + { + "$ref": "#/components/schemas/EventSessionNextPrompted" }, - "enterpriseUrl": { - "type": "string" - } - }, - "required": ["type", "refresh", "access", "expires"], - "additionalProperties": false - }, - "ApiAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["api"] + { + "$ref": "#/components/schemas/EventSessionNextSynthetic" }, - "key": { - "type": "string" + { + "$ref": "#/components/schemas/EventSessionNextShellStarted" }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["type", "key"], - "additionalProperties": false - }, - "WellKnownAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", + { + "$ref": "#/components/schemas/EventSessionNextShellEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextStepStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextStepEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextStepFailed" + }, + { + "$ref": "#/components/schemas/EventSessionNextTextStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextTextDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextTextEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextReasoningStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextReasoningDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextReasoningEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolInputStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolInputDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolInputEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolCalled" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolProgress" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolSuccess" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolFailed" + }, + { + "$ref": "#/components/schemas/EventSessionNextRetried" + }, + { + "$ref": "#/components/schemas/EventSessionNextCompactionStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextCompactionDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextCompactionEnded" + } + ] + }, + "OAuth": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["oauth"] + }, + "refresh": { + "type": "string" + }, + "access": { + "type": "string" + }, + "expires": { + "type": "integer", + "minimum": 0 + }, + "accountId": { + "type": "string" + }, + "enterpriseUrl": { + "type": "string" + } + }, + "required": ["type", "refresh", "access", "expires"], + "additionalProperties": false + }, + "ApiAuth": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["api"] + }, + "key": { + "type": "string" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": ["type", "key"], + "additionalProperties": false + }, + "WellKnownAuth": { + "type": "object", + "properties": { + "type": { + "type": "string", "enum": ["wellknown"] }, "key": { @@ -11018,6 +11264,38 @@ "required": ["additions", "deletions", "files"], "additionalProperties": false }, + "cost": { + "type": "number" + }, + "tokens": { + "type": "object", + "properties": { + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "reasoning": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + } + }, + "required": ["input", "output", "reasoning", "cache"], + "additionalProperties": false + }, "share": { "type": "object", "properties": { @@ -11175,12 +11453,6 @@ { "$ref": "#/components/schemas/EventSessionError" }, - { - "$ref": "#/components/schemas/EventInstallationUpdated" - }, - { - "$ref": "#/components/schemas/EventInstallationUpdate-available" - }, { "$ref": "#/components/schemas/EventQuestionAsked" }, @@ -11199,9 +11471,6 @@ { "$ref": "#/components/schemas/EventSessionIdle" }, - { - "$ref": "#/components/schemas/EventSessionCompacted" - }, { "$ref": "#/components/schemas/Event.tui.prompt.append" }, @@ -11226,6 +11495,9 @@ { "$ref": "#/components/schemas/EventProjectUpdated" }, + { + "$ref": "#/components/schemas/EventSessionCompacted" + }, { "$ref": "#/components/schemas/EventVcsBranchUpdated" }, @@ -11256,6 +11528,12 @@ { "$ref": "#/components/schemas/EventPtyDeleted" }, + { + "$ref": "#/components/schemas/EventInstallationUpdated" + }, + { + "$ref": "#/components/schemas/EventInstallationUpdate-available" + }, { "$ref": "#/components/schemas/EventMessageUpdated" }, @@ -11361,6 +11639,87 @@ { "$ref": "#/components/schemas/EventGlobalDisposed" }, + { + "$ref": "#/components/schemas/EventCatalogModelUpdated" + }, + { + "$ref": "#/components/schemas/EventSessionNextAgentSwitched" + }, + { + "$ref": "#/components/schemas/EventSessionNextModelSwitched" + }, + { + "$ref": "#/components/schemas/EventSessionNextPrompted" + }, + { + "$ref": "#/components/schemas/EventSessionNextSynthetic" + }, + { + "$ref": "#/components/schemas/EventSessionNextShellStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextShellEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextStepStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextStepEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextStepFailed" + }, + { + "$ref": "#/components/schemas/EventSessionNextTextStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextTextDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextTextEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextReasoningStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextReasoningDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextReasoningEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolInputStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolInputDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolInputEnded" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolCalled" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolProgress" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolSuccess" + }, + { + "$ref": "#/components/schemas/EventSessionNextToolFailed" + }, + { + "$ref": "#/components/schemas/EventSessionNextRetried" + }, + { + "$ref": "#/components/schemas/EventSessionNextCompactionStarted" + }, + { + "$ref": "#/components/schemas/EventSessionNextCompactionDelta" + }, + { + "$ref": "#/components/schemas/EventSessionNextCompactionEnded" + }, { "$ref": "#/components/schemas/SyncEventMessageUpdated" }, @@ -11599,9 +11958,6 @@ "websearch": { "$ref": "#/components/schemas/PermissionActionConfig" }, - "codesearch": { - "$ref": "#/components/schemas/PermissionActionConfig" - }, "repo_clone": { "$ref": "#/components/schemas/PermissionRuleConfig" }, @@ -12601,13 +12957,56 @@ "required": ["read", "write"], "additionalProperties": false }, - "experimentalOver200K": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { + "tiers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + }, + "tier": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["context"] + }, + "size": { + "type": "number" + } + }, + "required": ["type", "size"], + "additionalProperties": false + } + }, + "required": ["input", "output", "cache", "tier"], + "additionalProperties": false + } + }, + "experimentalOver200K": { + "type": "object", + "properties": { + "input": { + "type": "number" + }, + "output": { "type": "number" }, "cache": { @@ -12777,6 +13176,35 @@ "type": "string" } }, + "WorktreeError": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "WorktreeNotGitError", + "WorktreeNameGenerationFailedError", + "WorktreeCreateFailedError", + "WorktreeStartCommandFailedError", + "WorktreeRemoveFailedError", + "WorktreeResetFailedError", + "WorktreeListFailedError" + ] + }, + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": ["message"], + "additionalProperties": false + } + }, + "required": ["name", "data"], + "additionalProperties": false + }, "WorktreeCreateInput": { "type": "object", "properties": { @@ -12891,6 +13319,38 @@ "required": ["additions", "deletions", "files"], "additionalProperties": false }, + "cost": { + "type": "number" + }, + "tokens": { + "type": "object", + "properties": { + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "reasoning": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + } + }, + "required": ["input", "output", "reasoning", "cache"], + "additionalProperties": false + }, "share": { "type": "object", "properties": { @@ -13642,6 +14102,41 @@ "required": ["url", "method", "instructions"], "additionalProperties": false }, + "ProviderAuthError1": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "BadRequest", + "ProviderAuthOauthMissing", + "ProviderAuthOauthCodeMissing", + "ProviderAuthOauthCallbackFailed", + "ProviderAuthValidationFailed" + ] + }, + "data": { + "type": "object", + "properties": { + "providerID": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + }, + "kind": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "required": ["name", "data"], + "additionalProperties": false + }, "TextPartInput": { "type": "object", "properties": { @@ -14389,6 +14884,52 @@ } ] }, + "cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "tokens": { + "anyOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "reasoning": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + } + }, + "required": ["input", "output", "reasoning", "cache"], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, "share": { "type": "object", "properties": { @@ -16149,54 +16690,6 @@ "required": ["id", "type", "properties"], "additionalProperties": false }, - "EventInstallationUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["installation.updated"] - }, - "properties": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventInstallationUpdate-available": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["installation.update-available"] - }, - "properties": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, "EventQuestionAsked": { "type": "object", "properties": { @@ -16332,31 +16825,6 @@ "required": ["id", "type", "properties"], "additionalProperties": false }, - "EventSessionCompacted": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["session.compacted"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, "EventMcpToolsChanged": { "type": "object", "properties": { @@ -16460,6 +16928,31 @@ "required": ["id", "type", "properties"], "additionalProperties": false }, + "EventSessionCompacted": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["session.compacted"] + }, + "properties": { + "type": "object", + "properties": { + "sessionID": { + "type": "string", + "pattern": "^ses" + } + }, + "required": ["sessionID"], + "additionalProperties": false + } + }, + "required": ["id", "type", "properties"], + "additionalProperties": false + }, "EventVcsBranchUpdated": { "type": "object", "properties": { @@ -16713,7 +17206,7 @@ "required": ["id", "type", "properties"], "additionalProperties": false }, - "EventMessageUpdated": { + "EventInstallationUpdated": { "type": "object", "properties": { "id": { @@ -16721,15 +17214,63 @@ }, "type": { "type": "string", - "enum": ["message.updated"] + "enum": ["installation.updated"] }, "properties": { "type": "object", "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, + "version": { + "type": "string" + } + }, + "required": ["version"], + "additionalProperties": false + } + }, + "required": ["id", "type", "properties"], + "additionalProperties": false + }, + "EventInstallationUpdate-available": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["installation.update-available"] + }, + "properties": { + "type": "object", + "properties": { + "version": { + "type": "string" + } + }, + "required": ["version"], + "additionalProperties": false + } + }, + "required": ["id", "type", "properties"], + "additionalProperties": false + }, + "EventMessageUpdated": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["message.updated"] + }, + "properties": { + "type": "object", + "properties": { + "sessionID": { + "type": "string", + "pattern": "^ses" + }, "info": { "$ref": "#/components/schemas/Message" } @@ -18098,97 +18639,477 @@ "required": ["id", "type", "properties"], "additionalProperties": false }, - "SessionInfo": { + "ModelV2Info": { "type": "object", "properties": { "id": { - "type": "string", - "pattern": "^ses" - }, - "parentID": { - "type": "string", - "pattern": "^ses" + "type": "string" }, - "projectID": { + "apiID": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" + "providerID": { + "type": "string" }, - "path": { + "family": { "type": "string" }, - "agent": { + "name": { "type": "string" }, - "model": { + "endpoint": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["unknown"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["openai/responses"] + }, + "url": { + "type": "string" + }, + "websocket": { + "type": "boolean" + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["openai/completions"] + }, + "url": { + "type": "string" + }, + "reasoning": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["reasoning_content"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["reasoning_details"] + } + }, + "required": ["type"], + "additionalProperties": false + } + ] + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["anthropic/messages"] + }, + "url": { + "type": "string" + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["aisdk"] + }, + "package": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": ["type", "package"], + "additionalProperties": false + } + ] + }, + "capabilities": { "type": "object", "properties": { - "id": { - "type": "string" + "tools": { + "type": "boolean" }, - "providerID": { - "type": "string" + "input": { + "type": "array", + "items": { + "type": "string" + } }, - "variant": { - "type": "string" + "output": { + "type": "array", + "items": { + "type": "string" + } } }, - "required": ["id", "providerID", "variant"], + "required": ["tools", "input", "output"], "additionalProperties": false }, - "time": { + "options": { "type": "object", "properties": { - "created": { - "type": "number" + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "updated": { - "type": "number" + "body": { + "type": "object" }, - "archived": { - "type": "number" + "aisdk": { + "type": "object", + "properties": { + "provider": { + "type": "object" + }, + "request": { + "type": "object" + } + }, + "required": ["provider", "request"], + "additionalProperties": false + }, + "variant": { + "type": "string" } }, - "required": ["created", "updated"], + "required": ["headers", "body", "aisdk"], "additionalProperties": false }, - "title": { - "type": "string" - } - }, - "required": ["id", "projectID", "time", "title"], - "additionalProperties": false - }, - "SessionDelivery": { - "type": "string", - "enum": ["immediate", "deferred"] - }, - "SessionMessageAgentSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "metadata": { - "type": "object" + "variants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "type": "object" + }, + "aisdk": { + "type": "object", + "properties": { + "provider": { + "type": "object" + }, + "request": { + "type": "object" + } + }, + "required": ["provider", "request"], + "additionalProperties": false + } + }, + "required": ["id", "headers", "body", "aisdk"], + "additionalProperties": false + } }, "time": { "type": "object", "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["agent-switched"] - }, - "agent": { + "released": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string", + "enum": ["NaN"] + }, + { + "type": "string", + "enum": ["Infinity"] + }, + { + "type": "string", + "enum": ["-Infinity"] + }, + { + "type": "string", + "enum": ["Infinity", "-Infinity", "NaN"] + } + ] + } + }, + "required": ["released"], + "additionalProperties": false + }, + "cost": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tier": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["context"] + }, + "size": { + "type": "integer" + } + }, + "required": ["type", "size"], + "additionalProperties": false + }, + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + } + }, + "required": ["input", "output", "cache"], + "additionalProperties": false + } + }, + "status": { + "type": "string", + "enum": ["alpha", "beta", "deprecated", "active"] + }, + "enabled": { + "type": "boolean" + }, + "limit": { + "type": "object", + "properties": { + "context": { + "type": "integer" + }, + "input": { + "type": "integer" + }, + "output": { + "type": "integer" + } + }, + "required": ["context", "output"], + "additionalProperties": false + } + }, + "required": [ + "id", + "apiID", + "providerID", + "name", + "endpoint", + "capabilities", + "options", + "variants", + "time", + "cost", + "status", + "enabled", + "limit" + ], + "additionalProperties": false + }, + "EventCatalogModelUpdated": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["catalog.model.updated"] + }, + "properties": { + "type": "object", + "properties": { + "model": { + "$ref": "#/components/schemas/ModelV2Info" + } + }, + "required": ["model"], + "additionalProperties": false + } + }, + "required": ["id", "type", "properties"], + "additionalProperties": false + }, + "SessionInfo": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ses" + }, + "parentID": { + "type": "string", + "pattern": "^ses" + }, + "projectID": { + "type": "string" + }, + "workspaceID": { + "type": "string", + "pattern": "^wrk" + }, + "path": { + "type": "string" + }, + "agent": { + "type": "string" + }, + "model": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "providerID": { + "type": "string" + }, + "variant": { + "type": "string" + } + }, + "required": ["id", "providerID", "variant"], + "additionalProperties": false + }, + "cost": { + "type": "number" + }, + "tokens": { + "type": "object", + "properties": { + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "reasoning": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + } + }, + "required": ["input", "output", "reasoning", "cache"], + "additionalProperties": false + }, + "time": { + "type": "object", + "properties": { + "created": { + "type": "number" + }, + "updated": { + "type": "number" + }, + "archived": { + "type": "number" + } + }, + "required": ["created", "updated"], + "additionalProperties": false + }, + "title": { + "type": "string" + } + }, + "required": ["id", "projectID", "cost", "tokens", "time", "title"], + "additionalProperties": false + }, + "SessionDelivery": { + "type": "string", + "enum": ["immediate", "deferred"] + }, + "SessionMessageAgentSwitched": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "time": { + "type": "object", + "properties": { + "created": { + "type": "number" + } + }, + "required": ["created"], + "additionalProperties": false + }, + "type": { + "type": "string", + "enum": ["agent-switched"] + }, + "agent": { "type": "string" } }, @@ -18745,28 +19666,229 @@ } ] }, - "EventTuiToastShow1": { + "ProviderV2Info": { "type": "object", "properties": { "id": { "type": "string" }, - "type": { - "type": "string", - "enum": ["tui.toast.show"] + "name": { + "type": "string" }, - "properties": { - "type": "object", - "properties": { - "title": { - "type": "string" + "enabled": { + "anyOf": [ + { + "type": "boolean", + "enum": [false] }, - "message": { - "type": "string" + { + "type": "object", + "properties": { + "via": { + "type": "string", + "enum": ["env"] + }, + "name": { + "type": "string" + } + }, + "required": ["via", "name"], + "additionalProperties": false }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] + { + "type": "object", + "properties": { + "via": { + "type": "string", + "enum": ["auth"] + }, + "service": { + "type": "string" + } + }, + "required": ["via", "service"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "via": { + "type": "string", + "enum": ["custom"] + }, + "data": { + "type": "object" + } + }, + "required": ["via", "data"], + "additionalProperties": false + } + ] + }, + "env": { + "type": "array", + "items": { + "type": "string" + } + }, + "endpoint": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["unknown"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["openai/responses"] + }, + "url": { + "type": "string" + }, + "websocket": { + "type": "boolean" + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["openai/completions"] + }, + "url": { + "type": "string" + }, + "reasoning": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["reasoning_content"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["reasoning_details"] + } + }, + "required": ["type"], + "additionalProperties": false + } + ] + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["anthropic/messages"] + }, + "url": { + "type": "string" + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["aisdk"] + }, + "package": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": ["type", "package"], + "additionalProperties": false + } + ] + }, + "options": { + "type": "object", + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "type": "object" + }, + "aisdk": { + "type": "object", + "properties": { + "provider": { + "type": "object" + }, + "request": { + "type": "object" + } + }, + "required": ["provider", "request"], + "additionalProperties": false + } + }, + "required": ["headers", "body", "aisdk"], + "additionalProperties": false + } + }, + "required": ["id", "name", "enabled", "env", "endpoint", "options"], + "additionalProperties": false + }, + "EventTuiToastShow1": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["tui.toast.show"] + }, + "properties": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "message": { + "type": "string" + }, + "variant": { + "type": "string", + "enum": ["info", "success", "warning", "error"] }, "duration": { "type": "integer", @@ -18780,6 +19902,326 @@ "required": ["id", "type", "properties"], "additionalProperties": false }, + "ModelV2Info1": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "apiID": { + "type": "string" + }, + "providerID": { + "type": "string" + }, + "family": { + "type": "string" + }, + "name": { + "type": "string" + }, + "endpoint": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["unknown"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["openai/responses"] + }, + "url": { + "type": "string" + }, + "websocket": { + "type": "boolean" + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["openai/completions"] + }, + "url": { + "type": "string" + }, + "reasoning": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["reasoning_content"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["reasoning_details"] + } + }, + "required": ["type"], + "additionalProperties": false + } + ] + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["anthropic/messages"] + }, + "url": { + "type": "string" + } + }, + "required": ["type", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["aisdk"] + }, + "package": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": ["type", "package"], + "additionalProperties": false + } + ] + }, + "capabilities": { + "type": "object", + "properties": { + "tools": { + "type": "boolean" + }, + "input": { + "type": "array", + "items": { + "type": "string" + } + }, + "output": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["tools", "input", "output"], + "additionalProperties": false + }, + "options": { + "type": "object", + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "type": "object" + }, + "aisdk": { + "type": "object", + "properties": { + "provider": { + "type": "object" + }, + "request": { + "type": "object" + } + }, + "required": ["provider", "request"], + "additionalProperties": false + }, + "variant": { + "type": "string" + } + }, + "required": ["headers", "body", "aisdk"], + "additionalProperties": false + }, + "variants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "type": "object" + }, + "aisdk": { + "type": "object", + "properties": { + "provider": { + "type": "object" + }, + "request": { + "type": "object" + } + }, + "required": ["provider", "request"], + "additionalProperties": false + } + }, + "required": ["id", "headers", "body", "aisdk"], + "additionalProperties": false + } + }, + "time": { + "type": "object", + "properties": { + "released": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string", + "enum": ["NaN"] + }, + { + "type": "string", + "enum": ["Infinity"] + }, + { + "type": "string", + "enum": ["-Infinity"] + } + ] + } + }, + "required": ["released"], + "additionalProperties": false + }, + "cost": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tier": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["context"] + }, + "size": { + "type": "integer" + } + }, + "required": ["type", "size"], + "additionalProperties": false + }, + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": ["read", "write"], + "additionalProperties": false + } + }, + "required": ["input", "output", "cache"], + "additionalProperties": false + } + }, + "status": { + "type": "string", + "enum": ["alpha", "beta", "deprecated", "active"] + }, + "enabled": { + "type": "boolean" + }, + "limit": { + "type": "object", + "properties": { + "context": { + "type": "integer" + }, + "input": { + "type": "integer" + }, + "output": { + "type": "integer" + } + }, + "required": ["context", "output"], + "additionalProperties": false + } + }, + "required": [ + "id", + "apiID", + "providerID", + "name", + "endpoint", + "capabilities", + "options", + "variants", + "time", + "cost", + "status", + "enabled", + "limit" + ], + "additionalProperties": false + }, "BadRequestError": { "type": "object", "required": ["name", "data"], @@ -18875,6 +20317,14 @@ "name": "v2 messages", "description": "Experimental v2 message routes." }, + { + "name": "v2 models", + "description": "Experimental v2 model routes." + }, + { + "name": "v2 providers", + "description": "Experimental v2 provider routes." + }, { "name": "tui", "description": "Experimental HttpApi TUI routes." diff --git a/packages/slack/package.json b/packages/slack/package.json index 55e09f5d363e..efe396f5fb73 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/slack", - "version": "1.14.48", + "version": "1.15.0", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/storybook/.storybook/mocks/app/context/global-sync.ts b/packages/storybook/.storybook/mocks/app/context/global-sync.ts index 2eb134d37cd1..92622c04acf6 100644 --- a/packages/storybook/.storybook/mocks/app/context/global-sync.ts +++ b/packages/storybook/.storybook/mocks/app/context/global-sync.ts @@ -40,3 +40,16 @@ export function useGlobalSync() { }, } } + +export function useQueryOptions() { + return { + agents: (directory: string) => ({ + queryKey: [directory, "agents"], + queryFn: async () => [], + }), + providers: (directory: string | null) => ({ + queryKey: [directory, "providers"], + queryFn: async () => provider, + }), + } +} diff --git a/packages/ui/package.json b/packages/ui/package.json index 12441c8d09d2..94047fae1d9e 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "1.14.48", + "version": "1.15.0", "type": "module", "license": "MIT", "exports": { diff --git a/packages/ui/src/assets/audio/alert-01.mp3 b/packages/ui/src/assets/audio/alert-01.mp3 new file mode 100644 index 000000000000..45c3f6afddf3 Binary files /dev/null and b/packages/ui/src/assets/audio/alert-01.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-02.mp3 b/packages/ui/src/assets/audio/alert-02.mp3 new file mode 100644 index 000000000000..2aa5cda6acc9 Binary files /dev/null and b/packages/ui/src/assets/audio/alert-02.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-03.mp3 b/packages/ui/src/assets/audio/alert-03.mp3 new file mode 100644 index 000000000000..69ce3c0dbbb3 Binary files /dev/null and b/packages/ui/src/assets/audio/alert-03.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-04.mp3 b/packages/ui/src/assets/audio/alert-04.mp3 new file mode 100644 index 000000000000..f4ed65209270 Binary files /dev/null and b/packages/ui/src/assets/audio/alert-04.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-05.mp3 b/packages/ui/src/assets/audio/alert-05.mp3 new file mode 100644 index 000000000000..23be6b0f8440 Binary files /dev/null and b/packages/ui/src/assets/audio/alert-05.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-06.mp3 b/packages/ui/src/assets/audio/alert-06.mp3 new file mode 100644 index 000000000000..a0ced67c229c Binary files /dev/null and b/packages/ui/src/assets/audio/alert-06.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-07.mp3 b/packages/ui/src/assets/audio/alert-07.mp3 new file mode 100644 index 000000000000..312a419c5733 Binary files /dev/null and b/packages/ui/src/assets/audio/alert-07.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-08.mp3 b/packages/ui/src/assets/audio/alert-08.mp3 new file mode 100644 index 000000000000..6474f935ca4c Binary files /dev/null and b/packages/ui/src/assets/audio/alert-08.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-09.mp3 b/packages/ui/src/assets/audio/alert-09.mp3 new file mode 100644 index 000000000000..c26fb5bf634f Binary files /dev/null and b/packages/ui/src/assets/audio/alert-09.mp3 differ diff --git a/packages/ui/src/assets/audio/alert-10.mp3 b/packages/ui/src/assets/audio/alert-10.mp3 new file mode 100644 index 000000000000..139689fe373e Binary files /dev/null and b/packages/ui/src/assets/audio/alert-10.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-01.mp3 b/packages/ui/src/assets/audio/bip-bop-01.mp3 new file mode 100644 index 000000000000..f518059c54c1 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-01.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-02.mp3 b/packages/ui/src/assets/audio/bip-bop-02.mp3 new file mode 100644 index 000000000000..b25f80ada6f8 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-02.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-03.mp3 b/packages/ui/src/assets/audio/bip-bop-03.mp3 new file mode 100644 index 000000000000..adc68c91dc29 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-03.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-04.mp3 b/packages/ui/src/assets/audio/bip-bop-04.mp3 new file mode 100644 index 000000000000..4ef895b3bec3 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-04.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-05.mp3 b/packages/ui/src/assets/audio/bip-bop-05.mp3 new file mode 100644 index 000000000000..d6ec2e5a1fc6 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-05.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-06.mp3 b/packages/ui/src/assets/audio/bip-bop-06.mp3 new file mode 100644 index 000000000000..77f4ca99e636 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-06.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-07.mp3 b/packages/ui/src/assets/audio/bip-bop-07.mp3 new file mode 100644 index 000000000000..c41f8c526161 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-07.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-08.mp3 b/packages/ui/src/assets/audio/bip-bop-08.mp3 new file mode 100644 index 000000000000..24af5b0a2380 Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-08.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-09.mp3 b/packages/ui/src/assets/audio/bip-bop-09.mp3 new file mode 100644 index 000000000000..8eca42c0ebdb Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-09.mp3 differ diff --git a/packages/ui/src/assets/audio/bip-bop-10.mp3 b/packages/ui/src/assets/audio/bip-bop-10.mp3 new file mode 100644 index 000000000000..056730a1f13f Binary files /dev/null and b/packages/ui/src/assets/audio/bip-bop-10.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-01.mp3 b/packages/ui/src/assets/audio/nope-01.mp3 new file mode 100644 index 000000000000..3ec93f1ffc1c Binary files /dev/null and b/packages/ui/src/assets/audio/nope-01.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-02.mp3 b/packages/ui/src/assets/audio/nope-02.mp3 new file mode 100644 index 000000000000..8cdf890a1825 Binary files /dev/null and b/packages/ui/src/assets/audio/nope-02.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-03.mp3 b/packages/ui/src/assets/audio/nope-03.mp3 new file mode 100644 index 000000000000..42442317c372 Binary files /dev/null and b/packages/ui/src/assets/audio/nope-03.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-04.mp3 b/packages/ui/src/assets/audio/nope-04.mp3 new file mode 100644 index 000000000000..8ac496a5c4c8 Binary files /dev/null and b/packages/ui/src/assets/audio/nope-04.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-05.mp3 b/packages/ui/src/assets/audio/nope-05.mp3 new file mode 100644 index 000000000000..087efb6394fd Binary files /dev/null and b/packages/ui/src/assets/audio/nope-05.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-06.mp3 b/packages/ui/src/assets/audio/nope-06.mp3 new file mode 100644 index 000000000000..ed22c1cba2c6 Binary files /dev/null and b/packages/ui/src/assets/audio/nope-06.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-07.mp3 b/packages/ui/src/assets/audio/nope-07.mp3 new file mode 100644 index 000000000000..4b6dd462c80c Binary files /dev/null and b/packages/ui/src/assets/audio/nope-07.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-08.mp3 b/packages/ui/src/assets/audio/nope-08.mp3 new file mode 100644 index 000000000000..e54577e43576 Binary files /dev/null and b/packages/ui/src/assets/audio/nope-08.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-09.mp3 b/packages/ui/src/assets/audio/nope-09.mp3 new file mode 100644 index 000000000000..26a4ac806d08 Binary files /dev/null and b/packages/ui/src/assets/audio/nope-09.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-10.mp3 b/packages/ui/src/assets/audio/nope-10.mp3 new file mode 100644 index 000000000000..0720993519ca Binary files /dev/null and b/packages/ui/src/assets/audio/nope-10.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-11.mp3 b/packages/ui/src/assets/audio/nope-11.mp3 new file mode 100644 index 000000000000..483deefd606d Binary files /dev/null and b/packages/ui/src/assets/audio/nope-11.mp3 differ diff --git a/packages/ui/src/assets/audio/nope-12.mp3 b/packages/ui/src/assets/audio/nope-12.mp3 new file mode 100644 index 000000000000..4b62e62c174c Binary files /dev/null and b/packages/ui/src/assets/audio/nope-12.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-01.mp3 b/packages/ui/src/assets/audio/staplebops-01.mp3 new file mode 100644 index 000000000000..b3b34a32fe86 Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-01.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-02.mp3 b/packages/ui/src/assets/audio/staplebops-02.mp3 new file mode 100644 index 000000000000..276429104efe Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-02.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-03.mp3 b/packages/ui/src/assets/audio/staplebops-03.mp3 new file mode 100644 index 000000000000..465017e1058f Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-03.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-04.mp3 b/packages/ui/src/assets/audio/staplebops-04.mp3 new file mode 100644 index 000000000000..18181770ff25 Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-04.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-05.mp3 b/packages/ui/src/assets/audio/staplebops-05.mp3 new file mode 100644 index 000000000000..8046720b0cfa Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-05.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-06.mp3 b/packages/ui/src/assets/audio/staplebops-06.mp3 new file mode 100644 index 000000000000..93a71695a7e6 Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-06.mp3 differ diff --git a/packages/ui/src/assets/audio/staplebops-07.mp3 b/packages/ui/src/assets/audio/staplebops-07.mp3 new file mode 100644 index 000000000000..e6be5b5c8a7a Binary files /dev/null and b/packages/ui/src/assets/audio/staplebops-07.mp3 differ diff --git a/packages/ui/src/assets/audio/yup-01.mp3 b/packages/ui/src/assets/audio/yup-01.mp3 new file mode 100644 index 000000000000..d4c8dcbee537 Binary files /dev/null and b/packages/ui/src/assets/audio/yup-01.mp3 differ diff --git a/packages/ui/src/assets/audio/yup-02.mp3 b/packages/ui/src/assets/audio/yup-02.mp3 new file mode 100644 index 000000000000..09d4dc6c8be5 Binary files /dev/null and b/packages/ui/src/assets/audio/yup-02.mp3 differ diff --git a/packages/ui/src/assets/audio/yup-03.mp3 b/packages/ui/src/assets/audio/yup-03.mp3 new file mode 100644 index 000000000000..0406e15edadc Binary files /dev/null and b/packages/ui/src/assets/audio/yup-03.mp3 differ diff --git a/packages/ui/src/assets/audio/yup-04.mp3 b/packages/ui/src/assets/audio/yup-04.mp3 new file mode 100644 index 000000000000..533ead913676 Binary files /dev/null and b/packages/ui/src/assets/audio/yup-04.mp3 differ diff --git a/packages/ui/src/assets/audio/yup-05.mp3 b/packages/ui/src/assets/audio/yup-05.mp3 new file mode 100644 index 000000000000..ec7c13d00516 Binary files /dev/null and b/packages/ui/src/assets/audio/yup-05.mp3 differ diff --git a/packages/ui/src/assets/audio/yup-06.mp3 b/packages/ui/src/assets/audio/yup-06.mp3 new file mode 100644 index 000000000000..f611da8e82d8 Binary files /dev/null and b/packages/ui/src/assets/audio/yup-06.mp3 differ diff --git a/packages/ui/src/assets/icons/provider/digitalocean.svg b/packages/ui/src/assets/icons/provider/digitalocean.svg new file mode 100644 index 000000000000..5be390b9d348 --- /dev/null +++ b/packages/ui/src/assets/icons/provider/digitalocean.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/ui/src/components/icon.tsx b/packages/ui/src/components/icon.tsx index 2e4d1f53b7bc..7bd461f11065 100644 --- a/packages/ui/src/components/icon.tsx +++ b/packages/ui/src/components/icon.tsx @@ -1,4 +1,4 @@ -import { splitProps, type ComponentProps } from "solid-js" +import { onMount, splitProps, type ComponentProps } from "solid-js" const icons = { "align-right": ``, @@ -105,6 +105,41 @@ const icons = { "arrow-undo-down": ``, } +const spriteID = "opencode-icon-sprite" +const symbol = (name: keyof typeof icons) => `opencode-icon-${name}` +let spriteInserted = false + +function viewBox(name: keyof typeof icons) { + return name === "magnifying-glass" || name === "arrow-undo-down" ? "0 0 16 16" : "0 0 20 20" +} + +function ensureSprite() { + if (spriteInserted) return + if (typeof document === "undefined") return + if (document.getElementById(spriteID)) { + spriteInserted = true + return + } + const body = document.body as HTMLElement | null + if (!body) return + + const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg") + svg.id = spriteID + svg.setAttribute("aria-hidden", "true") + svg.setAttribute("width", "0") + svg.setAttribute("height", "0") + svg.style.position = "absolute" + svg.style.overflow = "hidden" + svg.innerHTML = Object.entries(icons) + .map(([name, path]) => { + const key = name as keyof typeof icons + return `${path}` + }) + .join("") + body.insertBefore(svg, body.firstChild) + spriteInserted = true +} + export interface IconProps extends ComponentProps<"svg"> { name: keyof typeof icons size?: "small" | "normal" | "medium" | "large" @@ -112,8 +147,8 @@ export interface IconProps extends ComponentProps<"svg"> { export function Icon(props: IconProps) { const [local, others] = splitProps(props, ["name", "size", "class", "classList"]) - const viewBox = () => - local.name === "magnifying-glass" || local.name === "arrow-undo-down" ? "0 0 16 16" : "0 0 20 20" + onMount(ensureSprite) + return (
+ > + +
) } diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 35598a170c3e..94da6cc66996 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -1738,9 +1738,13 @@ ToolRegistry.register({ const title = createMemo(() => agent().name ?? i18n.t("ui.tool.agent.default")) const tone = createMemo(() => agent().color) const subtitle = createMemo(() => { - const value = props.input.description - if (typeof value === "string" && value) return value - return childSessionId() + const value = + typeof props.input.description === "string" && props.input.description + ? props.input.description + : childSessionId() + if (!value) return value + if (props.metadata.background === true) return `${value} (background)` + return value }) const running = createMemo(() => props.status === "pending" || props.status === "running") diff --git a/packages/ui/src/components/provider-icons/sprite.svg b/packages/ui/src/components/provider-icons/sprite.svg index a0214b40d0a3..68b99ce56d4a 100644 --- a/packages/ui/src/components/provider-icons/sprite.svg +++ b/packages/ui/src/components/provider-icons/sprite.svg @@ -854,6 +854,20 @@ d="M79.01 5.863c-4.066 0-6.511 2.92-6.511 6.535 0 3.635 2.445 6.555 6.511 6.555 4.046 0 6.512-2.92 6.512-6.555s-2.466-6.535-6.512-6.535Zm0 10.968c-2.633 0-4.172-1.933-4.172-4.433s1.539-4.455 4.172-4.455c2.635 0 4.151 1.933 4.151 4.434 0 2.521-1.516 4.454-4.15 4.454Zm14.393 2.096c3.393 0 5.542-1.808 5.837-4.539h-2.36c-.316 1.555-1.517 2.437-3.477 2.437-2.423 0-3.878-1.68-3.878-4.433 0-2.774 1.476-4.434 3.878-4.434 1.96 0 3.14.862 3.477 2.5h2.36c-.295-2.773-2.444-4.622-5.837-4.622-3.856 0-6.217 2.669-6.217 6.535 0 3.887 2.36 6.556 6.217 6.556Zm-29.543-.311h2.36v-6.01c0-2.752 1.348-4.244 3.772-4.244h2.276V6.177h-2.255c-2.128 0-3.288.735-3.898 2.605l-.443-.063.527-2.542h-2.36v12.439h.02Zm-24.445-7.332c.106-2.101 1.517-3.53 3.793-3.53 2.276 0 3.646 1.345 3.646 3.53h-7.439Zm9.778.4c0-3.426-2.381-5.821-5.943-5.821-3.73 0-6.174 2.563-6.174 6.535 0 4.013 2.423 6.555 6.28 6.555 2.929 0 5.247-1.597 5.669-3.887h-2.36c-.507 1.156-1.666 1.828-3.31 1.828-2.38 0-3.877-1.408-3.94-3.803h9.694c.042-.588.084-.861.084-1.408Zm5.69 6.932h1.939l5.5-12.44h-2.529L56 15.99l-.316.021-3.793-9.833h-2.508l5.5 12.439ZM32.23 12.35c0-.882-.359-1.701-.99-2.437a8.594 8.594 0 0 1-1.497 1.093c.337.42.527.861.527 1.345 0 2.731-5.837 4.811-14.14 4.811-8.281.021-14.118-2.059-14.118-4.811 0-.463.168-.925.505-1.345a8.13 8.13 0 0 1-1.475-1.093c-.632.736-.99 1.555-.99 2.438 0 4.034 7.207 6.534 16.1 6.534 8.87.021 16.078-2.5 16.078-6.535Zm-3.351 1.534c-.906-.462-1.96-.861-3.16-1.197-1.37.378-2.909.672-4.553.861 2.318.294 4.341.778 5.9 1.408.76-.336 1.37-.693 1.813-1.072Zm-17.849-.357a31.902 31.902 0 0 1-4.467-.84c-1.18.336-2.255.735-3.16 1.197.42.379 1.01.715 1.748 1.05 1.539-.63 3.52-1.113 5.88-1.407Zm21.2-6.808c0-4.013-7.207-6.534-16.079-6.534C7.26.185.051 2.706.051 6.719c0 4.035 7.208 6.535 16.1 6.535 8.872.021 16.079-2.5 16.079-6.535Zm-1.94 0c0 2.732-5.836 4.812-14.139 4.812-8.302.021-14.14-2.06-14.14-4.812 0-2.731 5.838-4.811 14.14-4.811 7.86 0 14.14 2.08 14.14 4.811Zm-3.223 2.564c.758-.336 1.37-.694 1.812-1.072-2.95-1.513-7.544-2.353-12.728-2.353s-9.799.84-12.728 2.353c.422.378 1.012.715 1.75 1.05 2.507-1.05 6.363-1.68 10.978-1.68 4.404 0 8.324.651 10.916 1.702ZM1.042 15.628c-.632.736-.99 1.534-.99 2.438 0 4.034 7.207 6.534 16.1 6.534 8.892 0 16.099-2.521 16.099-6.534 0-.883-.359-1.702-.99-2.438-.422.4-.907.757-1.497 1.093.337.42.527.861.527 1.345 0 2.731-5.837 4.811-14.14 4.811-8.302 0-14.14-2.08-14.14-4.811 0-.463.17-.925.506-1.345a10.73 10.73 0 0 1-1.475-1.093Z" >
+ + + + + + ` in your DigitalOcean account. You can rotate or revoke it from the **Model Access Keys** page in the "Manage" section of the DigitalOcean console under Inference. + ::: + +4. Run the `/models` command. Your Inference Routers appear as the format `router:` in the model selection. + + ```txt + /models + ``` + +5. To pick up newly created Inference Routers, re-run `/connect` and select **DigitalOcean** again. + +#### Using a Model Access Key + +If you'd rather paste a key directly: + +1. Head over to the **Manage** page in the Inference section of the [DigitalOcean console](https://cloud.digitalocean.com/) and create a new key. + +2. Run the `/connect` command and select **DigitalOcean**, then **Paste Model Access Key**. + + ```txt + ┌ Enter your DigitalOcean Model Access Key + │ + │ + └ enter + ``` + + :::note + Inference Routers are not auto-discovered with this method. To surface them in the model picker, sign in via OAuth instead. + ::: + +3. Run the `/models` command to select a model. + + ```txt + /models + ``` + +#### Environment Variable + +Alternatively, set your Model Access Key as an environment variable. + +```bash frame="none" +export DIGITALOCEAN_ACCESS_TOKEN=your-model-access-key +``` + +#### Inference Routers + +Inference Routers let you define a routing policy across multiple models — picking the cheapest, fastest, or most appropriate model per request based on the task. After OAuth, OpenCode surfaces each router as `router:` in the model picker. + +Selecting a router model is a drop-in replacement for any other model — OpenCode forwards your request and DigitalOcean picks the underlying model based on your router's policy. Learn more about [Inference Routers](https://docs.digitalocean.com/products/inference/how-to/use-inference-router/) + +--- + ### FrogBot 1. Head over to the [FrogBot dashboard](https://app.frogbot.ai/signup), create an account, and generate an API key. diff --git a/packages/web/src/content/docs/pt-br/cli.mdx b/packages/web/src/content/docs/pt-br/cli.mdx index 889626d41793..a238aec9ef20 100644 --- a/packages/web/src/content/docs/pt-br/cli.mdx +++ b/packages/web/src/content/docs/pt-br/cli.mdx @@ -607,5 +607,4 @@ Essas variáveis de ambiente habilitam recursos experimentais que podem mudar ou | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | boolean | Desabilitar monitoramento de arquivos | | `OPENCODE_EXPERIMENTAL_EXA` | boolean | Habilitar recursos experimentais do Exa | | `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | Habilitar TY LSP para arquivos python | -| `OPENCODE_EXPERIMENTAL_MARKDOWN` | boolean | Habilitar recursos experimentais de markdown | | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | boolean | Habilitar modo de plano | diff --git a/packages/web/src/content/docs/ru/cli.mdx b/packages/web/src/content/docs/ru/cli.mdx index 5f52f3d7f0c9..be6c2cd0234c 100644 --- a/packages/web/src/content/docs/ru/cli.mdx +++ b/packages/web/src/content/docs/ru/cli.mdx @@ -608,5 +608,4 @@ opencode можно настроить с помощью переменных с | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | логическое значение | Отключить просмотрщик файлов | | `OPENCODE_EXPERIMENTAL_EXA` | логическое значение | Включить экспериментальные функции Exa | | `OPENCODE_EXPERIMENTAL_LSP_TY` | логическое значение | Включить TY LSP для файлов python | -| `OPENCODE_EXPERIMENTAL_MARKDOWN` | логическое значение | Включить экспериментальные функции Markdown | | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | логическое значение | Включить режим плана | diff --git a/packages/web/src/content/docs/th/cli.mdx b/packages/web/src/content/docs/th/cli.mdx index d98722846428..2c63bf6e8fde 100644 --- a/packages/web/src/content/docs/th/cli.mdx +++ b/packages/web/src/content/docs/th/cli.mdx @@ -609,5 +609,4 @@ OpenCode สามารถกำหนดค่าโดยใช้ตัว | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | Boolean | ปิดใช้งานตัวเฝ้าดูไฟล์ | | `OPENCODE_EXPERIMENTAL_EXA` | Boolean | ฟีเจอร์ Exa ทดลอง | | `OPENCODE_EXPERIMENTAL_LSP_TY` | Boolean | เปิดใช้งาน TY LSP สำหรับไฟล์ python | -| `OPENCODE_EXPERIMENTAL_MARKDOWN` | Boolean | ใช้ Markdown renderer แบบทดลอง | | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | Boolean | เปิดใช้งาน Plan mode | diff --git a/packages/web/src/content/docs/tr/cli.mdx b/packages/web/src/content/docs/tr/cli.mdx index 25b74ecfe40a..571d4058f29f 100644 --- a/packages/web/src/content/docs/tr/cli.mdx +++ b/packages/web/src/content/docs/tr/cli.mdx @@ -608,5 +608,4 @@ Bu ortam değişkenleri değişebilecek veya kaldırılabilecek deneysel özelli | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | boolean | Dosya izleyiciyi devre dışı bırak | | `OPENCODE_EXPERIMENTAL_EXA` | boolean | Deneysel Exa özelliklerini etkinleştirin | | `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | python dosyaları için TY LSP'yi etkinleştir | -| `OPENCODE_EXPERIMENTAL_MARKDOWN` | boolean | Deneysel işaretleme özelliklerini etkinleştir | | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | boolean | Plan modunu etkinleştir | diff --git a/packages/web/src/content/docs/tui.mdx b/packages/web/src/content/docs/tui.mdx index b9103c702fa0..cd668a3beff8 100644 --- a/packages/web/src/content/docs/tui.mdx +++ b/packages/web/src/content/docs/tui.mdx @@ -369,7 +369,17 @@ You can customize TUI behavior through `tui.json` (or `tui.jsonc`). "enabled": false }, "diff_style": "auto", - "mouse": true + "mouse": true, + "attention": { + "enabled": true, + "notifications": true, + "sound": true, + "volume": 0.4, + "sound_pack": "opencode.default", + "sounds": { + "error": "./sounds/error.mp3" + } + } } ``` @@ -386,9 +396,21 @@ This is separate from `opencode.json`, which configures server/runtime behavior. - `scroll_speed` - Controls how fast the TUI scrolls when using scroll commands (minimum: `0.001`, supports decimal values). Defaults to `3`. **Note: This is ignored if `scroll_acceleration.enabled` is set to `true`.** - `diff_style` - Controls diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows a single-column layout. - `mouse` - Enable or disable mouse capture in the TUI (default: `true`). When disabled, the terminal's native mouse selection/scrolling behavior is preserved. +- `attention` - Configures TUI desktop notifications and sounds. Disabled by default. Use `OPENCODE_TUI_CONFIG` to load a custom TUI config path. +### Attention + +The TUI can request attention for questions, permissions, session errors, and completed sessions. Enable it with `attention.enabled`; built-in events play sounds when triggered, and non-subagent events request desktop notifications only when the terminal is blurred. + +- `enabled` - Enable all attention notifications and sounds. Defaults to `false`. +- `notifications` - Allow terminal-mediated desktop notifications when attention is enabled. Defaults to `true`. +- `sound` - Allow attention sounds when attention is enabled. Defaults to `true`. +- `volume` - Default sound volume from `0` to `1`. Defaults to `0.4`. +- `sound_pack` - Sound pack ID to use. Defaults to `opencode.default`. +- `sounds` - Override sound files for `default`, `question`, `permission`, `error`, `done`, or `subagent_done`. Paths can be absolute, `file://` URLs, or relative to `tui.json`. + --- ## Customization diff --git a/packages/web/src/content/docs/zh-cn/cli.mdx b/packages/web/src/content/docs/zh-cn/cli.mdx index aa992b673404..883a8904c679 100644 --- a/packages/web/src/content/docs/zh-cn/cli.mdx +++ b/packages/web/src/content/docs/zh-cn/cli.mdx @@ -596,7 +596,7 @@ OpenCode 可以通过环境变量进行配置。 这些环境变量用于启用可能会更改或移除的实验性功能。 | 变量 | 类型 | 描述 | -| ----------------------------------------------- | ------- | ------------------------------- | --- | -------------------------------- | ------- | ------------------------ | +| ----------------------------------------------- | ------- | ------------------------------- | | `OPENCODE_EXPERIMENTAL` | boolean | 启用所有实验性功能 | | `OPENCODE_EXPERIMENTAL_ICON_DISCOVERY` | boolean | 启用图标发现 | | `OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT` | boolean | 禁用 TUI 中的选中即复制 | @@ -607,5 +607,5 @@ OpenCode 可以通过环境变量进行配置。 | `OPENCODE_EXPERIMENTAL_LSP_TOOL` | boolean | 启用实验性 LSP 工具 | | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | boolean | 禁用文件监听器 | | `OPENCODE_EXPERIMENTAL_EXA` | boolean | 启用实验性 Exa 功能 | -| `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | 为 python 文件启用 TY LSP | | `OPENCODE_EXPERIMENTAL_MARKDOWN` | boolean | 启用实验性 Markdown 功能 | +| `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | 为 python 文件启用 TY LSP | | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | boolean | 启用计划模式 | diff --git a/packages/web/src/content/docs/zh-tw/cli.mdx b/packages/web/src/content/docs/zh-tw/cli.mdx index 0d51bff2f842..cf0189845968 100644 --- a/packages/web/src/content/docs/zh-tw/cli.mdx +++ b/packages/web/src/content/docs/zh-tw/cli.mdx @@ -608,5 +608,4 @@ OpenCode 可以透過環境變數進行設定。 | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | boolean | 停用檔案監看器 | | `OPENCODE_EXPERIMENTAL_EXA` | boolean | 啟用實驗性 Exa 功能 | | `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | 為 python 檔案啟用 TY LSP | -| `OPENCODE_EXPERIMENTAL_MARKDOWN` | boolean | 啟用實驗性 Markdown 功能 | | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | boolean | 啟用計畫模式 | diff --git a/patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch b/patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch index 2e432255627e..f7267890aede 100644 --- a/patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch +++ b/patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch @@ -1,11 +1,282 @@ diff --git a/photon_rs.js b/photon_rs.js -index 8f4144d..b83e9a9 100644 +index 8f4144d..29a964a 100644 --- a/photon_rs.js +++ b/photon_rs.js -@@ -4509,7 +4509,8 @@ module.exports.__wbindgen_init_externref_table = function() { - ; +@@ -1,6 +1,7 @@ + + let imports = {}; +-imports['__wbindgen_placeholder__'] = module.exports; ++const __wbindgen_placeholder__ = {}; ++imports['__wbindgen_placeholder__'] = __wbindgen_placeholder__; + let wasm; + const { TextEncoder, TextDecoder } = require(`util`); + +@@ -4272,12 +4273,12 @@ class Rgba { + } + module.exports.Rgba = Rgba; + +-module.exports.__wbg_new_abda76e883ba8a5f = function() { ++__wbindgen_placeholder__.__wbg_new_abda76e883ba8a5f = function() { + const ret = new Error(); + return ret; + }; + +-module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; +@@ -4285,7 +4286,7 @@ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + +-module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { +@@ -4297,7 +4298,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + } + }; + +-module.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) { ++__wbindgen_placeholder__.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) { + let result; + try { + result = arg0 instanceof Window; +@@ -4308,42 +4309,42 @@ module.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) { + return ret; + }; + +-module.exports.__wbg_document_e5c1786dea6542e4 = function(arg0) { ++__wbindgen_placeholder__.__wbg_document_e5c1786dea6542e4 = function(arg0) { + const ret = arg0.document; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + +-module.exports.__wbg_body_e70ae6abd01ae584 = function(arg0) { ++__wbindgen_placeholder__.__wbg_body_e70ae6abd01ae584 = function(arg0) { + const ret = arg0.body; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + +-module.exports.__wbg_createElement_5d4c76f218b78145 = function() { return handleError(function (arg0, arg1, arg2) { ++__wbindgen_placeholder__.__wbg_createElement_5d4c76f218b78145 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.createElement(getStringFromWasm0(arg1, arg2)); + return ret; + }, arguments) }; + +-module.exports.__wbg_width_4c6f0048d64cf86b = function(arg0) { ++__wbindgen_placeholder__.__wbg_width_4c6f0048d64cf86b = function(arg0) { + const ret = arg0.width; + return ret; + }; + +-module.exports.__wbg_height_21f0d3fd8f753394 = function(arg0) { ++__wbindgen_placeholder__.__wbg_height_21f0d3fd8f753394 = function(arg0) { + const ret = arg0.height; + return ret; + }; + +-module.exports.__wbg_width_79e0847ed5883b03 = function(arg0) { ++__wbindgen_placeholder__.__wbg_width_79e0847ed5883b03 = function(arg0) { + const ret = arg0.width; + return ret; + }; + +-module.exports.__wbg_height_e4e4e4779f8feac0 = function(arg0) { ++__wbindgen_placeholder__.__wbg_height_e4e4e4779f8feac0 = function(arg0) { + const ret = arg0.height; + return ret; + }; + +-module.exports.__wbg_data_fda507064d127f5b = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbg_data_fda507064d127f5b = function(arg0, arg1) { + const ret = arg1.data; + const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; +@@ -4351,12 +4352,12 @@ module.exports.__wbg_data_fda507064d127f5b = function(arg0, arg1) { + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + +-module.exports.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05 = function() { return handleError(function (arg0, arg1, arg2, arg3) { ++__wbindgen_placeholder__.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0); + return ret; + }, arguments) }; + +-module.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = function(arg0) { ++__wbindgen_placeholder__.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = function(arg0) { + let result; + try { + result = arg0 instanceof CanvasRenderingContext2D; +@@ -4367,24 +4368,24 @@ module.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = fun + return ret; + }; + +-module.exports.__wbg_drawImage_fede06db74e39a60 = function() { return handleError(function (arg0, arg1, arg2, arg3) { ++__wbindgen_placeholder__.__wbg_drawImage_fede06db74e39a60 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.drawImage(arg1, arg2, arg3); + }, arguments) }; + +-module.exports.__wbg_drawImage_f395c8e43c79a909 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { ++__wbindgen_placeholder__.__wbg_drawImage_f395c8e43c79a909 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.drawImage(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + }, arguments) }; + +-module.exports.__wbg_getImageData_5e1c242046e6b59e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { ++__wbindgen_placeholder__.__wbg_getImageData_5e1c242046e6b59e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + const ret = arg0.getImageData(arg1, arg2, arg3, arg4); + return ret; + }, arguments) }; + +-module.exports.__wbg_putImageData_a8b3e177ee06d521 = function() { return handleError(function (arg0, arg1, arg2, arg3) { ++__wbindgen_placeholder__.__wbg_putImageData_a8b3e177ee06d521 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.putImageData(arg1, arg2, arg3); + }, arguments) }; + +-module.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) { ++__wbindgen_placeholder__.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLCanvasElement; +@@ -4395,93 +4396,93 @@ module.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(a + return ret; + }; + +-module.exports.__wbg_width_dc225e55343b745e = function(arg0) { ++__wbindgen_placeholder__.__wbg_width_dc225e55343b745e = function(arg0) { + const ret = arg0.width; + return ret; + }; + +-module.exports.__wbg_setwidth_488780db69b08846 = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbg_setwidth_488780db69b08846 = function(arg0, arg1) { + arg0.width = arg1 >>> 0; + }; + +-module.exports.__wbg_height_3a8bec2f3fe71b26 = function(arg0) { ++__wbindgen_placeholder__.__wbg_height_3a8bec2f3fe71b26 = function(arg0) { + const ret = arg0.height; + return ret; + }; + +-module.exports.__wbg_setheight_1761808c18403921 = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbg_setheight_1761808c18403921 = function(arg0, arg1) { + arg0.height = arg1 >>> 0; + }; + +-module.exports.__wbg_getContext_fc99dbd3a9a7e318 = function() { return handleError(function (arg0, arg1, arg2) { ++__wbindgen_placeholder__.__wbg_getContext_fc99dbd3a9a7e318 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + +-module.exports.__wbg_settextContent_f82a86a8df347e1c = function(arg0, arg1, arg2) { ++__wbindgen_placeholder__.__wbg_settextContent_f82a86a8df347e1c = function(arg0, arg1, arg2) { + arg0.textContent = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2); + }; + +-module.exports.__wbg_appendChild_fa3b00dade9fc4cf = function() { return handleError(function (arg0, arg1) { ++__wbindgen_placeholder__.__wbg_appendChild_fa3b00dade9fc4cf = function() { return handleError(function (arg0, arg1) { + const ret = arg0.appendChild(arg1); + return ret; + }, arguments) }; + +-module.exports.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return ret; + }; + +-module.exports.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) { ++__wbindgen_placeholder__.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; + }, arguments) }; + +-module.exports.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () { ++__wbindgen_placeholder__.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () { + const ret = self.self; + return ret; + }, arguments) }; + +-module.exports.__wbg_window_55e469842c98b086 = function() { return handleError(function () { ++__wbindgen_placeholder__.__wbg_window_55e469842c98b086 = function() { return handleError(function () { + const ret = window.window; + return ret; + }, arguments) }; + +-module.exports.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () { ++__wbindgen_placeholder__.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () { + const ret = globalThis.globalThis; + return ret; + }, arguments) }; + +-module.exports.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () { ++__wbindgen_placeholder__.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () { + const ret = global.global; + return ret; + }, arguments) }; + +-module.exports.__wbindgen_is_undefined = function(arg0) { ++__wbindgen_placeholder__.__wbindgen_is_undefined = function(arg0) { + const ret = arg0 === undefined; + return ret; + }; + +-module.exports.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) { ++__wbindgen_placeholder__.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) { + const ret = arg0.buffer; + return ret; + }; + +-module.exports.__wbg_new_bc5d9aad3f9ac80e = function(arg0) { ++__wbindgen_placeholder__.__wbg_new_bc5d9aad3f9ac80e = function(arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + +-module.exports.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) { ++__wbindgen_placeholder__.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); + }; + +-module.exports.__wbg_length_d9c4ded7e708c6a1 = function(arg0) { ++__wbindgen_placeholder__.__wbg_length_d9c4ded7e708c6a1 = function(arg0) { + const ret = arg0.length; + return ret; + }; + +-module.exports.__wbindgen_debug_string = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; +@@ -4489,16 +4490,16 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) { + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + +-module.exports.__wbindgen_throw = function(arg0, arg1) { ++__wbindgen_placeholder__.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + +-module.exports.__wbindgen_memory = function() { ++__wbindgen_placeholder__.__wbindgen_memory = function() { + const ret = wasm.memory; + return ret; }; +-module.exports.__wbindgen_init_externref_table = function() { ++__wbindgen_placeholder__.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_2; + const offset = table.grow(4); + table.set(0, undefined); +@@ -4509,7 +4510,8 @@ module.exports.__wbindgen_init_externref_table = function() { + ; + }; + -const path = require('path').join(__dirname, 'photon_rs_bg.wasm'); +// Allow opencode's Bun compiled binary to point photon-node at its embedded wasm asset. +const path = globalThis.__OPENCODE_PHOTON_WASM_PATH || require('path').join(__dirname, 'photon_rs_bg.wasm'); diff --git a/script/github/close-prs.ts b/script/github/close-prs.ts new file mode 100644 index 000000000000..0dd8953d90fb --- /dev/null +++ b/script/github/close-prs.ts @@ -0,0 +1,393 @@ +#!/usr/bin/env bun + +import { parseArgs } from "util" + +const defaultRepo = "anomalyco/opencode" +const defaultAgeMonths = 1 +const defaultThreshold = 2 +const defaultSleepMs = 20_000 +const defaultPrintLimit = 50 +const positiveReactions = new Set(["THUMBS_UP", "HEART", "HOORAY", "ROCKET"]) +const cleanupLabel = "automated-pr-cleanup" + +const { values } = parseArgs({ + args: Bun.argv.slice(2), + options: { + execute: { type: "boolean", default: false }, + "dry-run": { type: "boolean", default: false }, + repo: { type: "string", default: defaultRepo }, + threshold: { type: "string", default: String(defaultThreshold) }, + "age-months": { type: "string", default: String(defaultAgeMonths) }, + "max-close": { type: "string" }, + "sleep-ms": { type: "string", default: String(defaultSleepMs) }, + "print-limit": { type: "string", default: String(defaultPrintLimit) }, + help: { type: "boolean", short: "h", default: false }, + }, +}) + +if (values.help) { + console.log(` +Usage: bun script/github/close-prs.ts [options] + +Dry-run is the default. The script only comments and closes PRs when --execute is passed. + +Criteria: + - PRs created within the last month are untouched + - PRs older than one month are closed when they have fewer than 2 positive reactions + - Positive reactions are THUMBS_UP, HEART, HOORAY, and ROCKET reactions on the PR + +Options: + --execute Comment and close matching PRs + --dry-run Explicitly run without changing anything + --repo Repository to clean up (default: ${defaultRepo}) + --threshold Positive reaction threshold (default: ${defaultThreshold}) + --age-months Age cutoff in months (default: ${defaultAgeMonths}) + --max-close Maximum matching PRs to process + --sleep-ms Delay between closing PRs (default: ${defaultSleepMs}) + --print-limit Number of matching PRs to print in dry-run (default: ${defaultPrintLimit}) + -h, --help Show this help message + +Examples: + bun script/github/close-prs.ts + bun script/github/close-prs.ts --threshold 2 --print-limit 100 + bun script/github/close-prs.ts --execute --threshold 2 --max-close 25 +`) + process.exit(0) +} + +if (values.execute && values["dry-run"]) { + console.error("Use either --execute or --dry-run, not both") + process.exit(1) +} + +const token = await requireToken() +const repo = requireRepo(values.repo) +const threshold = requirePositiveInteger("threshold", values.threshold) +const ageMonths = requirePositiveInteger("age-months", values["age-months"]) +const maxClose = + values["max-close"] === undefined ? undefined : requirePositiveInteger("max-close", values["max-close"]) +const sleepMs = requireNonNegativeInteger("sleep-ms", values["sleep-ms"]) +const printLimit = requireNonNegativeInteger("print-limit", values["print-limit"]) +const cutoff = subtractMonths(new Date(), ageMonths) + +const headers = { + Authorization: `Bearer ${token}`, + "Content-Type": "application/json", + Accept: "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", +} + +type PullRequest = { + number: number + title: string + url: string + createdAt: string + reactionGroups: Array<{ + content: string + users: { + totalCount: number + } + }> + labels: { + nodes: Array<{ + name: string + }> + } +} + +type GraphqlResponse = { + data?: { + rateLimit: { + cost: number + remaining: number + resetAt: string + } + repository: { + pullRequests: { + pageInfo: { + hasNextPage: boolean + endCursor: string | null + } + nodes: PullRequest[] + } + } + } + errors?: Array<{ + message: string + }> +} + +type CleanupCandidate = PullRequest & { + positiveReactions: number +} + +const message = `Automated PR Cleanup + +Thank you for contributing to opencode. + +Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. + +This PR was closed because it matched the following cleanup criteria: + +- The PR was created more than ${ageMonths === 1 ? "1 month" : `${ageMonths} months`} ago +- The PR had fewer than ${threshold} positive reactions +- Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR + +PRs created within the last ${ageMonths === 1 ? "month are" : `${ageMonths} months are`} not affected by this cleanup. + +If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. + +Thanks again for taking the time to contribute.` + +async function main() { + console.log(`${values.execute ? "EXECUTE" : "DRY RUN"}: PR cleanup for ${repo.owner}/${repo.name}`) + console.log(`Cutoff: ${cutoff.toISOString()}`) + console.log(`Threshold: fewer than ${threshold} positive reactions`) + + const prs = await fetchOpenPullRequests() + const recentCount = prs.filter((pr) => new Date(pr.createdAt) >= cutoff).length + const matching = prs + .map((pr) => ({ ...pr, positiveReactions: positiveReactionCount(pr) })) + .filter((pr) => new Date(pr.createdAt) < cutoff && pr.positiveReactions < threshold) + const candidates = matching.filter((pr) => !hasPriorCleanup(pr)) + const selected = maxClose === undefined ? candidates : candidates.slice(0, maxClose) + + console.log(`Fetched ${prs.length} open PRs`) + console.log(`Matching cleanup criteria: ${matching.length}`) + console.log(`Skipped previously cleaned PRs: ${matching.length - candidates.length}`) + console.log(`Recent PRs untouched: ${recentCount}`) + console.log( + `Older PRs with at least ${threshold} positive reactions untouched: ${prs.length - matching.length - recentCount}`, + ) + + if (selected.length === 0) return + + if (!values.execute) { + console.log(`\nDry-run only. Re-run with --execute to comment and close matching PRs.`) + console.log(`Showing ${Math.min(printLimit, selected.length)} of ${selected.length} matching PRs:\n`) + for (const pr of selected.slice(0, printLimit)) { + console.log(`#${pr.number} ${pr.createdAt} positive=${pr.positiveReactions} ${pr.url}`) + } + if (selected.length > printLimit) console.log(`... ${selected.length - printLimit} more not shown`) + return + } + + await ensureCleanupLabel() + + console.log(`\nCommenting and closing ${selected.length} PRs...`) + for (const pr of selected) { + await closePullRequest(pr) + if (sleepMs > 0) await sleep(sleepMs) + } + console.log(`Closed ${selected.length} PRs`) +} + +async function fetchOpenPullRequests() { + const prs: PullRequest[] = [] + let endCursor: string | null = null + + while (true) { + const page = await graphql({ + query: `query($owner: String!, $name: String!, $endCursor: String) { + rateLimit { + cost + remaining + resetAt + } + repository(owner: $owner, name: $name) { + pullRequests(first: 100, states: OPEN, orderBy: { field: CREATED_AT, direction: ASC }, after: $endCursor) { + pageInfo { + hasNextPage + endCursor + } + nodes { + number + title + url + createdAt + reactionGroups { + content + users { + totalCount + } + } + labels(first: 100) { + nodes { + name + } + } + } + } + } + }`, + variables: { + owner: repo.owner, + name: repo.name, + endCursor, + }, + }) + + prs.push(...page.repository.pullRequests.nodes) + console.log( + `Fetched ${prs.length} PRs, GraphQL rate limit remaining ${page.rateLimit.remaining} (cost ${page.rateLimit.cost})`, + ) + + if (page.rateLimit.remaining < 100) { + const delay = Math.max(0, new Date(page.rateLimit.resetAt).getTime() - Date.now()) + 1_000 + console.warn(`GraphQL rate limit low; sleeping ${Math.ceil(delay / 1000)}s until reset`) + await sleep(delay) + } + + if (!page.repository.pullRequests.pageInfo.hasNextPage) return prs + endCursor = page.repository.pullRequests.pageInfo.endCursor + } +} + +async function graphql(input: { query: string; variables: Record }) { + const response = await githubRequest("/graphql", { + method: "POST", + body: JSON.stringify(input), + }) + const body = (await response.json()) as GraphqlResponse + if (body.errors?.length) + throw new Error(`GitHub GraphQL error: ${body.errors.map((error) => error.message).join(", ")}`) + if (!body.data) throw new Error("GitHub GraphQL response did not include data") + return body.data +} + +async function closePullRequest(pr: CleanupCandidate) { + await githubRequest(`/repos/${repo.owner}/${repo.name}/issues/${pr.number}/comments`, { + method: "POST", + body: JSON.stringify({ body: message }), + }) + await githubRequest(`/repos/${repo.owner}/${repo.name}/pulls/${pr.number}`, { + method: "PATCH", + body: JSON.stringify({ state: "closed" }), + }) + await githubRequest(`/repos/${repo.owner}/${repo.name}/issues/${pr.number}/labels`, { + method: "POST", + body: JSON.stringify({ labels: [cleanupLabel] }), + }) + console.log(`Closed #${pr.number} positive=${pr.positiveReactions} ${pr.url}`) +} + +async function ensureCleanupLabel() { + const response = await fetch( + `https://api.github.com/repos/${repo.owner}/${repo.name}/labels/${encodeURIComponent(cleanupLabel)}`, + { + headers, + }, + ) + if (response.ok) return + if (response.status !== 404) + throw new Error(`Failed to check cleanup label: ${response.status} ${response.statusText}`) + + await githubRequest(`/repos/${repo.owner}/${repo.name}/labels`, { + method: "POST", + body: JSON.stringify({ + name: cleanupLabel, + color: "ededed", + description: "PR was closed by automated cleanup", + }), + }) +} + +async function githubRequest(path: string, init: RequestInit, attempt = 0): Promise { + const response = await fetch(path.startsWith("https://") ? path : `https://api.github.com${path}`, { + ...init, + headers: { + ...headers, + ...init.headers, + }, + }) + + if (response.ok) return response + + const body = await response.text() + const retryAfter = response.headers.get("retry-after") + const reset = response.headers.get("x-ratelimit-reset") + const retryMs = retryAfter + ? Number(retryAfter) * 1000 + : response.headers.get("x-ratelimit-remaining") === "0" && reset + ? Math.max(0, Number(reset) * 1000 - Date.now()) + 1_000 + : body.toLowerCase().includes("secondary rate limit") + ? 300_000 + : response.status >= 500 + ? Math.min(300_000, 10_000 * 2 ** attempt) + : 0 + + if ((response.status === 403 || response.status === 429 || response.status >= 500) && retryMs > 0 && attempt < 10) { + console.warn(`GitHub request failed; sleeping ${Math.ceil(retryMs / 1000)}s before retry ${attempt + 1}`) + await sleep(retryMs) + return githubRequest(path, init, attempt + 1) + } + + throw new Error(`GitHub request failed: ${response.status} ${response.statusText}\n${body}`) +} + +function positiveReactionCount(pr: PullRequest) { + return pr.reactionGroups + .filter((group) => positiveReactions.has(group.content)) + .reduce((total, group) => total + group.users.totalCount, 0) +} + +function hasPriorCleanup(pr: PullRequest) { + return pr.labels.nodes.some((label) => label.name === cleanupLabel) +} + +function requireRepo(value: string | undefined) { + if (!value) throw new Error("repo is required") + const [owner, name] = value.split("/") + if (!owner || !name) throw new Error(`Invalid repo ${value}; expected owner/name`) + return { owner, name } +} + +async function requireToken() { + const envToken = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN + if (envToken) return envToken + + const proc = Bun.spawn(["gh", "auth", "token"], { + stdout: "pipe", + stderr: "pipe", + }) + const stdout = await new Response(proc.stdout).text() + const stderr = await new Response(proc.stderr).text() + const exitCode = await proc.exited + if (exitCode === 0 && stdout.trim()) return stdout.trim() + + throw new Error( + `GitHub authentication is required. Set GITHUB_TOKEN/GH_TOKEN or run gh auth login.\n${stderr.trim()}`, + ) +} + +function requirePositiveInteger(name: string, value: string | undefined) { + const parsed = Number(value) + if (!Number.isInteger(parsed) || parsed <= 0) throw new Error(`${name} must be a positive integer`) + return parsed +} + +function requireNonNegativeInteger(name: string, value: string | undefined) { + const parsed = Number(value) + if (!Number.isInteger(parsed) || parsed < 0) throw new Error(`${name} must be a non-negative integer`) + return parsed +} + +function subtractMonths(date: Date, months: number) { + const result = new Date(date) + const day = result.getUTCDate() + result.setUTCDate(1) + result.setUTCMonth(result.getUTCMonth() - months) + result.setUTCDate( + Math.min(day, new Date(Date.UTC(result.getUTCFullYear(), result.getUTCMonth() + 1, 0)).getUTCDate()), + ) + return result +} + +function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)) +} + +void main().catch((error) => { + console.error("Error:", error) + process.exit(1) +}) diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index 01737ee4e542..833d10836fce 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "1.14.48", + "version": "1.15.0", "publisher": "sst-dev", "repository": { "type": "git", diff --git a/specs/v2/api.html b/specs/v2/api.html new file mode 100644 index 000000000000..147d24f58bb3 --- /dev/null +++ b/specs/v2/api.html @@ -0,0 +1,1161 @@ + + + + + + opencode v2 API + + + +
+ + diff --git a/specs/v2/provider-model.md b/specs/v2/provider-model.md new file mode 100644 index 000000000000..fb4598b58fd1 --- /dev/null +++ b/specs/v2/provider-model.md @@ -0,0 +1,330 @@ +# Provider and Model Catalog + +## Provider Schema + +```ts +export const ID = Schema.String.pipe( + Schema.brand("ProviderV2.ID"), + withStatics((schema) => ({ + opencode: schema.make("opencode"), + anthropic: schema.make("anthropic"), + openai: schema.make("openai"), + google: schema.make("google"), + googleVertex: schema.make("google-vertex"), + githubCopilot: schema.make("github-copilot"), + amazonBedrock: schema.make("amazon-bedrock"), + azure: schema.make("azure"), + openrouter: schema.make("openrouter"), + mistral: schema.make("mistral"), + gitlab: schema.make("gitlab"), + })), +) +export type ID = typeof ID.Type + +const OpenAIResponses = Schema.Struct({ + type: Schema.Literal("openai/responses"), + url: Schema.String, + websocket: Schema.optional(Schema.Boolean), +}) + +const OpenAICompletions = Schema.Struct({ + type: Schema.Literal("openai/completions"), + url: Schema.String, + reasoning: Schema.Union([ + Schema.Struct({ + type: Schema.Literal("reasoning_content"), + }), + Schema.Struct({ + type: Schema.Literal("reasoning_details"), + }), + ]).pipe(Schema.optional), +}) +export type OpenAICompletions = typeof OpenAICompletions.Type + +const AISDK = Schema.Struct({ + type: Schema.Literal("aisdk"), + package: Schema.String, +}) + +const AnthropicMessages = Schema.Struct({ + type: Schema.Literal("anthropic/messages"), + url: Schema.String, +}) + +const UnknownEndpoint = Schema.Struct({ + type: Schema.Literal("unknown"), +}) + +export const Endpoint = Schema.Union([ + UnknownEndpoint, + OpenAIResponses, + OpenAICompletions, + AnthropicMessages, + AISDK, +]).pipe(Schema.toTaggedUnion("type")) +export type Endpoint = typeof Endpoint.Type + +export const Options = Schema.Struct({ + headers: Schema.Record(Schema.String, Schema.String), + body: Schema.Record(Schema.String, Schema.Any), +}) +export type Options = typeof Options.Type + +export class Info extends Schema.Class("ProviderV2.Info")({ + id: ID, + name: Schema.String, + enabled: Schema.Boolean, + env: Schema.String.pipe(Schema.Array), + endpoint: Endpoint, + options: Options, +}) { + static empty(providerID: ID) { + return new Info({ + id: providerID, + name: providerID, + enabled: false, + env: [], + endpoint: { + type: "unknown", + }, + options: { + headers: {}, + body: {}, + }, + }) + } +} + +export class NotFound extends Schema.TaggedErrorClass("ProviderV2.NotFound")("ProviderV2.NotFound", { + providerID: ID, +}) {} +``` + +## Model Schema + +```ts +export const ID = Schema.String.pipe(Schema.brand("ModelV2.ID")) +export type ID = typeof ID.Type + +export const VariantID = Schema.String.pipe(Schema.brand("VariantID")) +export type VariantID = typeof VariantID.Type + +export const Family = Schema.String.pipe(Schema.brand("Family")) +export type Family = typeof Family.Type + +export const Capabilities = Schema.Struct({ + tools: Schema.Boolean, + input: Schema.String.pipe(Schema.Array), + output: Schema.String.pipe(Schema.Array), +}) +export type Capabilities = typeof Capabilities.Type + +export const Variant = Schema.Struct({ + id: VariantID, + ...ProviderV2.Options.fields, +}) +export type Variant = typeof Variant.Type + +export const Cost = Schema.Struct({ + tier: Schema.Struct({ + type: Schema.Literal("context"), + size: Schema.Int, + }).pipe(Schema.optional), + input: Schema.Finite, + output: Schema.Finite, + cache: Schema.Struct({ + read: Schema.Finite, + write: Schema.Finite, + }), +}) +export type Cost = typeof Cost.Type + +export const Limit = Schema.Struct({ + context: Schema.Int, + input: Schema.Int.pipe(Schema.optional), + output: Schema.Int, +}) +export type Limit = typeof Limit.Type + +export const Ref = Schema.Struct({ + id: ID, + providerID: ProviderV2.ID, + variant: VariantID, +}) +export type Ref = typeof Ref.Type + +export class Info extends Schema.Class("ModelV2.Info")({ + id: ID, + providerID: ProviderV2.ID, + family: Family.pipe(Schema.optional), + name: Schema.String, + endpoint: ProviderV2.Endpoint, + options: Schema.Struct({ + ...ProviderV2.Options.fields, + variant: Schema.String.pipe(Schema.optional), + }), + capabilities: Capabilities, + variants: Variant.pipe(Schema.Array), + time: Schema.Struct({ + released: DateTimeUtcFromMillis, + }), + cost: Cost.pipe(Schema.Array), + status: Schema.Literals(["alpha", "beta", "deprecated", "active"]), + limit: Limit, +}) { + static empty(providerID: ProviderV2.ID, modelID: ID) { + return new Info({ + id: modelID, + providerID, + name: modelID, + endpoint: { + type: "unknown", + }, + capabilities: { + tools: false, + input: [], + output: [], + }, + options: { + headers: {}, + body: {}, + }, + variants: [], + time: { + released: DateTime.makeUnsafe(0), + }, + cost: [], + status: "active", + limit: { + context: 0, + output: 0, + }, + }) + } +} +``` + +## Catalog Interface + +```ts +export interface Interface { + readonly provider: { + readonly get: (providerID: ProviderV2.ID) => Effect.Effect> + readonly update: (providerID: ProviderV2.ID, fn: (provider: Draft) => void) => Effect.Effect + readonly remove: (providerID: ProviderV2.ID) => Effect.Effect + readonly all: () => Effect.Effect + readonly available: () => Effect.Effect + } + + readonly model: { + readonly get: (providerID: ProviderV2.ID, modelID: ModelV2.ID) => Effect.Effect> + readonly update: ( + providerID: ProviderV2.ID, + modelID: ModelV2.ID, + fn: (model: Draft) => void, + ) => Effect.Effect + readonly remove: (providerID: ProviderV2.ID, modelID: ModelV2.ID) => Effect.Effect + readonly all: () => Effect.Effect + readonly available: () => Effect.Effect + readonly default: () => Effect.Effect> + readonly small: (providerID: ProviderV2.ID) => Effect.Effect> + } +} +``` + +`ProviderV2.Info.enabled` is stored provider state. Provider plugins set this field after checking env, auth, config, or provider-specific availability. + +`ProviderV2.Endpoint` includes `{ type: "unknown" }`. `CatalogV2.model.get()` and `CatalogV2.model.all()` resolve `unknown` endpoints from the provider before returning models. + +Model storage is nested by provider because model ids are only unique within a provider. + +```ts +type ProviderRecord = { + provider: ProviderV2.Info + models: HashMap.HashMap +} + +let records = HashMap.empty() +``` + +`ModelV2.Info` does not have an `enabled` field. Model availability is derived by `CatalogV2.model.available()` from provider state and model status. + +```ts +const available = provider.enabled && model.status !== "deprecated" +``` + +## Plugin Interface + +```ts +export type Definition = Effect.Effect< + { + readonly order: number + readonly hooks: HookFunctions + }, + never, + R +> + +export interface Interface { + readonly add: (input: { id: ID; definition: Definition }) => Effect.Effect + + readonly remove: (id: ID) => Effect.Effect + + readonly trigger: (name: Name, input: HookInput) => Effect.Effect> +} +``` + +## Plugin Order + +```ts +export const Order = { + modelsDev: 0, + env: 10, + auth: 20, + provider: 30, + config: 40, + discovery: 50, +} as const +``` + +## Built-In Plugins + +```ts +export const ModelsDevPlugin: PluginV2.Definition + +export const EnvPlugin: PluginV2.Definition + +export const AuthPlugin: PluginV2.Definition + +export const ConfigPlugin: PluginV2.Definition + +export const AnthropicPlugin: PluginV2.Definition + +export const OpenRouterPlugin: PluginV2.Definition + +export const AmazonBedrockPlugin: PluginV2.Definition + +export const GoogleVertexPlugin: PluginV2.Definition + +export const GitLabPlugin: PluginV2.Definition + +export const GitLabDiscoveryPlugin: PluginV2.Definition +``` + +## Plugin Hooks + +```ts +export type Hooks = { + init: {} + + "provider.update": { + provider: Draft + cancel: boolean + } + + "model.update": { + model: Draft + cancel: boolean + } +} +``` diff --git a/sst-env.d.ts b/sst-env.d.ts index e75c54d05658..b75b4bd6e635 100644 --- a/sst-env.d.ts +++ b/sst-env.d.ts @@ -153,6 +153,10 @@ declare module "sst" { "type": "sst.sst.Linkable" "value": string } + "Stat": { + "type": "sst.cloudflare.Worker" + "url": string + } "Teams": { "type": "sst.cloudflare.SolidStart" "url": string diff --git a/sst.config.ts b/sst.config.ts index 696a6fa7689d..4bf7cc6a8d7c 100644 --- a/sst.config.ts +++ b/sst.config.ts @@ -19,10 +19,14 @@ export default $config({ }, async run() { await import("./infra/app.js") - await import("./infra/console.js") + const { stat } = await import("./infra/console.js") await import("./infra/enterprise.js") if ($app.stage === "production" || $app.stage === "vimtor") { await import("./infra/monitoring.js") } + + return { + StatWorkerUrl: stat.url, + } }, })
+
+
+
opencode v2
+

API map

+
+
+

+ A single /api route surface for simple clients and multi-directory frontends. The important + design question is not route nesting; it is where runtime context comes from. +

+
+ Server scoped + Request context + Session pinned +
+
+
+ +
+
+ Everything has one canonical route. Some routes are server-scoped; runtime routes use context; session item + routes use the session. +

+ Server-scoped routes manage the whole server: projects, workspace lifecycle, and auth accounts. Runtime + context is for anything resolved from an active directory, including config, provider capabilities, tools, + files, and VCS. +

+
+
+
+ +
+
+

Context Model

+ + API context resolution + + Non-session routes resolve from request context, session item routes resolve from session storage. + + + + + + + + + Non-session route + /api/file, /api/vcs/status + + + Request context + query params or default runtime + + + Runtime context + directory + workspaceID? + + + Session item route + /api/session/:id/prompt + + + Session row + contains pinned context + + + Runtime context + directory + workspaceID? + +
+ +
+

Request-context calls

+

+ These calls operate against a directory, optionally through a workspace. Simple clients omit context and use + the default runtime. +

+
GET /api/fs/tree?path=.&directory=/repo/app&workspace=ws_123
+
+ +
+

Session-pinned calls

+

+ These calls never take request context. The session is already pinned to the directory and workspace it was + created in. +

+
POST /api/session/ses_123/prompt
+
+// server resolves
+sessionID -> { directory, workspaceID? }
+
+
+ +
+
+

Operation Inventory

+

+ The SDK is the source of truth. HTTP routes are mounts for RPC-style operations. + server operations do not use runtime context. + request operations use request/default runtime context from + directory and workspace query parameters. + session operations use pinned session context and should not accept + context input. +

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationInputContextHTTP mountPurpose
agent.list{}requestGET /api/agentAvailable agents.
auth.activate{ accountID: AccountID }serverPOST /api/auth/:accountID/activateSet the account as active for its service.
auth.create + { serviceID: ServiceID credential: | { type: "oauth", refresh: string, access: string, expires: + number } | { type: "api", key: string, metadata?: Record<string, string> } description?: + string active?: boolean } + serverPOST /api/authCreate an auth account.
auth.delete{ accountID: AccountID }serverDELETE /api/auth/:accountIDRemove an auth account.
auth.get{ accountID: AccountID }serverGET /api/auth/:accountIDGet one auth account.
auth.list{ serviceID?: ServiceID }serverGET /api/authList saved auth accounts. Response includes active account mapping.
auth.update + { accountID: AccountID description?: string credential?: | { type: "oauth", refresh: string, + access: string, expires: number } | { type: "api", key: string, metadata?: Record<string, + string> } } + serverPATCH /api/auth/:accountIDUpdate account description or credential.
catalog.model.get{ providerID: ProviderID modelID: ModelID }serverGET /api/catalog/model/:providerID/:modelIDGet one catalog model.
catalog.model.list{}serverGET /api/catalog/modelList flattened catalog models.
command.list{}requestGET /api/commandAvailable commands.
config.get{}requestGET /api/configResolved config.
config.update{ config: Config }requestPATCH /api/configUpdate config.
event.subscribe{}requestGET /api/eventServer-sent events for the resolved runtime context.
formatter.status{}requestGET /api/formatterFormatter status.
fs.file{ path: string }requestGET /api/fs/fileRead one file.
fs.grep{ pattern: string include?: string limit?: number }requestPOST /api/fs/grepSearch file contents.
fs.search{ query: string type?: "file" | "directory" limit?: number }requestPOST /api/fs/searchSearch paths by name.
fs.tree{ path: string }requestGET /api/fs/treeBrowse a directory.
lsp.status{}requestGET /api/lspLSP status.
mcp.prompt.list{}requestGET /api/mcp/promptList MCP prompts.
mcp.prompt.render + { server: string name: string arguments?: Record<string, string> } + requestPOST /api/mcp/prompt/renderRender one MCP prompt.
mcp.resource.list{}requestGET /api/mcp/resourceList MCP resources.
mcp.resource.read{ server: string uri: string }requestGET /api/mcp/resource/readRead one MCP resource.
mcp.server.create + { name: string config: | { type: "local", command: string, arguments?: string[], environment?: + Record<string, string> } | { type: "remote", url: string, headers?: Record<string, + string>, oauth?: boolean | object } } + requestPOST /api/mcp/serverAdd an MCP server to runtime config.
mcp.server.list{}requestGET /api/mcp/serverList MCP servers with status and auth state.
mcp.server.oauth.callback{ name: string code: string }requestPOST /api/mcp/server/:name/oauth/callbackComplete MCP OAuth.
mcp.server.oauth.delete{ name: string }requestDELETE /api/mcp/server/:name/oauthRemove MCP OAuth credentials.
mcp.server.oauth.start{ name: string }requestPOST /api/mcp/server/:name/oauthStart MCP OAuth.
permission.list{}requestGET /api/permissionPending permission requests.
permission.reply{ permissionID: PermissionID response: PermissionReply }requestPOST /api/permission/:permissionID/replyReply to a permission request.
project.get{ projectID: ProjectID }serverGET /api/project/:projectIDGet project metadata.
project.list{}serverGET /api/projectList projects known to this server.
project.update + { projectID: ProjectID name?: string icon?: string commands?: Array<{ name: string command: + string }> } + serverPATCH /api/project/:projectIDUpdate project metadata.
provider.list{}requestGET /api/providerProvider inventory for the runtime context.
pty.create{ command?: string cwd?: string shell?: string }requestPOST /api/ptyCreate PTY in the runtime context.
pty.delete{ ptyID: PtyID }requestDELETE /api/pty/:ptyIDDelete PTY.
pty.get{ ptyID: PtyID }requestGET /api/pty/:ptyIDGet PTY info.
pty.list{}requestGET /api/ptyList PTYs for the runtime.
pty.update + { ptyID: PtyID title?: string size?: { columns: number, rows: number } } + requestPATCH /api/pty/:ptyIDUpdate PTY.
question.list{}requestGET /api/questionPending user questions.
question.reject{ questionID: QuestionID }requestPOST /api/question/:questionID/rejectReject a question.
question.reply{ questionID: QuestionID response: QuestionResponse }requestPOST /api/question/:questionID/replyReply to a question.
session.compact{ sessionID: SessionID }sessionPOST /api/session/:sessionID/compactCompact the session conversation.
session.context{ sessionID: SessionID }sessionGET /api/session/:sessionID/contextReturn active context messages after the last compaction.
session.create + { title?: string agent?: string model?: { providerID: ProviderID, modelID: ModelID } permission?: + PermissionRule[] } + requestPOST /api/sessionCreate a session pinned to resolved runtime context.
session.delete{ sessionID: SessionID }sessionDELETE /api/session/:sessionIDDelete a session.
session.diff{ sessionID: SessionID }sessionGET /api/session/:sessionID/diffReturn session diff summary.
session.get{ sessionID: SessionID }sessionGET /api/session/:sessionIDGet one session.
session.list + { limit?: number order?: "asc" | "desc" path?: string roots?: boolean start?: number search?: + string cursor?: string } + requestGET /api/sessionList sessions for the current runtime context by default.
session.message.list + { sessionID: SessionID limit?: number order?: "asc" | "desc" cursor?: string } + sessionGET /api/session/:sessionID/messagePage through session messages.
session.prompt + { sessionID: SessionID prompt: Prompt delivery?: "immediate" | "deferred" } + sessionPOST /api/session/:sessionID/promptCreate a user message and queue the agent loop.
session.todo{ sessionID: SessionID }sessionGET /api/session/:sessionID/todoReturn todos associated with the session.
session.update + { sessionID: SessionID title?: string archived?: number permission?: PermissionRule[] } + sessionPATCH /api/session/:sessionIDUpdate title, archival state, or session metadata.
session.wait{ sessionID: SessionID }sessionPOST /api/session/:sessionID/waitWait until the session is idle.
skill.list{}requestGET /api/skillAvailable skills.
vcs.diff{ format?: "json" | "patch" mode?: "worktree" | "default" }requestGET /api/vcs/diffDiff for the runtime directory.
vcs.get{}requestGET /api/vcsVCS metadata.
vcs.patch{ patch: string }requestPOST /api/vcs/patchApply a patch to the runtime directory.
vcs.status{}requestGET /api/vcs/statusChanged files.
workspace.create + { projectID?: ProjectID name?: string directory?: string type: string metadata?: Record<string, + unknown> } + serverPOST /api/workspaceCreate or register a workspace.
workspace.delete{ workspaceID: WorkspaceID }serverDELETE /api/workspace/:workspaceIDRemove a workspace registration.
workspace.get{ workspaceID: WorkspaceID }serverGET /api/workspace/:workspaceIDGet workspace metadata.
workspace.list{ projectID?: ProjectID }serverGET /api/workspaceList workspaces, optionally filtered by project.
workspace.status{}serverGET /api/workspace/statusConnection/lifecycle status for all workspaces. Needs team discussion.
workspace.sync{}serverPOST /api/workspace/syncSync workspace metadata from adapters. Needs team discussion.
workspace.update + { workspaceID: WorkspaceID name?: string metadata?: Record<string, unknown> archived?: + boolean } + serverPATCH /api/workspace/:workspaceIDUpdate workspace metadata or lifecycle state.
workspace.warp + { workspaceID?: WorkspaceID sessionID: SessionID copyChanges: boolean } + serverPOST /api/workspace/warpMove a session into or out of a workspace. Needs team discussion.
+
+
+ +
+
+

Event Envelope

+

+ Every event uses the same envelope. Resource identity belongs in payload. Runtime identity + belongs in context. +

+
+
type ApiEvent<Payload> = {
+  id: string
+  type: string
+  time: number
+  context: {
+    directory: string
+    workspaceID?: string
+  }
+  payload: Payload
+}
+
{
+  "id": "evt_01",
+  "type": "message.part.delta",
+  "time": 1760000000000,
+  "context": {
+    "directory": "/repo/app",
+    "workspaceID": "ws_123"
+  },
+  "payload": {
+    "sessionID": "ses_123",
+    "messageID": "msg_456",
+    "partID": "part_789",
+    "field": "text",
+    "delta": "hello"
+  }
+}
+
+
+
+ +
+
+

Frontend Sync Store

+

+ A frontend can keep one giant store like the current TUI. Runtime data is partitioned by + contextKey. Durable entities such as sessions and messages are keyed by their own IDs. +

+
type RuntimeContext = {
+  directory: string
+  workspaceID?: string
+}
+
+type ContextKey = string
+type SessionID = string
+type MessageID = string
+
+type SyncStore = {
+  status: "loading" | "partial" | "complete"
+
+  shared: {
+    provider: Provider[]
+    provider_default: Record<string, string>
+    provider_next: ProviderListResponse
+    provider_auth: Record<string, ProviderAuthMethod[]>
+    console_state: ConsoleState
+  }
+
+  contexts: Record<
+    ContextKey,
+    {
+      context: RuntimeContext
+
+      config: Config
+      agent: Agent[]
+      command: Command[]
+      lsp: LspStatus[]
+      formatter: FormatterStatus[]
+      vcs: VcsInfo | undefined
+      mcp: Record<string, McpStatus>
+      mcp_resource: Record<string, McpResource>
+
+      session: SessionID[]
+      session_status: Record<SessionID, SessionStatus>
+    }
+  >
+
+  session: Record<SessionID, Session & { context: RuntimeContext }>
+  session_diff: Record<SessionID, Snapshot.FileDiff[]>
+  todo: Record<SessionID, Todo[]>
+  permission: Record<SessionID, PermissionRequest[]>
+  question: Record<SessionID, QuestionRequest[]>
+
+  message: Record<SessionID, Message[]>
+  part: Record<MessageID, Part[]>
+}
+
+function contextKey(context: RuntimeContext) {
+  return `${context.workspaceID ?? "local"}:${context.directory}`
+}
+
+
+